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

:root {
    --primary: #0f172a;
    --accent: #3b82f6;
    --accent2: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f8fafc;
    --bg2: #f1f5f9;
    --white: #ffffff;
    --text: #1e293b;
    --text2: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Outfit', sans-serif;
    --nav-h: 68px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
input, button { font-family: var(--font); }

.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    transition: box-shadow 0.3s;
}

.header.scrolled {
    box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5em;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.5px;
}

.logo-icon { font-size: 1.1em; }
.logo-accent { color: var(--accent); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    font-size: 0.95em;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-cart {
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    position: relative;
}

.btn-cart:hover { background: #2563eb; transform: translateY(-1px); }

.cart-count {
    background: var(--warning);
    color: var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.nav-overlay.show { display: block; }

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    padding: var(--nav-h) 24px 60px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-block;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.3);
    color: var(--accent2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero-title {
    font-size: clamp(2.8em, 7vw, 5.5em);
    font-weight: 800;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1em, 2.5vw, 1.2em);
    color: rgba(255,255,255,0.65);
    max-width: 520px;
    margin-bottom: 36px;
    font-weight: 400;
    line-height: 1.7;
}

.hero-btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: var(--accent);
    color: var(--white);
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1em;
    transition: all 0.2s;
    display: inline-block;
}

.btn-hero-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59,130,246,0.4);
}

.btn-hero-wa {
    background: rgba(255,255,255,0.08);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1em;
    transition: all 0.2s;
    display: inline-block;
}

.btn-hero-wa:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.hero-visual {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.06;
    font-size: 18em;
    line-height: 1;
    pointer-events: none;
}

/* ===== FILTROS ===== */
.filtros-section {
    background: var(--white);
    padding: 40px 0 20px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: var(--nav-h);
    z-index: 100;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-title {
    font-size: clamp(1.5em, 3vw, 2em);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.section-title.center { text-align: center; }

.search-wrap input {
    background: var(--bg2);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-size: 0.95em;
    width: 280px;
    transition: all 0.2s;
    outline: none;
}

.search-wrap input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
}

.categorias-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 4px;
}

.chip {
    background: var(--bg2);
    border: 2px solid var(--border);
    color: var(--text2);
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font);
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

/* ===== PRODUCTOS ===== */
.productos-section { padding: 40px 0 60px; }

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.producto-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    transition: all 0.25s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.producto-img-wrap {
    position: relative;
    padding-top: 75%;
    background: var(--bg2);
    overflow: hidden;
}

.producto-img-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.producto-card:hover .producto-img-wrap img { transform: scale(1.05); }

.producto-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-nuevo { background: #dcfce7; color: #166534; }
.badge-oferta { background: #fee2e2; color: #991b1b; }
.badge-destacado { background: #fef3c7; color: #92400e; }

.producto-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.producto-cat {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.producto-nombre {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.producto-precios {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.precio-principal {
    font-size: 1.3em;
    font-weight: 800;
    color: var(--accent);
}

.precio-antes {
    font-size: 0.85em;
    color: var(--text2);
    text-decoration: line-through;
}

.precio-mayoreo {
    font-size: 0.78em;
    color: var(--success);
    font-weight: 600;
}

.btn-agregar {
    margin-top: 12px;
    background: var(--accent);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    font-family: var(--font);
}

.btn-agregar:hover { background: #2563eb; }

/* ===== ESTADOS ===== */
.loading-state, .empty-state, .error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text2);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== BANNER MAYOREO ===== */
.banner-mayoreo {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    padding: 40px 0;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.banner-icon { font-size: 2.5em; flex-shrink: 0; }

.banner-content h3 {
    color: var(--white);
    font-size: 1.3em;
    font-weight: 700;
}

.banner-content p {
    color: rgba(255,255,255,0.85);
    font-size: 0.95em;
}

.btn-banner {
    margin-left: auto;
    background: var(--white);
    color: var(--accent);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-banner:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* ===== CONTACTO ===== */
.contacto-section { padding: 70px 0; background: var(--white); }

.contacto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 36px;
}

.contacto-card {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: all 0.2s;
    display: block;
}

.contacto-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.contacto-icon { font-size: 2em; margin-bottom: 10px; }
.contacto-card h4 { font-size: 1em; font-weight: 700; margin-bottom: 4px; }
.contacto-card p { color: var(--text2); font-size: 0.9em; }

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 40px 0 20px;
}

.footer-top {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.footer-top p { font-size: 0.9em; }
.footer-bottom { font-size: 0.82em; text-align: center; }

/* ===== CARRITO PANEL ===== */
.carrito-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.carrito-overlay.show { display: block; }

.carrito-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    max-width: 100vw;
    height: 100vh;
    background: var(--white);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transition: right 0.35s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.2);
}

.carrito-panel.open { right: 0; }

.carrito-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--primary);
    color: var(--white);
}

.carrito-header h3 { font-size: 1.1em; font-weight: 700; }

.carrito-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.carrito-close:hover { background: rgba(255,255,255,0.2); }

.carrito-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.carrito-empty {
    text-align: center;
    color: var(--text2);
    padding: 40px;
    font-size: 0.95em;
}

.carrito-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    align-items: center;
}

.carrito-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg2);
    flex-shrink: 0;
}

.carrito-item-info { flex: 1; min-width: 0; }
.carrito-item-nombre { font-weight: 600; font-size: 0.88em; margin-bottom: 4px; }
.carrito-item-precio { color: var(--accent); font-weight: 700; font-size: 0.95em; }

.carrito-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 700;
    transition: all 0.15s;
    font-family: var(--font);
}

.qty-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--white); }
.qty-num { font-weight: 700; font-size: 0.95em; min-width: 20px; text-align: center; }

.carrito-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--bg2);
}

.carrito-totales { margin-bottom: 16px; }

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9em;
}

.total-row.descuento { color: var(--success); font-weight: 600; }

.total-row.total-final {
    font-size: 1.15em;
    font-weight: 800;
    color: var(--accent);
    padding-top: 8px;
    border-top: 2px solid var(--border);
    margin-top: 4px;
}

.datos-entrega { margin-bottom: 14px; }
.datos-entrega h4 { font-size: 0.9em; font-weight: 700; margin-bottom: 10px; }

.datos-entrega input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.88em;
    margin-bottom: 8px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
    font-family: var(--font);
}

.datos-entrega input:focus { border-color: var(--accent); }

.btn-pedido {
    width: 100%;
    background: #25d366;
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
}

.btn-pedido:hover { background: #20bd5a; transform: translateY(-1px); }

/* ===== MODAL PRODUCTO ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
}

.modal-overlay.show { display: block; }

.modal-producto {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 3001;
    padding: 28px;
    transition: transform 0.25s;
    box-shadow: var(--shadow-lg);
}

.modal-producto.show {
    display: block;
    transform: translate(-50%, -50%) scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg2);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.15s;
}

.modal-close:hover { background: var(--border); }

/* ===== RESPONSIVE MÓVIL ===== */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 24px 40px;
        gap: 4px;
        z-index: 999;
        transition: left 0.35s cubic-bezier(0.4,0,0.2,1);
        border-right: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links.open { left: 0; }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        font-size: 1.05em;
    }

    .hero { min-height: auto; padding: 100px 0px 60px; }
    .hero-visual { display: none; }
    .hero-content { padding: 0 20px; }
    .hero-btns { flex-direction: column; align-items: flex-start; }
    .btn-hero-primary, .btn-hero-wa { width: 100%; text-align: center; }

    .filtros-section { padding: 24px 0 16px; position: relative; top: 0; }
    .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .search-wrap input { width: 100%; }

    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .producto-body { padding: 12px; }
    .producto-nombre { font-size: 0.88em; }
    .precio-principal { font-size: 1.1em; }

    .banner-content { flex-direction: column; text-align: center; }
    .btn-banner { margin: 0 auto; }

    .carrito-panel { width: 100%; right: -100%; }

    .contacto-grid { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
    .productos-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.4em; }
}

@media (min-width: 1024px) {
    .productos-grid { grid-template-columns: repeat(4, 1fr); }
}
