:root {
    /* 🌿 Paleta Identidad */
    --primary: #27ae60;         /* Verde IG */
    --primary-dark: #1e8449;
    --primary-soft: rgba(39, 174, 96, 0.1);
    
    /* 🌚 Colores de Interfaz */
    --header-bg: #1a1c1e;       /* Negro mate profesional */
    --bg-body: #f0f2f5;         /* Gris LinkedIn */
    --white: #ffffff;
    --text-main: #1c1e21;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    
    /* 📐 Medidas */
    --header-height: 72px;
    --radius: 10px;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
* a { text-decoration: none; }

/* --- HEADER --- */
.main-header {
    background: var(--header-bg);
    height: var(--header-height);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-container {
    max-width: 1300px;
    width: 95%;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Marca */
.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img { height: 42px; width: auto; }

.logo-text-group { display: flex; flex-direction: column; }
.brand-name { color: var(--white); font-size: 1.1rem; font-weight: 800; }
.brand-name strong { color: var(--primary); }
.brand-sub { color: var(--text-muted); font-size: 0.7rem; letter-spacing: 2px; font-weight: 400; }

/* Buscador Central */
.search-bar { flex: 1; max-width: 550px; margin: 0 2rem; }

.search-input-wrapper {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 0 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.2);
}

.search-icon { font-size: 0.9rem; margin-right: 8px; }

.search-bar input {
    background: transparent;
    border: none;
    padding: 10px 0;
    width: 100%;
    color: var(--white);
    outline: none;
    font-size: 0.9rem;
}

.search-input-wrapper:focus-within input { color: var(--white); }

/* Acciones */
.header-actions { display: flex; align-items: center; gap: 1.5rem; }

.nav-link-admin {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}
.nav-link-admin:hover { color: var(--primary); }

.cart-btn {
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    transition: transform 0.2s;
}

.cart-btn:hover { transform: translateY(-2px); background: var(--primary-dark); }

.cart-badge {
    background: rgba(0,0,0,0.2);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* User Menu */
.user-menu { position: relative; }

.user-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar-circle {
    width: 32px; height: 32px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.9rem;
    border: 2px solid rgba(255,255,255,0.1);
}

.arrow { color: var(--text-muted); font-size: 0.6rem; }

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    background: var(--white);
    min-width: 240px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0; visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.user-menu:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-info { padding: 15px; display: flex; flex-direction: column; }
.dropdown-info strong { font-size: 0.9rem; color: var(--text-main); }
.dropdown-info small { font-size: 0.75rem; color: var(--text-muted); }

.dropdown-menu a {
    display: block; padding: 12px 15px;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: background 0.2s;
}
.dropdown-menu a:hover { background: var(--primary-soft); color: var(--primary); }

.btn-logout {
    width: 100%; text-align: left; border: none; background: none;
    padding: 12px 15px; color: #e74c3c; cursor: pointer; font-weight: 600;
}

/* Wrapper */
.main-wrapper { margin-top: var(--header-height); padding: 5px 0; flex: 1 0 auto; }


/* 👤 Contenedor del Menú */
.user-menu {
    position: relative;
    display: inline-block;
}

/* 🔘 Botón Disparador */
.user-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 50px; /* Estilo píldora */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.user-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* 🟢 Círculo del Avatar */
.avatar-circle {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.3);
}

.arrow {
    font-size: 0.6rem;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.user-menu:hover .arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

/* 📂 El Dropdown (La magia) */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
}

.user-menu:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ✨ Links del Menú */
.dropdown-menu a, .logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.dropdown-menu hr {
    border: 0;
    border-top: 1px solid #f1f5f9;
    margin: 8px 0;
}

/* 🚪 Botón Salir */
.logout-btn {
    background: transparent;
    border: none;
    color: #e11d48; /* Rojo sutil */
    cursor: pointer;
    text-align: left;
}

.logout-btn:hover {
    background: #fff1f2;
    color: #be123c;
}

/* ESTILO DEL FOOTER */
.main-footer {
    background: var(--header-bg); /* El mismo negro mate del header */
    color: #cbd5e1;
    padding: 3rem 0 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-container {
    max-width: 1250px;
    width: 90%;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    color: var(--white);
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary); /* Línea verde esmeralda */
}

/* Marca */
.footer-logo { color: var(--white); font-weight: 800; font-size: 1.3rem; margin-top: 0; }
.footer-logo strong { color: var(--primary); }
.footer-desc { line-height: 1.6; color: #94a3b8; }
.cuit-tag { 
    background: rgba(255,255,255,0.05); 
    padding: 4px 10px; 
    border-radius: 6px; 
    font-size: 0.75rem; 
    border: 1px solid rgba(255,255,255,0.1); 
}

/* Links */
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #94a3b8; transition: 0.3s; }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }

/* Contacto */
.footer-contact { list-style: none; padding: 0; }
.footer-contact li { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }

/* Bottom */
.footer-bottom {
    max-width: 1250px;
    width: 90%;
    margin: 2rem auto 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 10px;
}

.dev-tag { font-style: italic; opacity: 0.7; }

.dev-tag a {
    color: var(--primary); /* Usamos el verde esmeralda */
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent; 
}

.dev-tag a:hover {
    color: var(--white);
    border-bottom: 1px solid var(--primary);
    opacity: 1;
}

/* Estilo para Productos Destacados */
.featured-card {
    border: 2px solid var(--primary) !important; /* El verde esmeralda */
    background: linear-gradient(180deg, #ffffff 0%, var(--primary-soft) 100%) !important;
    transform: scale(1.02); /* Un toque más grande */
    box-shadow: 0 10px 25px -5px rgba(39, 174, 96, 0.2) !important;
}

/* Badge especial para la esquina */
.featured-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Título de la sección */
.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 2rem 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary);
    border-radius: 4px;
}

.footer-wa-link {
    color: #cbd5e1 !important; /* Forzamos el gris claro del footer */
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-wa-link:hover, 
.footer-wa-link:visited:hover {
    color: var(--primary) !important; /* Verde esmeralda al pasar el mouse */
    transform: translateX(5px);
}

.footer-wa-link:visited {
    color: #cbd5e1; /* Evitamos que se ponga violeta si ya entraste */
}

.footer-wa-link small {
    font-size: 0.7rem;
    opacity: 0.8;
    background: rgba(39, 174, 96, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}
.bx-icons a {
    color: #94a3b8;
    font-size: 20pt;
    opacity: 0.5;
    transition: all 0.3s ease-in-out;
}
.bx-icons a:hover {
    opacity: 1;
    transform: translateY(-3px);
}




/* ============== VERSION MOVIL =============== */
/* Responsive */
@media (max-width: 768px) {
    .footer-bottom { justify-content: center; text-align: center; }
}

/* --- RESPONSIVE HEADER --- */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap; /* Permite que los elementos bajen de línea */
        gap: 10px;
        padding: 10px;
    }

    .logo-wrapper { order: 1; } /* Logo arriba izquierda */
    .header-actions { order: 2; } /* Carrito/User arriba derecha */
    
    .search-bar { 
        order: 3; /* El buscador baja a una segunda línea solo */
        width: 100%; 
        margin: 5px 0;
    }

    .brand-name { font-size: 1rem; } /* Achicamos texto de marca */
    .cart-text { display: none; } /* En celu, solo mostramos el icono del carrito 🛒 */
}

/* --- SIDEBAR MÓVIL --- */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px; /* Escondido a la izquierda */
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 10000;
    transition: 0.3s ease-all;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.sidebar.open { left: 0; } /* Se desliza hacia adentro */

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 9999;
}
.sidebar-overlay.active { display: block; }

.mobile-menu-toggle {
    display: none; /* Oculto en PC */
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.5rem;
    z-index: 999;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Estilos internos de la Sidebar */
.sidebar-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.sidebar-nav { padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.sidebar-nav a { text-decoration: none; color: #333; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.close-sidebar { background: none; border: none; font-size: 1.5rem; color: #999; }


/* Cuando el buscador esta bloqueado o cerrado en otras areas */

/* Estado cuando el buscador está deshabilitado */
.search-locked {
    background: rgba(30, 41, 59, 0.03) !important; /* Más transparente */
    border-color: rgba(81, 108, 152, 0.347) !important;
    cursor: not-allowed;
    box-shadow: none !important;
}

.search-locked input {
    cursor: not-allowed;
    color: #94a3b8; /* Texto grisáceo */
}

.search-locked .search-icon {
    opacity: 0.3;
}

/* Animación sutil si intentan hacer click en el bloqueado */
.search-locked:active {
    animation: shake 0.2s ease-in-out;
}


@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}



@media (max-width: 500px) {
    .search-bar {
        margin-top: 3px;
    }
    .search-input-wrapper {
        padding: 10px 15px;
    }
    /* --- BUSCADOR FLOTANTE Y VISIBLE --- */
    .search-input-wrapper {
        background: rgba(30, 41, 59, 0.05); /* Un gris azulado muy suave */
        border: 1.5px solid rgba(30, 41, 59, 0.1);
        backdrop-filter: blur(8px); /* Efecto esmerilado */
        border-radius: 0 0 10px 10px;

    }

    .search-input-wrapper:focus-within {
        background: rgba(30, 41, 59, 0.08);
        border-color: var(--primary);
    }

    .search-input-wrapper input {
        border: none;
        background: transparent;
        width: 100%;
        padding: 5px 10px;
        outline: none;
        font-size: 0.95rem;
        color: #1e293b;
    }

    .search-icon {
        font-size: 1.1rem;
        opacity: 0.5;
    }

    /* Estilo para el buscador deshabilitado (no logueado) */
    .search-disabled {
        background: #f8fafc;
        opacity: 0.7;
        cursor: not-allowed;
    }
    .dropdown-header-label {
        padding: 8px 15px;
        font-size: 0.65rem;
        text-transform: uppercase;
        font-weight: 800;
        color: #94a3b8;
        letter-spacing: 1px;
    }

    .catalog-layout {
        /* Reducimos el padding superior que estaba en 2rem */
        padding: 0.5rem !important; 
    }

    .main-section-title {
        /* Pegamos más el título al buscador */
        margin-top: 2.8rem !important; 
        margin-bottom: 1rem !important;
        font-size: 1rem !important;
    }

    .cat-item {
        font-size: 0.85rem !important;
        padding-left: 25px !important; /* Indentación para las categorías */
    }
}
/* --- 1. CONTENEDOR DE LA GRILLA (Debe estar en catalogo.html envolviendo el include) --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* PC: Columnas de 250px */
    gap: 20px;
    padding: 20px 0;
}

/* --- 2. AJUSTES PARA MÓVIL (Mercado Libre Style) --- */
@media (max-width: 500px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas exactas */
        gap: 8px; /* Espacio mínimo para aprovechar la pantalla */
        padding: 5px 4px;
    }

    .product-card {
        border-radius: 12px; /* Bordes un poco más sutiles en celu */
    }

    /* Imagen más compacta */
    .product-img-box {
        height: 130px !important; /* Bajamos de 180px a 130px */
    }

    .no-img-placeholder {
        font-size: 2rem;
    }

    /* Cuerpo de la tarjeta */
    .product-body {
        padding: 10px !important;
    }

    .lab-tag {
        font-size: 0.55rem !important; /* Lab muy chiquito */
        padding: 2px 6px !important;
    }

    .type-tag {
        font-size: 0.55rem !important;
        height: 14px !important;
    }

    .prod-name {
        font-size: 0.85rem !important; /* Nombre legible pero compacto */
        height: 34px; /* Forzamos 2 líneas para que todas las cajas midan igual */
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .prod-spec {
        display: none; /* 🚩 OCULTAMOS la presentación en móvil para ganar aire */
    }

    /* Precios compactos */
    .price-box {
        padding-top: 6px !important;
    }

    .price-label, .pct-label {
        font-size: 0.6rem !important;
    }

    .price-value {
        font-size: 1rem !important; /* El precio sigue siendo lo más importante */
    }

    .pct-value {
        font-size: 0.8rem !important;
    }

    /* Botón más amigable para dedos */
    .btn-add-cart {
        padding: 12px 5px !important;
        font-size: 0.7rem !important;
        letter-spacing: 0;
    }

    /* Badge de oferta miniatura */
    .promo-badge {
        font-size: 0.6rem !important;
        padding: 4px 8px !important;
        top: 8px;
    }
}