/* ═══════════════════════════════════════════════════════════
   PECADO — Sex Shop Online · estilos.css
   Estilos GENERALES compartidos por todas las páginas.
   Paleta: Rojo #FF0000 · Negro #000000 · Blanco #FFFFFF · Rosa #FF006C
   Tipografía: Montserrat (titulares) · Inter (texto)
   ═══════════════════════════════════════════════════════════ */

:root {
    --pecado-red:   #FF0000;
    --pecado-pink:  #FF006C;
    --pecado-black: #000000;
    --pecado-white: #FFFFFF;
    --font-head: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 14px;
    --radius-sm: 9px;
    --header-h: 72px;
    --shadow: 0 10px 40px rgba(0,0,0,.25);
    --transition: .22s ease;
}

/* ── Tema oscuro (por defecto) ── */
:root, [data-theme="dark"] {
    color-scheme: dark;
    --bg: #14151b;
    --bg-soft: #1a1b22;
    --surface: #20222b;
    --surface-2: #2a2c37;
    --border: #383a47;
    --text: #f4f4f7;
    --text-soft: #dcdce4;
    --text-faint: #a9abb8;
    --accent: #ff3333;
    --accent-btn: #a31010;
    --accent-hover: #b31212;
    --accent-soft: rgba(255,51,51,.14);
    --pink-soft: rgba(255,0,108,.16);
    --card-shadow: 0 8px 30px rgba(0,0,0,.5);
    --header-bg: rgba(20,21,27,.82);
    --input-bg: #1a1c23;
    /* Tintas semánticas: rojo/rosa de marca y estados como color de
       texto/icono sobre --surface o su fondo tintado (≥4.5:1).
       --pecado-red queda para bordes y acentos grandes. */
    --accent-text: #ff5c5c;
    --danger-text: #ff7a7a;
    --ok-text: #4ade80;
    --warn-text: #fbbf24;
    --info-text: #60a5fa;
    --pink-text: #ff5c9d;
    --danger-bg: rgba(255,0,0,.13);
    --ok-bg: rgba(34,197,94,.13);
    --warn-bg: rgba(245,158,11,.14);
    --info-bg: rgba(59,130,246,.14);
}

/* ── Tema claro ── */
[data-theme="light"] {
    color-scheme: light;
    --bg: #fafafa;
    --bg-soft: #f1f1f4;
    --surface: #ffffff;
    --surface-2: #f5f5f7;
    --border: #e4e4ea;
    --text: #141417;
    --text-soft: #55555f;
    --text-faint: #70707a;
    --accent: var(--pecado-red);
    --accent-btn: #b31212;
    --accent-hover: #8f0e0e;
    --accent-soft: rgba(255,0,0,.08);
    --pink-soft: rgba(255,0,108,.09);
    --card-shadow: 0 8px 28px rgba(20,20,30,.10);
    --header-bg: rgba(255,255,255,.88);
    --input-bg: #ffffff;
    --shadow: 0 10px 40px rgba(20,20,30,.14);
    /* Versiones oscuras de cada tinta para ≥4.5:1 sobre blanco. */
    --accent-text: #c60000;
    --danger-text: #b91c1c;
    --ok-text: #166534;
    --warn-text: #b45309;
    --info-text: #1d4ed8;
    --pink-text: #c81e62;
    --danger-bg: rgba(220,38,38,.09);
    --ok-bg: rgba(22,163,74,.08);
    --warn-bg: rgba(217,119,6,.12);
    --info-bg: rgba(37,99,235,.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; font-size: 17px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh; /* sigue la barra del navegador al ocultarse/mostrar */
    overflow-x: hidden;
    overflow-x: clip; /* clip no crea contexto de scroll: el sticky del header sigue funcionando */
    transition: background .3s ease, color .3s ease;
}

/* Marca de agua — isotipo P al fondo, a la derecha */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    right: -7%;
    transform: translateY(-50%);
    width: min(48vw, 580px);
    aspect-ratio: 78 / 122;
    background: url('../images/Pecado-P-Vector%20Blanco.png') center / contain no-repeat;
    opacity: .055;
    pointer-events: none;
    z-index: -1;
}
[data-theme="light"] body::before {
    background-image: url('../images/Pecado-P-Vector%20Negro.png');
    opacity: .045;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
input, select, textarea { font: inherit; color: var(--text); }
textarea { field-sizing: content; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; }

::-moz-selection { background: var(--accent-btn); color: #fff; }

::selection { background: var(--accent-btn); color: #fff; }

/* Logos según tema */
.logo-for-dark  { display: none; }
.logo-for-light { display: block; }
[data-theme="dark"]  .logo-for-dark  { display: block; }
[data-theme="dark"]  .logo-for-light { display: none; }

/* ── Transición entre páginas (View Transitions API — efecto cross-fade básico) ── */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    -webkit-animation: vt-salida .22s ease both;
            animation: vt-salida .22s ease both;
}
::view-transition-new(root) {
    -webkit-animation: vt-entrada .22s ease both;
            animation: vt-entrada .22s ease both;
}

@-webkit-keyframes vt-salida {
    to { opacity: 0; }
}

@keyframes vt-salida {
    to { opacity: 0; }
}
@-webkit-keyframes vt-entrada {
    from { opacity: 0; }
}
@keyframes vt-entrada {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

/* ══════════════ Verificación de edad ══════════════ */
.age-gate {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.92);
    display: flex; align-items: center; justify-content: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.age-card {
    background: #20222b; border: 1px solid #383a47; border-radius: 20px;
    padding: 44px 38px; text-align: center; max-width: 420px; margin: 20px;
    box-shadow: var(--shadow);
}
.age-logo { height: 60px; margin: 0 auto 22px; }
.age-card h2 { color: #f4f4f7; font-size: 1.5rem; margin-bottom: 12px; }
.age-card p { color: #dcdce4; margin-bottom: 26px; }
.age-actions { display: flex; flex-direction: column; gap: 12px; }

/* ══════════════ Header ══════════════ */
.site-header {
    position: -webkit-sticky;
    position: sticky; top: 0; z-index: 100;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

/* Franja "modo pruebas": va dentro del header sticky, siempre visible
   mientras Wompi está en sandbox */
.modo-pruebas {
    background: repeating-linear-gradient(-45deg, #f5b301 0 14px, #d99e00 14px 28px);
    color: #17140a;
    font-size: 12px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; text-align: center;
    padding: 5px 14px;
}
.modo-pruebas i { margin-right: 4px; }

.header-inner {
    width: calc(100% - 40px); margin-inline: auto; height: var(--header-h);
    display: flex; align-items: center; gap: 28px;
}
.brand { flex-shrink: 0; }
.brand-logo { height: 42px; width: auto; flex-shrink: 0; }
.main-nav { display: flex; gap: 4px; margin-left: 8px; }
.main-nav a {
    padding: 8px 14px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 500; font-size: 1.05rem;
    transition: var(--transition);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--accent-text); }

/* Tarjeta de consentimiento legal (+18 / términos) en registro */
.legal-consent {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 13px 15px; margin: 4px 0 14px;
    border: 1px solid var(--border); border-radius: 12px;
    background: var(--bg-soft);
    font-size: .9rem; line-height: 1.5; color: var(--text-soft);
    cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.legal-consent:hover { border-color: var(--accent); }
.legal-consent:has(:checked) { border-color: var(--accent); background: var(--accent-soft); }
.legal-consent input[type="checkbox"] {
    appearance: none; -webkit-appearance: none;
    flex: 0 0 20px; width: 20px; height: 20px; margin: 2px 0 0;
    border: 1.5px solid var(--border); border-radius: 6px;
    background: var(--input-bg); display: grid; place-content: center;
    cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.legal-consent input[type="checkbox"]:checked {
    background: var(--accent-btn); border-color: var(--accent-btn);
}
.legal-consent input[type="checkbox"]:checked::after {
    content: ""; width: 10px; height: 6px;
    border: 2.4px solid #fff; border-top: 0; border-right: 0;
    transform: rotate(-45deg) translateY(-1px);
}
.legal-consent input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
.legal-consent .lc-icon { font-size: 1.2rem; color: var(--accent-text); margin-top: 1px; }
.legal-consent strong { color: var(--text); }

/* Submenú de categorías bajo "Tienda" (hover/teclado en escritorio) */
.nav-drop { position: relative; display: flex; }
.nav-drop > a { display: flex; align-items: center; gap: 3px; }
.nav-drop > a i { font-size: 1.05rem; transition: transform .2s; }
.nav-drop:hover > a i, .nav-drop:focus-within > a i { transform: rotate(180deg); }
.nav-sub {
    display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 10;
    min-width: 210px; flex-direction: column; gap: 2px; padding: 8px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
/* Puente invisible: evita que el submenú se cierre al bajar el mouse */
.nav-sub::before {
    content: ''; position: absolute; left: 0; right: 0; top: -28px; height: 28px;
}
.nav-drop:hover .nav-sub, .nav-drop:focus-within .nav-sub { display: flex; }
.nav-drop.cerrado .nav-sub { display: none; } /* tras clic: JS la quita al salir el mouse */
.nav-sub a { display: block; white-space: nowrap; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
    width: 42px; height: 42px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; color: var(--text-soft); position: relative;
    transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.cart-count {
    position: absolute; top: 2px; right: 0;
    background: var(--accent-btn); color: #fff;
    font-size: .68rem; font-weight: 700; line-height: 1;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.menu-btn { display: none; }

/* Buscador visible en el header (escritorio) */
.search-inline {
    display: flex; align-items: center; gap: 8px;
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: 99px; padding: 9px 16px; margin-right: 6px;
    transition: var(--transition); width: clamp(200px, 24vw, 320px); flex-shrink: 1;
}
.search-inline:focus-within { border-color: var(--pecado-red); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-inline i { color: var(--text-faint); font-size: 1.1rem; }
.search-inline input {
    flex: 1; min-width: 0; background: none; border: none; outline: none;
    font-size: .9rem; color: var(--text);
}
.search-inline input::-webkit-input-placeholder { color: var(--text-faint); }
.search-inline input::-moz-placeholder { color: var(--text-faint); }
.search-inline input:-ms-input-placeholder { color: var(--text-faint); }
.search-inline input::-ms-input-placeholder { color: var(--text-faint); }
.search-inline input::placeholder { color: var(--text-faint); }
#search-toggle { display: none; }

.search-bar {
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; width: calc(100% - 40px); margin-inline: auto;
}
.search-bar i { color: var(--text-faint); font-size: 1.2rem; }
.search-bar input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 1.05rem; padding: 6px 0;
}

/* ══════════════ Botones ══════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .95rem; letter-spacing: .02em;
    transition: var(--transition); border: 1.5px solid transparent;
}
.btn-primary { background: var(--accent-btn); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline { border-color: var(--pecado-red); color: var(--accent-text); background: transparent; }
.btn-outline:hover { background: var(--accent-soft); }
.btn-ghost { color: var(--text-soft); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }
/* Variante para <a> (no admiten :disabled): ej. "Ir a pagar" bajo el pedido mínimo */
.btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; transform: none !important; }

/* ══════════════ Compartir en redes (inicio, ficha de producto) ══════════════ */
.share-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.share-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .84rem; font-weight: 600; color: var(--text-faint);
    text-transform: uppercase; letter-spacing: .05em;
}
.share-label i { color: var(--accent-text); }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.15rem; color: var(--text-soft);
    background: var(--surface); border: 1px solid var(--border);
    transition: var(--transition);
}
.share-btn:hover { transform: translateY(-2px); color: #fff; border-color: transparent; }
.share-wa:hover   { background: #25D366; }
.share-fb:hover   { background: #1877F2; }
.share-x:hover    { background: #111; border-color: #444; }
.share-tg:hover   { background: #229ED9; }
.share-copy:hover, .share-copy.copied { background: var(--accent-btn); }
.share-more:hover { background: var(--pecado-pink); }

/* ══════════════ Layout principal ══════════════ */
.app-main { min-height: 60vh; min-height: 60dvh; }
.container { width: calc(100% - 40px); margin-inline: auto; }
.section { padding: 64px 0; }
/* El primer bloque va pegado al header: el aire amplio de .section
   es entre secciones, no contra la cabecera (cubre .container.section
   y el .container sin .section de /tienda). */
.app-main > .container:first-child { padding-top: 30px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 34px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.8rem; font-weight: 800; }
.section-head h2 span { color: var(--pecado-red); }
.section-head a { color: var(--text-soft); font-weight: 500; font-size: .92rem; }
.section-head a:hover { color: var(--accent-text); }

/* ══════════════ Tarjeta de producto (inicio, tienda, relacionados) ══════════════ */
/* Flex centrado: cards de ancho fijo 260px; envuelven según la pantalla y la última fila queda centrada */
.product-grid {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 20px;
}
.product-grid > .product-card { flex: 0 0 260px; min-width: 0; }
.product-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; position: relative;
    transition: var(--transition); display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--border); box-shadow: var(--card-shadow); }
.product-media { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.product-media img { width: 100%; height: 100%; -o-object-fit: cover; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-media img { transform: scale(1.06); }
/* Segunda foto al hover (como la tienda del proveedor) */
.product-media .card-img-alt {
    position: absolute; inset: 0;
    opacity: 0; transition: opacity .3s ease, transform .4s ease;
}
.product-card:hover .card-img-alt { opacity: 1; }
.badge-sale {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    background: var(--accent-btn); color: #fff;
    font-size: .72rem; font-weight: 700; padding: 5px 11px; border-radius: 99px;
    letter-spacing: .04em;
}
.badge-out {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    background: rgba(0,0,0,.75); color: #fff;
    font-size: .72rem; font-weight: 600; padding: 5px 11px; border-radius: 99px;
}
.product-info { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-cat { font-size: .74rem; color: var(--pink-text); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.product-name { font-size: 1rem; font-weight: 600; font-family: var(--font-body); }
.product-name a:hover { color: var(--accent-text); }
.product-price { margin-top: auto; display: flex; align-items: baseline; gap: 10px; padding-top: 8px; }
.price-now { font-size: 1.15rem; font-weight: 700; font-family: var(--font-head); }
.price-old { font-size: .85rem; color: var(--text-faint); text-decoration: line-through; }
.product-add {
    margin-top: 8px; width: 100%;
    padding: 11px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-weight: 600; font-size: .88rem;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.product-add i { font-size: 1.35rem; line-height: 1; }
.product-add:hover { background: var(--accent-btn); border-color: var(--accent-btn); color: #fff; }
.product-add:disabled,
.product-add.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.product-add:disabled:hover,
.product-add.is-disabled:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
/* Esquina inferior derecha teñida con el color del proveedor (Admin → Proveedores);
   el overflow:hidden + border-radius de la card la dejan como una "oreja" redondeada. */
.prov-mark {
    position: absolute; right: 0; bottom: 0; z-index: 3;
    width: 26px; height: 26px;
    background: var(--prov-color);
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
    opacity: .45; transition: var(--transition);
}
.product-card:hover .prov-mark { opacity: .85; }

/* ══════════════ Carrito lateral (drawer, presente en todas las páginas) ══════════════ */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 190; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.cart-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw);
    background: var(--bg-soft); border-left: 1px solid var(--border);
    z-index: 200; display: flex; flex-direction: column;
    transform: translateX(105%); transition: transform .3s ease;
    box-shadow: var(--shadow);
}
.cart-drawer.open { transform: translateX(0); }
.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 22px; border-bottom: 1px solid var(--border);
}
.drawer-head h3 { font-size: 1.1rem; display: flex; gap: 10px; align-items: center; }
.drawer-actions { display: flex; align-items: center; gap: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot { padding: 20px 22px; border-top: 1px solid var(--border); }
.drawer-total { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: 10px; }
.drawer-total strong { font-family: var(--font-head); font-size: 1.3rem; color: var(--accent-text); }
.drawer-note { font-size: .78rem; color: var(--text-faint); margin-bottom: 14px; }
/* Aviso "pedido mínimo": drawer del carrito y resumen de /carrito */
.min-order-hint {
    background: var(--pink-soft); color: var(--pink-text);
    font-size: .82rem; border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0;
}
.drawer-foot .btn + .btn { margin-top: 8px; }
.cart-empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.cart-empty i { font-size: 3rem; display: block; margin-bottom: 14px; }

/* Vuelo del producto al carrito (clon animado por JS en store.js) */
.fly-img {
    position: fixed; z-index: 300; margin: 0; pointer-events: none;
    -o-object-fit: cover; object-fit: cover;
    border-radius: var(--radius-sm); background: var(--surface-2);
    box-shadow: var(--shadow); will-change: transform, opacity;
}
#cart-toggle.cart-bump { -webkit-animation: cart-bump .45s ease; animation: cart-bump .45s ease; }
@-webkit-keyframes cart-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.3); }
    70% { transform: scale(.92); }
    100% { transform: scale(1); }
}
@keyframes cart-bump {
    0% { transform: scale(1); }
    35% { transform: scale(1.3); }
    70% { transform: scale(.92); }
    100% { transform: scale(1); }
}

.cart-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: none; }
.cart-item img { width: 72px; height: 72px; -o-object-fit: cover; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h5 { font-size: .92rem; font-weight: 600; margin-bottom: 4px; }
.cart-item-info .ci-variant { display: block; font-size: .76rem; color: var(--text-faint); margin-top: 2px; }
.cart-item-info .ci-price { color: var(--accent-text); font-weight: 700; font-size: .92rem; }
.cart-item-controls { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ci-qty { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 7px; }
.ci-qty button { width: 28px; height: 28px; font-size: .95rem; color: var(--text-soft); }
.ci-qty span { min-width: 30px; text-align: center; font-size: .88rem; font-weight: 600; }
.ci-remove { color: var(--text-faint); font-size: 1.1rem; margin-left: auto; }
.ci-remove:hover { color: var(--accent-text); }

/* ══════════════ Layout de dos columnas (carrito / checkout) ══════════════ */
.checkout-layout { display: flex; gap: 36px; align-items: flex-start; }
.checkout-layout > * { flex: 1 1 0; min-width: 0; }
.checkout-layout > *:first-child { flex-grow: 1.4; }

/* ══════════════ Tarjetas y formularios ══════════════ */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.card h3 i { color: var(--accent-text); }
.form-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.form-grid > * { flex: 1 1 calc(50% - 8px); min-width: 0; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.full { flex-basis: 100%; }
.form-field label { font-size: .85rem; font-weight: 600; color: var(--text-soft); }
.form-field input, .form-field textarea, .form-field select {
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; outline: none;
    transition: var(--transition); width: 100%;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
    border-color: var(--pecado-red); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field textarea { resize: vertical; min-height: 80px; }

/* Ojo para mostrar/ocultar contraseña */
.pass-wrap { position: relative; display: block; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; line-height: 1;
    color: var(--text-soft); font-size: 1.15rem; padding: 6px;
    transition: var(--transition);
}
.pass-toggle:hover { color: var(--pink-text); }

/* Autofill de Chrome/Safari: respeta el tema (sin fondo azul claro) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
    caret-color: var(--text);
    -webkit-transition: background-color 9999s ease-in-out 0s;
    transition: background-color 9999s ease-in-out 0s;
}

/* ══════════════ Resúmenes de pedido (carrito, checkout, seguimiento, pago) ══════════════ */
.summary-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: .92rem; border-bottom: 1px dashed var(--border); }
.summary-item:last-of-type { border-bottom: none; }
.summary-item .si-name { color: var(--text-soft); }
.summary-item .si-name em { font-style: normal; color: var(--text-faint); font-size: .85em; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .95rem; color: var(--text-soft); }
.summary-row.total { font-size: 1.2rem; color: var(--text); font-weight: 700; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; }
.summary-row.total strong { color: var(--accent-text); font-family: var(--font-head); }
/* Fila de descuento por cupón/referido (verde = a favor del cliente) */
.summary-row.discount { color: var(--ok-text); }
.summary-row.discount em { font-style: normal; }
.drawer-total.drawer-discount { font-size: .92rem; color: var(--ok-text); margin-top: -4px; }
.drawer-total.drawer-discount strong { font-size: 1rem; color: var(--ok-text); }
.drawer-total.drawer-discount em { font-style: normal; }

/* ══════════════ Cupón de descuento / referido (carrito, checkout, cuenta) ══════════════ */
.coupon-box { display: flex; gap: 8px; margin-top: 12px; }
.coupon-box .coupon-input {
    flex: 1; min-width: 0; padding: 9px 12px; font-size: .88rem;
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    text-transform: uppercase; letter-spacing: .04em;
}
.coupon-box .coupon-input::placeholder { text-transform: none; letter-spacing: normal; }
.coupon-box .coupon-input:focus { outline: none; border-color: var(--accent-text); }
.coupon-applied { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.coupon-chip {
    flex: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    background: var(--pink-soft); color: var(--pink-text);
    border: 1px dashed var(--pink-text); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: .85rem;
}
.coupon-chip strong { letter-spacing: .06em; }
.coupon-chip em { font-style: normal; font-weight: 600; margin-left: auto; }
/* Código de referido del cliente (/cuenta) */
.ref-box { background: var(--pink-soft); border: 1px dashed var(--pink-text); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; }
.ref-box > p { margin: 0 0 10px; color: var(--pink-text); font-size: .9rem; }
.ref-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ref-code {
    font-family: monospace; font-size: 1.05rem; font-weight: 700; letter-spacing: .08em;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 8px 14px; color: var(--pink-text);
}
code.ref-code { font-size: .95rem; padding: 4px 10px; }
.cupon-estado.ok { color: var(--ok-text); font-weight: 600; font-size: .85rem; }
.cupon-estado.out { color: var(--text-faint); font-size: .85rem; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ══════════════ Auth (cuenta / seguimiento) ══════════════ */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; }
.auth-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 8px; }
.auth-card > p { text-align: center; color: var(--text-soft); font-size: .92rem; margin-bottom: 26px; }
.auth-card .form-field { margin-bottom: 16px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: .9rem; color: var(--text-soft); }
.auth-switch a { color: var(--accent-text); font-weight: 600; }

/* Giro 3D acceso / registro / recuperar: UN solo flipper con 3 caras
   hermanas apiladas en la misma celda (la tarjeta mide la más alta, no
   salta). Antes de girar, JS reparte la cara destino a la posición que
   mira atrás (.b) y rota el flipper +180°, así cada cambio es un giro
   limpio de 180° con el patrón clásico de 2 posiciones — evita el
   preserve-3d anidado, que Chromium no oculta bien (crbug 391504029).
   align-self:start deja a cada cara su alto natural y JS anima height
   del flipper al alto de la cara activa (las ocultas rebasan por abajo
   sin pintarse). Ojo: nada de will-change/overflow/filter en .auth-flip
   — crean stacking context y fuerzan transform-style: flat (rompe el 3D). */
.auth-scene { perspective: 1400px; }
.auth-flip {
    display: grid; transform: rotateY(0deg);
    transform-style: preserve-3d; -webkit-transform-style: preserve-3d;
    transition: transform .55s cubic-bezier(.45,.05,.2,1), height .55s cubic-bezier(.45,.05,.2,1);
}
.auth-face {
    grid-area: 1 / 1; width: 100%; align-self: start;
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.auth-face.b { transform: rotateY(180deg); }
.auth-face.oculta { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .auth-flip { transition: none; } }

/* Honeypot anti-bots: invisible pero en el DOM (no display:none — así los
   bots sí lo ven y rellenan; los humanos no). Sin desplazamiento lateral:
   dentro de una cara girada (rotateY 180° en .auth-face.b) un left:-100vw
   se espejaba al lado contrario, desbordaba el viewport en móvil y Chrome
   expandía el layout — los fijos anclados a la derecha (drawer) salían
   cortados de la pantalla. */
.hp-field {
    position: absolute; top: 0; left: 0; width: 1px; height: 1px;
    overflow: hidden; opacity: 0; pointer-events: none;
}

/* ══════════════ Píldoras de estado ══════════════ */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 99px; font-size: .78rem; font-weight: 600;
}
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pendiente { background: var(--warn-bg); color: var(--warn-text); }
.st-aprobado  { background: var(--ok-bg);   color: var(--ok-text); }
.st-enviado   { background: var(--info-bg); color: var(--info-text); }
.st-entregado { background: var(--ok-bg);   color: var(--ok-text); }
.st-rechazado, .st-cancelado { background: var(--danger-bg); color: var(--danger-text); }

/* ══════════════ Estados varios ══════════════ */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-faint); }
.empty-state i { font-size: 3.4rem; display: block; margin-bottom: 16px; }
.empty-state h3 { color: var(--text-soft); margin-bottom: 8px; }
.loading { display: flex; justify-content: center; padding: 80px 0; }
.spinner {
    width: 42px; height: 42px; border-radius: 50%;
    border: 3px solid var(--border); border-top-color: var(--pecado-red);
    -webkit-animation: spin .8s linear infinite;
            animation: spin .8s linear infinite;
}
@-webkit-keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.page-head { padding: 0 0 8px; }
.page-head h1 { font-size: 2rem; font-weight: 800; }
.page-head p { color: var(--text-soft); margin-top: 6px; }
.breadcrumb { font-size: .84rem; color: var(--text-faint); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--accent-text); }

/* ══════════════ Footer ══════════════ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); margin-top: 60px; }
.footer-grid {
    width: calc(100% - 40px); margin-inline: auto; padding: 56px 0 40px;
    display: flex; gap: 36px;
}
.footer-grid > * { flex: 1 1 0; min-width: 0; }
.footer-grid > .footer-brand { flex-grow: 1.4; }
.footer-grid > .footer-col:last-child { flex-grow: 1.2; }
.footer-brand .brand-logo { height: 46px; margin-bottom: 18px; }
.footer-brand p { color: var(--text-soft); font-size: .9rem; }
.social-links { display: flex; gap: 8px; margin-top: 18px; }
.social-links a {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.15rem; color: var(--text-soft);
    border: 1px solid var(--border); transition: var(--transition);
}
.social-links a:hover { color: #fff; background: var(--accent-btn); border-color: var(--accent-btn); }
.footer-col h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; color: var(--text); }
.footer-col a { display: block; padding: 5px 0; color: var(--text-soft); font-size: .9rem; }
.footer-col a:hover { color: var(--accent-text); }
.footer-note { color: var(--text-soft); font-size: .88rem; padding: 5px 0; display: flex; align-items: center; gap: 10px; }
.footer-note i { color: var(--accent-text); }
.footer-pay-badge { height: 36px; width: auto; display: block; margin-top: 10px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.footer-bottom {
    border-top: 1px solid var(--border); padding: 20px 24px; text-align: center;
    color: var(--text-faint); font-size: .82rem;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.dev-credit {
    display: inline-flex; align-items: center; gap: 10px;
    color: var(--text-faint); transition: var(--transition);
}
.dev-credit img { height: 30px; width: auto; opacity: .85; transition: var(--transition); }
.dev-credit:hover { color: var(--text-soft); }
.dev-credit:hover img { opacity: 1; }

/* ══════════════ WhatsApp flotante ══════════════ */
.wa-float {
    position: fixed; right: 24px; bottom: 24px; z-index: 150;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: #fff; font-size: 1.7rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(37,211,102,.4);
    transition: var(--transition);
}
.wa-float:hover { transform: scale(1.08); }

/* Selector de contacto dentro del SweetAlert (#wa-float / footer) */
.wa-menu { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.wa-op {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: var(--radius);
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); text-decoration: none; transition: var(--transition);
}
.wa-op:hover { border-color: #25d366; transform: translateY(-1px); }
.wa-op i { font-size: 1.5rem; color: #25d366; }
.wa-op span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-op strong { font-weight: 600; }
.wa-op small { color: var(--text-faint); }
.wa-sep {
    display: flex; align-items: center; gap: 6px; margin-top: 6px;
    font-size: .78rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-faint);
}
.wa-nota { margin: 4px 0 0; font-size: .85rem; color: var(--text-faint); }

/* ══════════════ SweetAlert2 — tema ══════════════ */
/* El toast sale abajo a la derecha, por encima del botón de WhatsApp (24 + 56px). */
.swal2-container.swal2-bottom-end { bottom: 92px; }
.swal2-popup { background: var(--surface) !important; color: var(--text) !important; border-radius: var(--radius) !important; }
.swal2-title { color: var(--text) !important; font-family: var(--font-head) !important; }
.swal2-html-container { color: var(--text-soft) !important; }
.swal2-confirm { background: var(--accent-btn) !important; }
.swal2-cancel { background: var(--surface-2) !important; color: var(--text) !important; }

/* ══════════════ View Transitions ══════════════
   Solo el contenido principal (#app) se anima entre vistas;
   header, nav y footer permanecen estáticos. */
#app { view-transition-name: page; }

::view-transition-old(root),
::view-transition-new(root) { -webkit-animation: none; animation: none; }

::view-transition-old(page) { -webkit-animation: vt-fade-out .16s ease-out both; animation: vt-fade-out .16s ease-out both; }
::view-transition-new(page) { -webkit-animation: vt-page-in .3s ease-out both; animation: vt-page-in .3s ease-out both; }

/* Cambio de tema: fundido de la página completa */
html:active-view-transition-type(theme)::view-transition-old(root) { -webkit-animation: vt-fade-out .25s ease-out both; animation: vt-fade-out .25s ease-out both; }
html:active-view-transition-type(theme)::view-transition-new(root) { -webkit-animation: vt-fade-in .3s ease-out both; animation: vt-fade-in .3s ease-out both; }
html:active-view-transition-type(theme)::view-transition-new(page) { -webkit-animation: vt-fade-in .3s ease-out both; animation: vt-fade-in .3s ease-out both; }

@-webkit-keyframes vt-fade-out { to { opacity: 0; } }

@keyframes vt-fade-out { to { opacity: 0; } }
@-webkit-keyframes vt-fade-in  { from { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } }
@-webkit-keyframes vt-page-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes vt-page-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════ iOS / táctil ══════════════ */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }

.drawer-body { -ms-scroll-chaining: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.drawer-foot { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.wa-float {
    right: calc(24px + env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom));
}
.search-bar { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* Sin :hover pegado en pantallas táctiles */
@media (hover: none) {
    .product-card:hover, .btn-primary:hover { transform: none; }
    .product-card:hover .product-media img { transform: none; }
    .product-card:hover .card-img-alt { opacity: 0; }
}

/* ══════════════ Responsive ══════════════ */
@media (max-width: 980px) {
    .search-inline { display: none; }
    #search-toggle { display: inline-flex; }
    .checkout-layout { flex-direction: column; }
    /* Los hijos flex no deben forzar el ancho por su contenido mínimo */
    .checkout-layout > * { min-width: 0; }
    .footer-grid { flex-wrap: wrap; }
    .footer-grid > .footer-brand, .footer-grid > .footer-col { flex: 1 1 calc(50% - 18px); }
    .product-grid > .product-card { flex-basis: 220px; flex-grow: 0; flex-shrink: 0; }
}

@media (max-width: 720px) {
    .header-inner { gap: 8px; height: 64px; }
    :root { --header-h: 64px; }
    .icon-btn { width: 38px; height: 38px; font-size: 1.15rem; }
    .main-nav {
        display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
        background: var(--bg-soft); border-bottom: 1px solid var(--border);
        flex-direction: column; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); gap: 2px;
        box-shadow: var(--shadow);
        max-height: calc(100vh - var(--header-h));
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
    }
    .main-nav.open { display: flex; }
    .main-nav a { padding: 13px 14px; }
    /* En móvil el submenú va expandido e indentado dentro del menú */
    .nav-drop { flex-direction: column; }
    .nav-drop > a i { display: none; }
    .nav-sub {
        position: static; display: flex; min-width: 0; padding: 0 0 4px 18px;
        background: transparent; border: 0; box-shadow: none;
    }
    .nav-sub a { font-size: .9rem; padding: 10px 14px; }
    .menu-btn { display: inline-flex; }
    .search-bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .form-grid > * { flex-basis: 100%; }
    .section { padding: 44px 0; }
    .section-head h2 { font-size: 1.4rem; }
    .page-head { padding: 0 0 2px; }
    .page-head h1 { font-size: 1.35rem; }
    .breadcrumb { font-size: .76rem; margin-bottom: 4px; }
    .app-main { padding-bottom: 76px; } /* el botón de WhatsApp no tapa el contenido final */
    .wa-float { width: 48px; height: 48px; font-size: 1.45rem; }
    .card { padding: 20px; }
    .auth-card { padding: 26px 20px; }
    .age-card { padding: 32px 22px; }
    .cart-item img { width: 60px; height: 60px; }
    .footer-grid { gap: 28px; padding: 40px 0 28px; }
    .footer-grid > .footer-brand, .footer-grid > .footer-col { flex-basis: 100%; }
    .footer-bottom {
        padding-left: calc(20px + env(safe-area-inset-left));
        padding-right: calc(20px + env(safe-area-inset-right));
    }
    /* iOS hace zoom al enfocar inputs <16px */
    input, select, textarea { font-size: 16px !important; }
    .product-grid { gap: 12px; }
    .product-grid > .product-card { flex: 1 1 calc(50% - 6px); max-width: none; }
    .product-info { padding: 12px; }
    .product-add { font-size: .8rem; padding: 9px 6px; }
}

@media (max-width: 380px) {
    .product-grid { gap: 10px; }
    .product-info { padding: 10px; }
    .product-name { font-size: .88rem; }
    .price-now { font-size: 1rem; }
}

/* ─────────────────────── Blog (componentes compartidos) ───────────────────
   La tarjeta de artículo se usa en /blog, en el detalle ("sigue leyendo")
   y en el módulo "Del blog" del inicio → vive aquí, no en blog.css. */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.blog-card {
    display: flex; flex-direction: column; min-width: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow); }
.blog-card-media {
    display: block; aspect-ratio: 16 / 9; overflow: hidden;
    background: var(--surface-2);
}
.blog-card-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .35s ease;
}
.blog-card:hover .blog-card-media img { transform: scale(1.04); }
.blog-card-sinimg {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; font-size: 2.4rem; color: var(--text-faint);
}
.blog-card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px; flex: 1; }
.blog-card-meta {
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    font-size: .76rem; color: var(--text-faint);
}
.blog-card-meta i { margin-right: 3px; }
.blog-card-titulo {
    font-family: var(--font-head); font-size: 1.06rem; line-height: 1.3; margin: 0;
}
.blog-card-titulo a { color: var(--text); text-decoration: none; }
.blog-card-titulo a:hover { color: var(--accent-text); }
.blog-card-resumen {
    color: var(--text-soft); font-size: .88rem; line-height: 1.55; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-pie {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: auto; padding-top: 10px;
}
.blog-card-etiq { font-size: .74rem; color: var(--text-faint); }
.blog-card-etiq i { margin-right: 3px; }
.blog-card-mas {
    font-size: .84rem; font-weight: 600; color: var(--accent-text);
    text-decoration: none; white-space: nowrap;
}
.blog-card-mas:hover { text-decoration: underline; }

@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; gap: 14px; }
}
