/* ─────────────────────────────────────────────────────────────────
   Checkout · paso 1 (Envío) — fiel al Figma de Carmen, sobre los
   tokens de styles.css. Sin tocar arquitectura: misma cabecera
   reducida, dos columnas (configuración del envío · resumen).
   ───────────────────────────────────────────────────────────────── */

/* ───────── Cabecera de checkout ───────── */
.co-header { background: var(--green-700); color: #fff; }
.co-header__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 40px;
  height: 94px;
}
.co-header .brand__logo { height: 28px; }

/* Stepper: Envío → Pago → Pedido realizado */
.stepper {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 0;
  list-style: none; margin: 0; padding: 0;
}
.stepper__step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px;
  font-size: 12px; line-height: 12px;
  color: var(--green-200);
}
.stepper__dot {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--green-200);
  color: rgba(0, 105, 55, .5);
  font-size: 16px;
}
.stepper__step.is-current { color: var(--green-400); font-weight: 800; }
.stepper__step.is-current .stepper__dot { background: var(--green-400); color: var(--green-700); }
.stepper__line {
  width: 87px; height: 2px;
  margin-top: 15px;
  background: var(--green-200);
}

.co-help { font-size: 14px; line-height: 20px; }
.co-help strong { display: block; font-weight: 500; font-size: 16px; }

/* ───────── Botón píldora (_Boton) ───────── */
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0;
  border-radius: 30px;
  background: var(--green-400);
  color: var(--green-900);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 24px;
  transition: background .2s ease;
}
.pill-btn:hover { background: var(--green-300); }
.pill-btn--lg { width: 100%; font-size: 20px; padding: 10px 24px; min-height: 48px; }
.pill-btn--soft { background: var(--green-200); color: var(--green-700); font-weight: 500; padding: 8px 14px; }
.pill-btn--soft:hover { background: var(--green-300); }

/* ───────── Layout ───────── */
.co-page {
  display: grid;
  grid-template-columns: minmax(0, 855fr) minmax(0, 550fr);
  gap: 16px;
  align-items: start;
  padding-top: 32px; padding-bottom: 64px;
}
.co-card {
  background: #fff;
  border: 1px solid var(--green-700);
  border-radius: var(--r-md);
}
.co-main { padding: 24px 32px 40px; display: flex; flex-direction: column; align-items: center; gap: 36px; }
.co-side { display: flex; flex-direction: column; gap: 16px; }

.co-h2 { margin: 0; font-size: 32px; line-height: 32px; font-weight: 800; color: var(--green-700); text-align: center; }
.co-h3 { margin: 0; font-size: 24px; line-height: 24px; font-weight: 800; color: var(--green-700); text-align: center; }
.co-h4 { margin: 0; font-size: 20px; line-height: 20px; font-weight: 600; color: var(--green-700); text-align: center; }
.co-block { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }

/* ───────── Modo de entrega ───────── */
.modes { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mode {
  width: 202px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 10px 12px 14px;
  background: #fff;
  border: .5px solid var(--green-700);
  border-radius: var(--r-md);
  color: var(--green-700);
  font-weight: 700; font-size: 18px; line-height: 22px;
}
.mode img { width: 163px; max-width: 100%; height: auto; margin-top: auto; }
.mode.is-selected { background: var(--green-200); border-color: transparent; }

/* Desktop por debajo de ~1700px: el gutter de 24px de .wrap se queda pegado
   al borde; se abre progresivamente hasta empalmar con el margen natural de 1920. */
/* Por debajo de 1100px la columna principal no cabe junto al resumen: se apilan. */
@media (max-width: 1100px) {
  .co-page { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 721px) and (max-width: 1700px) {
  .wrap { padding-left: clamp(24px, 4.5vw, 72px); padding-right: clamp(24px, 4.5vw, 72px); }
}

/* ───────── Direcciones (radio cards) ───────── */
.addresses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 312px));
  gap: 9px clamp(16px, 2.5vw, 48px);
  width: 100%;
  justify-content: center;
}
.address {
  display: flex; gap: 16px; align-items: center;
  min-height: 93px;
  padding: 13px 16px 13px 8px;
  background: #fff;
  border: .5px solid var(--green-700);
  border-radius: var(--r-md);
  font-weight: 500; font-size: 18px; line-height: 22px;
  color: var(--ink-800);
}
.address.is-selected { background: var(--green-200); border-color: transparent; min-height: 118px; }
.radio {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid #B3B3B3;
  background: #fff;
}
.address.is-selected .radio { border-color: var(--green-700); box-shadow: inset 0 0 0 1.5px #fff; background: var(--green-700); }

/* ───────── Día y hora ───────── */
.slots { width: 400px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); width: 100%; }
.weekdays span { text-align: center; font-size: 16px; line-height: 22px; color: rgba(0, 105, 55, .5); }
.weekdays span:last-child { color: var(--ink-800); opacity: .4; }
.days {
  border: 1px solid var(--green-700);
  border-radius: var(--r-md);
  overflow: hidden;
}
.day {
  height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: #fff;
  border-right: .5px solid var(--green-700);
  border-bottom: .5px solid var(--green-700);
  color: var(--green-700);
  font-weight: 500;
}
.day:nth-child(7n) { border-right: 0; }
.day:nth-last-child(-n+7) { border-bottom: 0; }
.day b { font-size: 20px; line-height: 22px; font-weight: 600; }
.day small { font-size: 10px; line-height: 11px; }
.day.is-full { background: #EDECEC; color: #D4D4D4; }
.day.is-selected { background: var(--green-400); }
.full { font-size: 9px; line-height: 10px; color: var(--magenta); font-weight: 500; }

.hours {
  display: grid; grid-template-columns: repeat(4, 1fr);
  width: 100%;
  border: 1.5px solid var(--green-700);
  border-radius: var(--r-md);
  overflow: hidden;
}
.hour {
  height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  background: #fff;
  border-right: .5px solid var(--green-700);
  color: var(--green-700);
  font-weight: 500;
}
.hour:last-child { border-right: 0; }
.hour b { font-size: 20px; line-height: 25px; font-weight: 600; }
.hour__price { font-size: 18px; line-height: 22px; }
.hour.is-full { background: #EDECEC; color: #D4D4D4; }
.hour.is-selected { background: var(--green-400); }

.notes { width: 100%; max-width: 726px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.notes textarea {
  width: 100%; min-height: 90px; resize: none;
  padding: 12px 16px;
  border: 1px solid var(--green-700); border-radius: var(--r-md);
  font: 500 18px/22px var(--font-sans); color: var(--green-700);
}
.notes textarea::placeholder { color: var(--green-700); opacity: .7; }
.co-main > .pill-btn--lg { max-width: 398px; }

/* ───────── Resumen ───────── */
.summary { padding: 20px 26px 24px; }
.co-title { margin: 0 0 8px; font-size: 32px; line-height: 35px; font-weight: 700; color: var(--green-700); }
.summary__list { border-top: .5px solid var(--green-700); padding-top: 8px; margin: 0 0 16px; }
.summary__row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  font-size: 20px; line-height: 22px; font-weight: 500; color: var(--green-700);
}
.summary__row strong { color: var(--ink-900); font-weight: 700; }
.summary__row small { display: block; font-size: 15px; font-weight: 400; color: var(--ink-900); margin-top: 4px; }
.summary__row--discount strong { color: var(--magenta); }
.summary__row--total { justify-content: flex-end; gap: 24px; font-size: 24px; font-weight: 800; color: var(--green-900); }
.summary__row--total strong { color: var(--green-900); font-weight: 800; }

/* ───────── No te olvides de… ───────── */
.upsell { padding: 16px 20px 24px; }
.upsell__item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 4px 14px;
  align-items: center;
  padding: 8px 0 12px;
  border-bottom: .5px solid var(--green-700);
}
.upsell__item:last-child { border-bottom: 0; }
.upsell__item img { grid-row: span 2; width: 82px; height: 82px; object-fit: cover; }
.upsell__name { margin: 0; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--green-700); }
.upsell__price { justify-self: end; font-size: 16px; font-weight: 900; color: var(--ink-900); }
.upsell__tag {
  justify-self: start;
  background: var(--lime-500, #65B32E);
  color: var(--green-900);
  border-radius: var(--r-md);
  padding: 1px 12px;
  font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: -.01em;
}

/* ───────── Mobile (≤720px) ───────── */
@media (max-width: 720px) {
  .co-header__row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand help" "steps steps";
    height: auto; gap: 12px; padding-top: 14px; padding-bottom: 12px;
  }
  .co-header .brand { grid-area: brand; }
  .co-header .brand__logo { height: 20px; }
  .co-header .pill-btn { display: none; }
  .co-help { grid-area: help; font-size: 11px; line-height: 14px; text-align: right; }
  .co-help strong { font-size: 12px; }
  .stepper { grid-area: steps; }
  .stepper__line { width: 48px; }

  .co-page { grid-template-columns: 1fr; padding-top: 16px; }
  .co-main { padding: 18px 14px 24px; gap: 28px; }
  .co-h2 { font-size: 22px; line-height: 24px; }
  .co-h3 { font-size: 18px; line-height: 20px; }
  .co-h4 { font-size: 16px; line-height: 18px; }
  .modes { gap: 6px; flex-wrap: nowrap; width: 100%; }
  .mode { width: auto; flex: 1; font-size: 12px; line-height: 14px; padding: 8px 4px 10px; }
  .addresses { grid-template-columns: 1fr; width: 100%; gap: 8px; }
  .address, .address.is-selected { min-height: 0; font-size: 14px; line-height: 18px; }
  .slots { width: 100%; }
  .weekdays span { font-size: 12px; }
  .day { height: 44px; }
  .day b { font-size: 16px; }
  .hour { height: 64px; }
  .hour b { font-size: 14px; line-height: 18px; }
  .hour__price { font-size: 13px; }
  .notes textarea { font-size: 14px; min-height: 72px; }
  .pill-btn--lg { font-size: 16px; min-height: 44px; }
  .co-title { font-size: 24px; line-height: 28px; }
  .summary__row { font-size: 16px; }
  .summary__row--total { font-size: 18px; }
}

/* ───────── Interacción (hover · focus · selección) ─────────
   Mismos patrones que home/PLP: elevación translateY + --shadow-2 en tarjetas,
   fondos --green-100/200 en opciones, sin tocar el estado seleccionado. */
.pill-btn { cursor: pointer; transition: background .2s ease, transform .12s ease, box-shadow .2s ease; }
.pill-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.pill-btn:active { transform: translateY(0); box-shadow: none; }
.pill-btn--soft.is-added { background: var(--green-700); color: var(--white); }

.mode, .address, .day, .hour, .upsell__item { transition: background .15s ease, border-color .15s ease, transform .25s ease, box-shadow .25s ease, color .15s ease; }

.mode { cursor: pointer; }
.mode img { transition: transform .25s ease; }
.mode:not(.is-selected):hover { background: var(--green-100); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.mode:hover img { transform: scale(1.04); }

.address { cursor: pointer; }
.address:not(.is-selected):hover { background: var(--green-100); border-color: var(--green-500); }
.address:not(.is-selected):hover .radio { border-color: var(--green-700); }
.radio { transition: background .15s ease, border-color .15s ease; }

.day:not(.is-full), .hour:not(.is-full) { cursor: pointer; }
.day.is-full, .hour.is-full { cursor: not-allowed; }
.day:not(.is-full):not(.is-selected):hover,
.hour:not(.is-full):not(.is-selected):hover { background: var(--green-200); }

.notes textarea { transition: border-color .15s ease, box-shadow .15s ease; }
.notes textarea:hover { border-color: var(--green-500); }
.notes textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px var(--green-200); }

.upsell__item img { transition: transform .25s ease; }
.upsell__item:hover img { transform: scale(1.05); }
.upsell__item:hover .upsell__name { color: var(--green-900); }

.summary__row strong { transition: color .2s ease; }
.summary.is-bump .summary__row--total strong { color: var(--green-600); }

/* Stepper · paso completado (enlazable para volver) */
.stepper__step.is-done { color: var(--green-400); }
.stepper__step.is-done .stepper__dot { background: var(--green-400); color: var(--green-700); text-decoration: none; transition: transform .15s ease; }
a.stepper__dot:hover { transform: scale(1.08); }
.stepper__line.is-done { background: var(--green-400); }
a.pill-btn { text-decoration: none; }
.pill-btn:disabled { background: var(--green-200); color: rgba(0, 105, 55, .35); box-shadow: inset 0 0 0 1px var(--green-300); cursor: not-allowed; transform: none; }
