/* ═══════════════════════════════════════════════════════════════════════
   LAGO APP — Tienda online (zona transaccional)
   Paleta verde LAGO + ultracompacto + above-the-fold
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --green-dark: #1d6b3a;
    --green:      #258a48;
    --green-soft: #e8f3ec;
    --green-line: #c8e1d0;
    --gold:       #f5b800;
    --bg:         #f6f8f7;
    --white:      #fff;
    --ink:        #1f2a24;
    --ink-soft:   #5a6b62;
    --line:       #e3e8e5;
    --danger:     #c63838;
    --warn:       #d68a00;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.06);
    --shadow:     0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:  0 16px 48px rgba(0,0,0,.18);
    --radius:     8px;
    --radius-sm:  5px;
    --topbar-h:   58px;
    --sidebar-w:  220px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─────────────── TOPBAR ─────────────── */
.topbar {
    position: sticky; top: 0; z-index: 100;
    background: var(--green-dark);
    color: #fff;
    height: var(--topbar-h);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.topbar-inner {
    max-width: 1600px;
    margin: 0 auto;
    height: 100%;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand {
    display: flex; flex-direction: column;
    color: #fff !important; text-decoration: none !important;
    line-height: 1;
}
.brand-mark { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.brand-tag { font-size: 10px; opacity: .75; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

.search-box {
    flex: 1;
    max-width: 540px;
    background: rgba(255,255,255,.95);
    border-radius: 24px;
    padding: 0 14px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}
.search-box i.bi-search { color: var(--ink-soft); font-size: 16px; }
.search-box input {
    flex: 1; border: 0; outline: 0; background: transparent; height: 100%;
    color: var(--ink);
}
.search-clear {
    background: none; border: 0; color: var(--ink-soft);
    font-size: 16px; padding: 0; visibility: hidden;
}
.search-box.has-text .search-clear { visibility: visible; }

.topbar-actions { display: flex; align-items: center; gap: 4px; }
.topbar-link {
    background: transparent;
    border: 0;
    color: #fff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; gap: 6px;
    font-size: 13px;
    text-decoration: none !important;
    transition: background .15s;
}
.topbar-link:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-link i { font-size: 18px; }

.cart-btn { position: relative; }
.cart-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: var(--gold);
    color: var(--ink);
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 16px;
    text-align: center;
    border: 2px solid var(--green-dark);
}
.cart-badge.empty { display: none; }

.user-chip {
    background: rgba(255,255,255,.12);
    padding: 6px 8px 6px 12px;
}
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout {
    background: rgba(0,0,0,.18); border: 0; color: #fff;
    padding: 4px 8px; border-radius: 4px; margin-left: 4px;
}
.user-logout:hover { background: rgba(0,0,0,.35); }

/* ─────────────── LAYOUT ─────────────── */
.layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    gap: 16px;
    min-height: calc(100vh - var(--topbar-h));
}

/* ─────────────── SIDEBAR ─────────────── */
.sidebar {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    height: fit-content;
    position: sticky;
    top: calc(var(--topbar-h) + 12px);
    max-height: calc(100vh - var(--topbar-h) - 24px);
    overflow-y: auto;
}
.sidebar-close { display: none; }

.filter-block { padding: 8px 0; border-bottom: 1px solid var(--line); }
.filter-block:last-child { border-bottom: 0; }
.filter-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--ink-soft);
    font-weight: 600;
    margin-bottom: 8px;
}

.cat-list, .brand-list { list-style: none; padding: 0; margin: 0; max-height: 220px; overflow-y: auto; }
.cat-item, .brand-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background .12s;
}
.cat-item:hover, .brand-item:hover { background: var(--green-soft); }
.cat-item.active, .brand-item.active {
    background: var(--green-dark);
    color: #fff;
    font-weight: 600;
}
.cat-item.active .cat-count, .brand-item.active .brand-count { color: #fff; opacity: .85; }
.cat-count, .brand-count { font-size: 11px; color: var(--ink-soft); }

.filter-search {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 8px;
    margin-bottom: 6px;
    font-size: 12px;
}

.price-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.price-input {
    width: 80px;
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 5px 6px;
    font-size: 12px;
}
.price-row span { color: var(--ink-soft); }

.btn-mini {
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    color: var(--green-dark);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.btn-mini:hover { background: var(--green-line); }

.check-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--green-dark); }

.btn-clear {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-clear:hover { background: var(--bg); color: var(--ink); }

/* ─────────────── CATALOG ─────────────── */
.catalog { min-height: 400px; }

.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}
.result-info { font-size: 13px; color: var(--ink-soft); }
.result-info strong { color: var(--ink); font-size: 15px; }

.sort-select {
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--ink);
}

/* GRID DENSO: cards 180px de ancho, 5-6 columnas en 1366 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.product-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all .15s ease;
    position: relative;
}
.product-card:hover {
    border-color: var(--green-line);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.product-img {
    aspect-ratio: 1 / 1;
    background: var(--green-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--green-dark);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
}
.product-img img { width: 100%; height: 100%; object-fit: contain; }

.product-stock-flag {
    position: absolute;
    top: 6px; right: 6px;
    font-size: 9px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}
.product-stock-flag.ok { background: var(--green-dark); color: #fff; }
.product-stock-flag.no { background: #f4d3d3; color: var(--danger); }

.product-body {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.product-brand {
    font-size: 10px;
    color: var(--green-dark);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.product-name {
    font-size: 12px;
    color: var(--ink);
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
}
.product-sku { font-size: 10px; color: var(--ink-soft); }
.product-price {
    font-size: 16px;
    font-weight: 800;
    color: var(--ink);
    margin-top: auto;
}
.product-price-small { font-size: 10px; color: var(--ink-soft); font-weight: 400; }

.product-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.qty-mini {
    display: flex; align-items: center; gap: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}
.qty-mini button {
    background: var(--white);
    border: 0;
    width: 22px; height: 26px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 700;
}
.qty-mini button:hover { background: var(--green-soft); color: var(--green-dark); }
.qty-mini input {
    width: 32px; height: 26px;
    border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    text-align: center;
    font-size: 12px;
    -moz-appearance: textfield;
}
.qty-mini input::-webkit-outer-spin-button,
.qty-mini input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-add {
    flex: 1;
    background: var(--green-dark);
    color: #fff;
    border: 0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background .15s;
}
.btn-add:hover { background: var(--green); }
.btn-add:disabled { background: #b8c2bd; cursor: not-allowed; }

/* ─────────────── CATALOG FOOTER ─────────────── */
.catalog-footer { padding: 24px 0; text-align: center; }
.btn-load-more {
    background: var(--white);
    border: 1px solid var(--green-line);
    color: var(--green-dark);
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-load-more:hover { background: var(--green-soft); }

.empty-state, .loading-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--ink-soft);
}
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 8px; }
.empty-state p { margin: 0 0 12px; }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--green-soft);
    border-top-color: var(--green-dark);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────── DRAWERS ─────────────── */
.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.drawer-overlay.show { opacity: 1; visibility: visible; }

.drawer {
    position: fixed;
    top: 0; right: -440px;
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 210;
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
}
.drawer.show { right: 0; }

.drawer-header {
    background: var(--green-dark);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.drawer-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.drawer-close, .drawer-back {
    background: rgba(255,255,255,.15);
    border: 0;
    color: #fff;
    width: 32px; height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.drawer-close:hover, .drawer-back:hover { background: rgba(255,255,255,.25); }

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 18px;
}
.drawer-footer {
    border-top: 1px solid var(--line);
    padding: 14px 18px;
    background: var(--bg);
}

/* CART ITEMS */
.cart-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item-img {
    width: 50px; height: 50px;
    background: var(--green-soft);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-dark);
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-info {
    min-width: 0;
}
.cart-item-name {
    font-size: 12px;
    line-height: 1.3;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.cart-item-price { font-size: 11px; color: var(--ink-soft); }
.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.cart-item-total { font-size: 13px; font-weight: 700; color: var(--ink); }
.cart-item-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.cart-item-qty button {
    background: var(--white);
    border: 0;
    width: 22px; height: 24px;
    color: var(--ink-soft);
    font-size: 14px;
}
.cart-item-qty button:hover { background: var(--green-soft); }
.cart-item-qty input {
    width: 32px; height: 24px;
    border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    text-align: center;
    font-size: 12px;
}
.cart-item-remove {
    background: none; border: 0;
    color: var(--ink-soft);
    font-size: 12px;
    padding: 2px 4px;
}
.cart-item-remove:hover { color: var(--danger); }

.cart-alert {
    background: #fff8e1;
    border: 1px solid #f5c87a;
    color: #8a5a00;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 10px;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: var(--ink-soft);
}
.empty-cart i { font-size: 56px; opacity: .3; display: block; margin-bottom: 10px; }
.empty-cart p { margin: 0 0 16px; }

.cart-totals { margin-bottom: 12px; }
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 13px;
    color: var(--ink-soft);
}
.total-row.total-final {
    border-top: 1px solid var(--line);
    margin-top: 6px;
    padding-top: 10px;
    font-size: 15px;
    color: var(--ink);
}
.total-row.total-final strong { font-size: 22px; color: var(--green-dark); }

.btn-checkout {
    background: var(--green-dark);
    color: #fff;
    border: 0;
    padding: 14px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s;
}
.btn-checkout:hover { background: var(--green); }

.btn-primary {
    background: var(--green-dark);
    color: #fff;
    border: 0;
    padding: 10px 18px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
}
.btn-primary:hover { background: var(--green); }
.btn-block { width: 100%; }

/* ─────────────── CHECKOUT FORM ─────────────── */
.form-group { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-label {
    display: block;
    font-size: 12px;
    color: var(--ink-soft);
    font-weight: 600;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.form-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 14px;
    background: var(--white);
    color: var(--ink);
    transition: border-color .15s;
}
.form-input:focus {
    outline: 0;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px var(--green-soft);
}

.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-card {
    border: 2px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.radio-card input { display: none; }
.radio-card span { display: block; font-size: 13px; color: var(--ink); }
.radio-card span i { display: block; font-size: 22px; color: var(--green-dark); margin-bottom: 4px; }
.radio-card:has(input:checked) {
    border-color: var(--green-dark);
    background: var(--green-soft);
}

.checkout-summary {
    background: var(--bg);
    border-radius: 6px;
    padding: 12px;
    margin: 16px 0;
}
.checkout-summary h4 {
    margin: 0 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--ink-soft);
    letter-spacing: .5px;
}
.checkout-summary .checkout-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 3px 0;
    color: var(--ink);
}
.checkout-note {
    text-align: center;
    font-size: 11px;
    color: var(--ink-soft);
    margin: 10px 0 0;
}

/* ─────────────── PEDIDOS ─────────────── */
.pedido-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}
.pedido-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.pedido-nro { font-size: 15px; font-weight: 700; color: var(--ink); }
.pedido-fecha { font-size: 11px; color: var(--ink-soft); }
.pedido-estado {
    font-size: 10px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: .5px;
}
.pedido-estado.pendiente { background: #fff3cd; color: #856404; }
.pedido-estado.aprobado  { background: #d4edda; color: #155724; }
.pedido-estado.cancelado { background: #f8d7da; color: #721c24; }
.pedido-estado.entregado { background: var(--green-soft); color: var(--green-dark); }
.pedido-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ink-soft);
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
.pedido-total { font-weight: 700; color: var(--ink); font-size: 14px; }

/* ─────────────── MODAL ─────────────── */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 300;
    opacity: 0; visibility: hidden;
    transition: opacity .2s, visibility .2s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

.modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.96);
    width: 440px;
    max-width: 92vw;
    max-height: 92vh;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 310;
    opacity: 0;
    visibility: hidden;
    transition: all .2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(0,0,0,.05);
    border: 0;
    width: 30px; height: 30px;
    border-radius: 50%;
    color: var(--ink-soft);
    z-index: 2;
}
.modal-close:hover { background: rgba(0,0,0,.12); color: var(--ink); }

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}
.modal-tab {
    flex: 1;
    background: transparent;
    border: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    border-bottom: 3px solid transparent;
    transition: all .15s;
}
.modal-tab.active {
    color: var(--green-dark);
    border-bottom-color: var(--green-dark);
    background: var(--white);
}

.modal-pane {
    display: none;
    padding: 20px 24px 24px;
    overflow-y: auto;
}
.modal-pane.active { display: block; }
.modal-pane h2 { margin: 0 0 4px; font-size: 20px; color: var(--ink); }
.modal-sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; }

.modal-error {
    background: #fde8e8;
    color: var(--danger);
    border: 1px solid #f4c0c0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}
.modal-success {
    background: var(--green-soft);
    color: var(--green-dark);
    border: 1px solid var(--green-line);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
}

.modal-foot {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    color: var(--ink-soft);
}
.modal-foot.small { font-size: 11px; line-height: 1.5; }

/* ─────────────── TOAST ─────────────── */
.toast-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 5px;
    font-size: 13px;
    box-shadow: var(--shadow);
    pointer-events: auto;
    animation: slideIn .25s ease;
    min-width: 220px;
    max-width: 360px;
}
.toast.success { background: var(--green-dark); }
.toast.error   { background: var(--danger); }
.toast.warn    { background: var(--warn); }
@keyframes slideIn {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ─────────────── RESPONSIVE ─────────────── */
.d-mobile { display: none !important; }
.d-none-mobile { display: inline; }

.filter-toggle {
    display: none;
    background: var(--white);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 8px 14px;
    border-radius: 5px;
    font-size: 13px;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    .sidebar {
        position: fixed;
        top: 0; left: -280px;
        width: 280px;
        height: 100vh;
        max-height: 100vh;
        z-index: 250;
        border-radius: 0;
        transition: left .25s;
        padding-top: 50px;
    }
    .sidebar.show { left: 0; }
    .sidebar-close {
        display: flex !important;
        position: absolute;
        top: 10px; right: 10px;
        background: rgba(0,0,0,.05);
        border: 0;
        width: 32px; height: 32px;
        border-radius: 50%;
        color: var(--ink);
        align-items: center; justify-content: center;
    }
    .filter-toggle { display: inline-flex; }
    .d-mobile { display: inline-flex !important; }
    .d-none-mobile { display: none; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
    .topbar-link { padding: 8px; }
    .brand-tag { display: none; }
    .search-box { max-width: none; }
}

@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .drawer { width: 100vw; max-width: 100vw; right: -100vw; }
}

/* ─────────────── CARD AGRUPADA (padre con variantes) ─────────────── */
/* ADAPTATIVO: la card decide su ancho segun cant. de variantes (data attribute).
   Los chips usan flexbox real (no grid rigido) y crecen segun contenido. */

.product-card.has-variants {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0;
    padding: 0;
    min-height: 280px;
}
/* span dinamico segun cantidad de variantes (set por JS via data-variantes-count) */
.product-card.has-variants[data-variantes-count="2"],
.product-card.has-variants[data-variantes-count="3"]   { grid-column: span 2; }
.product-card.has-variants[data-variantes-count="4"],
.product-card.has-variants[data-variantes-count="5"]   { grid-column: span 3; }
.product-card.has-variants[data-variantes-count="6"],
.product-card.has-variants[data-variantes-count="7"],
.product-card.has-variants[data-variantes-count="8"]   { grid-column: span 3; }
.product-card.has-variants[data-variantes-count="9"],
.product-card.has-variants[data-variantes-count="10"]  { grid-column: span 4; }

/* Default si JS no seteo el atributo */
.product-card.has-variants:not([data-variantes-count]) { grid-column: span 3; }

.product-card.has-variants .product-img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 280px;
    border-right: 1px solid var(--line);
    font-size: 48px;
    padding: 8px;
}
.product-card.has-variants .product-body {
    padding: 14px 16px 14px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.product-card.has-variants .product-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    min-height: auto;
    margin-bottom: 8px;
}

/* CHIPS: flexbox real, crecen segun contenido del nombre */
.variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin: 6px 0 12px;
}
.variant-chip {
    border: 2px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: var(--white);
    cursor: pointer;
    text-align: center;
    transition: all .15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 90px;
    max-width: 200px;
    flex: 0 1 auto;
    position: relative;
}
.variant-chip:hover {
    border-color: var(--green-line);
    background: var(--green-soft);
}
.variant-chip.active {
    border-color: var(--green-dark);
    background: var(--green-soft);
    box-shadow: 0 0 0 1px var(--green-dark);
}
.variant-chip.active::after {
    content: '✓';
    position: absolute;
    top: 3px; right: 6px;
    color: var(--green-dark);
    font-size: 11px;
    font-weight: 800;
}
.variant-chip.no-stock { opacity: 0.55; }

.variant-chip .vc-img {
    width: 38px; height: 38px;
    border-radius: 4px;
    background: var(--green-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-dark);
    font-weight: 700;
    overflow: hidden;
    font-size: 12px;
    flex-shrink: 0;
}
.variant-chip .vc-img img { width: 100%; height: 100%; object-fit: contain; }

/* CLAVE: el nombre crece segun contenido, NO se trunca, hasta max-width del chip */
.variant-chip .vc-name {
    font-size: 11px;
    line-height: 1.25;
    color: var(--ink);
    font-weight: 600;
    width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-height: 4.5em;        /* hasta 3 lineas, despues se corta visualmente */
    overflow: hidden;
}
.variant-chip .vc-price {
    font-size: 12px;
    font-weight: 800;
    color: var(--green-dark);
    margin-top: 2px;
    white-space: nowrap;
}

.variant-price-big {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    margin-top: auto;
    padding-top: 8px;
}

@media (max-width: 1200px) {
    .product-card.has-variants[data-variantes-count],
    .product-card.has-variants:not([data-variantes-count]) {
        grid-column: span 2;
    }
}
@media (max-width: 900px) {
    .product-card.has-variants[data-variantes-count],
    .product-card.has-variants:not([data-variantes-count]) {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }
    .product-card.has-variants .product-img {
        aspect-ratio: 16 / 9;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}
@media (max-width: 480px) {
    .product-card.has-variants[data-variantes-count],
    .product-card.has-variants:not([data-variantes-count]) {
        grid-column: 1 / -1;
    }
    .variant-chip { min-width: 130px; flex: 1 1 calc(50% - 4px); }
}


/* ═══════════════════════════════════════════════════════════════════════
   PORT LAGO.AR — Hero compacto, breadcrumbs, footer, WhatsApp, back-top
   Agregado en migración lago.ar → app.lago.ar (2026-04-10)
   ═══════════════════════════════════════════════════════════════════════ */

/* ───── HERO STRIP COMPACTO (1 línea, integrado bajo el header) ───── */
.hero-strip {
    background: linear-gradient(135deg, var(--verde-800, #14532d) 0%, var(--verde-600, #16a34a) 100%);
    color: #fff;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.hero-strip-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-strip .hero-stat { display: inline-flex; align-items: center; gap: 5px; }
.hero-strip .hero-stat strong { font-weight: 700; }
.hero-strip .hero-dot { opacity: .5; }
.hero-strip .hero-slogan { font-weight: 500; }
.hero-strip .hero-horarios { opacity: .85; font-size: 12px; }
@media (max-width: 600px) {
    .hero-strip { font-size: 12px; padding: 5px 0; }
    .d-none-mobile { display: none !important; }
}

/* ───── BREADCRUMBS (contextuales, reflejan filtros activos) ───── */
.breadcrumbs {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
    font-size: 13px;
}
.breadcrumbs-list {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumbs-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}
.breadcrumbs-list li:not(:last-child)::after {
    content: "›";
    color: #cbd5e1;
    margin-left: 2px;
}
.breadcrumbs-list a {
    color: #0f5132;
    text-decoration: none;
    cursor: pointer;
}
.breadcrumbs-list a:hover { text-decoration: underline; }
.breadcrumbs-list .bc-current { color: #1f2937; font-weight: 600; }
.breadcrumbs-list .bc-remove {
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #475569;
}
.breadcrumbs-list .bc-remove:hover { background: #fca5a5; color: #7f1d1d; }

/* ───── FOOTER DINÁMICO ───── */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    margin-top: 48px;
    font-size: 13px;
}
.site-footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
}
.footer-col h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-col p {
    margin: 4px 0;
    line-height: 1.5;
    color: #94a3b8;
}
.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
}
.footer-col a:hover { color: #4ade80; }
.footer-slogan { font-style: italic; }
.footer-legal-note { font-size: 11px; color: #64748b; }

.site-footer-legal {
    border-top: 1px solid #1e293b;
    background: #020617;
}
.site-footer-legal-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.legal-text {
    flex: 1;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.legal-text p { margin: 3px 0; }
.legal-text strong { color: #94a3b8; }
.legal-disclaimer { font-size: 10px; opacity: .75; }
.legal-qr img {
    width: 40px;
    height: 40px;
    display: block;
    background: #fff;
    padding: 2px;
    border-radius: 3px;
}
.site-footer-bottom {
    text-align: center;
    padding: 12px;
    border-top: 1px solid #1e293b;
    font-size: 11px;
    color: #475569;
}
@media (max-width: 640px) {
    .site-footer-grid { padding: 24px 16px 20px; gap: 20px; }
    .site-footer-legal-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ───── WHATSAPP FLOTANTE ───── */
.wa-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
}
.wa-float-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .45);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
}
.wa-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(37, 211, 102, .6);
}
@media (max-width: 640px) {
    .wa-float { bottom: 14px; right: 14px; }
    .wa-float-btn { width: 48px; height: 48px; font-size: 24px; }
}

/* ───── BACK TO TOP ───── */
.back-top {
    position: fixed;
    bottom: 85px;
    right: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f5132;
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 997;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.back-top.show {
    opacity: 1;
    pointer-events: auto;
}
.back-top:hover { transform: translateY(-2px); background: #166534; }
@media (max-width: 640px) {
    .back-top { bottom: 74px; right: 16px; width: 36px; height: 36px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   PORT LAGO.AR — Hero compacto, breadcrumbs, footer, WhatsApp, back-top
   Agregado en migración lago.ar → app.lago.ar (2026-04-10)
   ═══════════════════════════════════════════════════════════════════════ */

/* ───── HERO STRIP COMPACTO (1 línea, integrado bajo el header) ───── */
.hero-strip {
    background: linear-gradient(135deg, var(--verde-800, #14532d) 0%, var(--verde-600, #16a34a) 100%);
    color: #fff;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}
.hero-strip-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.hero-strip .hero-stat { display: inline-flex; align-items: center; gap: 5px; }
.hero-strip .hero-stat strong { font-weight: 700; }
.hero-strip .hero-dot { opacity: .5; }
.hero-strip .hero-slogan { font-weight: 500; }
.hero-strip .hero-horarios { opacity: .85; font-size: 12px; }
@media (max-width: 600px) {
    .hero-strip { font-size: 12px; padding: 5px 0; }
    .d-none-mobile { display: none !important; }
}

/* ───── BREADCRUMBS (contextuales, reflejan filtros activos) ───── */
.breadcrumbs {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 0;
    font-size: 13px;
}
.breadcrumbs-list {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.breadcrumbs-list li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
}
.breadcrumbs-list li:not(:last-child)::after {
    content: "›";
    color: #cbd5e1;
    margin-left: 2px;
}
.breadcrumbs-list a {
    color: #0f5132;
    text-decoration: none;
    cursor: pointer;
}
.breadcrumbs-list a:hover { text-decoration: underline; }
.breadcrumbs-list .bc-current { color: #1f2937; font-weight: 600; }
.breadcrumbs-list .bc-remove {
    background: #e2e8f0;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #475569;
}
.breadcrumbs-list .bc-remove:hover { background: #fca5a5; color: #7f1d1d; }

/* ───── FOOTER DINÁMICO ───── */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    margin-top: 48px;
    font-size: 13px;
}
.site-footer-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 28px;
}
.footer-col h4 {
    color: #fff;
    font-size: 14px;
    margin: 0 0 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-col p {
    margin: 4px 0;
    line-height: 1.5;
    color: #94a3b8;
}
.footer-col a {
    color: #cbd5e1;
    text-decoration: none;
}
.footer-col a:hover { color: #4ade80; }
.footer-slogan { font-style: italic; }
.footer-legal-note { font-size: 11px; color: #64748b; }

.site-footer-legal {
    border-top: 1px solid #1e293b;
    background: #020617;
}
.site-footer-legal-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.legal-text {
    flex: 1;
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.legal-text p { margin: 3px 0; }
.legal-text strong { color: #94a3b8; }
.legal-disclaimer { font-size: 10px; opacity: .75; }
.legal-qr img {
    width: 40px;
    height: 40px;
    display: block;
    background: #fff;
    padding: 2px;
    border-radius: 3px;
}
.site-footer-bottom {
    text-align: center;
    padding: 12px;
    border-top: 1px solid #1e293b;
    font-size: 11px;
    color: #475569;
}
@media (max-width: 640px) {
    .site-footer-grid { padding: 24px 16px 20px; gap: 20px; }
    .site-footer-legal-inner { flex-direction: column; align-items: center; text-align: center; }
}

/* ───── WHATSAPP FLOTANTE ───── */
.wa-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 998;
}
.wa-float-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 14px rgba(37, 211, 102, .45);
    transition: transform .15s ease, box-shadow .15s ease;
    text-decoration: none;
}
.wa-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(37, 211, 102, .6);
}
@media (max-width: 640px) {
    .wa-float { bottom: 14px; right: 14px; }
    .wa-float-btn { width: 48px; height: 48px; font-size: 24px; }
}

/* ───── BACK TO TOP ───── */
.back-top {
    position: fixed;
    bottom: 85px;
    right: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f5132;
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 997;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.back-top.show {
    opacity: 1;
    pointer-events: auto;
}
.back-top:hover { transform: translateY(-2px); background: #166534; }
@media (max-width: 640px) {
    .back-top { bottom: 74px; right: 16px; width: 36px; height: 36px; }
}


/* ───── LINKS EXTERNOS EN TOPBAR (Corralon, etc.) ───── */
.topbar-links-external {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-right: 8px;
}
.topbar-link-ext {
    padding: 6px 12px;
    border-radius: 6px;
    background: #f0fdf4;
    color: #0f5132;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #bbf7d0;
    transition: all .15s;
    white-space: nowrap;
}
.topbar-link-ext:hover {
    background: #0f5132;
    color: #fff;
    border-color: #0f5132;
}
@media (max-width: 768px) {
    .topbar-links-external { display: none; }
}
