/* Pages vitrine (accueil, tarifs, avis) et avis clients : apparitions au
   défilement, étoiles, carrousel, note moyenne, estimation des prix. Tout
   reste lisible et immobile sans JavaScript (showcase.js) ou si le téléphone
   demande moins d'animations. Aucune valeur de style n'est écrite dans les
   pages (la CSP l'interdit) : les largeurs passent par des classes. */

/* --- Apparitions au défilement (classe .anim posée par showcase.js) ------------------- */

/* Un élément qui arrive par le côté ne crée pas de défilement horizontal. */
.showcase-section {
  overflow-x: hidden;
  overflow-x: clip;
}

.anim [data-reveal] {
  transition:
    opacity 1.1s var(--ease),
    transform 1.1s var(--ease);
}

.anim [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(40px);
  transition-duration: 0s;
  transition-delay: 0s;
}

.anim [data-reveal="left"]:not(.is-visible) {
  transform: translateX(-64px);
}

.anim [data-reveal="right"]:not(.is-visible) {
  transform: translateX(64px);
}

/* L'un après l'autre dans une grille. */
.anim .offers > :nth-child(3n + 2),
.anim .reviews-grid > :nth-child(3n + 2) {
  transition-delay: 0.15s;
}

.anim .offers > :nth-child(3n + 3),
.anim .reviews-grid > :nth-child(3n + 3) {
  transition-delay: 0.3s;
}

/* --- Étoiles : une seule balise, remplie jusqu'à --fill ------------------------------------ */

.stars {
  --star: 1.1rem;
  display: inline-block;
  flex: none;
  width: calc(var(--star) * 5);
  height: var(--star);
  vertical-align: -0.15em;
  background: linear-gradient(90deg, var(--c-star) var(--fill, 0%), var(--c-star-off) var(--fill, 0%));
  -webkit-mask: url("../icons/star-mask.8855e4f7b952.svg") 0 0 / var(--star) var(--star) repeat-x;
  mask: url("../icons/star-mask.8855e4f7b952.svg") 0 0 / var(--star) var(--star) repeat-x;
}

.stars--lg {
  --star: 1.75rem;
}

@media (forced-colors: active) {
  .stars {
    forced-color-adjust: none;
  }
}

.fill-0 {
  --fill: 0%;
}

.fill-2 {
  --fill: 2%;
}

.fill-4 {
  --fill: 4%;
}

.fill-6 {
  --fill: 6%;
}

.fill-8 {
  --fill: 8%;
}

.fill-10 {
  --fill: 10%;
}

.fill-12 {
  --fill: 12%;
}

.fill-14 {
  --fill: 14%;
}

.fill-16 {
  --fill: 16%;
}

.fill-18 {
  --fill: 18%;
}

.fill-20 {
  --fill: 20%;
}

.fill-22 {
  --fill: 22%;
}

.fill-24 {
  --fill: 24%;
}

.fill-26 {
  --fill: 26%;
}

.fill-28 {
  --fill: 28%;
}

.fill-30 {
  --fill: 30%;
}

.fill-32 {
  --fill: 32%;
}

.fill-34 {
  --fill: 34%;
}

.fill-36 {
  --fill: 36%;
}

.fill-38 {
  --fill: 38%;
}

.fill-40 {
  --fill: 40%;
}

.fill-42 {
  --fill: 42%;
}

.fill-44 {
  --fill: 44%;
}

.fill-46 {
  --fill: 46%;
}

.fill-48 {
  --fill: 48%;
}

.fill-50 {
  --fill: 50%;
}

.fill-52 {
  --fill: 52%;
}

.fill-54 {
  --fill: 54%;
}

.fill-56 {
  --fill: 56%;
}

.fill-58 {
  --fill: 58%;
}

.fill-60 {
  --fill: 60%;
}

.fill-62 {
  --fill: 62%;
}

.fill-64 {
  --fill: 64%;
}

.fill-66 {
  --fill: 66%;
}

.fill-68 {
  --fill: 68%;
}

.fill-70 {
  --fill: 70%;
}

.fill-72 {
  --fill: 72%;
}

.fill-74 {
  --fill: 74%;
}

.fill-76 {
  --fill: 76%;
}

.fill-78 {
  --fill: 78%;
}

.fill-80 {
  --fill: 80%;
}

.fill-82 {
  --fill: 82%;
}

.fill-84 {
  --fill: 84%;
}

.fill-86 {
  --fill: 86%;
}

.fill-88 {
  --fill: 88%;
}

.fill-90 {
  --fill: 90%;
}

.fill-92 {
  --fill: 92%;
}

.fill-94 {
  --fill: 94%;
}

.fill-96 {
  --fill: 96%;
}

.fill-98 {
  --fill: 98%;
}

.fill-100 {
  --fill: 100%;
}

/* --- Un avis --------------------------------------------------------------------------------- */

.review {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  padding: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--sh-sm);
}

.review__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
}

.review__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-gradient);
  color: #fff;
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}

.review__who p {
  margin: 0;
}

.review__name {
  font-weight: var(--fw-semibold);
  overflow-wrap: anywhere;
}

.review__city,
.review__meta,
.review__date {
  color: var(--c-text-muted);
  font-weight: var(--fw-regular);
  font-size: var(--fs-sm);
}

.review__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--c-success);
  font-weight: var(--fw-semibold);
}

.review__verified .icon {
  width: 14px;
  height: 14px;
}

.review__body {
  position: relative;
  padding-left: var(--sp-4);
  border-left: 3px solid var(--c-primary-soft);
}

.review__body p {
  margin: 0;
  overflow-wrap: anywhere;
}

.review__date {
  margin: 0;
}

.review__reply {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-primary-soft);
}

.review__reply p {
  margin: 0;
  overflow-wrap: anywhere;
}

.review__reply-title {
  color: var(--c-primary-text);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
}

.review--compact {
  height: 100%;
}

/* --- Carrousel ------------------------------------------------------------------------------- */

.carousel {
  display: grid;
  gap: var(--sp-3);
  min-width: 0;
}

.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(86%, 340px);
  gap: var(--sp-4);
  padding: 4px 4px var(--sp-3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.carousel__track:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-lg);
}

.carousel__slide {
  scroll-snap-align: start;
}

.carousel__controls {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
}

.carousel__controls[hidden] {
  display: none;
}

.carousel__button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--c-border-strong);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.carousel__button:hover {
  background: var(--c-primary-soft);
  transform: translateY(-1px);
}

.carousel__play,
.carousel.is-paused .carousel__pause {
  display: none;
}

.carousel.is-paused .carousel__play {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .carousel__track {
    scroll-behavior: smooth;
  }
}

/* --- Note moyenne et répartition --------------------------------------------------------------- */

.rating-summary {
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
  align-content: start;
}

.rating-summary p {
  margin: 0;
}

.rating-summary__value {
  font-size: clamp(2.75rem, 7vw, 3.5rem);
  font-weight: var(--fw-black);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.rating-summary__max {
  color: var(--c-text-muted);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}

.rating-summary__count {
  color: var(--c-text-muted);
}

.rating-bars {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rating-bar {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 2.5rem;
  gap: var(--sp-3);
  align-items: center;
  padding: 4px var(--sp-2);
  border-radius: var(--r-sm);
  color: var(--c-text);
  text-decoration: none;
}

.rating-bar:hover,
.rating-bar.is-current {
  background: var(--c-surface-2);
}

.rating-bar__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: var(--fw-semibold);
}

.rating-bar__label .icon {
  width: 14px;
  height: 14px;
  color: var(--c-star);
}

.rating-bar__track {
  height: 10px;
  overflow: hidden;
  border-radius: var(--r-pill);
  background: var(--c-surface-2);
}

.rating-bar__fill {
  display: block;
  width: var(--fill, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--c-star);
  transform-origin: left center;
  transition: transform 1.2s var(--ease) 0.2s;
}

.anim [data-reveal]:not(.is-visible) .rating-bar__fill {
  transform: scaleX(0);
}

.rating-bar__count {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Mises en page des avis -------------------------------------------------------------------- */

.reviews-band {
  display: grid;
  gap: var(--sp-6);
  align-items: center;
}

@media (min-width: 900px) {
  .reviews-band {
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
  }
}

.reviews-band .rating-summary .cluster {
  margin-top: var(--sp-2);
}

.reviews-overview {
  display: grid;
  gap: var(--sp-6);
  align-items: center;
  margin-bottom: var(--sp-5);
}

@media (min-width: 720px) {
  .reviews-overview {
    grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.6fr);
  }
}

.reviews-filter {
  margin-bottom: var(--sp-5);
}

.reviews-grid {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  margin-bottom: var(--sp-5);
}

.reviews-empty,
.reviews-cta {
  display: grid;
  gap: var(--sp-4);
  align-items: center;
}

@media (min-width: 720px) {
  .reviews-empty,
  .reviews-cta {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .reviews-cta {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.reviews-empty h2,
.reviews-empty h3,
.reviews-cta h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-1);
  font-size: var(--fs-xl);
}

.reviews-empty p,
.reviews-cta p {
  margin: 0;
}

.reviews-cta {
  margin-block: var(--sp-5);
}

.reviews-charter summary {
  font-weight: var(--fw-semibold);
  cursor: pointer;
}

.reviews-charter ul {
  display: grid;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 0;
  padding-left: 1.25rem;
  color: var(--c-text-muted);
}

/* Bandeau d'accueil : la note moyenne, sous les boutons. */
.hero-rating {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  padding: 6px var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-sm);
  text-decoration: none;
  box-shadow: var(--sh-sm);
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.hero-rating:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

.hero-rating strong {
  font-variant-numeric: tabular-nums;
}

/* --- Estimation d'une commande (tarifs, showcase.js) ---------------------------------------------- */

.estimator {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  font-size: var(--fs-sm);
}

.estimator[hidden] {
  display: none;
}

.estimator label {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  font-weight: var(--fw-semibold);
}

.estimator input[type="range"] {
  width: 100%;
  accent-color: var(--c-primary);
}

.estimator__total {
  margin: 0;
  color: var(--c-text-muted);
}

.estimator__total strong {
  color: var(--c-text);
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}

/* --- Note à donner : cinq boutons radio dessinés en étoiles ---------------------------------------- */

.star-input {
  margin: 0;
  padding: 0;
  border: 0;
}

.star-input legend {
  margin-bottom: var(--sp-2);
  padding: 0;
}

.star-input__stars {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.star-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.star-input label {
  padding: 2px;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.star-input label::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--c-star-off);
  -webkit-mask: url("../icons/star-mask.8855e4f7b952.svg") center / contain no-repeat;
  mask: url("../icons/star-mask.8855e4f7b952.svg") center / contain no-repeat;
  transition:
    background var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.star-input input:focus-visible + label {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}

/* Étoiles allumées jusqu'à la note choisie… */
.star-input__stars:has(input:nth-of-type(1):checked) label:nth-of-type(-n + 1)::before,
.star-input__stars:has(input:nth-of-type(2):checked) label:nth-of-type(-n + 2)::before,
.star-input__stars:has(input:nth-of-type(3):checked) label:nth-of-type(-n + 3)::before,
.star-input__stars:has(input:nth-of-type(4):checked) label:nth-of-type(-n + 4)::before,
.star-input__stars:has(input:nth-of-type(5):checked) label:nth-of-type(-n + 5)::before,
/* …ou jusqu'à celle que la souris survole. */
.star-input__stars:hover label:hover::before,
.star-input__stars:hover label:has(~ label:hover)::before {
  background: var(--c-star);
}

/* Survol d'une note plus basse que celle choisie : les étoiles suivantes s'éteignent
   (sélecteur plus précis que celui de la note choisie). */
.star-input .star-input__stars:hover label:hover ~ label:nth-of-type(n)::before {
  background: var(--c-star-off);
}

.star-input label:hover::before {
  transform: scale(1.12);
}

/* Sans :has() : au moins l'étoile choisie s'allume. */
.star-input input:checked + label::before {
  background: var(--c-star);
}

.star-input__hint {
  margin-left: var(--sp-2);
  color: var(--c-text-muted);
  font-weight: var(--fw-semibold);
}

.review-form__counter {
  margin-top: calc(-1 * var(--sp-3));
  text-align: right;
}

.review-mine {
  display: grid;
  gap: var(--sp-5);
}

.review-mine .alert strong {
  margin-right: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .anim [data-reveal],
  .rating-bar__fill {
    transition: none;
  }
}

/* Le carrousel reste dans sa colonne (sinon la grille s'élargit à sa bande). */
.reviews-band > * {
  min-width: 0;
}

.pricing-reviews {
  margin-block: var(--sp-7);
}
