/* ==========================================================================
   SANLILAS - CHECKOUT SEGURO & CONFIRMACIÓN DE PEDIDO STYLESHEET
   Aesthetic: Serene Luxury, High-Security Form, Editorial Precision
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --chk-marfil: #FAF7F2;
  --chk-marfil-light: #FAF7F2;
  --chk-chocolate: #2C211B;
  --chk-cafe-muted: #8A7A6A;
  --chk-champagne: #C8A46A;
  --chk-border: rgba(23, 20, 23, 0.18);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.checkout-body {
  background-color: var(--chk-marfil);
  color: var(--chk-chocolate);
  font-family: var(--font-sans);
  margin: 0;
  padding: 0;
}

/* Minimalist Secure Header */
.checkout-header {
  padding: 1.5rem 2rem;
  background: var(--chk-marfil-light);
  border-bottom: 1px solid rgba(23, 20, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkout-brand {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  letter-spacing: 0.18em;
  color: var(--chk-chocolate);
  text-decoration: none;
}

.checkout-secure-badge {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chk-cafe-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Container & Layout */
.checkout-main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.checkout-grid-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3.5rem;
  align-items: start;
}

/* Form Sections Card */
.checkout-section-card {
  background: var(--chk-marfil-light);
  border: 1px solid var(--chk-border);
  border-radius: 6px;
  padding: 2.2rem;
  margin-bottom: 2rem;
}

.checkout-section-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--chk-chocolate);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--chk-border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group-full {
  grid-column: span 2;
}

.checkout-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--chk-chocolate);
  margin-bottom: 0.4rem;
}

.checkout-input,
.checkout-select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--chk-chocolate);
  background: #FFFFFF;
  border: 1px solid var(--chk-border);
  border-radius: 4px;
  outline: none;
  box-sizing: border-box;
  transition: var(--transition-smooth);
}

.checkout-input:focus,
.checkout-select:focus {
  border-color: var(--chk-champagne);
  box-shadow: 0 0 0 3px rgba(142, 111, 174, 0.15);
}

.field-error-msg {
  font-size: 0.78rem;
  color: #C06A5A;
  margin-top: 0.3rem;
  display: none;
}

/* Shipping & Payment Option Radio Cards */
.option-radio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  background: #FFFFFF;
  border: 1px solid var(--chk-border);
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.8rem;
  transition: var(--transition-smooth);
}

.option-radio-card:hover,
.option-radio-card.is-selected {
  border-color: var(--chk-champagne);
  background: var(--chk-marfil);
}

.option-radio-card input[type="radio"] {
  accent-color: var(--chk-champagne);
  width: 18px;
  height: 18px;
}

/* Order Summary Sticky Sidebar */
.checkout-summary-sidebar {
  position: sticky;
  top: 40px;
  background: var(--chk-marfil-light);
  border: 1px solid var(--chk-border);
  border-radius: 6px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.checkout-submit-btn {
  width: 100%;
  padding: 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
  border: 1px solid var(--chk-champagne);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
  margin-top: 1rem;
}

.checkout-submit-btn:hover {
  background: var(--chk-champagne);
  color: #fff;
  box-shadow: 0 10px 25px rgba(142, 111, 174, 0.3);
}

/* ORDER CONFIRMATION PAGE STYLES */
.confirm-hero-card {
  background: rgba(255, 255, 255, 0.48);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--chk-border);
  border-radius: 6px;
  padding: 3.5rem 2.5rem;
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04);
}

.confirm-check-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #FAF7F2;
  border: 1px solid var(--chk-champagne);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--chk-chocolate);
  animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.confirm-order-number-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  background: var(--chk-marfil);
  border: 1px solid var(--chk-champagne);
  color: var(--chk-chocolate);
  border-radius: 30px;
  margin: 1.2rem 0 2rem;
}

.copy-btn-pill {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
  border: none;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copy-btn-pill:hover {
  background: var(--chk-champagne);
}

/* Order Timeline Tracker */
.order-timeline-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2rem 0;
  position: relative;
  padding: 0 1rem;
}

.order-timeline-wrapper::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: rgba(23, 20, 23, 0.12);
  z-index: 1;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
}

.timeline-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--chk-marfil-light);
  border: 2px solid #F0E6D2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #8A7A6A;
  transition: var(--transition-smooth);
}

.timeline-step.is-active .timeline-dot {
  border-color: var(--chk-chocolate);
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
}

.timeline-step.is-completed .timeline-dot {
  border-color: var(--chk-champagne);
  background: var(--chk-champagne);
  color: #fff;
}

.timeline-label {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--chk-cafe-muted);
}

.timeline-step.is-active .timeline-label {
  font-weight: 700;
  color: var(--chk-chocolate);
}

/* ── SESSION CHIP ────────────────────────────────────────────────── */

.checkout-session-chip {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--chk-cafe-muted);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--chk-border);
  border-radius: 30px;
  background: var(--chk-marfil);
}

.checkout-session-chip.is-authed {
  color: var(--chk-chocolate);
  border-color: var(--chk-champagne);
  background: rgba(142, 111, 174, 0.1);
}


/* ── AUTH GATE (solo con sesión) ────────────────────────────────── */

.checkout-auth-gate {
  padding: 3rem 1rem;
}

.checkout-auth-gate-card {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(250, 247, 242, 0.55));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(142, 111, 174, 0.2);
  border-radius: 20px;
  padding: 3.5rem 2.5rem;
  box-shadow: 0 24px 60px rgba(44, 33, 27, 0.10), 0 4px 14px rgba(142, 111, 174, 0.08);
}

.checkout-auth-gate-emblem {
  width: 84px;
  height: 84px;
  margin: 0 auto 1.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--chk-champagne);
  background: radial-gradient(circle at 35% 30%, rgba(200, 164, 106, 0.22), rgba(142, 111, 174, 0.12) 70%);
  border: 1px solid rgba(200, 164, 106, 0.45);
  box-shadow: inset 0 0 18px rgba(200, 164, 106, 0.16), 0 8px 22px rgba(142, 111, 174, 0.14);
}

.checkout-auth-gate-emblem svg {
  width: 38px;
  height: 38px;
}

.checkout-auth-gate-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--chk-chocolate);
  margin: 0 0 0.8rem;
}

.checkout-auth-gate-text {
  font-size: 0.95rem;
  color: var(--chk-cafe-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.checkout-auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 320px;
  margin: 0 auto;
}

.checkout-auth-btn-primary,
.checkout-auth-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 15px 28px;
  border-radius: 30px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checkout-auth-btn-primary {
  background: linear-gradient(135deg, var(--chk-chocolate), #4A3528);
  color: var(--chk-marfil);
  border: 1px solid var(--chk-chocolate);
  box-shadow: 0 14px 30px rgba(44, 33, 27, 0.22);
}

.checkout-auth-btn-primary:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--chk-champagne), #B08D4F);
  color: var(--chk-chocolate);
  border-color: var(--chk-champagne);
  box-shadow: 0 20px 42px rgba(44, 33, 27, 0.26);
}

.checkout-auth-btn-secondary {
  background: transparent;
  color: var(--chk-chocolate);
  border: 1px solid rgba(142, 111, 174, 0.4);
}

.checkout-auth-btn-secondary:hover {
  transform: translateY(-2px);
  background: rgba(142, 111, 174, 0.1);
  border-color: rgba(142, 111, 174, 0.7);
  box-shadow: 0 12px 26px rgba(142, 111, 174, 0.16);
}

.checkout-auth-back {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--chk-cafe-muted);
  text-decoration: none;
}

.checkout-auth-back:hover {
  color: var(--chk-chocolate);
}


/* ── PROGRESS INDICATOR ─────────────────────────────────────────── */

.checkout-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.55;
  transition: opacity 0.3s var(--transition-smooth);
}

.progress-step.is-active,
.progress-step.is-completed {
  opacity: 1;
}

.progress-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--chk-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--chk-cafe-muted);
  background: var(--chk-marfil-light);
  transition: all 0.3s var(--transition-smooth);
}

.progress-step.is-active .progress-dot {
  border-color: var(--chk-champagne);
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
  box-shadow: 0 0 0 4px rgba(142, 111, 174, 0.15);
}

.progress-step.is-completed .progress-dot {
  border-color: var(--chk-champagne);
  background: var(--chk-champagne);
  color: #fff;
}

.progress-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chk-cafe-muted);
}

.progress-step.is-active .progress-label {
  font-weight: 700;
  color: var(--chk-chocolate);
}

.progress-line {
  width: 44px;
  height: 2px;
  background: var(--chk-border);
  border-radius: 2px;
  transition: background 0.4s var(--transition-smooth);
}

.progress-line.is-completed {
  background: var(--chk-champagne);
}

@media (max-width: 600px) {
  .progress-line { width: 18px; }
  .progress-label { font-size: 0.62rem; letter-spacing: 0.08em; }
}


/* ── STEP HEADER ────────────────────────────────────────────────── */

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checkout-section-title .step-num {
  margin-right: 0.6rem;
}

.checkout-input.is-invalid,
.checkout-select.is-invalid {
  border-color: #C06A5A !important;
}

.checkout-step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.8rem;
}

.checkout-next-btn {
  padding: 0.95rem 2rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
  border: 1px solid var(--chk-champagne);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checkout-next-btn:hover {
  background: var(--chk-champagne);
  color: #fff;
}

.checkout-back-btn {
  padding: 0.9rem 1.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: transparent;
  color: var(--chk-cafe-muted);
  border: 1px solid var(--chk-border);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.checkout-back-btn:hover {
  color: var(--chk-chocolate);
  border-color: var(--chk-chocolate);
}

.shipping-skeleton {
  padding: 2rem;
  text-align: center;
  color: var(--chk-cafe-muted);
  background: var(--chk-marfil);
  border-radius: 6px;
  animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}


/* ── SAVED ADDRESSES ────────────────────────────────────────────── */

.checkout-saved-addresses {
  background: var(--chk-marfil);
  border: 1px solid rgba(142, 111, 174, 0.25);
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.5rem;
}

.checkout-saved-addresses-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--chk-champagne);
  margin-bottom: 0.8rem;
}

.saved-address-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--chk-chocolate);
  cursor: pointer;
}

.saved-address-option input[type="radio"] {
  accent-color: var(--chk-champagne);
  width: 16px;
  height: 16px;
}

.saved-address-use {
  margin-top: 0.8rem;
  padding: 0.55rem 1.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  color: var(--chk-chocolate);
  border: 1px solid var(--chk-chocolate);
  border-radius: 2px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.saved-address-use:hover {
  background: var(--chk-chocolate);
  color: var(--chk-marfil);
}


/* ── TERMS & SUMMARY TOGGLE ─────────────────────────────────────── */

.checkout-terms-row {
  margin-top: 1.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--chk-border);
}

.checkout-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--chk-cafe-muted);
  line-height: 1.6;
  cursor: pointer;
}

.checkout-terms-label input[type="checkbox"] {
  accent-color: var(--chk-champagne);
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.checkout-terms-label a {
  color: var(--chk-chocolate);
}

.checkout-summary-toggle {
  display: none;
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: var(--chk-marfil);
  border: 1px solid var(--chk-border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chk-chocolate);
  cursor: pointer;
}

.checkout-summary-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--chk-chocolate);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--chk-border);
}

.checkout-confirmation-box {
  animation: scaleIn 0.4s var(--transition-smooth);
}

@media (max-width: 992px) {
  .checkout-grid-layout {
    grid-template-columns: 1fr;
  }
  .checkout-summary-sidebar {
    position: static;
  }
  .checkout-summary-toggle {
    display: block;
  }
  .checkout-summary-body {
    display: none;
  }
  .checkout-summary-body.is-open {
    display: block;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-group-full {
    grid-column: span 1;
  }
  .order-timeline-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  .order-timeline-wrapper::before {
    display: none;
  }
  .timeline-step {
    flex-direction: row;
    gap: 1rem;
  }
}

/* ══════════════════════════════════════════════════════════════════
   CHECKOUT EN MÓVIL (360–600px): header, progreso y tarjetas
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .checkout-header {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
  }
  .checkout-brand {
    font-size: 1.4rem;
  }
  .checkout-secure-badge {
    font-size: 0.68rem;
  }
  .checkout-main-container {
    padding: 2rem 1.25rem 4rem;
  }
  .checkout-section-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .checkout-progress {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }
  .progress-step {
    flex: 0 0 auto;
  }
  .checkout-step-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .checkout-step-actions .checkout-next-btn {
    width: 100%;
  }
}


