/* =============================================
   FRESH ONLINE — styles.css (v3 MEJORADO)
============================================= */

/* ===== VARIABLES ===== */
:root {
    --bg: #f8fafc;
    --text: #0f172a;
    --muted: #64748b;
    --card: #ffffff;
    --border: rgba(59,130,246,.08);
    --border-strong: rgba(59,130,246,.16);
    --shadow-xs: 0 1px 4px rgba(59,130,246,.04);
    --shadow-sm: 0 2px 12px rgba(59,130,246,.06);
    --shadow: 0 8px 32px rgba(59,130,246,.08);
    --shadow-lg: 0 20px 48px rgba(59,130,246,.12);
    --shadow-xl: 0 32px 72px rgba(59,130,246,.16);
    --blue: #3b82f6;
    --blue-2: #2563eb;
    --blue-light: rgba(59,130,246,.07);
    --chip-bg: rgba(59,130,246,.06);
    --ring: 0 0 0 .25rem rgba(59,130,246,.18);
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --gradient-blue: linear-gradient(135deg, #3b82f6, #2563eb);
    --navbar-h: 80px;
    --transition: all .28s cubic-bezier(.4,0,.2,1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(1400px 600px at 15% -5%, rgba(59,130,246,.04), transparent 50%),
        radial-gradient(1200px 600px at 90% 15%, rgba(59,130,246,.03), transparent 55%),
        var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

img { display: block; }
a { text-decoration: none; }
button { cursor: pointer; }
input, textarea, select { -webkit-text-size-adjust: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(59,130,246,.2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59,130,246,.4); }

/* Accessibility */
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--blue); color: #fff;
    padding: 8px 16px; z-index: 9999;
    border-radius: 0 0 8px 0; transition: top .2s;
}
.skip-link:focus { top: 0; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* UPPERCASE UI */
.upper-all * { text-transform: uppercase !important; letter-spacing: .2px; }
/* Excluir chatbot de las mayúsculas - los mensajes deben verse naturales */
.upper-all .chat-bubble,
.upper-all .chat-bubble *,
.upper-all .chat-product-name,
.upper-all .chat-product-price { text-transform: none !important; letter-spacing: 0 !important; }
.upper-all input,
.upper-all textarea,
.upper-all .no-upper,
.upper-all code,
.upper-all pre,
.upper-all .bi,
.upper-all i[class^="bi-"],
.upper-all i[class*=" bi-"] { text-transform: none !important; letter-spacing: 0 !important; }

/* =============================================
   NAVBAR
============================================= */
.nav-glass {
    background: rgba(255,255,255,.82);
    backdrop-filter: saturate(200%) blur(24px);
    -webkit-backdrop-filter: saturate(200%) blur(24px);
    border-bottom: 1px solid rgba(59,130,246,.06);
    box-shadow: 0 1px 20px rgba(59,130,246,.05);
    transition: var(--transition);
    z-index: 1040;
}
.nav-glass.scrolled {
    background: rgba(255,255,255,.95);
    box-shadow: 0 4px 32px rgba(59,130,246,.1);
}

.brand-badge {
    width: 48px; height: 48px; border-radius: 14px;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    display: grid; place-items: center;
    box-shadow: 0 8px 24px rgba(59,130,246,.25);
    overflow: hidden; flex-shrink: 0;
}

/* =============================================
   SEARCH
============================================= */
.search-wrap { position: relative; max-width: 680px; }

.search-wrap > .bi-search {
    position: absolute; left: 18px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted); font-size: 17px;
    pointer-events: none; z-index: 2;
}

.search-input {
    padding: 13px 52px 13px 50px;
    border-radius: 999px;
    border: 2px solid rgba(59,130,246,.1);
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-sm);
    font-size: 15px; font-weight: 500; width: 100%;
    transition: var(--transition);
}
.search-input:focus {
    box-shadow: var(--ring), var(--shadow);
    border-color: rgba(59,130,246,.35);
    background: #fff; outline: none;
}
.search-input::placeholder { color: var(--muted); font-weight: 400; }

.btn-voice {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    padding: 6px 8px; color: var(--muted);
    transition: var(--transition); z-index: 3;
    border-radius: 8px;
}
.btn-voice:hover { color: var(--blue); background: var(--blue-light); }
.btn-voice.listening { color: #ef4444; animation: pulse-voice 1s infinite; }

@keyframes pulse-voice {
    0%,100% { transform: translateY(-50%) scale(1); }
    50%     { transform: translateY(-50%) scale(1.18); }
}

/* =============================================
   BUTTONS
============================================= */
.btn-soft {
    border: 1px solid rgba(59,130,246,.08);
    background: rgba(255,255,255,.95);
    border-radius: 999px; padding: 10px 20px;
    font-weight: 600; transition: var(--transition); white-space: nowrap;
}
.btn-soft:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(59,130,246,.2); }
.btn-soft:active { transform: translateY(0); }

.btn-primary-neo {
    background: var(--gradient-blue); border: none;
    border-radius: 999px; padding: 12px 24px;
    font-weight: 700; color: #fff;
    box-shadow: 0 8px 20px rgba(59,130,246,.28);
    transition: var(--transition);
}
.btn-primary-neo:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(59,130,246,.38); color: #fff; }
.btn-primary-neo:active { transform: translateY(0); }

.btn-whatsapp {
    width: 44px; height: 44px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: #25D366; color: #fff; border: none;
    box-shadow: 0 6px 18px rgba(37,211,102,.22);
    transition: var(--transition); flex-shrink: 0;
}
.btn-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,211,102,.35); color: #fff; }

.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
    content: ""; position: absolute;
    width: 16px; height: 16px; top: 50%; left: 50%; margin: -8px 0 0 -8px;
    border: 2px solid #fff; border-top-color: transparent;
    border-radius: 50%; animation: spin .55s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   LAYOUT
============================================= */
.app { padding-top: var(--navbar-h); }

/* =============================================
   SIDEBAR
============================================= */
.side-card {
    border: 1px solid rgba(59,130,246,.08);
    background: rgba(255,255,255,.97);
    border-radius: var(--radius-lg); box-shadow: var(--shadow);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    position: sticky; top: 104px;
}
@media (min-width: 992px) {
    .side-card { max-height: calc(100vh - 128px); overflow-y: auto; padding-right: 4px; }
}

.side-title { font-weight: 900; letter-spacing: -.3px; font-size: 17px; }
.chip {
    font-size: 12px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid rgba(59,130,246,.08); background: rgba(255,255,255,.95);
    font-weight: 600; white-space: nowrap;
    display: inline-flex; align-items: center;
}
.divider { height: 2px; background: var(--border); border-radius: 2px; }

/* Categories */
.cat-item {
    border-radius: var(--radius); border: 2px solid transparent;
    padding: 11px 14px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; transition: var(--transition); user-select: none;
}
.cat-item:hover { background: var(--blue-light); border-color: rgba(59,130,246,.15); transform: translateX(3px); }
.cat-item.active { background: var(--chip-bg); border-color: rgba(59,130,246,.2); box-shadow: var(--shadow-sm); }

.sub-list { margin: 6px 0 10px; padding-left: 10px; display: none; }
.sub-list.show { display: block; animation: slideDown .28s ease; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sub-pill {
    display: inline-flex; align-items: center; gap: 6px;
    margin: 5px 5px 0 0; padding: 7px 13px;
    border-radius: 999px; border: 1px solid rgba(59,130,246,.08);
    background: #fff; cursor: pointer; transition: var(--transition);
    font-size: 13px; font-weight: 600;
}
.sub-pill:hover { transform: translateY(-2px); background: var(--blue-light); border-color: rgba(59,130,246,.22); box-shadow: var(--shadow-sm); }
.sub-pill.active { background: var(--chip-bg); border-color: rgba(59,130,246,.3); box-shadow: var(--shadow-sm); }

/* =============================================
   HERO SLIDER
============================================= */
.hero-card {
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid rgba(59,130,246,.08);
    box-shadow: var(--shadow-lg);
    background: #fff;
}

.hero-slide {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #eef3fb;
}

.hero-media {
    display: block;
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 38%, rgba(0,0,0,.14) 72%, rgba(0,0,0,.34) 100%);
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    z-index: 2;
    max-width: 62%;
}

.hero-title, .hero-desc {
    color: #fff;
    text-shadow: 0 4px 14px rgba(0,0,0,.5);
    max-width: 100%;
    margin: 0;
}
.hero-title { font-weight: 900; letter-spacing: -.4px; line-height: 1.08; }
.hero-desc { margin-top: 4px; }
.hero-title:empty, .hero-desc:empty { display: none !important; }

.hero-btn-db {
    position: relative;
    margin-top: 14px;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(0,0,0,.22);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-kicker {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 9px 16px; border-radius: 999px;
    background: rgba(59,130,246,.1); border: 2px solid rgba(59,130,246,.2);
    font-weight: 700; font-size: 13px; position: relative; z-index: 2;
}

/* =============================================
   TOOLBAR
============================================= */
.products-toolbar {
    display: flex; align-items: flex-end;
    justify-content: space-between;
    gap: 12px; margin-bottom: 14px;
}
.products-toolbar .pt-left { min-width: 200px; }
.products-toolbar #resultsInfo { font-weight: 500; display: block; line-height: 1.25; margin-top: 3px; font-size: 13px; }
.products-toolbar .pt-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.section-title { font-weight: 900; letter-spacing: -.4px; }

.sort-select {
    width: 210px; border-radius: 999px;
    border: 1px solid rgba(59,130,246,.08); font-weight: 700;
    background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm);
    padding: 10px 16px;
}

.view-toggle {
    display: flex; gap: 4px; background: #fff;
    border: 1px solid rgba(59,130,246,.08); border-radius: 14px; padding: 4px;
}
.view-btn {
    width: 40px; height: 38px; border: none; border-radius: 10px;
    background: transparent; display: grid; place-items: center;
    transition: var(--transition); color: var(--muted);
}
.view-btn:hover { background: var(--blue-light); }
.view-btn.active { background: var(--gradient-blue); color: #fff; box-shadow: var(--shadow-sm); }

/* =============================================
   PRODUCT CARDS — GRID
============================================= */
.product-card {
    border: 1px solid rgba(59,130,246,.08); border-radius: calc(var(--radius) + 2px);
    overflow: hidden; background: rgba(255,255,255,.99);
    box-shadow: var(--shadow-sm); transition: var(--transition);
    height: 100%; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 20px 48px rgba(59,130,246,.14); border-color: rgba(59,130,246,.15); }

.p-img {
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #faf9ff, #f0edff);
    overflow: hidden; display: grid; place-items: center;
    position: relative; flex-shrink: 0;
}
.p-img img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .35s ease;
}
.product-card:hover .p-img img { transform: scale(1.04); }

/* Badges */
.p-badge {
    position: absolute; top: 12px; left: 12px;
    font-size: 11px; padding: 6px 11px; border-radius: 999px;
    background: rgba(15,23,42,.85); color: #fff;
    border: 2px solid rgba(255,255,255,.15);
    font-weight: 800; z-index: 2; pointer-events: none;
}
.p-badge.badge-top { background: linear-gradient(135deg, #1e1b4b, #312e81); border-color: rgba(255,255,255,.25); box-shadow: 0 6px 16px rgba(15,23,42,.18); }
.p-badge.badge-offer {
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-color: rgba(255,255,255,.3); box-shadow: 0 6px 14px rgba(239,68,68,.3);
    animation: offerPulse 2.8s infinite ease-in-out;
}
@keyframes offerPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.p-badge.badge-out {
    top: 14px; left: -44px; width: 170px; text-align: center;
    padding: 7px 0; background: #dc2626; color: #fff;
    font-weight: 900; font-size: 11px; letter-spacing: .7px;
    border-radius: 8px; transform: rotate(-45deg);
    box-shadow: 0 8px 20px rgba(0,0,0,.22); border: 2px solid rgba(255,255,255,.3);
}

.p-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.p-name {
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
    font-weight: 700; font-size: 14px; line-height: 1.35; margin-bottom: 4px;
}
.p-meta { color: var(--muted); font-size: 13px; line-height: 1.4; margin-bottom: 8px; }
.p-price { font-weight: 900; font-size: 18px; color: var(--blue); }
.p-old { color: var(--muted); text-decoration: line-through; font-size: 13px; font-weight: 600; }

/* =============================================
   LIST VIEW
============================================= */
.list-view .col-12, .list-view .col-sm-6, .list-view .col-xl-4 {
    width: 100%; max-width: 100%; flex: 0 0 100%;
}
.list-view .product-card { flex-direction: row; align-items: stretch; }
.list-view .product-card:hover { transform: translateY(-2px); }
.list-view .p-img {
    flex: 0 0 140px; width: 140px; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    aspect-ratio: auto; min-height: 130px; background: #ffffff; padding: 8px;
    display: flex; align-items: center; justify-content: center;
}
.list-view .p-img img { object-fit: contain; width: 100%; height: 100%; border-radius: 10px; background:#ffffff; }
.list-view .p-img .p-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    right: auto !important;
    width: auto !important;
    max-width: calc(100% - 16px) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.72) !important;
    transform: none !important;
    animation: none !important;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(15,23,42,.08) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    letter-spacing: .35px;
    white-space: nowrap;
}
.list-view .p-img .p-badge.badge-offer {
    background: rgba(249,115,22,.88) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.7) !important;
}
.list-view .p-img .p-badge.badge-out  {
    background: rgba(220,38,38,.88) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.72) !important;
}
.list-view .p-img .p-badge.badge-top  {
    background: rgba(15,23,42,.82) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.6) !important;
}
.list-view .p-body { padding: 12px 16px !important; justify-content: center; }
.list-view .p-name  { font-size: 15px !important; font-weight: 900 !important; }
.list-view .p-meta  { font-size: 12px !important; margin-bottom: 4px !important; }
.list-view .p-price { font-size: 15px !important; }
.list-view .p-old   { font-size: 12px !important; }
.list-view .p-body .chip { font-size: 10px; padding: 4px 8px; }
.list-view .product-card .btn { border-radius: 12px !important; padding: 9px 12px !important; }

@media (max-width: 768px) {
    .list-view .p-img { flex: 0 0 110px; width: 110px; min-height: 110px; padding: 6px; }
    .list-view .p-body { padding: 10px 12px !important; }
    .list-view .p-name { font-size: 14px !important; }
}

/* =============================================
   PAGINATION
============================================= */
.pagination { gap: 6px; flex-wrap: wrap; justify-content: center; }
.page-link { border-radius: 999px !important; border: 1px solid rgba(59,130,246,.08) !important; font-weight: 800; padding: 8px 16px; transition: var(--transition); }
.page-item.active .page-link { background: var(--gradient-blue); border-color: transparent !important; box-shadow: 0 4px 12px rgba(59,130,246,.3); }

/* =============================================
   MODAL PRODUCTO
============================================= */
.modal-content { border-radius: var(--radius-xl); border: 1px solid rgba(59,130,246,.08); box-shadow: var(--shadow-xl); overflow: hidden; }
.modal-header { border-bottom: 1px solid rgba(59,130,246,.06); padding: 16px 20px; }
.modal-footer { border-top: 1px solid rgba(59,130,246,.06); padding: 16px 20px; }

.modal-img-square {
    width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-lg);
    overflow: hidden; border: 1px solid rgba(59,130,246,.08); background: #fff;
    display: grid; place-items: center; padding: 12px; position: relative;
}
.modal-img-square img { width: 100%; height: 100%; object-fit: contain; display: block; }

#modalImgWrap { height: auto !important; overflow: visible !important; aspect-ratio: 1/1; }
#modalImgWrap img { object-fit: contain !important; }

.modal-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 999px;
    border: 1px solid rgba(59,130,246,.08); background: rgba(255,255,255,.92);
    display: grid; place-items: center; font-size: 16px;
    transition: var(--transition); z-index: 5;
}
.modal-nav:hover { background: #fff; box-shadow: var(--shadow); }
.modal-prev { left: 8px; }
.modal-next { right: 8px; }

.modal-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 7px; justify-content: center; }
.modal-dots .dot {
    width: 9px; height: 9px; border-radius: 999px;
    border: 2px solid rgba(15,23,42,.2); background: rgba(255,255,255,.7);
    cursor: pointer; transition: var(--transition);
}
.modal-dots .dot.active { border-color: var(--blue); background: var(--blue); }

.qty-btn {
    width: 38px; height: 38px; border-radius: 12px;
    border: 1px solid rgba(59,130,246,.08); background: #fff; font-weight: 800;
    display: grid; place-items: center; transition: var(--transition);
}
.qty-btn:hover { background: var(--blue-light); border-color: rgba(59,130,246,.2); }
.qty-input { width: 52px; text-align: center; border: 1px solid rgba(59,130,246,.08); border-radius: 12px; height: 38px; font-weight: 800; }

/* =============================================
   CART
============================================= */
.cart-item {
    border: 1px solid rgba(59,130,246,.08); border-radius: var(--radius);
    padding: 14px; background: rgba(255,255,255,.98); transition: var(--transition);
}
.cart-item:hover { border-color: rgba(59,130,246,.15); box-shadow: var(--shadow-sm); }

/* =============================================
   TOAST
============================================= */
.toast { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 16px !important; }

/* =============================================
   MOBILE BAR
============================================= */
.mobile-bar {
    position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px;
    background: rgba(255,255,255,.92); border-top: 1px solid rgba(59,130,246,.06);
    backdrop-filter: saturate(200%) blur(24px); -webkit-backdrop-filter: saturate(200%) blur(24px);
    display: none; z-index: 1035; box-shadow: 0 -4px 20px rgba(15,23,42,.07);
}
@media (max-width: 991.98px) {
    .mobile-bar { display: block; }
    .app { padding-bottom: 84px; }
}

/* =============================================
   COMPARE
============================================= */
.compare-badge {
    position: fixed; bottom: 84px; right: 18px;
    background: var(--blue); color: #fff; padding: 11px 18px;
    border-radius: 999px; box-shadow: 0 8px 20px rgba(59,130,246,.3);
    cursor: pointer; z-index: 1020; transition: var(--transition);
    display: flex; align-items: center; gap: 8px; font-weight: 700;
}
.compare-badge:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(59,130,246,.4); }

/* =============================================
   ADVANCED FILTERS
============================================= */
.filter-section { padding: 12px; border: 1px solid rgba(59,130,246,.08); border-radius: var(--radius); background: rgba(255,255,255,.5); }
.filter-title { font-weight: 800; font-size: 13px; margin-bottom: 8px; color: var(--blue); }
.filter-checkbox { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; border-radius: 8px; transition: background .15s; }
.filter-checkbox:hover { background: var(--blue-light); }
.filter-checkbox input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--blue); }
.filter-brands { max-height: 190px; overflow-y: auto; }

/* =============================================
   AUTOCOMPLETE
============================================= */
.autocomplete-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: rgba(255,255,255,.99); border: 1px solid rgba(59,130,246,.08);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    max-height: 400px; overflow-y: auto; z-index: 1200; display: none;
}
.ac-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; cursor: pointer; transition: background .15s;
    border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: var(--blue-light); }
.ac-name { font-weight: 700; font-size: 14px; }
.ac-meta { font-size: 12px; color: var(--muted); }
.ac-section-title { padding: 7px 16px; font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--blue); background: rgba(59,130,246,.03); }

/* =============================================
   ANIMATIONS
============================================= */
.flying-product { position: fixed; font-size: 22px; color: var(--blue); pointer-events: none; z-index: 9999; transition: all .55s cubic-bezier(.25,.46,.45,.94); }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.pulse { animation: pulse .28s ease; }

/* Keyboard nav */
.keyboard-navigation *:focus { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Did you mean */
.dymLink { color: var(--blue); text-decoration: underline; }
.dymLink:hover { color: var(--blue-2); }

/* Footer */
.footer-mini { color: var(--muted); background: rgba(255,255,255,.9); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius-lg); }

/* =============================================
   CHATBOT IA — v2 MEJORADO
============================================= */
.chat-bot-btn {
    position: fixed; bottom: 84px; right: 18px;
    width: 62px; height: 62px; border-radius: 50%;
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6d28d9 100%);
    border: none; color: #fff; font-size: 28px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 32px rgba(139,92,246,.45), 0 0 0 0 rgba(139,92,246,.4);
    cursor: pointer; z-index: 1000;
    transition: all .3s cubic-bezier(.34,1.56,.64,1);
    animation: chatBtnPulse 3s ease-in-out infinite;
}
.chat-bot-btn:hover {
    transform: scale(1.12) rotate(-5deg);
    box-shadow: 0 12px 40px rgba(139,92,246,.55);
}
@keyframes chatBtnPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(139,92,246,.45), 0 0 0 0 rgba(139,92,246,.3); }
    50% { box-shadow: 0 8px 32px rgba(139,92,246,.45), 0 0 0 12px rgba(139,92,246,0); }
}

.chat-window {
    position: fixed; bottom: 20px; right: 18px;
    width: 440px; max-width: calc(100vw - 36px);
    height: 680px; max-height: calc(100vh - 60px);
    background: #fff; border-radius: 24px;
    box-shadow: 0 25px 80px rgba(15,23,42,.18), 0 8px 32px rgba(139,92,246,.12);
    display: flex; flex-direction: column;
    z-index: 1001; overflow: hidden;
    border: 1px solid rgba(139,92,246,.15);
    animation: chatIn .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes chatIn {
    from { transform: scale(.85) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.chat-header {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 50%, #6d28d9 100%);
    color: #fff; padding: 18px 20px;
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
    position: relative; overflow: hidden;
}
.chat-header::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,.12) 0%, transparent 60%);
    pointer-events: none;
}

#chatCloseBtn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,.18); backdrop-filter: blur(8px);
    border: 2px solid rgba(255,255,255,.3);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0;
    transition: all .2s; opacity: 1 !important; filter: none !important;
    background-image: none !important; padding: 0 !important;
    position: relative; z-index: 1;
}
#chatCloseBtn:hover { background: rgba(255,255,255,.32); transform: scale(1.1); }
@media (max-width: 640px) {
    #chatCloseBtn { width: 44px; height: 44px; font-size: 22px; }
}

.chat-header .chat-header-info { position: relative; z-index: 1; }
.chat-header .chat-header-title {
    font-weight: 800; font-size: 16px; letter-spacing: -.01em;
}
.chat-header .status-dot {
    width: 9px; height: 9px; border-radius: 50%; background: #4ade80;
    display: inline-block; flex-shrink: 0;
    animation: statusPulse 2.5s infinite;
    box-shadow: 0 0 8px rgba(74,222,128,.6);
}
@keyframes statusPulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

.chat-body {
    flex: 1; padding: 20px; overflow-y: auto;
    background: linear-gradient(180deg, #f8faff 0%, #f1f5ff 100%);
    display: flex; flex-direction: column; gap: 12px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(139,92,246,.2); border-radius: 4px; }

.chat-message { display: flex; gap: 10px; align-items: flex-end; animation: msgSlide .35s cubic-bezier(.34,1.56,.64,1); }
.chat-message.user { flex-direction: row-reverse; }
@keyframes msgSlide { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.chat-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 16px;
    box-shadow: 0 4px 12px rgba(139,92,246,.25);
}
.chat-message.user .chat-avatar {
    background: linear-gradient(135deg, #a855f7, #06b6d4);
    box-shadow: 0 4px 12px rgba(139,92,246,.2);
}

.chat-bubble {
    max-width: 78%; padding: 12px 16px; border-radius: 20px;
    font-size: 14px; line-height: 1.55; font-weight: 500;
    word-break: break-word;
}
.chat-message.bot .chat-bubble {
    background: #fff; color: #1e293b; border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(15,23,42,.06); border: 1px solid rgba(139,92,246,.1);
}
.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff; border-bottom-right-radius: 6px;
    box-shadow: 0 4px 16px rgba(139,92,246,.3);
}

.typing-indicator { display: flex; gap: 5px; padding: 4px 0; }
.typing-indicator span {
    width: 8px; height: 8px; border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-10px); opacity: 1; } }

.chat-footer {
    padding: 14px 16px; background: #fff;
    border-top: 1px solid rgba(139,92,246,.08);
    display: flex; gap: 10px; align-items: center; flex-shrink: 0;
}

.chat-input {
    flex: 1; padding: 12px 18px;
    border: 2px solid rgba(139,92,246,.15); border-radius: 999px;
    font-size: 14px; font-weight: 500;
    outline: none; transition: all .25s; background: #f8faff;
}
.chat-input:focus { border-color: #8b5cf6; background: #fff; box-shadow: 0 0 0 4px rgba(139,92,246,.1); }

.chat-send-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed); border: none; color: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: all .25s; flex-shrink: 0; font-size: 18px;
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(139,92,246,.4); }
.chat-send-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.chat-send-btn.btn-loading { animation: sendPulse .8s infinite; }
@keyframes sendPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.chat-suggestions {
    padding: 12px 16px; background: #fafaff; border-top: 1px solid rgba(139,92,246,.06);
    display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0;
}
.suggestion-chip {
    padding: 8px 14px; border: 2px solid rgba(139,92,246,.15); border-radius: 999px;
    background: #fff; font-size: 12px; font-weight: 700; cursor: pointer;
    transition: all .25s; white-space: nowrap; color: #6d28d9;
}
.suggestion-chip:hover {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff; border-color: transparent;
    transform: translateY(-2px); box-shadow: 0 4px 16px rgba(139,92,246,.3);
}

.chat-products { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.chat-product-card {
    background: #fff; border-radius: 16px; padding: 12px;
    display: flex; gap: 12px; cursor: pointer;
    transition: all .25s cubic-bezier(.34,1.56,.64,1);
    border: 2px solid rgba(139,92,246,.08);
    box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.chat-product-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(139,92,246,.15);
}
.chat-product-card img { width: 76px; height: 76px; object-fit: contain; border-radius: 12px; background: #f8faff; }

.chat-product-placeholder {
    width: 76px; height: 76px; background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: #7c3aed; flex-shrink: 0;
}
.chat-product-top { position: relative; flex-shrink: 0; }
.chat-offer-badge {
    position: absolute; top: 4px; left: 4px;
    background: linear-gradient(135deg, #ef4444, #f97316); color: #fff;
    font-weight: 800; font-size: 10px;
    padding: 3px 8px; border-radius: 999px; z-index: 2;
    box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.chat-product-info { flex: 1; min-width: 0; }
.chat-product-name { font-weight: 800; font-size: 13px; margin-bottom: 4px; color: #1e293b; }
.chat-product-price { font-weight: 900; font-size: 16px; color: #3b82f6; margin-bottom: 8px; }

/* PC Grande (> 1200px): chat aún más grande */
@media (min-width: 1200px) {
    .chat-window { width: 480px; height: 720px; bottom: 24px; right: 24px; }
    .chat-bot-btn { width: 66px; height: 66px; font-size: 30px; bottom: 88px; right: 24px; }
    .chat-bubble { font-size: 14.5px; }
    .chat-product-card img, .chat-product-placeholder { width: 84px; height: 84px; }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .chat-window { width: 400px; height: 620px; }
}

/* Mobile: chat fullscreen */
@media (max-width: 640px) {
    .chat-window {
        position: fixed;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
        width: 100vw !important; height: 100dvh !important;
        max-width: 100% !important; max-height: 100% !important;
        border-radius: 0 !important; border: 0 !important;
        z-index: 99999 !important;
    }
    .chat-header {
        padding-top: max(18px, env(safe-area-inset-top)) !important;
        padding-bottom: 14px;
    }
    .chat-bot-btn {
        bottom: 84px; right: 14px; width: 56px; height: 56px; font-size: 26px;
        z-index: 1050;
    }
    .chat-body { padding: 14px; gap: 10px; }
    .chat-bubble { font-size: 14px; max-width: 84%; }
    .chat-input { font-size: 16px !important; padding: 12px 16px; }
    .chat-footer {
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
    }
    .chat-suggestions {
        padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
        overflow-x: auto; flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .suggestion-chip { flex-shrink: 0; }
    .chat-product-card img, .chat-product-placeholder { width: 68px; height: 68px; }
}

/* Bloquear scroll del body cuando chat abierto en móvil */
body.chat-open-mobile {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* =============================================
   RESPONSIVE — NAVBAR MOBILE
============================================= */
@media (max-width: 991.98px) {
    :root { --navbar-h: 130px; }
    main.app { padding-top: var(--navbar-h) !important; }

    .search-wrap { max-width: 100% !important; width: 100% !important; display: flex; align-items: center; flex: 1; }
    .search-wrap input { flex: 1; min-width: 0; }

    #searchInputMobile, .search-input {
        font-size: 16px !important;
        height: 46px; padding: 12px 48px !important;
        border-radius: 999px; width: 100% !important;
    }
    .mobile-bar .btn { padding: 10px 14px; }
}

/* =============================================
   RESPONSIVE — TOOLBAR MOBILE
============================================= */
@media (max-width: 768px) {
    .products-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .products-toolbar .pt-left { min-width: 0; }
    .products-toolbar .pt-right {
        display: grid;
        grid-template-columns: minmax(0,1fr) minmax(120px,1fr);
        grid-template-areas:
            "sort sort"
            "all all"
            "best best"
            "share toggle";
        gap: 10px;
        align-items: stretch;
        justify-content: initial;
    }
    .products-toolbar .sort-select {
        grid-area: sort;
        width: 100%;
        height: 50px;
        border-radius: 16px;
        border-width: 1px;
        font-weight: 800;
        padding-inline: 16px;
    }
    .products-toolbar .btn-showall,
    .products-toolbar #btnShowBestsellers {
        width: 100%;
        min-width: 0;
        height: 48px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        padding-inline: 16px;
        font-weight: 800;
        white-space: nowrap;
        gap: 8px;
    }
    .products-toolbar .btn-showall { grid-area: all; }
    .products-toolbar #btnShowBestsellers { grid-area: best; }
    .products-toolbar #btnShareFilters {
        grid-area: share;
        width: 54px;
        min-width: 54px;
        height: 48px;
        padding: 0;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        justify-self: start;
    }
    .products-toolbar #btnShareFilters::after {
        content: none !important;
        display: none !important;
    }
    .products-toolbar #btnShareFilters i {
        margin: 0;
        font-size: 19px;
    }
    .products-toolbar .view-toggle {
        grid-area: toggle;
        padding: 5px;
        border-radius: 16px;
        border-width: 1px;
        justify-self: stretch;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
        min-width: 0;
    }
    .products-toolbar .view-btn { width: 100%; height: 38px; border-radius: 12px; }
    #productsTop { font-size: 21px; }
}

/* =============================================
   RESPONSIVE — HERO MOBILE
============================================= */
@media (max-width: 768px) {
    .hero-card {
        border-radius: 18px;
        margin-top: 6px;
    }
    .hero-slide {
        border-radius: 18px;
        background: #eef3fb;
    }
    .hero-media {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        object-position: center;
    }
    .hero-content {
        left: 50%;
        right: auto;
        bottom: 14px;
        width: calc(100% - 28px);
        max-width: 90%;
        transform: translateX(-50%);
        text-align: center;
    }
    .hero-title { font-size: 20px !important; }
    .hero-desc  { font-size: 12px !important; }
    .hero-btn-db {
        margin-top: 10px;
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .hero-card {
        border-radius: 20px;
    }
    .hero-slide {
        position: relative;
        border-radius: 20px;
        overflow: hidden;
    }
    .hero-media {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: cover;
        object-position: center;
    }
    /* Mantener overlay y texto ENCIMA de la imagen, igual que en PC */
    .hero-overlay {
        display: block;
    }
    .hero-content {
        position: absolute;
        left: 50%;
        right: auto;
        bottom: 14px;
        width: calc(100% - 24px);
        max-width: 94%;
        transform: translateX(-50%);
        text-align: center;
        padding: 0;
        background: none;
    }
    .hero-title,
    .hero-desc {
        color: #fff;
        text-shadow: 0 3px 12px rgba(0,0,0,.55);
        max-width: 100%;
    }
    .hero-title {
        font-size: 18px !important;
        line-height: 1.08;
    }
    .hero-desc {
        margin-top: 4px;
        font-size: 11px !important;
    }
    .hero-btn-db {
        margin-top: 10px;
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 430px) {
    .products-toolbar .pt-right {
        grid-template-columns: 54px minmax(0,1fr);
        grid-template-areas:
            "sort sort"
            "all all"
            "best best"
            "share toggle";
    }
    .products-toolbar .btn-showall,
    .products-toolbar #btnShowBestsellers,
    .products-toolbar .sort-select,
    .products-toolbar #btnShareFilters {
        height: 46px;
    }
    .hero-content {
        width: calc(100% - 18px);
        max-width: 94%;
    }
}

/* ══════════════════════════════════════════
   CARRITO — Diseño mejorado
   ══════════════════════════════════════════ */
#offcanvasCart {
    width: 400px !important;
    border-left: none !important;
    box-shadow: -12px 0 48px rgba(0,0,0,.1) !important;
}
#offcanvasCart .offcanvas-header {
    background: var(--gradient-blue);
    color: #fff;
    padding: 18px 20px;
    border-bottom: none;
}
#offcanvasCart .offcanvas-title {
    color: #fff !important;
    font-size: 17px;
}
#offcanvasCart .btn-close {
    filter: brightness(0) invert(1);
    opacity: .8;
}
#offcanvasCart .btn-close:hover { opacity: 1; }
#offcanvasCart .offcanvas-body {
    padding: 16px;
    background: #f8fafc;
}
.cart-item {
    border-radius: 14px !important;
    padding: 12px !important;
    background: #fff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.04) !important;
    transition: all .2s !important;
}
.cart-item:hover {
    box-shadow: 0 4px 12px rgba(59,130,246,.08) !important;
}
.qty-btn:hover {
    background: var(--blue) !important;
    color: #fff !important;
    border-color: var(--blue) !important;
}
#btnCheckout {
    padding: 14px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    background: #25D366 !important;
    box-shadow: 0 6px 20px rgba(37,211,102,.25) !important;
}
#btnCheckout:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 28px rgba(37,211,102,.35) !important;
}
#btnClearCart {
    border-radius: 14px !important;
    font-weight: 600 !important;
}
#btnClearCart:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: rgba(239,68,68,.04) !important;
}
@media (max-width: 576px) {
    #offcanvasCart { width: 100vw !important; }
}
