/**
 * Page Réservation — layout éditorial + pile de cartes postales.
 * Scoped à body.me-plugin-reservation ; n’altère pas les autres pages.
 *
 * @package Maldives_Evasion
 */

/* Ancre Hero → Bloc 1 : sous le header sticky */
body.me-plugin-reservation #comment-reserver {
  scroll-margin-top: calc(var(--header-h, 78px) + 16px);
}

body.me-plugin-reservation .me-rsv-block__layout {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.85rem);
  align-items: start;
}

/* Même logique de largeur pour les 2 blocs (colonnes inversées) */
body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__layout {
  grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.62fr);
  align-items: stretch;
}

/* Bloc « Comment réserver » : groupe compact des 3 cartes, centré dans la colonne droite */
@media (min-width: 901px) {
  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__cards {
    align-self: stretch;
    height: auto;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-inline-start: 0;
  }

  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__stack--right {
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    align-items: center;
    gap: clamp(0.65rem, 1.35vw, 1.05rem);
    margin-inline: auto;
    transform: none;
  }
}

body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__layout {
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
}

body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__cards {
  order: 1;
  justify-content: flex-start;
  padding-inline-end: clamp(0.25rem, 1.5vw, 1rem);
}

body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__copy {
  order: 2;
}

body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__cards {
  justify-content: center;
  padding-inline-start: 0;
}

body.me-plugin-reservation .me-rsv-block__copy {
  min-width: 0;
  max-width: none;
  width: 100%;
}

body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__copy {
  margin-inline-start: 0;
}

body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__copy {
  margin-inline-end: 0;
}

/* Cartes postales ancrées vers l’extérieur (miroir bloc 1 / bloc 2) */
body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__stack--left {
  margin-inline-start: 0;
  margin-inline-end: auto;
  transform: translateX(clamp(-1.25rem, -2.2vw, -0.35rem));
}

body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__stack--right {
  margin-inline: auto;
  transform: none;
}

body.me-plugin-reservation .me-rsv-block .me-prose p {
  margin: 0 0 1rem;
}

body.me-plugin-reservation .me-rsv-block .me-prose p:last-child {
  margin-bottom: 0;
}

/* 5 pancartes d’étapes — Comment réserver uniquement */
body.me-plugin-reservation .me-rsv-steps {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

body.me-plugin-reservation .me-rsv-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  margin: 0;
  padding: 0.72rem 0.95rem;
  background: #ffffff;
  border: 1px solid rgba(17, 17, 17, 0.07);
  border-radius: 10px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 18px rgba(17, 17, 17, 0.045);
  box-sizing: border-box;
}

/* Pancartes compactes — mêmes proportions sur les 2 blocs */
body.me-plugin-reservation .me-rsv-block--has-steps .me-rsv-steps {
  gap: 0.42rem;
  margin-top: 1rem;
}

body.me-plugin-reservation .me-rsv-block--has-steps .me-rsv-step {
  gap: 0.6rem;
  padding: 0.52rem 0.85rem;
}

body.me-plugin-reservation .me-rsv-block--has-steps .me-rsv-step__num {
  margin-top: 0.06rem;
  min-width: 1.7rem;
  font-size: 0.74rem;
}

body.me-plugin-reservation .me-rsv-block--has-steps .me-rsv-step__line {
  font-size: 0.875rem;
  line-height: 1.38;
}

body.me-plugin-reservation .me-rsv-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.85rem;
  margin-top: 0.08rem;
  font-family: var(--font-sans, 'DM Sans', system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--color-coral, #F36F68);
}

body.me-plugin-reservation .me-rsv-step__body {
  min-width: 0;
}

body.me-plugin-reservation .me-rsv-step__line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #1A2224;
}

body.me-plugin-reservation .me-rsv-step__title {
  font-weight: 700;
  color: #111111;
}

body.me-plugin-reservation .me-rsv-step__sep {
  color: rgba(17, 17, 17, 0.45);
}

body.me-plugin-reservation .me-rsv-step__text {
  font-weight: 400;
}

body.me-plugin-reservation .me-rsv-step__note {
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  border-left: 3px solid var(--color-coral, #F36F68);
  background: rgba(243, 111, 104, 0.09);
  color: #1A2224;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.4;
  text-transform: none;
}

/* CTA centré sous le texte (desktop + mobile) */
body.me-plugin-reservation .me-rsv-block__cta {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

body.me-plugin-reservation .me-rsv-block__cta .me-btn {
  margin: 0;
}

/* Pile de 3 cartes postales — même esprit que me-pq-hero / me-postcard */
body.me-plugin-reservation .me-rsv-block__cards {
  min-width: 0;
  display: flex;
  justify-content: center;
}

body.me-plugin-reservation .me-rsv-block__stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.55rem, 1.2vw, 0.95rem);
  width: min(100%, 220px);
}

body.me-plugin-reservation .me-rsv-block__stack--left {
  align-items: flex-end;
}

body.me-plugin-reservation .me-rsv-block__stack--right {
  align-items: center;
}

body.me-plugin-reservation .me-rsv-block__card {
  margin: 0;
  width: min(100%, 148px);
  transition: transform .45s var(--ease);
}

body.me-plugin-reservation .me-rsv-block__card--left-1 {
  width: min(100%, 132px);
  transform: rotate(-2.2deg) translateY(4px);
}

body.me-plugin-reservation .me-rsv-block__card--left-2 {
  width: min(100%, 158px);
  transform: rotate(1.5deg) translateX(-6px) translateY(-2px);
}

body.me-plugin-reservation .me-rsv-block__card--left-3 {
  width: min(100%, 142px);
  transform: rotate(-0.9deg) translateX(4px) translateY(3px);
}

body.me-plugin-reservation .me-rsv-block__card--right-1 {
  width: min(100%, 150px);
  transform: rotate(1.8deg) translateY(3px);
}

body.me-plugin-reservation .me-rsv-block__card--right-2 {
  width: min(100%, 134px);
  transform: rotate(-1.6deg) translateX(8px) translateY(-3px);
}

body.me-plugin-reservation .me-rsv-block__card--right-3 {
  width: min(100%, 156px);
  transform: rotate(0.8deg) translateX(-2px) translateY(4px);
}

body.me-plugin-reservation .me-rsv-block__frame {
  background: #fffcfa;
  border: 1px solid rgba(17, 17, 17, 0.06);
  border-radius: 3px;
  padding: .4rem .4rem .95rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 12px 24px rgba(17, 17, 17, 0.08),
    0 3px 8px rgba(17, 17, 17, 0.04);
}

body.me-plugin-reservation .me-rsv-block__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 1px;
  background: rgba(17, 17, 17, 0.04);
  transition: transform .55s var(--ease), filter .55s var(--ease);
}

body.me-plugin-reservation .me-rsv-block__card:hover {
  z-index: 2;
  transform: rotate(0deg) translateY(-3px) scale(1.03);
}

body.me-plugin-reservation .me-rsv-block__card:hover .me-rsv-block__frame img {
  transform: scale(1.03);
  filter: saturate(1.05);
}

@media (prefers-reduced-motion: reduce) {
  body.me-plugin-reservation .me-rsv-block__card,
  body.me-plugin-reservation .me-rsv-block__card--left-1,
  body.me-plugin-reservation .me-rsv-block__card--left-2,
  body.me-plugin-reservation .me-rsv-block__card--left-3,
  body.me-plugin-reservation .me-rsv-block__card--right-1,
  body.me-plugin-reservation .me-rsv-block__card--right-2,
  body.me-plugin-reservation .me-rsv-block__card--right-3 {
    transition: none;
  }

  body.me-plugin-reservation .me-rsv-block__card:hover {
    transform: none;
  }
}

/* Mobile : texte → CTA → cartes */
@media (max-width: 900px) {
  body.me-plugin-reservation .me-rsv-block__layout,
  body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__layout,
  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: stretch;
  }

  body.me-plugin-reservation .me-rsv-block__copy,
  body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__copy,
  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__copy {
    order: 1;
    max-width: none;
    margin-inline: 0;
  }

  body.me-plugin-reservation .me-rsv-block__cards,
  body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__cards,
  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__cards {
    order: 2;
    justify-content: center;
    padding-inline: 0;
  }

  body.me-plugin-reservation .me-rsv-block__stack,
  body.me-plugin-reservation .me-rsv-block__stack--left,
  body.me-plugin-reservation .me-rsv-block__stack--right,
  body.me-plugin-reservation .me-rsv-block--cards-left .me-rsv-block__stack--left,
  body.me-plugin-reservation .me-rsv-block--cards-right .me-rsv-block__stack--right {
    align-items: center;
    width: min(100%, 200px);
    height: auto;
    min-height: 0;
    justify-content: flex-start;
    gap: clamp(0.55rem, 1.2vw, 0.95rem);
    margin-inline: auto;
    transform: none;
  }

  body.me-plugin-reservation .me-rsv-block__cta {
    margin-top: 1.25rem;
  }

  body.me-plugin-reservation .me-rsv-block__cta .me-btn {
    width: auto;
    max-width: 100%;
    min-width: min(16rem, 100%);
  }

  body.me-plugin-reservation .me-rsv-steps {
    margin-top: 1rem;
    gap: 0.5rem;
  }

  body.me-plugin-reservation .me-rsv-step {
    padding: 0.68rem 0.8rem;
    gap: 0.65rem;
  }

  body.me-plugin-reservation .me-rsv-step__line {
    font-size: 0.9rem;
    line-height: 1.42;
    word-break: break-word;
  }

  body.me-plugin-reservation .me-rsv-step__note {
    font-size: 0.76rem;
    line-height: 1.38;
    word-break: break-word;
  }

  /* Rotations plus douces + pas de débordement */
  body.me-plugin-reservation .me-rsv-block__card--left-1,
  body.me-plugin-reservation .me-rsv-block__card--right-1 {
    width: min(100%, 118px);
    transform: rotate(-1.6deg) translateY(2px);
  }

  body.me-plugin-reservation .me-rsv-block__card--left-2,
  body.me-plugin-reservation .me-rsv-block__card--right-2 {
    width: min(100%, 136px);
    transform: rotate(1.2deg) translateY(-1px);
  }

  body.me-plugin-reservation .me-rsv-block__card--left-3,
  body.me-plugin-reservation .me-rsv-block__card--right-3 {
    width: min(100%, 124px);
    transform: rotate(-0.7deg) translateY(2px);
  }
}
