/* ==========================================================================
   GLAMWEL LABORATOIRES - Modale de validation de commande
   Reprend les variables et les conventions de site.css (serif, or, angles
   droits, micro-libelles en capitales espacees).
   ========================================================================== */

.checkout-modal {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: flex;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 300ms var(--ease);
}

.checkout-modal[hidden] { display: none; }
.checkout-modal.is-open { opacity: 1; }

body.checkout-open { overflow: hidden; }

.checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 16, 15, .62);
  backdrop-filter: blur(4px);
}

.checkout-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: auto;
  border: 1px solid var(--line);
  background: var(--warm-white);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
  transform: translateY(14px);
  transition: transform 300ms var(--ease);
}

.checkout-modal.is-open .checkout-panel { transform: none; }

/* EN-TETE */
.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.checkout-title {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -.02em;
  line-height: 1;
}

.checkout-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  transition: color 250ms ease;
}

.checkout-close svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.checkout-close:hover { color: var(--gold); }

.checkout-body { padding: 0 22px 26px; }

/* BANDEAU LIVRAISON */
.checkout-banner {
  margin: 20px 0 0;
  padding: 12px 14px;
  background: var(--gold);
  color: var(--white);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.6;
  text-transform: uppercase;
}

/* SECTIONS */
.checkout-section { margin-top: 26px; }

.checkout-section-title {
  display: inline-block;
  margin-bottom: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--gold);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
}

/* ARTICLES */
.checkout-empty {
  color: #81786e;
  font-size: 12px;
}

.checkout-items { list-style: none; }

.checkout-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.checkout-item:last-child { border-bottom: 0; }

.checkout-item-media {
  width: 62px;
  height: 78px;
  flex: 0 0 auto;
  overflow: hidden;
  background: #e5ded4;
}

.checkout-item-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkout-item-body { flex: 1 1 auto; min-width: 0; }

.checkout-item-name {
  font-size: 12px;
  line-height: 1.5;
}

.checkout-item-price {
  margin-top: 5px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
}

.checkout-item-remove {
  flex: 0 0 auto;
  color: #9e9387;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: .14em;
  text-decoration: underline;
  text-transform: uppercase;
  text-underline-offset: 3px;
  transition: color 250ms ease;
}

.checkout-item-remove:hover { color: var(--black); }

/* FORMULAIRE */
.checkout-form { margin-top: 26px; }

.checkout-field { margin-bottom: 18px; }

.checkout-field label {
  display: block;
  margin-bottom: 6px;
  color: #81786e;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.checkout-field input,
.checkout-field select {
  width: 100%;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--black);
  font-size: 13px;
  transition: border-color 250ms ease;
}

.checkout-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--taupe) 50%),
                    linear-gradient(135deg, var(--taupe) 50%, transparent 50%);
  background-position: right 8px center, right 3px center;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 20px;
  cursor: pointer;
}

.checkout-field input::placeholder { color: var(--taupe); }

.checkout-field input:focus,
.checkout-field select:focus { border-bottom-color: var(--gold); }

.checkout-field.has-error input,
.checkout-field.has-error select { border-bottom-color: #a33f36; }

.checkout-error {
  min-height: 0;
  margin-top: 5px;
  color: #a33f36;
  font-size: 10px;
  line-height: 1.5;
}

.checkout-error:empty { display: none; }

.checkout-field-row { display: grid; gap: 0; }

/* CODE PROMO */
.checkout-promo-toggle {
  margin-bottom: 18px;
  color: #6f685f;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 250ms ease;
}

.checkout-promo-toggle:hover { color: var(--black); }
.checkout-promo[hidden] { display: none; }

/* TOTAUX */
.checkout-section-total { margin-top: 24px; }

.checkout-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.checkout-total-row span:first-child {
  color: #6f685f;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.checkout-total-row span:last-child { text-align: right; }

.checkout-total-row-final {
  border-bottom: 0;
  padding-top: 15px;
}

.checkout-total-row-final span:first-child {
  color: var(--black);
  font-size: 10px;
}

.checkout-total-row-final span:last-child {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
}

/* VALIDATION */
.checkout-submit {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 22px;
  padding: 16px 20px;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--white);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  transition: background 300ms var(--ease), border-color 300ms var(--ease);
}

.checkout-submit:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold);
}

.checkout-submit:disabled { cursor: default; opacity: .55; }

.checkout-note {
  margin-top: 14px;
  color: #81786e;
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
}

.checkout-form-error {
  margin-top: 14px;
  color: #a33f36;
  font-size: 11px;
  text-align: center;
}

.checkout-form-error:empty { display: none; }

/* La confirmation se fait desormais sur la page /commande/merci. */

/* TABLET */
@media (min-width: 760px) {
  .checkout-modal { padding: 34px 20px; }
  .checkout-head { padding: 26px 30px 21px; }
  .checkout-title { font-size: 30px; }
  .checkout-body { padding: 0 30px 32px; }
  .checkout-field-row { grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .checkout-item-media { width: 70px; height: 88px; }
}
