/* Modal de commande */

body.order-modal-open {
  overflow: hidden;
}

.order-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.order-modal.is-open {
  display: block;
}

.order-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 47, 0.62);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.order-modal.is-open .order-modal__backdrop {
  opacity: 1;
}

.order-modal__panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 50vw;
  min-width: 560px;
  height: 100%;
  overflow-y: auto;
  background: var(--paper);
  color: var(--navy);
  box-shadow: -18px 0 45px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  transition: transform 0.28s ease;
}

.order-modal.is-open .order-modal__panel {
  transform: translateX(0);
}

.order-modal__close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.order-modal__close:hover,
.order-modal__close:focus-visible {
  background: rgba(36, 59, 99, 0.07);
  outline: none;
}

.order-modal__content {
  width: min(calc(100% - 56px), 720px);
  margin: 0 auto;
  padding: 54px 0 44px;
}

/* Intro livre */

.order-modal__intro {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.order-modal__details {
  padding-right: 56px;
}

.order-modal__cover {
  width: 118px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.order-modal__eyebrow {
  margin: 0 0 3px;
  color: var(--brown);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.order-modal__title {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: clamp(2rem, 3.2vw, 3.3rem);
  font-weight: 400;
  line-height: 1.05;
}

.order-modal__author {
  margin: 7px 0 14px;
  font-family: var(--sans);
  font-size: 1rem;
}

.order-modal__summary {
  margin: 0;
  max-width: 470px;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Nouvelle édition */

.order-edition-notice,
.order-waiting {
  width: 100%;
  margin-top: 8px;
  padding: 18px 20px;
  border: 1px solid var(--navy);
  border-radius: 7px;
  background: var(--white);
  box-sizing: border-box;
  overflow: hidden;
}

.order-edition-notice__title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.order-edition-notice__date {
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--navy);
  color: var(--white);
  letter-spacing: 0.08em;
}

.order-edition-notice__content p {
  margin: 0;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
}

/* Formats */

.order-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 28px;
  border: 1px solid #e2ddd4;
  border-radius: 7px;
  overflow: hidden;
  background: #f2efe9;
}

.order-tab {
  min-height: 80px;
  padding: 14px 18px;
  border: 0;
  background: #f8f6f2;
  color: var(--navy);
  text-align: left;
  cursor: pointer;
}

.order-tab + .order-tab {
  border-left: 1px solid #e2ddd4;
}

.order-tab.is-active {
  background: #e2ddd4;
  color: var(--navy);
}

.order-tab__label,
.order-tab__price {
  display: block;
}

.order-tab__label {
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-tab__price {
  margin-top: 4px;
  font-size: 1.1rem;
  font-weight: 700;
}

.order-panel {
  display: none;
  padding-top: 28px;
}

.order-panel.is-active {
  display: block;
}

/* Librairies / revendeurs papier */

.order-retailers__title {
  margin: 0 0 14px;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

#order-panel-paper.has-paper-note {
  padding-top: 0;
}

.order-modal__note {
  margin: 1.25rem 0;
  color: color-mix(in srgb, var(--navy) 75%, transparent);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.5;
}

.order-modal__note strong {
  color: var(--navy);
}

.order-retailers-groups {
  display: grid;
  gap: 18px;
}

.order-retailers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.order-retailer {
  min-height: 125px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ded8cf;
  border-radius: 7px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(36, 59, 99, 0.04);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.order-retailer:hover,
.order-retailer:focus-visible {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(36, 59, 99, 0.08);
  outline: none;
}

.order-retailer__visual {
  width: 100%;
  height: 60px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-retailer__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 115px;
  max-height: 60px;
  object-fit: contain;
}

.order-retailer__label {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.order-retailer__location {
  margin-top: 4px;
  color: #776f64;
  font-size: 0.64rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

/* Recherche d'une autre librairie */

.order-find-bookstore {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid #e2ddd4;
}

.order-find-bookstore__text {
  margin: 0 0 12px;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.order-find-bookstore__link {
  min-height: 58px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid var(--navy);
  border-radius: 7px;
  background: transparent;
  color: var(--navy);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.order-find-bookstore__link:hover,
.order-find-bookstore__link:focus-visible {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
  outline: none;
}

/* Liens de commande */

.order-links {
  display: grid;
  gap: 14px;
}

.order-link {
  min-height: 76px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #ded8cf;
  border-radius: 7px;
  background: var(--white);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 5px 18px rgba(36, 59, 99, 0.05);
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.order-link:hover,
.order-link:focus-visible {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(36, 59, 99, 0.08);
  outline: none;
}

.order-link__arrow {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 400;
}

.order-open {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* Mobile */

@media (max-width: 800px) {
  .order-modal__panel {
    width: 100%;
    min-width: 0;
  }

  .order-modal__content {
    width: min(calc(100% - 34px), 680px);
    padding: 76px 0 32px;
  }

  .order-modal__close {
    top: 16px;
    right: 17px;
  }

  .order-modal__intro {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 18px;
  }

  .order-modal__details {
    display: contents;
    padding-right: 0;
  }

  .order-modal__cover {
    width: 88px;
  }

  .order-modal__title {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }

  .order-modal__author {
    margin-bottom: 10px;
  }

  .order-modal__summary {
    font-size: 0.9rem;
  }

  .order-edition-notice,
  .order-waiting {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
    padding: 15px 16px;
  }

  .order-edition-notice__title {
    gap: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .order-edition-notice__date {
    padding: 4px 7px;
  }

  .order-edition-notice__content p {
    font-size: 0.95rem;
  }

  .order-tabs {
    margin-top: 24px;
  }

  .order-tab {
    min-height: 74px;
    padding: 12px 14px;
  }

  .order-tab__label {
    font-size: 0.68rem;
  }

  .order-tab__price {
    font-size: 1rem;
  }

  .order-panel {
    padding-top: 24px;
  }

  .order-link {
    min-height: 68px;
    padding: 15px 17px;
    font-size: 1rem;
  }

  .order-retailers-groups {
    gap: 10px;
  }

  .order-retailers {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .order-retailers::-webkit-scrollbar {
    display: none;
  }

  .order-retailer {
    flex: 0 0 42%;
    min-width: 0;
    scroll-snap-align: start;
  }

  .order-retailer__visual {
    height: 56px;
    margin-bottom: 7px;
  }

  .order-retailer__logo {
    width: auto;
    height: auto;
    max-width: 105px;
    max-height: 56px;
  }

  .order-retailer__label {
    font-size: 0.74rem;
  }

  .order-retailer__location {
    margin-top: 3px;
    font-size: 0.63rem;
  }

  .order-find-bookstore {
    margin-top: 24px;
    padding-top: 20px;
  }
}

/* Très petits écrans */

@media (max-width: 420px) {
  .order-modal__intro {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .order-modal__cover {
    width: 76px;
  }

  .order-modal__summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .order-tab {
    padding-inline: 10px;
  }
}

/* Accessibilité */

@media (prefers-reduced-motion: reduce) {
  .order-modal__backdrop,
  .order-modal__panel {
    transition: none;
  }
}

/* Mode attente */

.order-waiting {
  margin-top: 32px;
  color: var(--navy);
}

.order-waiting h2 {
  margin: 0 0 18px;
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
}

.order-waiting > p {
  margin: 0 0 24px;
  line-height: 1.65;
}

.order-waiting .fluentform,
.order-waiting .fluentform form {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.order-waiting .fluentform form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.order-waiting .fluentform .ff-t-container,
.order-waiting .fluentform .ff-t-cell {
  display: contents;
}

.order-waiting .fluentform .ff-el-group {
  grid-column: 1 / -1;
  min-width: 0;
  /* La marge basse est partagée avec le contact dans contact.css. */
  margin-top: 0;
  margin-inline: 0;
  padding: 0;
  border: 0;
}

.order-waiting .fluentform input[type="checkbox"]:focus-visible,
.order-waiting .fluentform button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.order-waiting .fluentform .ff-el-form-check,
.order-waiting .fluentform .ff-el-form-check-label,
.order-waiting .fluentform .ff-el-tc {
  margin: 0;
  color: var(--navy);
  font-size: 0.82rem;
  line-height: 1.5;
}

.order-waiting .fluentform .ff-el-form-check-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 0;
}

.order-waiting .fluentform .ff-el-form-check-input {
  accent-color: var(--navy);
  position: static;
  float: none;
  flex: 0 0 auto;
  margin: 0.2em 0 0;
}

.order-waiting .fluentform .ff-message-success {
  margin: 20px 0 0;
  padding: 18px;
  border: 0;
  border-radius: 5px;
  background: var(--cream);
  color: var(--navy);
  box-shadow: none;
  line-height: 1.6;
}

@media (max-width: 599px) {
  .order-waiting .fluentform .ff-btn-submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .order-waiting .fluentform .ff-btn-submit {
    transition: none;
  }
}
