/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #F4F5F8;
    --text-main: #1A1A1A;
    --text-muted: #666666;
    --primary: #2D1B8E;
    --primary-dark: #1e1260;
    --primary-light: #F0EEF9;
    --secondary: #F0A500;
    --secondary-dark: #C8820A;
    --secondary-light: #FFF8E6;
    --border-light: transparent;
    --white: #FFFFFF;
    --green: #007A00;
    --green-light: #E3F5E3;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.4;
}

a { text-decoration: none; }

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== HEADER ===== */
.main-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border-bottom: 1px solid var(--border-light);
}

.header-container {
    padding-top: 10px;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo a {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo span { color: var(--secondary); }

.search-bar {
    flex: 1;
    display: flex;
    max-width: 800px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    overflow: hidden;
    height: 40px;
}

.search-bar input {
    flex: 1;
    padding: 0 16px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text-main);
}

.search-bar button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0 24px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover { background: var(--primary-dark); }

.nav-actions { display: flex; gap: 8px; }

.btn-outline {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    transition: background 0.2s;
}

.btn-outline:hover { background: #f5f5f5; }

.btn-primary {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    background: var(--secondary);
    color: #1A1A1A;
    border: none;
    cursor: pointer;
    transition: transform 0.15s;
}

.btn-primary:hover { transform: translateY(-1px); }

/* ===== QUICK STATS ===== */
.quick-stats {
    background: var(--white);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.stats-flex {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== CONTENEDORES ANIDADOS ===== */
.outer-box {
    background: var(--white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.box-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-header h2::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
    display: inline-block;
}

/* Excepción: sección de ofertas tiene emoji en el título */
.offres-box .box-header h2::before { display: none; }

.ver-todo {
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===== HERO ===== */
.hero-layout {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

/* ===== SIDEBAR ===== */
.sidebar-menu {
    width: 240px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    position: relative;
}

.sidebar-title {
    padding: 12px 16px;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-light);
    background: #FAFAFA;
    border-radius: 8px 8px 0 0;
}

.cat-list { list-style: none; padding: 4px 0; }

.cat-link {
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.cat-link span:first-child {
    margin-right: 10px;
    font-size: 0.85rem;
    opacity: 0.65;
}

.cat-link .arrow {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 1rem;
}

.cat-item:hover .cat-link {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

/* ===== MEGA MENÚ ===== */
.mega-menu {
    position: absolute;
    left: 100%;
    top: 0;
    width: 500px;
    min-height: 100%;
    background: var(--white);
    box-shadow: 4px 4px 20px rgba(0,0,0,0.1);
    border-left: 2px solid var(--primary);
    padding: 20px;
    display: none;
    z-index: 100;
    border-radius: 0 8px 8px 0;
}

.cat-item:hover .mega-menu { display: block; }

.mega-menu h4 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.mega-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.mega-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-main);
    gap: 6px;
    transition: color 0.15s, transform 0.15s;
}

.mega-grid a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.icon-circle {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 4px;
    border: 1px solid var(--border-light);
    transition: background 0.15s, border-color 0.15s;
}

.mega-grid a:hover .icon-circle {
    background: var(--secondary-light);
    border-color: var(--secondary);
}

/* ===== HERO BANNER ===== */
.hero-banner {
    flex: 1;
    background: url('https://images.unsplash.com/photo-1586528116311-ad8dd3c8310d?q=80&w=1000') center/cover;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    min-height: 360px;
}

.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(45,27,142,0.95) 0%, rgba(45,27,142,0.4) 70%, rgba(45,27,142,0.05) 100%);
}

.banner-content {
    position: relative;
    z-index: 2;
    padding: 44px 40px;
    color: var(--white);
    max-width: 500px;
}

.banner-badge {
    display: inline-block;
    background: rgba(240,165,0,0.2);
    border: 1px solid rgba(240,165,0,0.5);
    color: var(--secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.3px;
}

.banner-content h2 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
}

.banner-content p {
    font-size: 0.9rem;
    opacity: 0.85;
    line-height: 1.6;
    margin-bottom: 4px;
}

.banner-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.btn-banner-outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.55);
    padding: 8px 18px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 12px;
}

.btn-banner-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.banner-trust {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 4px;
}

.banner-trust span {
    font-size: 0.74rem;
    opacity: 0.8;
}

/* ===== TRUST BADGES ===== */
.trust-outer { padding: 14px; }

.trust-badges {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.trust-badge {
    background: var(--bg-color);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color 0.2s;
}

.trust-badge:hover { border-color: var(--primary); }

.trust-icon { font-size: 20px; flex-shrink: 0; }

.trust-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.trust-desc { font-size: 0.7rem; color: var(--text-muted); }

/* ===== OFERTAS ===== */
.deal-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.deal-slider::-webkit-scrollbar { display: none; }

.deal-card {
    min-width: 148px;
    background: var(--bg-color);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s;
}

.deal-card:hover { border-color: var(--primary); }

.deal-img {
    height: 110px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    background: var(--white);
    border-radius: 6px;
    padding: 6px;
}

.deal-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: darken;
}

/* PRECIO OFERTA — dorado Pymay, no rojo Alibaba */
.deal-price {
    color: var(--secondary-dark);
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.deal-price::before {
    content: '↓';
    font-size: 0.65rem;
    color: var(--secondary-dark);
    background: var(--secondary-light);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.deal-moq { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* ===== PROMO BANNERS ===== */
.promo-grid {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
}

.promo-banner {
    flex: 1;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    height: 160px;
    border: 1px solid var(--border-light);
}

/* Banner con colores de marca Pymay */
.banner-orange {
    background: linear-gradient(90deg, #FFF8E6 0%, var(--white) 100%);
    border-color: #FFE8B0;
}

.banner-purple {
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--white) 100%);
    border-color: #D8D3F5;
}

.promo-info {
    padding: 20px;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.promo-info h3 {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-main);
}

.promo-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* HIGHLIGHT — dorado Pymay, no rojo */
.highlight-text { color: var(--secondary-dark); }

/* BADGE PROMO — dorado Pymay */
.promo-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--secondary-dark);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.promo-carousel {
    display: flex;
    gap: 10px;
    padding: 14px;
    overflow-x: auto;
    flex: 1;
    align-items: center;
}

.promo-carousel::-webkit-scrollbar { display: none; }

.mini-card {
    background: var(--white);
    border-radius: 6px;
    padding: 8px;
    min-width: 100px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: border-color 0.15s;
}

.mini-card:hover { border-color: var(--primary); }

.mini-card img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    mix-blend-mode: darken;
    margin-bottom: 4px;
}

/* PRECIO MINI CARD — dorado Pymay */
.mc-price {
    font-weight: 800;
    color: var(--secondary-dark);
    font-size: 0.88rem;
}

/* ===== PRODUCTOS — 5 columnas PC ===== */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.prod-card {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.prod-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.prod-img {
    height: 150px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    background: #FAFAFA;
}

.prod-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.prod-card:hover .prod-img img { transform: scale(1.04); }

.prod-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.prod-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.prod-price-tier { margin-bottom: 2px; }

/* PRECIO PRINCIPAL — morado Pymay */
.price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.unit { font-size: 0.75rem; color: var(--text-muted); }

.prod-min {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-light);
}

.prod-supplier {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

/* BADGE SUNAT — verde confianza */
.badge-sunat {
    font-size: 0.65rem;
    color: var(--green);
    font-weight: 700;
    background: var(--green-light);
    padding: 2px 5px;
    border-radius: 4px;
    align-self: flex-start;
}

.supplier-loc { font-size: 0.7rem; color: var(--text-muted); }

/* ===== CTA VENDEDORES ===== */
.cta-vendedores {
    background: var(--primary);
    border-radius: 8px;
    padding: 2rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cta-text { flex: 1; min-width: 180px; }

.cta-text h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 6px;
}

.cta-text p {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
}

.cta-perks { display: flex; flex-direction: column; gap: 5px; }

.cta-perks span {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.88);
    font-weight: 500;
}

.btn-cta {
    background: var(--secondary);
    color: #1A1A1A;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: transform 0.2s;
}

.btn-cta:hover { transform: scale(1.02); }

/* ===== FOOTER ===== */
footer {
    background: var(--white);
    border-top: 1px solid var(--border-light);
    padding: 36px 0 16px;
    margin-top: 8px;
}

.footer-inner {
    display: flex;
    gap: 3rem;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.footer-brand { flex: 1; min-width: 200px; }

.footer-brand p {
    color: var(--text-muted);
    margin-top: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-links { display: flex; gap: 3rem; flex-wrap: wrap; }

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.footer-col a {
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
    color: #999;
    font-size: 0.76rem;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

/* ===== RESPONSIVE MÓVIL ===== */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }

    .container { padding: 0 8px; }

    .header-container { flex-wrap: wrap; gap: 10px; padding: 10px 8px; }
    .logo a { font-size: 1.4rem; }
    .nav-actions { gap: 6px; }
    .btn-outline, .btn-primary { padding: 6px 12px; font-size: 0.8rem; }
    .search-bar { order: 3; min-width: 100%; height: 38px; }

    .outer-box { padding: 12px; margin-bottom: 12px; border-radius: 6px; }
    .box-header h2 { font-size: 1rem; }

    .hero-banner { border-radius: 6px; min-height: 220px; }
    .banner-content { padding: 20px; }
    .banner-content h2 { font-size: 1.4rem; }
    .banner-btns { flex-wrap: wrap; gap: 8px; }

    .trust-badges { grid-template-columns: repeat(2, 1fr); }

    .promo-grid { flex-direction: column; gap: 10px; margin-bottom: 12px; }
    .promo-banner { height: auto; flex-direction: column; }
    .promo-info { padding: 12px; min-width: 100%; border-bottom: 1px solid rgba(0,0,0,0.05); }

    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

    .prod-card { border-radius: 6px; }
    .prod-img { height: 130px; padding: 6px; }
    .prod-body { padding: 8px; }
    .prod-name { font-size: 0.75rem; margin-bottom: 4px; }
    .price { font-size: 1rem; }
    .prod-min { font-size: 0.65rem; margin-bottom: 6px; padding-bottom: 6px; }

    .deal-card { min-width: 130px; padding: 8px; }
    .deal-img { height: 95px; }
    .deal-price { font-size: 1rem; }

    .cta-vendedores { flex-direction: column; gap: 1rem; padding: 1.4rem; }
    .cta-text h2 { font-size: 1rem; }

    .footer-inner { flex-direction: column; gap: 1.5rem; }
    .footer-links { gap: 1.5rem; }
}