/* =============================================================================
   Cabo Imports — Tienda. Diseño cálido, premium, mobile-first.
   Reescrito para responsividad real en dispositivos chicos: tipografía fluida,
   targets táctiles ≥44px, sin scroll horizontal, safe-area en notch, hover solo
   en dispositivos con puntero, y modal/detalle pensados para el pulgar.
   ============================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --acento: #111114;        /* blanco y negro: acento negro */
    --acento-2: #000000;
    --bg: #f6f6f7;
    --surface: #ffffff;
    --surface-2: #f0f0f2;
    --text: #18181b;
    --text-2: #52525b;
    --muted: #9a9aa3;
    --border: #ececee;
    --border-2: #dcdce1;
    --shadow-sm: 0 1px 3px rgba(15,15,20,.06), 0 1px 2px rgba(15,15,20,.04);
    --shadow-md: 0 8px 24px -8px rgba(15,15,20,.16), 0 3px 8px rgba(15,15,20,.07);
    --shadow-lg: 0 20px 50px -12px rgba(15,15,20,.24);
    --radius: 14px;
    --radius-sm: 10px;
    --maxw: 1200px;
    --ease: cubic-bezier(.16,1,.3,1);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --pad-x: clamp(.9rem, 4vw, 1.25rem);   /* gutter lateral fluido */
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: clip; }           /* mata cualquier scroll horizontal accidental */
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.5;
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
    min-height: 100vh; min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; min-width: 0; }
.brand-mark {
    width: 2rem; height: 2rem; border-radius: 8px; flex-shrink: 0;
    background: var(--acento); color: #fff; font-weight: 800; font-size: .8rem;
    display: grid; place-items: center; letter-spacing: -.02em;
}
.brand-name {
    font-weight: 800; letter-spacing: -.02em; font-size: clamp(.98rem, 3.5vw, 1.05rem);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Header ---------- */
.hdr {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding-top: var(--safe-t);
    padding-left: var(--safe-l); padding-right: var(--safe-r);
}
.hdr-in {
    max-width: var(--maxw); margin: 0 auto; padding: .7rem var(--pad-x);
    display: flex; align-items: center; gap: .6rem;
}
.nav { display: flex; align-items: center; gap: .25rem; margin-left: 1.25rem; flex: 1; min-width: 0; }
.nav-link {
    padding: .45rem .7rem; border-radius: 8px; font-weight: 500; font-size: .9rem;
    color: var(--text-2); transition: all .15s var(--ease); white-space: nowrap;
}
.hdr-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; flex-shrink: 0; }
.btn-fb {
    display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .85rem;
    background: #1877f2; color: #fff; border-radius: 999px; font-weight: 600; font-size: .85rem;
    box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), filter .15s;
}
.btn-icon {
    display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
    background: #25d366; color: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease);
}
.hamburger {
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    width: 2.75rem; height: 2.75rem; align-items: center; border-radius: 10px;
}
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .25s var(--ease); }
body.menu-open .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.menu-open .hamburger span:nth-child(2) { opacity: 0; }
body.menu-open .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-overlay { position: fixed; inset: 0; background: rgba(40,30,20,.4); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 40; }
body.menu-open .nav-overlay { opacity: 1; pointer-events: auto; }

/* ---------- Barra de aviso / anuncio ---------- */
.aviso-bar {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: .6rem 2.4rem; text-align: center; position: relative;
    background: linear-gradient(120deg, var(--acento), var(--acento2, var(--acento)));
    color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.35;
    animation: avisoIn .4s ease both;
}
@keyframes avisoIn { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.aviso-txt { max-width: 70ch; }
.aviso-x {
    position: absolute; right: .55rem; top: 50%; transform: translateY(-50%);
    width: 1.55rem; height: 1.55rem; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.22); color: #fff; font-size: 1.15rem; line-height: 1;
    display: grid; place-items: center; transition: background .15s;
}
.aviso-x:hover { background: rgba(255,255,255,.4); }

/* ---------- Hero ---------- */
.hero {
    background:
      radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--acento) 18%, transparent), transparent 55%),
      radial-gradient(100% 120% at 0% 100%, color-mix(in srgb, var(--acento2, var(--acento)) 15%, transparent), transparent 55%),
      linear-gradient(180deg, var(--surface), var(--bg));
    border-bottom: 1px solid var(--border);
}
.hero-in { max-width: var(--maxw); margin: 0 auto; padding: clamp(2.2rem, 7vw, 3.5rem) var(--pad-x) clamp(1.8rem, 6vw, 3rem); }
.hero-eyebrow {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
    color: var(--acento); margin-bottom: .6rem;
}
.hero-title { font-size: clamp(2rem, 7vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; overflow-wrap: anywhere; }
.hero-sub { color: var(--text-2); font-size: clamp(.98rem, 3.4vw, 1.05rem); margin-top: .6rem; max-width: 40ch; }
.hero-desc { color: var(--text-2); font-size: .96rem; line-height: 1.65; margin-top: .85rem; max-width: 62ch; white-space: pre-line; }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.chip {
    display: inline-flex; align-items: center; min-height: 40px;
    padding: .45rem .85rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border-2);
    font-size: .82rem; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm); transition: all .15s var(--ease);
    white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: clamp(1.6rem, 5vw, 2.5rem) var(--pad-x) 4rem; }
.cat { margin-bottom: clamp(2.2rem, 6vw, 3rem); }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.1rem; gap: 1rem; }
.cat-head h2 { font-size: clamp(1.2rem, 4.5vw, 1.45rem); font-weight: 800; letter-spacing: -.02em; }
.cat-head .count { color: var(--muted); font-size: .85rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }

/* Grid mobile-first: 2 columnas en teléfono, auto-fill conforme crece el viewport. */
.grid { display: grid; gap: .7rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .grid { gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
@media (min-width: 900px) { .grid { gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

/* ---------- Card ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.card:active { transform: scale(.985); }
.card-imgwrap { position: relative; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.card-imgwrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.badge-off {
    position: absolute; top: .55rem; left: .55rem; z-index: 2;
    background: var(--acento); color: #fff; font-weight: 800; font-size: .78rem;
    padding: .28rem .5rem; border-radius: 8px; box-shadow: var(--shadow-sm); letter-spacing: -.01em;
}
.badge-out {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
    background: rgba(255,255,255,.62); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.badge-out span { background: var(--text); color: #fff; font-weight: 700; font-size: .8rem; padding: .35rem .75rem; border-radius: 999px; }
.card-body { padding: .8rem .85rem .9rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-name {
    font-weight: 600; font-size: clamp(.85rem, 2.6vw, .95rem); line-height: 1.3; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sku { font-size: .72rem; color: var(--muted); font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.card-price { margin-top: auto; padding-top: .25rem; display: flex; align-items: baseline; gap: .4rem .5rem; flex-wrap: wrap; }
.price-now { font-weight: 800; font-size: clamp(1rem, 3.2vw, 1.15rem); letter-spacing: -.02em; }
.price-now.on-offer { color: var(--acento); }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .85rem; font-weight: 500; }

/* ---------- Skeleton ---------- */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; }
.sk::after {
    content: ""; position: absolute; inset: 0; transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-card { pointer-events: none; }
.sk-img { aspect-ratio: 1; border-radius: 0; }
.sk-title { width: min(220px, 60vw); height: 24px; }
.sk-line { height: 13px; width: 90%; margin-top: .2rem; }
.sk-line.short { width: 55%; }
.sk-price { height: 20px; width: 40%; margin-top: .5rem; }

/* ---------- Empty / error ---------- */
.tienda-msg { text-align: center; padding: 4rem 1rem; color: var(--muted); }

/* ---------- Footer ---------- */
.ftr { background: var(--surface); border-top: 1px solid var(--border); margin-top: 2rem; }
.ftr-in {
    max-width: var(--maxw); margin: 0 auto; padding: clamp(2rem, 6vw, 2.5rem) var(--pad-x);
    display: flex; justify-content: space-between; gap: 1.5rem 2rem; flex-wrap: wrap;
}
.ftr-desc { color: var(--text-2); margin-top: .6rem; max-width: 38ch; font-size: .9rem; }
.ftr-social { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.ftr-social a { font-weight: 600; color: var(--text-2); transition: color .15s; padding: .2rem 0; }
.ftr-copy {
    border-top: 1px solid var(--border); text-align: center; color: var(--muted); font-size: .82rem;
    padding: 1.1rem var(--pad-x) calc(1.1rem + var(--safe-b));
}

/* ---------- To top ---------- */
.to-top {
    position: fixed; right: calc(1.1rem + var(--safe-r)); bottom: calc(1.1rem + var(--safe-b)); z-index: 30;
    width: 2.9rem; height: 2.9rem; border-radius: 999px; background: var(--text); color: #fff;
    display: grid; place-items: center; font-size: 1.1rem; box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(10px); pointer-events: none; transition: all .25s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Stock en card ---------- */
.stk { display:inline-block; margin-top:.1rem; font-size:.72rem; font-weight:600; color:var(--muted); }
.stk-low { color:var(--acento); }

/* =============================================================================
   Modal de detalle de producto
   ============================================================================= */
body.no-scroll { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.open { display: block; }
.modal-overlay { position: absolute; inset: 0; background: rgba(40,30,20,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-panel {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    width: min(960px, 94vw); max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
    animation: pop .25s var(--ease);
}
.modal-x {
    position: absolute; top: .8rem; right: .8rem; z-index: 5; width: 2.4rem; height: 2.4rem; border-radius: 999px;
    background: rgba(255,255,255,.9); color: var(--text); font-size: 1.4rem; line-height: 1; display: grid; place-items: center;
    box-shadow: var(--shadow-md); border: 1px solid var(--border); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    transition: background .15s, transform .15s;
}
.modal-x:active { transform: scale(.92); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%,-46%) scale(.97); } }

.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; padding: 1.5rem; }
.d-gallery { min-width: 0; }
.d-gallery .d-main { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.d-gallery .d-main img { width: 100%; height: 100%; object-fit: contain; }
.d-thumbs { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.d-thumbs img { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: 8px; border: 2px solid transparent; background: var(--surface-2); cursor: pointer; transition: border-color .15s; }
.d-thumbs img.active { border-color: var(--acento); }
.d-img-sk { aspect-ratio: 1; border-radius: 14px; }

.d-info { display: flex; flex-direction: column; min-width: 0; }
.d-cat { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--acento); }
.d-name { font-size: clamp(1.25rem, 4.5vw, 1.5rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-top: .35rem; overflow-wrap: anywhere; }
.d-sku { font-size: .8rem; color: var(--muted); margin-top: .3rem; overflow-wrap: anywhere; }
/* ---- Tarjeta de compra: precio + selector + botón, agrupados y SIEMPRE arriba ---- */
.d-buybox {
    margin-top: 1rem; padding: 1.1rem 1.15rem 1.2rem; border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--acento2, var(--acento)) 6%, var(--surface)), var(--surface));
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.d-prices { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin: 0 0 .9rem; }
.d-price { font-size: clamp(1.6rem, 6.5vw, 2rem); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.d-price.on-offer { color: var(--acento); }
.d-badge { position: static; }

.d-stock { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; margin-bottom: 1rem; }
.d-stock.out { color: var(--acento-2); }

/* ---- Descripción colapsable (no debe opacar el botón de compra) ---- */
.d-desc-wrap { margin-top: 1.4rem; margin-bottom: 1.1rem; }
.d-desc-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .45rem; }
.d-desc {
    color: var(--text-2); line-height: 1.65; font-size: .92rem; white-space: normal; overflow-wrap: anywhere;
    position: relative; max-height: 7.8em; overflow: hidden; transition: max-height .3s var(--ease);
}
.d-desc::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2.6em; pointer-events: none;
    background: linear-gradient(180deg, transparent, var(--surface) 92%); transition: opacity .25s;
}
.d-desc.open { max-height: 200em; }
.d-desc.open::after, .d-desc--short::after { opacity: 0; }
.d-desc--short { max-height: none; }
.d-desc.muted { color: var(--muted); }
.d-desc-toggle {
    margin-top: .5rem; font-size: .82rem; font-weight: 700; color: var(--acento);
    display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; background: none;
}
.d-desc-toggle::after { content: '▾'; transition: transform .2s; }
.d-desc-toggle.open::after { transform: rotate(180deg); }
.d-desc-toggle:hover { text-decoration: underline; }

.d-link { margin-bottom: 1rem; }
.d-link-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.d-link-row { display: flex; gap: .5rem; margin-top: .35rem; }
.d-link-row input { flex: 1; min-width: 0; padding: .6rem .7rem; border: 1px solid var(--border-2); border-radius: 9px; font-size: .82rem; background: var(--bg); color: var(--text-2); }
.d-copy { padding: .6rem .9rem; border-radius: 9px; background: var(--text); color: #fff; font-weight: 600; font-size: .82rem; white-space: nowrap; transition: filter .15s, transform .15s; }
.d-copy:active { transform: scale(.95); }

.d-contact { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: auto; }
.d-btn { flex: 1; min-width: 140px; text-align: center; padding: .85rem 1rem; border-radius: 11px; font-weight: 700; color: #fff; box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), filter .15s; }
.d-btn:active { transform: scale(.98); }
.d-btn.wa { background: #25d366; }
.d-btn.fb { background: #1877f2; }

/* =============================================================================
   Hover solo en dispositivos con puntero fino (evita estados "pegados" al tocar)
   ============================================================================= */
@media (hover: hover) and (pointer: fine) {
    .nav-link:hover { background: var(--surface-2); color: var(--text); }
    .btn-fb:hover { transform: translateY(-1px); filter: brightness(1.06); }
    .btn-icon:hover { transform: translateY(-1px); }
    .chip:hover { border-color: var(--acento); color: var(--acento); transform: translateY(-1px); }
    .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-2); }
    .card:hover .card-imgwrap img { transform: scale(1.04); }
    .ftr-social a:hover { color: var(--acento); }
    .modal-x:hover { background: var(--surface-2); }
    .d-copy:hover { filter: brightness(1.2); }
    .d-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
}

/* =============================================================================
   Breakpoints
   ============================================================================= */

/* Menú hamburguesa / panel lateral */
@media (max-width: 860px) {
    .hamburger { display: flex; }
    .nav {
        position: fixed; top: 0; right: 0; height: 100dvh; width: min(82vw, 320px);
        flex-direction: column; align-items: stretch; gap: .15rem; margin: 0;
        padding: calc(4.5rem + var(--safe-t)) calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) 1rem;
        background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(100%);
        transition: transform .3s var(--ease); z-index: 45; overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    body.menu-open .nav { transform: none; }
    .nav-link { padding: .9rem .9rem; font-size: 1rem; border-bottom: 1px solid var(--border); border-radius: 0; }
    .nav-link:last-child { border-bottom: 0; }
    .btn-fb span { display: none; }
    .btn-fb { padding: 0; width: 2.5rem; height: 2.5rem; justify-content: center; }
}

/* Detalle: una columna, modal a pantalla completa, contacto fijo al pulgar */
@media (max-width: 720px) {
    .modal-panel {
        width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; top: 0; left: 0; transform: none;
        display: flex; flex-direction: column;
    }
    @keyframes pop { from { opacity: 0; transform: translateY(2%); } }
    .modal-x {
        position: fixed; top: calc(.7rem + var(--safe-t)); right: calc(.7rem + var(--safe-r));
        width: 2.6rem; height: 2.6rem;
    }
    .d-grid {
        grid-template-columns: 1fr; gap: 1.1rem; flex: 1;
        padding: calc(1.1rem + var(--safe-t)) calc(1.1rem + var(--safe-r)) 1.1rem calc(1.1rem + var(--safe-l));
    }
    .d-gallery .d-main { max-height: 56vh; }
    .d-gallery .d-main img { object-fit: contain; }
    /* Botones de contacto pegados abajo, siempre al alcance del pulgar */
    .d-contact {
        position: sticky; bottom: 0; z-index: 4; flex-wrap: nowrap;
        margin: .4rem calc(-1.1rem - var(--safe-r)) calc(-1.1rem) calc(-1.1rem - var(--safe-l));
        padding: .8rem calc(1.1rem + var(--safe-r)) calc(.8rem + var(--safe-b)) calc(1.1rem + var(--safe-l));
        background: color-mix(in srgb, var(--surface) 92%, transparent);
        backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        border-top: 1px solid var(--border);
    }
    .d-btn { padding: .95rem 1rem; font-size: .95rem; min-width: 0; }
}

/* Teléfonos angostos */
@media (max-width: 380px) {
    .hdr-actions, .hdr-actions { gap: .3rem; }
    .btn-icon { width: 2.4rem; height: 2.4rem; }
    .hero-chips { gap: .4rem; }
    .chip { padding: .4rem .7rem; font-size: .78rem; }
}

/* Respeta usuarios con movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* =============================================================================
   Búsqueda + orden
   ============================================================================= */
.hidden { display: none !important; }
.shop-tools { display: flex; gap: .6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.search-box svg { position: absolute; left: .85rem; color: var(--muted); pointer-events: none; }
.search-box input { width: 100%; padding: .8rem 2.4rem; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); font-size: .95rem; color: var(--text); }
.search-box input:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 14%, transparent); }
.q-clear { position: absolute; right: .5rem; width: 1.7rem; height: 1.7rem; border-radius: 999px; color: var(--muted); font-size: 1.2rem; line-height: 1; }
.q-clear:hover { background: var(--surface-2); color: var(--text); }
.sort-sel { padding: .8rem 1rem; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); font-size: .9rem; color: var(--text-2); cursor: pointer; }

/* =============================================================================
   Quick-add en card + stepper de cantidad
   ============================================================================= */
.card-add {
    position: absolute; bottom: .55rem; right: .55rem; z-index: 3; width: 2.1rem; height: 2.1rem;
    border-radius: 999px; background: var(--acento); color: #fff; font-size: 1.3rem; font-weight: 700; line-height: 1;
    display: grid; place-items: center; box-shadow: var(--shadow-md); transition: transform .15s var(--ease), filter .15s;
}
.card-add:active { transform: scale(.9); }
.qty { display: inline-flex; align-items: center; gap: .25rem; }
.qty-btn { width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); font-size: 1.1rem; font-weight: 700; line-height: 1; display: grid; place-items: center; color: var(--text); }
.qty-btn:active { transform: scale(.92); }
.qty-n { min-width: 1.6rem; text-align: center; font-weight: 700; }
.d-buy { display: flex; align-items: center; gap: .8rem; margin: 0; flex-wrap: wrap; }
.d-btn.add { flex: 1; min-width: 160px; background: var(--acento); }
.d-btn.add.ok { background: #16a34a; }

/* =============================================================================
   Carrito (drawer lateral)
   ============================================================================= */
.cart-btn { position: relative; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 999px; color: var(--text); }
.cart-btn:hover { background: var(--surface-2); }
.cart-btn.pulse { animation: cartPulse .4s var(--ease); }
@keyframes cartPulse { 0%,100% { transform: none; } 35% { transform: scale(1.18); } }
.cart-count { position: absolute; top: -2px; right: -2px; min-width: 1.15rem; height: 1.15rem; padding: 0 .25rem; border-radius: 999px; background: var(--acento); color: #fff; font-size: .68rem; font-weight: 800; display: none; align-items: center; justify-content: center; }
.cart-count.show { display: inline-flex; }

.cart-overlay { position: fixed; inset: 0; background: rgba(20,20,25,.5); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 110; }
.cart-overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
    position: fixed; top: 0; right: 0; height: 100dvh; width: min(420px, 92vw); z-index: 115;
    background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
    transform: translateX(100%); transition: transform .3s var(--ease);
    padding-top: var(--safe-t); padding-right: var(--safe-r);
}
.cart-drawer.open { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--border); }
.cart-head h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.cart-x { width: 2.2rem; height: 2.2rem; border-radius: 999px; background: var(--surface-2); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; color: var(--text); }
.cart-items { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .5rem 1rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-weight: 600; }
.cart-empty span { font-weight: 400; font-size: .9rem; }
.cart-item { display: grid; grid-template-columns: 3.4rem 1fr auto; gap: .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.cart-item img { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.cart-item-name { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.cart-item-price { color: var(--muted); font-size: .8rem; margin: .1rem 0 .35rem; }
.cart-item-sub { font-weight: 800; white-space: nowrap; align-self: flex-start; }
.cart-item-rm { margin-left: .4rem; font-size: 1rem; opacity: .6; }
.cart-item-rm:hover { opacity: 1; }
.cart-foot { border-top: 1px solid var(--border); padding: 1rem 1.25rem calc(1rem + var(--safe-b)); display: flex; flex-direction: column; gap: .7rem; }
.cart-total-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 1rem; }
.cart-total-row strong { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.cart-wa { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .9rem; border-radius: 12px; background: #25d366; color: #fff; font-weight: 700; }
.cart-wa.disabled { opacity: .5; pointer-events: none; }
.cart-clear { padding: .5rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.cart-clear:hover { color: var(--acento); }

/* =============================================================================
   Banner / portada de la tienda
   ============================================================================= */
.hero-banner { background-size: cover; background-position: center; border-bottom: 0; }
.hero-banner .hero-eyebrow { color: #fff; opacity: .92; }
.hero-banner .hero-title, .hero-banner .hero-sub, .hero-banner .hero-desc { color: #fff; }
.hero-banner .chip { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.28); color: #fff; }
.hero-banner .chip:hover { background: rgba(255,255,255,.25); }

/* =============================================================================
   Botón cerrar menú móvil
   ============================================================================= */
.nav-close { display: none; }
@media (max-width: 860px) {
    .nav-close {
        display: grid; place-items: center; position: absolute; top: calc(.9rem + var(--safe-t)); right: 1rem;
        width: 2.4rem; height: 2.4rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
        color: var(--text); font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2;
    }
    .nav-close:active { transform: scale(.92); }
}

/* =============================================================================
   Carrusel de imágenes (detalle de producto): flechas + contador
   ============================================================================= */
.d-main { position: relative; }
.d-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 2.5rem; height: 2.5rem; border-radius: 999px; display: grid; place-items: center;
    background: rgba(255,255,255,.92); color: #111; font-size: 1.7rem; font-weight: 700; line-height: 1;
    box-shadow: var(--shadow-md); border: 1px solid var(--border); cursor: pointer; transition: transform .15s var(--ease), background .15s;
}
.d-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.d-arrow:active { transform: translateY(-50%) scale(.94); }
.d-prev { left: .6rem; } .d-next { right: .6rem; }
.d-counter {
    position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); z-index: 3;
    background: rgba(20,20,25,.66); color: #fff; font-size: .75rem; font-weight: 700;
    padding: .2rem .6rem; border-radius: 999px; letter-spacing: .02em; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* =============================================================================
   Aviso al agregar al carrito (estilo Shopify) + mini-toast
   ============================================================================= */
.add-toast {
    position: fixed; right: 1rem; bottom: 1rem; z-index: 130; width: min(340px, calc(100vw - 2rem));
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg);
    padding: 1rem 1rem .85rem; transform: translateY(140%); opacity: 0; pointer-events: none;
    transition: transform .35s var(--ease), opacity .25s; padding-bottom: calc(.85rem + var(--safe-b));
}
.add-toast.show { transform: none; opacity: 1; pointer-events: auto; }
.add-toast-x { position: absolute; top: .5rem; right: .55rem; width: 1.7rem; height: 1.7rem; border-radius: 999px; color: var(--muted); font-size: 1.25rem; line-height: 1; display: grid; place-items: center; }
.add-toast-x:hover { background: var(--surface-2); color: var(--text); }
.add-toast-row { display: flex; align-items: center; gap: .8rem; }
.add-toast-img { width: 3rem; height: 3rem; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.add-toast-title { font-weight: 800; font-size: .82rem; color: #16a34a; letter-spacing: -.01em; }
.add-toast-name { font-size: .9rem; color: var(--text); margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.add-toast-actions { display: flex; gap: .5rem; margin-top: .85rem; }
.add-toast-btn { flex: 1; padding: .65rem; border-radius: 11px; font-weight: 700; font-size: .85rem; cursor: pointer; text-align: center; }
.add-toast-btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.add-toast-btn.ghost:hover { border-color: var(--acento); color: var(--acento); }
.add-toast-btn.solid { background: var(--acento); color: #fff; }
.add-toast-btn.solid:hover { filter: brightness(1.12); }

.cart-wa.fb { background: #1877f2; }

.mini-toast {
    position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 140%); z-index: 140;
    max-width: min(420px, calc(100vw - 2rem)); background: #111418; color: #fff; padding: .8rem 1.1rem;
    border-radius: 12px; font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0;
    transition: transform .3s var(--ease), opacity .25s; text-align: center; pointer-events: none;
}
.mini-toast.show { transform: translateX(-50%); opacity: 1; }
@media (max-width: 480px) { .add-toast { left: 1rem; right: 1rem; width: auto; } }

/* =============================================================================
   Modal "copia este mensaje y mándaselo al vendedor" (checkout por Facebook)
   ============================================================================= */
.fb-modal { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 1rem; }
.fb-modal.show { display: flex; }
.fb-modal-overlay { position: absolute; inset: 0; background: rgba(20,20,25,.55); }
.fb-modal-box { position: relative; z-index: 1; width: min(440px, 100%); background: var(--surface); border-radius: 18px;
    box-shadow: var(--shadow-lg); padding: 1.3rem 1.3rem calc(1.3rem + var(--safe-b)); animation: fbIn .25s var(--ease); }
@keyframes fbIn { from { transform: translateY(16px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.fb-modal-x { position: absolute; top: .6rem; right: .65rem; width: 1.9rem; height: 1.9rem; border-radius: 999px; color: var(--muted); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; }
.fb-modal-x:hover { background: var(--surface-2); color: var(--text); }
.fb-modal-head { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.fb-modal-ic { width: 2.6rem; height: 2.6rem; border-radius: 12px; background: #1877f2; color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.fb-modal-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.fb-modal-sub { color: var(--text-2); font-size: .85rem; margin-top: .15rem; }
.fb-modal-text { width: 100%; box-sizing: border-box; min-height: 140px; resize: vertical; border: 1px solid var(--border-2);
    border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: .88rem; line-height: 1.5; padding: .8rem .9rem; white-space: pre-wrap; }
.fb-modal-text:focus { outline: none; border-color: var(--acento); }
.fb-modal-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.fb-modal-btn { flex: 1; min-width: 150px; padding: .85rem; border-radius: 12px; font-weight: 700; font-size: .9rem; text-align: center; cursor: pointer; }
.fb-modal-btn.copy { background: var(--acento); color: #fff; }
.fb-modal-btn.copy:hover { filter: brightness(1.12); }
.fb-modal-btn.open { background: #1877f2; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.fb-modal-btn.open:hover { filter: brightness(1.08); }

/* =============================================================================
   Header PRO: nav corto (Inicio · Categorías · Reseñas); social compacto;
   en móvil las redes viven dentro del menú (drawer)
   ============================================================================= */
.hdr-social { display: flex; align-items: center; gap: .15rem; }
.nav-social { display: none; }
@media (min-width: 861px) {
    .nav { overflow: visible; flex: 0 1 auto; }
    .nav-link { white-space: nowrap; flex-shrink: 0; }
}
@media (max-width: 860px) {
    .hdr-social { display: none; }                /* las redes pasan al menú: header limpio */
    .nav { display: flex; }
    .nav-social { display: flex; flex-direction: column; gap: .55rem; margin-top: auto; padding-top: 1.2rem; border-top: 1px solid var(--border); }
    .nav-social-label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: .1rem; }
    .nav-social-btn { display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; border-radius: 12px; color: #fff; font-weight: 700; font-size: .92rem; }
    .nav-social-btn.wa { background: #25d366; }
    .nav-social-btn.fb { background: #1877f2; }
    .nav-social-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c 35%, #dc2743 60%, #bc1888); }
    .nav-social-btn:active { transform: scale(.98); }
}

/* =============================================================================
   Reseñas de clientes (estrellas, nombre, comentario, foto)
   ============================================================================= */
.res-sec { border-top: 1px solid var(--border); background: var(--surface); padding: clamp(2rem, 6vw, 3.2rem) 0 clamp(2.4rem, 7vw, 3.6rem); margin-top: 2.5rem; }
.res-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.res-head-text h2 { font-size: clamp(1.35rem, 4.5vw, 1.7rem); font-weight: 800; letter-spacing: -.02em; }
.res-avg { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; font-weight: 700; }
.res-avg-hint { color: var(--muted); font-weight: 500; font-size: .9rem; }
.res-stars { color: #f59e0b; letter-spacing: .08em; font-size: 1.05rem; line-height: 1; }
.res-stars .off { color: var(--border-2); }
.res-avg-n { color: var(--text-2); font-size: .88rem; font-weight: 600; }
.res-write { padding: .8rem 1.2rem; border-radius: 12px; background: var(--acento); color: #fff; font-weight: 700; font-size: .92rem; cursor: pointer; transition: transform .15s var(--ease), filter .15s; box-shadow: var(--shadow-md); }
.res-write:hover { filter: brightness(1.12); transform: translateY(-1px); }
.res-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.res-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.15rem; display: flex; flex-direction: column; gap: .55rem; }
.res-card-top { display: flex; align-items: center; gap: .7rem; }
.res-avatar { width: 2.4rem; height: 2.4rem; border-radius: 999px; background: var(--acento); color: #fff; font-weight: 800; font-size: .88rem; display: grid; place-items: center; flex-shrink: 0; }
.res-who { min-width: 0; }
.res-name { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-date { color: var(--muted); font-size: .74rem; }
.res-text { color: var(--text-2); font-size: .9rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.res-photo { margin-top: .2rem; }
.res-photo img { max-width: 100%; max-height: 200px; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; transition: transform .18s var(--ease), box-shadow .18s; }
@media (hover: hover) and (pointer: fine) {
    .res-photo img:hover { transform: scale(1.02); box-shadow: var(--shadow-md); }
}

/* Lightbox: zoom de foto en la misma página (reseñas) */
.lightbox { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 1.2rem; opacity: 0; pointer-events: none; transition: opacity .22s var(--ease); }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-bg { position: absolute; inset: 0; background: rgba(12, 12, 16, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox-fig { position: relative; z-index: 1; max-width: min(92vw, 980px); max-height: calc(100dvh - 3rem); display: flex; flex-direction: column; align-items: center; gap: .6rem; transform: scale(.92); transition: transform .22s var(--ease); }
.lightbox.open .lightbox-fig { transform: scale(1); }
.lightbox-img { max-width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); cursor: zoom-out; }
.lightbox-cap { color: rgba(255,255,255,.85); font-size: .85rem; font-weight: 600; }
.lightbox-x { position: absolute; top: calc(-0.4rem + var(--safe-t)); right: -0.4rem; transform: translate(50%, -50%); width: 2.6rem; height: 2.6rem; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); color: #fff; font-size: 1.5rem; line-height: 1; display: grid; place-items: center; cursor: pointer; z-index: 2; transition: background .15s; }
.lightbox-x:hover { background: rgba(255,255,255,.3); }
@media (max-width: 720px) {
    .lightbox { padding: .8rem; }
    .lightbox-x { top: calc(.4rem + var(--safe-t)); right: .4rem; transform: none; position: fixed; }
}
.res-empty { color: var(--muted); text-align: center; padding: 1.6rem 1rem; grid-column: 1 / -1; }

/* Modal escribir reseña */
.res-modal { position: fixed; inset: 0; z-index: 150; display: none; align-items: center; justify-content: center; padding: 1rem; }
.res-modal.open { display: flex; }
.res-modal-overlay { position: absolute; inset: 0; background: rgba(20,20,25,.55); }
.res-modal-box { position: relative; z-index: 1; width: min(460px, 100%); max-height: calc(100dvh - 2rem); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 1.4rem 1.4rem calc(1.4rem + var(--safe-b)); animation: fbIn .25s var(--ease); }
.res-modal-x { position: absolute; top: .6rem; right: .65rem; width: 1.9rem; height: 1.9rem; border-radius: 999px; color: var(--muted); font-size: 1.4rem; line-height: 1; display: grid; place-items: center; }
.res-modal-x:hover { background: var(--surface-2); color: var(--text); }
.res-modal-title { font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 1rem; padding-right: 1.6rem; }
.res-field { margin-bottom: .95rem; }
.res-field label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: .35rem; color: var(--text-2); }
.res-opt { color: var(--muted); font-weight: 500; }
.res-field input[type=text], .res-field textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-2); border-radius: 11px; background: var(--bg); color: var(--text); font: inherit; font-size: .92rem; padding: .7rem .8rem; }
.res-field input:focus, .res-field textarea:focus { outline: none; border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 14%, transparent); }
.res-field textarea { resize: vertical; min-height: 96px; }
.res-count { text-align: right; color: var(--muted); font-size: .72rem; margin-top: .2rem; }
.res-stars-pick { display: flex; gap: .1rem; }
.res-stars-pick button { font-size: 1.9rem; line-height: 1; min-width: 2.6rem; min-height: 2.6rem; display: grid; place-items: center; color: var(--border-2); cursor: pointer; padding: .2rem; transition: transform .12s var(--ease), color .12s; background: none; border: none; }
.res-stars-pick button.on { color: #f59e0b; }
.res-stars-pick button:hover { transform: scale(1.15); }
.res-photo-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.res-photo-btn { padding: .55rem .85rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; }
.res-photo-btn:hover { border-color: var(--acento); }
.res-photo-name { color: var(--text-2); font-size: .8rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-photo-rm { min-width: 2.4rem; min-height: 2.4rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 1.2rem; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.res-photo-rm:hover { color: #dc2626; }
.res-submit { width: 100%; padding: .9rem; border-radius: 12px; background: var(--acento); color: #fff; font-weight: 800; font-size: .95rem; cursor: pointer; transition: filter .15s; }
.res-submit:hover { filter: brightness(1.12); }
.res-submit:disabled { opacity: .55; cursor: default; }
.res-err { color: #dc2626; font-size: .82rem; margin-top: .5rem; font-weight: 600; }
.res-note { color: var(--muted); font-size: .76rem; text-align: center; margin-top: .7rem; line-height: 1.45; }
.res-ok { text-align: center; padding: 1rem 0 .4rem; }
.res-ok-ic { font-size: 2.6rem; margin-bottom: .4rem; }
.res-ok h4 { font-size: 1.15rem; font-weight: 800; margin-bottom: .3rem; }
.res-ok p { color: var(--text-2); font-size: .9rem; margin-bottom: 1.1rem; }
@media (max-width: 480px) {
    .res-field input[type=text], .res-field textarea { padding: .85rem 1rem; }
    .res-modal-x { top: calc(.6rem + var(--safe-t)); right: calc(.65rem + var(--safe-r)); }
}

/* =============================================================================
   Menú de categorías PRO: nav con dropdown + barra de categorías (filtro)
   ============================================================================= */
.nav-cats { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.nav-caret { transition: transform .2s var(--ease); flex-shrink: 0; }
.nav-cats[aria-expanded="true"] .nav-caret { transform: rotate(180deg); }

/* Barra de categorías: segunda fila del header (pegajosa con él), scroll horizontal de pills */
.catbar { border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.catbar-in {
    max-width: var(--maxw); margin: 0 auto; padding: .5rem var(--pad-x);
    display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
    scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.catbar-in::-webkit-scrollbar { display: none; }
.cat-pill {
    flex-shrink: 0; scroll-snap-align: start; display: inline-flex; align-items: center; gap: .4rem;
    padding: .42rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
    color: var(--text-2); background: var(--surface-2); border: 1px solid transparent;
    white-space: nowrap; transition: background .15s var(--ease), color .15s, transform .15s;
}
.cat-pill-n { font-size: .72rem; font-weight: 700; color: var(--muted); }
.cat-pill.active { background: var(--acento); color: #fff; box-shadow: var(--shadow-sm); }
.cat-pill.active .cat-pill-n { color: rgba(255,255,255,.78); }
.cat-pill:active { transform: scale(.96); }

/* Panel desplegable (mega-menú) de categorías */
.catmenu { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-start; justify-content: center; }
.catmenu[hidden] { display: none; }
.catmenu-overlay { position: absolute; inset: 0; background: rgba(20,18,22,.5); opacity: 0; transition: opacity .2s; }
.catmenu.show .catmenu-overlay { opacity: 1; }
.catmenu-panel {
    position: relative; z-index: 1; width: min(720px, 100%); margin: calc(var(--hdr-h, 104px) + 12px + var(--safe-t)) 1rem 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
    padding: 1.1rem 1.2rem 1.3rem; transform: translateY(-12px); opacity: 0;
    transition: transform .22s var(--ease), opacity .22s; max-height: calc(100dvh - 120px); overflow-y: auto;
}
.catmenu.show .catmenu-panel { transform: none; opacity: 1; }
.catmenu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; font-weight: 800; letter-spacing: -.01em; font-size: 1.02rem; }
.catmenu-x { width: 2rem; height: 2rem; border-radius: 999px; color: var(--muted); font-size: 1.5rem; line-height: 1; display: grid; place-items: center; }
.catmenu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: .5rem; }
.catmenu-item {
    display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left;
    padding: .8rem .95rem; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent;
    font-weight: 600; font-size: .92rem; color: var(--text); transition: border-color .15s var(--ease), transform .15s, background .15s;
}
.catmenu-item.active { background: var(--acento); color: #fff; }
.catmenu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catmenu-n { font-size: .76rem; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.catmenu-item.active .catmenu-n { color: rgba(255,255,255,.78); }

/* Chips del hero como filtros (estado activo) */
.chip.active { background: var(--acento); border-color: var(--acento); color: #fff; }
.hero-banner .chip.active { background: rgba(255,255,255,.34); border-color: rgba(255,255,255,.55); color: #fff; }

/* Reset del catálogo vacío */
.tienda-reset { display: inline-block; margin-top: .8rem; padding: .6rem 1.1rem; border-radius: 999px; background: var(--acento); color: #fff; font-weight: 700; font-size: .88rem; cursor: pointer; transition: filter .15s; }

/* Ajuste de anclas según la altura real del header (var actualizada por JS) */
.cat { scroll-margin-top: calc(var(--hdr-h, 104px) + 10px); }
.res-sec { scroll-margin-top: calc(var(--hdr-h, 104px) + 10px); }

/* =============================================================================
   Selector de TALLA / COLOR (detalle de producto) + disponibilidad
   ============================================================================= */
.d-avail { font-size: .92rem; font-weight: 600; }
.d-avail-ok { color: #16a34a; }
.d-avail-out { color: #dc2626; }
.d-avail-pick { color: var(--text-2); }
.d-opts { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.1rem; }
.d-opts.shake { animation: dShake .42s; }
@keyframes dShake { 10%,90%{transform:translateX(-1px)} 30%,70%{transform:translateX(3px)} 50%{transform:translateX(-4px)} }
.d-opt-label { font-size: .76rem; font-weight: 800; color: var(--text-2); margin-bottom: .5rem; text-transform: uppercase; letter-spacing: .05em; }
.d-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.d-chip {
    min-width: 2.9rem; padding: .55rem .8rem; border-radius: 10px; font-weight: 700; font-size: .9rem;
    background: var(--surface); color: var(--text); border: 1.5px solid var(--border-2);
    transition: background .15s var(--ease), color .15s, border-color .15s, transform .12s; cursor: pointer;
}
.d-chip.sel { background: var(--acento); color: #fff; border-color: var(--acento); }
.d-chip.dim { opacity: .6; }
.d-chip.off { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.d-chip:active { transform: scale(.95); }
.d-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.d-swatch {
    display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem .4rem .45rem; border-radius: 999px;
    background: var(--surface); border: 1.5px solid var(--border-2); font-weight: 600; font-size: .85rem; color: var(--text);
    transition: border-color .15s var(--ease), box-shadow .15s, transform .12s; cursor: pointer;
}
.d-swatch-dot { width: 1.05rem; height: 1.05rem; border-radius: 999px; border: 1px solid rgba(0,0,0,.16); flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.d-swatch.sel { border-color: var(--acento); box-shadow: 0 0 0 1.5px var(--acento) inset; }
.d-swatch.dim { opacity: .58; }
.d-swatch.off { opacity: .4; cursor: not-allowed; }
.d-swatch.off .d-swatch-name { text-decoration: line-through; }
.d-swatch:active { transform: scale(.96); }
.d-btn.add.disabled, .d-btn.add:disabled { background: var(--border-2); color: var(--muted); cursor: not-allowed; box-shadow: none; pointer-events: none; }

/* Variante en el carrito + botón "+" topado */
.cart-item-var { font-size: .76rem; color: var(--text-2); font-weight: 600; margin-top: .05rem; }
.qty-btn.off { opacity: .4; }

/* Hover (solo puntero fino) para los elementos nuevos */
@media (hover: hover) and (pointer: fine) {
    .cat-pill:hover { background: var(--border-2); color: var(--text); }
    .cat-pill.active:hover { filter: brightness(1.08); background: var(--acento); color: #fff; }
    .catmenu-item:hover { border-color: var(--acento); transform: translateY(-1px); }
    .catmenu-x:hover { background: var(--surface-2); color: var(--text); }
    .d-chip:not(.off):hover { border-color: var(--acento); }
    .d-swatch:not(.off):hover { border-color: var(--acento); }
    .tienda-reset:hover { filter: brightness(1.12); }
    .nav-cats:hover { background: var(--surface-2); color: var(--text); }
}
