/* Compra en línea: carrito, checkout, seguimiento y avisos. Usa la paleta de styles.css
   con valores literales para funcionar también en las landings (landing.css). */
:root {
  --st-ink: #111111;
  --st-heading: #092d35;
  --st-soft: #55666a;
  --st-border: #dddddd;
  --st-teal: #28798b;
  --st-cyan: #4db4cb;
  --st-cyan-hover: #1cd1b2;
  --st-gold: #ffbc13;
  --st-cream: #fff6e0;
  --st-cream-ink: #8a6100;
  --st-ok: #1d6b45;
  --st-error: #9a3b2a;
}

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.hint { color: var(--st-soft); font-size: 0.88rem; margin: 6px 0; }
.error { color: var(--st-error); font-size: 0.88rem; margin: 6px 0; }
.reference { color: var(--st-soft); font-size: 0.8rem; overflow-wrap: anywhere; }
button.link { background: none; border: 0; padding: 0; color: var(--st-teal); text-decoration: underline; cursor: pointer; font: inherit; }

.btn-outline { background: #fff; border: 1px solid var(--st-border); color: var(--st-heading); }
.btn-outline:hover { border-color: var(--st-cyan); color: var(--st-teal); }
.btn[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* Encabezado */
.cart-link { gap: 8px; white-space: nowrap; }
.cart-count { background: var(--st-gold); color: var(--st-heading); border-radius: 999px; padding: 1px 9px; font-size: 0.85rem; font-weight: 800; }
.header-cta button.btn-ghost { font-family: inherit; }

/* Tarjetas del catálogo */
.price-unit { font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); }
.card-footer { display: flex; flex-direction: column; gap: 8px; }
.card-add {
  width: 100%; padding: 10px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--st-cyan); color: #fff; font: 700 0.88rem/1.2 "Albert Sans", system-ui, sans-serif;
}
.card-add:hover { background: var(--st-cyan-hover); }
.card-add.muted { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); }

/* Selector de packs */
.pack-input { display: inline-flex; align-items: stretch; border: 1px solid var(--st-border); border-radius: 999px; overflow: hidden; background: #fff; }
.pack-input button { width: 42px; border: 0; background: #f1f6f7; color: var(--st-heading); font-size: 1.2rem; cursor: pointer; }
.pack-input button:hover { background: #e2f1f4; }
.pack-input input { width: 92px; border: 0; text-align: center; font: 700 1rem "Albert Sans", system-ui, sans-serif; padding: 9px 4px; -moz-appearance: textfield; }
.pack-input input::-webkit-outer-spin-button, .pack-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Detalle de producto */
.product-price small { font: 500 0.9rem "Albert Sans", system-ui, sans-serif; color: var(--st-soft); }
.buy-box { margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.buy-box label { font-weight: 700; color: var(--st-heading); }
.buy-box label small { font-weight: 400; color: var(--st-soft); }
.buy-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.buy-total { font: 800 1.4rem "League Spartan", system-ui, sans-serif; color: var(--st-heading); }

/* Aviso al agregar */
.cart-toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; max-width: min(420px, calc(100% - 36px));
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--st-heading); color: #fff; box-shadow: 0 12px 40px rgba(9, 45, 53, 0.3);
  font-family: "Albert Sans", system-ui, sans-serif;
}
.cart-toast div { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cart-toast small { color: rgba(255, 255, 255, 0.7); }
.cart-toast a { color: var(--st-gold); font-weight: 700; white-space: nowrap; }
.cart-toast button { background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.cart-toast.error { background: var(--st-error); }

/* Página del pedido */
.checkout-page { padding: 24px 24px 60px; }
.checkout-title { font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--st-heading); margin: 0 0 20px; }
.empty-cart { padding: 40px 0; color: var(--st-soft); }
.empty-cart a { color: var(--st-teal); text-decoration: underline; }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.checkout-lines { display: flex; flex-direction: column; gap: 12px; }
.checkout-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--st-border); border-radius: 14px; padding: 12px; background: #fff; }
.line-media img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.line-info h3 { margin: 0 0 4px; font-size: 1rem; color: var(--st-heading); line-height: 1.25; }
.line-info small { display: block; color: var(--st-soft); margin-bottom: 8px; }
.line-total { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line-total strong { font: 800 1.1rem "League Spartan", system-ui, sans-serif; color: var(--st-heading); }
.cart-total { display: flex; justify-content: space-between; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--st-border); }
.cart-total.discount strong { color: var(--st-ok); }
.cart-total.grand { border-bottom: 0; font-size: 1.1rem; }
.cart-total.grand strong { font: 800 1.5rem "League Spartan", system-ui, sans-serif; color: var(--st-heading); }

/* El formulario ya no es sticky (si es más alto que la pantalla, su botón final quedaba fuera de
   alcance); queda fijo el resumen de la izquierda y la barra de pago al pie del formulario. */
.checkout-form { border: 1px solid var(--st-border); border-radius: 16px; padding: 22px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 901px) {
  .checkout-lines { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; overscroll-behavior: contain; }
}
.checkout-form h2 { margin: 0 0 6px; color: var(--st-heading); }
.checkout-form > label, .invoice-grid label, .invoice-fields > label { font-weight: 600; color: var(--st-heading); font-size: 0.92rem; margin-top: 8px; }
.checkout-form input:not([type=checkbox]), .checkout-form select, .checkout-form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--st-border); border-radius: 10px; font: inherit; background: #fff; color: var(--st-ink);
}
.checkout-form textarea { min-height: 80px; resize: vertical; }
.checkout-form input:focus, .checkout-form select:focus, .checkout-form textarea:focus { outline: 2px solid var(--st-cyan); outline-offset: 1px; }
.checkout-fieldset { border: 1px solid var(--st-border); border-radius: 12px; padding: 12px 14px; margin: 10px 0 4px; }
.checkout-fieldset legend { font-weight: 800; color: var(--st-heading); padding: 0 6px; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--st-heading); cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--st-teal); }
.invoice-fields { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.invoice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.invoice-grid .wide, .invoice-grid p { grid-column: 1 / -1; }
.invoice-grid label { display: flex; flex-direction: column; gap: 4px; }
.invoice-grid label small { font-weight: 400; color: var(--st-soft); }
.known-client { background: #e9f6ef; color: var(--st-ok); border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-weight: 600; }
.delivery-address { background: #f4f8f9; border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; margin: 8px 0 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--st-soft); margin-top: 10px; }
.consent input { margin-top: 3px; accent-color: var(--st-teal); flex-shrink: 0; }
.consent a { color: var(--st-teal); text-decoration: underline; }
.errors { background: #fbeeea; color: var(--st-error); border-radius: 10px; padding: 8px 12px; }
.errors p { margin: 4px 0; }
.checkout-form .submit { margin-top: 10px; width: 100%; }

.order-success { border: 1px solid #cfe7da; background: #f3faf6; border-radius: 16px; padding: 22px; margin-bottom: 24px; }
.order-success h2 { margin: 0 0 6px; color: var(--st-heading); }
.success-mark { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center; background: var(--st-ok); color: #fff; font-weight: 800; }
.success-lines { padding-left: 18px; }
.success-lines small { color: var(--st-soft); }
.success-total { font: 800 1.3rem "League Spartan", system-ui, sans-serif; color: var(--st-heading); }
.success-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.tracking-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 16px 0 4px; flex-wrap: wrap; }
.tracking-steps li { flex: 1; min-width: 110px; text-align: center; padding: 8px; border-radius: 999px; background: #e9eef0; color: var(--st-soft); font-size: 0.82rem; font-weight: 700; }
.tracking-steps li.done { background: var(--st-teal); color: #fff; }
.tracking-section { border-top: 1px solid var(--st-border); padding: 12px 0; }
.tracking-section h2 { font-size: 1.1rem; color: var(--st-heading); margin: 0 0 6px; }
.copy-tracking { margin: 18px 0; }
.copy-tracking label { font-weight: 700; color: var(--st-heading); }
.copy-tracking div { display: flex; gap: 8px; margin-top: 6px; }
.copy-tracking input { flex: 1; min-width: 0; padding: 10px; border: 1px solid var(--st-border); border-radius: 10px; }
.eyebrow { font-size: 0.75rem; letter-spacing: 0.12em; font-weight: 700; color: var(--st-teal); }

/* Landings */
.landing-cart { white-space: nowrap; }
.landing-add { width: 100%; margin-top: 10px; padding: 9px; border: 0; border-radius: 8px; background: #092d35; color: #fff; font-weight: 700; cursor: pointer; }
.landing-add:hover { background: var(--st-teal); }
.product-price small { font-size: 0.75em; }
.secondary-cta, .primary-cta, .nav-cta { cursor: pointer; font: inherit; }
.landing-footer .link { color: inherit; }

/* Cotización */
.quote-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: #52666b; margin-top: 12px; }
.quote-consent input { margin-top: 3px; flex-shrink: 0; }
.quote-consent a { color: var(--st-teal); text-decoration: underline; }

/* Aviso de cookies, conexión y mensajes */
.cookie-notice {
  position: fixed; left: 18px; bottom: 18px; z-index: 50; max-width: min(560px, calc(100% - 36px));
  background: #fff; border: 1px solid var(--st-border); border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 12px 40px rgba(9, 45, 53, 0.2); font: 400 0.88rem/1.5 "Albert Sans", system-ui, sans-serif; color: var(--st-ink);
}
.cookie-notice p { margin: 4px 0 10px; color: var(--st-soft); }
.cookie-notice a { color: var(--st-teal); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer-links a, .footer-links .link { color: rgba(255, 255, 255, 0.8); text-decoration: underline; font-size: 0.85rem; }
.connection-note, .flash-error, .flash-info { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 45; padding: 10px 16px; border-radius: 10px; font: 600 0.9rem "Albert Sans", system-ui, sans-serif; }
.connection-note { background: var(--st-cream); color: var(--st-cream-ink); }
.flash-error { background: #fbeeea; color: var(--st-error); }
.flash-info { background: #e9f6ef; color: var(--st-ok); position: static; transform: none; display: inline-block; }

/* Administración y privacidad */
.admin-page, .privacy-page { padding: 30px 24px 60px; max-width: 980px; }
.admin-card { border: 1px solid var(--st-border); border-radius: 14px; padding: 16px 18px; margin: 14px 0; }
.admin-card h2, .admin-card h3 { margin: 0 0 4px; color: var(--st-heading); }
.admin-subtitle { margin-top: 40px; color: var(--st-heading); }
.privacy-page table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.privacy-page th, .privacy-page td { border-bottom: 1px solid var(--st-border); padding: 8px; text-align: left; vertical-align: top; }
.privacy-page a { color: var(--st-teal); text-decoration: underline; }

@media (max-width: 900px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .checkout-form { position: static; }
}

@media (max-width: 560px) {
  .checkout-line { grid-template-columns: 64px 1fr; }
  .line-media img { width: 64px; height: 64px; }
  .line-total { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .invoice-grid { grid-template-columns: 1fr; }
  .cart-toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

.checkout-form > label.consent { font-weight: 400; color: var(--st-soft); font-size: 0.85rem; }
@media (max-width: 560px) {
  .checkout-page, .product-page { padding-left: 16px; padding-right: 16px; }
}

/* TiendaUI (bolsa, aviso al agregar, confianza y pago por pasos) con la marca de genéricos */
:root {
  --tu-tinta: var(--st-heading); --tu-suave: var(--st-soft); --tu-borde: var(--st-border); --tu-fondo-2: #f2f6f7;
  --tu-acento: #092d35; --tu-acento-hover: #0f4250; --tu-acento-texto: #fff; --tu-acento-suave: #e3f2f5;
  --tu-ok: var(--st-ok); --tu-ok-suave: #e5f3ec; --tu-fuente: "Albert Sans", system-ui, sans-serif; --tu-titulos: "League Spartan", system-ui, sans-serif;
}
.tu-barra-cta { color: #092d35; }
.checkout-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.checkout-form { position: static; }
.checkout-paso h2 { margin: 0 0 4px; font: 800 1.15rem "League Spartan", system-ui, sans-serif; color: var(--st-heading); }
.checkout-paso + .checkout-paso { margin-top: 12px; }
.checkout-paso .tu-totales { margin-bottom: 8px; }
.checkout-paso .tu-ayuda { margin-top: 12px; }
.checkout-opcional { border: 1px solid var(--st-border); border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.checkout-opcional summary { cursor: pointer; font-weight: 600; color: var(--st-heading); font-size: .92rem; }
.checkout-opcional[open] summary { margin-bottom: 8px; }
.checkout-confianza { margin-top: 28px; }
.checkout-lines .tu-lineas { border: 1px solid var(--st-border); border-radius: 14px; padding: 0 14px; background: #fff; }
.checkout-resumen-movil { display: none; border: 1px solid var(--st-border); border-radius: 14px; padding: 12px 14px; background: #fff; }
.checkout-resumen-movil summary { display: flex; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 600; color: var(--st-heading); }
.checkout-resumen-movil summary b { font: 800 1.1rem "League Spartan", system-ui, sans-serif; }
.order-success .tu-confianza-compacta { margin-top: 12px; }
@media (max-width: 900px) {
  .checkout-lines { display: none; }
  .checkout-resumen-movil { display: block; }
  .checkout-side::after { content: none; }
}
.checkout-paso > label, .checkout-paso .invoice-fields > label { display: block; font-weight: 600; color: var(--st-heading); font-size: 0.92rem; margin: 10px 0 4px; }
.checkout-paso > label.consent { font-weight: 400; color: var(--st-soft); font-size: 0.85rem; display: flex; gap: 8px; }
