/* ── Variables: fallback por si PHP no carga el :root ── */
:root {
  --brand:#2563eb; --brand2:#10b981; --text:#1e293b; --muted:#64748b;
  --border:#e2e8f0; --bg:#f8fafc; --radius:12px;
  --price-color:#1e293b; --price-size:1rem;
}
* { box-sizing:border-box; }
body { background:var(--bg); font-family:var(--font,'Inter',system-ui,sans-serif); color:var(--text); margin:0; }

/* ── Barra anuncio ──────────────────────────────────────────── */
.tn-announce { color:#fff; text-align:center; font-size:.8rem; font-weight:600; padding:.45rem 1rem; letter-spacing:.02em; }

/* ── Navbar ─────────────────────────────────────────────────── */
.tn-nav { background:#fff; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:100; box-shadow:0 1px 6px rgba(0,0,0,.06); }
.tn-nav-inner { max-width:1200px; margin:0 auto; padding:.6rem 1rem; display:flex; align-items:center; gap:1rem; }
.tn-logo { display:flex; align-items:center; gap:.5rem; text-decoration:none; color:var(--text); font-weight:700; font-size:1.05rem; white-space:nowrap; }
.tn-logo img { height:36px; width:auto; object-fit:contain; border-radius:6px; }
.tn-search-wrap { flex:1; max-width:480px; }
.tn-search { display:flex; border:1.5px solid var(--border); border-radius:10px; overflow:hidden; background:#fff; transition:border-color .15s; }
.tn-search:focus-within { border-color:var(--brand); }
.tn-search input { flex:1; border:none; outline:none; padding:.45rem .8rem; font-size:.88rem; background:transparent; min-width:0; }
.tn-search button { background:var(--brand); color:#fff; border:none; padding:.45rem .85rem; cursor:pointer; font-size:.9rem; transition:background .15s; }
.tn-search button:hover { background:#1d4ed8; }
.tn-actions { display:flex; align-items:center; gap:.75rem; margin-left:auto; }
.tn-cart-btn { display:flex; align-items:center; gap:.4rem; background:var(--brand); color:#fff; border:none; border-radius:10px; padding:.45rem .9rem; font-size:.85rem; font-weight:600; text-decoration:none; cursor:pointer; transition:background .15s; position:relative; }
.tn-cart-btn:hover { background:#1d4ed8; color:#fff; }
.cart-badge { background:#ef4444; color:#fff; font-size:.65rem; font-weight:700; width:18px; height:18px; border-radius:50%; display:flex; align-items:center; justify-content:center; }

/* Buscador mobile */
.mobile-search { background:#fff; border-bottom:1px solid var(--border); padding:.5rem .75rem; }
.mobile-search .tn-search { width:100%; }

/* ── Hero ───────────────────────────────────────────────────── */
.tn-hero { background:linear-gradient(135deg,var(--brand) 0%,#1d4ed8 100%); color:#fff; text-align:center; padding:3.5rem 1.5rem; }
.tn-hero h1 { font-size:clamp(1.5rem,4vw,2.4rem); font-weight:800; margin-bottom:.75rem; }
.tn-hero p { font-size:1rem; opacity:.88; margin-bottom:1.5rem; }
.btn-hero { background:#fff; color:var(--brand); font-weight:700; padding:.65rem 1.8rem; border-radius:10px; text-decoration:none; font-size:.95rem; transition:.15s; display:inline-block; }
.btn-hero:hover { background:#eff6ff; color:var(--brand); }

/* ── Slide ───────────────────────────────────────────────────── */
.tn-slide { max-height:480px; overflow:hidden; }
.tn-slide-img { width:100%; max-height:480px; object-fit:cover; display:block; }
.tn-slide-overlay { position:absolute; inset:0; background:linear-gradient(to top,rgba(0,0,0,.55) 0%,transparent 60%); display:flex; align-items:flex-end; }
.tn-slide-content { padding:2rem; color:#fff; }
.tn-slide-content h2 { font-size:clamp(1.2rem,3vw,2rem); font-weight:800; margin-bottom:.4rem; }
.tn-slide-content p { font-size:.95rem; opacity:.88; margin-bottom:.8rem; }
.btn-slide { background:#fff; color:var(--brand); font-weight:700; padding:.5rem 1.4rem; border-radius:8px; text-decoration:none; font-size:.88rem; display:inline-block; }
.carousel-item { position:relative; }

/* ── Menú de rubros ─────────────────────────────────────────── */
.cat-menu-wrap { background:#fff; border-bottom:1px solid var(--border); box-shadow:0 1px 4px rgba(0,0,0,.04); position:sticky; top:57px; z-index:95; }
.cat-menu { max-width:1200px; margin:0 auto; display:flex; gap:0; overflow-x:auto; scrollbar-width:none; padding:0 .5rem; justify-content:center; -webkit-overflow-scrolling:touch; scroll-snap-type:x mandatory; }
@media(max-width:768px) { .cat-menu { justify-content:flex-start; } .cat-menu-item { scroll-snap-align:start; } }
.cat-menu::-webkit-scrollbar { display:none; }
.cat-menu-item { display:flex; flex-direction:column; align-items:center; gap:.3rem; padding:.7rem .85rem; text-decoration:none; color:var(--muted); font-size:.72rem; font-weight:600; white-space:nowrap; border-bottom:2px solid transparent; transition:color .15s, border-color .15s; flex-shrink:0; }
.cat-menu-item:hover { color:var(--brand); }
.cat-menu-item.active { color:var(--brand); border-bottom-color:var(--brand); }
.cat-menu-icon { width:40px; height:40px; border-radius:50%; background:var(--bg); display:flex; align-items:center; justify-content:center; font-size:1.1rem; color:var(--muted); transition:background .15s, color .15s; }
.cat-menu-item:hover .cat-menu-icon { background:color-mix(in srgb, var(--brand) 12%, #fff); color:var(--brand); }
.cat-menu-item.active .cat-menu-icon { background:color-mix(in srgb, var(--brand) 15%, #fff); color:var(--brand); }
@media(max-width:480px) { .cat-menu-item { padding:.6rem .6rem; } .cat-menu-icon { width:36px; height:36px; font-size:1rem; } }

/* ── Filtros ─────────────────────────────────────────────────── */
.tn-filters-bar { background:#fff; border-bottom:1px solid var(--border); padding:.5rem 1rem; position:sticky; top:121px; z-index:85; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.tn-filters-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; gap:.75rem; flex-wrap:wrap; }
.tn-filter-group { display:flex; align-items:center; gap:.35rem; }
.tn-filter-label { font-size:.75rem; font-weight:600; color:var(--muted); white-space:nowrap; }
.tn-filter-select { font-size:.8rem; border:1.5px solid var(--border); border-radius:8px; padding:.3rem .65rem; background:var(--bg); color:var(--text); cursor:pointer; outline:none; }
.tn-filter-select:focus { border-color:var(--brand); }
.tn-filter-tags { display:flex; gap:.4rem; flex-wrap:wrap; }
.tn-tag-active { display:inline-flex; align-items:center; background:var(--brand); color:#fff; font-size:.72rem; font-weight:600; padding:3px 10px; border-radius:20px; text-decoration:none; gap:.25rem; }
.tn-tag-active:hover { opacity:.85; color:#fff; }
.tn-filter-count { font-size:.78rem; color:#94a3b8; white-space:nowrap; }

/* ── Grilla productos ────────────────────────────────────────── */
.prod-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:1rem; }
@media(max-width:480px) { .prod-grid { grid-template-columns:repeat(2,1fr); gap:.6rem; } }

/* ── Card producto ───────────────────────────────────────────── */
.prod-card { background:#fff; border-radius:var(--radius); border:1px solid var(--border); display:flex; flex-direction:column; overflow:hidden; transition:box-shadow .15s,transform .15s; position:relative; }
.prod-card:hover { box-shadow:0 6px 20px rgba(0,0,0,.1); transform:translateY(-2px); }
.prod-card-link { position:absolute; inset:0; z-index:2; }
.prod-img-wrap { position:relative; aspect-ratio:1/1; background:#f1f5f9; overflow:hidden; z-index:1; }
.prod-img { width:100%; height:100%; object-fit:contain; transition:transform .3s; padding:4px; }
.prod-card:hover .prod-img { transform:scale(1.04); }
.prod-img-ph { width:100%; height:100%; display:flex; align-items:center; justify-content:center; color:#cbd5e1; font-size:2.5rem; }
.prod-info { padding:.65rem .75rem; flex:1; display:flex; flex-direction:column; gap:.2rem; position:relative; z-index:1; }
.prod-marca { font-size:.68rem; font-weight:700; color:var(--brand); text-transform:uppercase; letter-spacing:.05em; }
.prod-name { font-size:.85rem; font-weight:600; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.prod-price { font-size:1rem; font-weight:800; color:var(--text); margin-top:auto; padding-top:.3rem; }
.prod-price-original { font-size:.75rem; color:var(--muted); text-decoration:line-through; font-weight:400; }
.prod-sin-stock { font-size:.7rem; color:#ef4444; font-weight:600; }
.badge-oferta { position:absolute; top:.5rem; left:.5rem; background:#ef4444; color:#fff; font-size:.65rem; font-weight:700; padding:2px 7px; border-radius:20px; z-index:1; }
.badge-dest { position:absolute; top:.5rem; right:.5rem; background:#f59e0b; color:#fff; font-size:.65rem; width:22px; height:22px; border-radius:50%; display:flex; align-items:center; justify-content:center; z-index:1; }
.btn-add { margin:.5rem .6rem .6rem; background:var(--brand); color:#fff; border:none; border-radius:8px; padding:.45rem; font-size:.78rem; font-weight:600; cursor:pointer; transition:background .15s; display:flex; align-items:center; justify-content:center; gap:.3rem; position:relative; z-index:3; }
.btn-add:hover { background:#1d4ed8; }

/* ── Títulos sección ─────────────────────────────────────────── */
.section-title { font-size:1.05rem; font-weight:700; color:var(--text); margin:0; display:flex; align-items:center; gap:.4rem; }

/* ── Estado vacío ───────────────────────────────────────────── */
.empty-state { text-align:center; padding:3rem 1rem; color:var(--muted); }
.empty-state i { font-size:3rem; margin-bottom:1rem; display:block; color:#cbd5e1; }

/* ── Paginación ─────────────────────────────────────────────── */
.tn-pag { display:flex; justify-content:center; align-items:center; gap:.4rem; flex-wrap:wrap; }
.tn-pag a, .tn-pag span { display:inline-flex; align-items:center; justify-content:center; min-width:36px; height:36px; padding:0 .6rem; border-radius:8px; border:1.5px solid var(--border); font-size:.85rem; font-weight:600; text-decoration:none; color:var(--text); transition:.15s; }
.tn-pag a:hover { border-color:var(--brand); color:var(--brand); }
.tn-pag span.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.tn-pag span.disabled { color:#cbd5e1; cursor:default; }

/* ── Footer ─────────────────────────────────────────────────── */
.tn-footer { background:#1e293b; color:#94a3b8; text-align:center; padding:1.5rem 1rem; font-size:.82rem; }
body { display:flex; flex-direction:column; min-height:100vh; }
body > .tn-footer { margin-top:auto; }
.tn-footer strong { color:#fff; }
.tn-social-link { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:50%; background:#334155; color:#94a3b8; font-size:1rem; text-decoration:none; transition:.15s; }
.tn-social-link:hover { background:var(--brand); color:#fff; }

/* ── WhatsApp FAB ───────────────────────────────────────────── */
.wa-fab { position:fixed; bottom:1.5rem; right:1.5rem; width:52px; height:52px; border-radius:50%; background:#25d366; color:#fff; display:flex; align-items:center; justify-content:center; font-size:1.6rem; text-decoration:none; box-shadow:0 4px 16px rgba(37,211,102,.4); z-index:200; transition:.2s; }
.wa-fab:hover { transform:scale(1.1); color:#fff; }

/* ── Mini panel carrito ──────────────────────────────────────── */
#cartSnack { position:fixed; bottom:1.5rem; right:1.5rem; width:min(340px,calc(100vw - 2rem)); background:#fff; border-radius:16px; box-shadow:0 8px 32px rgba(0,0,0,.18); display:flex; flex-direction:column; overflow:hidden; z-index:400; opacity:0; transform:translateY(20px) scale(.97); pointer-events:none; transition:opacity .25s,transform .25s; }
#cartSnack.show { opacity:1; transform:translateY(0) scale(1); pointer-events:all; }
#cartSnack > div:first-child { display:flex; align-items:center; gap:.85rem; padding:1rem 1rem .6rem; }
#cartSnackImg { width:52px; height:52px; border-radius:10px; background:#f1f5f9; display:flex; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
#cartSnackImg img { width:100%; height:100%; object-fit:contain; }
#cartSnackImg i { font-size:1.4rem; color:#94a3b8; }
.cs-info { flex:1; min-width:0; }
.cs-check { font-size:.78rem; font-weight:700; color:#16a34a; display:flex; align-items:center; gap:.3rem; margin-bottom:.15rem; }
.cs-nombre { font-size:.85rem; font-weight:600; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-close { position:absolute; top:.6rem; right:.6rem; background:none; border:none; color:#94a3b8; cursor:pointer; font-size:.9rem; padding:.2rem; line-height:1; }
.cs-actions { display:flex; gap:.5rem; padding:.5rem 1rem .8rem; }
.cs-btn { flex:1; padding:.5rem .6rem; border-radius:10px; font-size:.78rem; font-weight:700; text-align:center; cursor:pointer; text-decoration:none; border:none; transition:.15s; -webkit-tap-highlight-color:transparent; }
.cs-btn-primary { background:var(--brand); color:#fff; }
.cs-btn-primary:hover { opacity:.88; color:#fff; }
.cs-btn-secondary { background:#f1f5f9; color:#1e293b; }
.cs-btn-secondary:hover { background:#e2e8f0; }
.cs-bar { height:3px; background:var(--brand); width:100%; transform-origin:left; }
@media(max-width:480px) { #cartSnack { bottom:0; right:0; width:100%; border-radius:16px 16px 0 0; } }

/* ── Fixes iOS / Android ─────────────────────────────────────── */
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; }
input, select, textarea { font-size:16px; } /* evita zoom en iOS al hacer focus */
button, a { -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
img { max-width:100%; height:auto; }
.tn-nav { -webkit-overflow-scrolling:touch; }
.cats-bar { -webkit-overflow-scrolling:touch; }
* { -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }
