﻿body {
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --primary: #4CAF50;
    --primary-light: #e8f5e9;
    --text: #1a1a1a;
    --muted: #888;
    --bg: #f5f5f5;
    --card: #fff;
    --border: #e0e0e0;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(0,0,0,.08);
}

body {
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    background: var(--bg);
    color: var(--text)
}

/* ─── HEADER ─── */
.header {
    background: var(--primary);
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.2)
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px
}

.logo-circle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    overflow: hidden
}

    .logo-circle img {
        width: 44px;
        height: 44px;
        object-fit: cover
    }

.negocio-nombre {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.3px
}

.cart-btn {
    position: relative;
    background: #fff;
    border: 1.5px solid rgba(0,0,0,.2);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    color: var(--primary);
    font-size: 22px;
    transition: .2s;
    box-shadow: 0 2px 6px rgba(0,0,0,.12)
}

    .cart-btn:active {
        background: #f0f0f0;
        transform: scale(.95)
    }

.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ff5252;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700
}

.search-wrap {
    display: flex;
    gap: 8px
}

    .search-wrap input {
        flex: 1;
        padding: 11px 16px;
        border-radius: 12px;
        border: none;
        font-size: 14px;
        outline: none;
        background: #fff;
        color: #1a1a1a
    }

        .search-wrap input::placeholder {
            color: #aaa
        }

    .search-wrap button {
        background: #fff;
        border: 1.5px solid rgba(0,0,0,.2);
        border-radius: 12px;
        padding: 11px 16px;
        cursor: pointer;
        color: var(--primary);
        font-size: 16px;
        transition: .2s;
        box-shadow: 0 2px 6px rgba(0,0,0,.12)
    }

        .search-wrap button:active {
            background: #f0f0f0;
            transform: scale(.95)
        }

/* ─── CHIPS ─── */
.chips-wrap {
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    background: #fff;
    border-bottom: 1px solid var(--border)
}

    .chips-wrap::-webkit-scrollbar {
        display: none
    }

.chip {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: .2s;
    flex-shrink: 0
}

    .chip:active {
        transform: scale(.96)
    }

    .chip.active {
        background: var(--primary);
        color: #fff;
        border-color: var(--primary);
        box-shadow: 0 2px 8px rgba(0,0,0,.15)
    }

/* ─── GRID ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px
}

.grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px
}

@media(min-width:540px) {
    .grid {
        grid-template-columns: repeat(3,1fr)
    }
}

@media(min-width:800px) {
    .grid {
        grid-template-columns: repeat(4,1fr)
    }
}

@media(min-width:1100px) {
    .grid {
        grid-template-columns: repeat(5,1fr)
    }
}

/* ─── CARD ─── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .2s,box-shadow .2s;
    display: flex;
    flex-direction: column
}

    .card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px rgba(0,0,0,.12)
    }

    .card:active {
        transform: scale(.98)
    }

.card-img-wrap {
    position: relative;
    overflow: hidden
}

.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
    display: block;
    transition: transform .3s
}

.card:hover .card-img {
    transform: scale(1.04)
}

.card-img-placeholder {
    width: 100%;
    height: 160px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary)
}

.cat-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.2)
}

.gal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2196F3;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,.2)
}

.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1
}

.card-nombre {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    color: var(--text)
}

.card-meta {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.card-precio {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    margin-top: auto
}

.card-costo {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px
}

.btn-agregar {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    background: var(--primary-light);
    border: none;
    border-radius: 10px;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: .2s
}

    .btn-agregar:hover {
        background: var(--primary);
        color: #fff
    }

    .btn-agregar:active {
        transform: scale(.97)
    }

.btn-en-carrito {
    background: var(--primary) !important;
    color: #fff !important
}

/* ─── LOADER / EMPTY ─── */
.loader {
    text-align: center;
    padding: 32px;
    color: var(--muted)
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 8px
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted)
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px
}

/* ─── OVERLAY / MODAL ─── */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px)
}

    .overlay.show {
        display: flex
    }

.modal {
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom,16px)
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 12px auto 0
}

.modal-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #f0f0f0
}

.galeria {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    scrollbar-width: none
}

    .galeria::-webkit-scrollbar {
        display: none
    }

.gal-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: .2s;
    opacity: .7
}

    .gal-thumb.active {
        border-color: var(--primary);
        opacity: 1
    }

.modal-body {
    padding: 18px 20px
}

.modal-nombre {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.3
}

.modal-meta {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px
}

.modal-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 16px
}

.precios-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px
}

.precio-box {
    background: var(--bg);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    border: 1px solid var(--border)
}

.precio-lbl {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px
}

.precio-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary)
}

    .precio-val.costo {
        color: var(--text);
        font-size: 16px
    }

.btn-modal-add {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 4px 12px rgba(0,0,0,.15)
}

    .btn-modal-add:active {
        transform: scale(.98);
        opacity: .9
    }

/* ─── CARRITO ─── */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 300;
    display: none;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(2px)
}

    .cart-overlay.show {
        display: flex
    }

.cart-panel {
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom,16px)
}

.cart-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border)
}

    .cart-header h3 {
        font-size: 17px;
        font-weight: 700
    }

.btn-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s
}

    .btn-close:hover {
        background: #e0e0e0
    }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border)
}

    .cart-item img {
        width: 56px;
        height: 56px;
        object-fit: cover;
        border-radius: 10px;
        background: #f0f0f0;
        flex-shrink: 0
    }

.ci-info {
    flex: 1;
    min-width: 0
}

.ci-nombre {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px
}

.ci-sku {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px
}

.ci-precio {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700
}

.ci-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px
}

    .ci-qty button {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        border: 1.5px solid var(--border);
        background: #fff;
        cursor: pointer;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        transition: .2s
    }

        .ci-qty button:active {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary)
        }

    .ci-qty span {
        font-size: 15px;
        font-weight: 700;
        min-width: 24px;
        text-align: center
    }

.ci-del {
    background: none;
    border: none;
    color: #ff5252;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    opacity: .7;
    transition: .2s
}

    .ci-del:hover {
        opacity: 1
    }

.cart-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border)
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px
}

    .cart-total span {
        font-size: 15px;
        font-weight: 600;
        color: var(--muted)
    }

    .cart-total .total-val {
        font-size: 22px;
        color: var(--primary);
        font-weight: 800
    }

.btn-wa {
    width: 100%;
    padding: 15px;
    background: #25D366;
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: .2s;
    box-shadow: 0 4px 12px rgba(37,211,102,.3)
}

    .btn-wa:active {
        opacity: .9;
        transform: scale(.98)
    }

.cart-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted)
}

.cart-empty-icon {
    font-size: 48px;
    margin-bottom: 12px
}

/* ─── 404 ─── */
.notfound {
    text-align: center;
    padding: 80px 20px
}

    .notfound h1 {
        font-size: 72px;
        color: var(--primary);
        font-weight: 900
    }

    .notfound p {
        color: var(--muted);
        margin-top: 8px;
        font-size: 16px
    }


/* ─── FOOTER ─── */
.footer {
    background: var(--primary);
    color: #fff;
    padding: 20px 20px 16px;
    margin-top: 24px
}

.footer-negocio {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -.3px
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center
}


.footer-redes {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px
}

.footer-red {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .2s;
    flex-shrink: 0
}

    .footer-red:active {
        transform: scale(.96)
    }

    .footer-red svg {
        flex-shrink: 0
    }

    .footer-red.wa {
        background: #25D366;
        color: #fff;
        box-shadow: 0 4px 12px rgba(37,211,102,.3)
    }

    .footer-red.fb {
        background: #1877F2;
        color: #fff;
        box-shadow: 0 4px 12px rgba(24,119,242,.3)
    }

    .footer-red.ig {
        background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
        color: #fff;
        box-shadow: 0 4px 12px rgba(220,39,67,.3)
    }

.footer-copy {
    font-size: 12px;
    color: rgba(255,255,255,.7);
    margin-top: 4px
}