/* ==========================================================================
   1. VARIABLES DE DISEÑO (Modo Claro / Modo Oscuro Integrado)
   ========================================================================== */
:root {
    --bg-color: #f6f8fa;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --navbar-bg: #0b0f19;
    --border-color: #e2e8f0;
    
    --color-brand: #07678c;
    --color-accent: #ff4757;
    --color-btn-filter: #335276;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --navbar-bg: #090d16;
    --border-color: #334155;
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   2. ESTILOS BASE
   ========================================================================== */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; 
    scroll-behavior: smooth; 
}

body { 
    background: var(--bg-color); 
    color: var(--text-color); 
    overflow-x: hidden; 
    transition: background 0.3s var(--transition), color 0.3s var(--transition); 
}

/* ==========================================================================
   3. BARRA DE NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0 5%; 
    height: 75px;
    background: var(--navbar-bg); 
    color: #fff; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;           /* Espacio entre la imagen del logo y el texto */
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span { 
    color: #0d8bf2; 
    font-weight: bold; 
}

/* Estilo para la imagen del logo al costado del texto */
.logo-img {
width: 35px;         /* Ancho fijo para garantizar que sea un cuadrado perfecto */
    height: 35px;        /* Alto fijo igual al ancho */
    border-radius: 50%;  /* Recorta las esquinas al 50%, haciéndola 100% circular */
    object-fit: cover;   /* Centra y recorta el logo dentro del círculo sin deformarlo */
    border: 2px solid rgba(255, 255, 255, 0.15); /* Opcional: un borde sutil blanco para resaltar */
}

/* Buscador Estilizado */
.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 3px 3px 3px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.search-bar:focus-within {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.search-bar input { 
    padding: 6px 0; 
    background: transparent;
    border: none; 
    outline: none; 
    width: 180px; 
    color: #fff;
    font-size: 14px;
}

.search-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-bar button { 
    padding: 8px 18px; 
    background: var(--color-accent); 
    color: white; 
    border: none; 
    cursor: pointer; 
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.search-bar button:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 10px rgba(255, 71, 87, 0.3);
}

/* Enlaces Navegación */
.nav-links { 
    display: flex; 
    list-style: none; 
    align-items: center; 
}

.nav-links li { 
    margin-left: 24px; 
}

.nav-links a { 
    color: rgba(255, 255, 255, 0.85); 
    text-decoration: none; 
    font-weight: 600; 
    font-size: 14px;
    transition: var(--transition);
}

.nav-links a:hover { 
    color: #fff; 
    opacity: 1;
}

/* Botón Carrito */
.cart-btn { 
    background: var(--color-brand); 
    color: white; 
    border: none; 
    padding: 10px 18px; 
    border-radius: var(--radius-lg); 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.cart-btn:hover {
    background: #097ba7;
    transform: translateY(-1px);
}

/* Modificadores Modo Oscuro Navbar */
[data-theme="dark"] .nav-links a { color: #ffffff; }

/* ==========================================================================
   4. SECCIÓN HERO (Tu imagen original 100% preservada)
   ========================================================================== */
.hero { 
    height: 85vh; 
    min-height: 450px;
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.55)), url('https://i.ibb.co/4ZGFK85R/Whats-App-Image-2026-06-09-at-12-59-28-PM.jpg'); 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    text-align: center;
    border-bottom: 5px solid var(--color-brand);
}

/* ==========================================================================
   5. FILTROS DE BÚSQUEDA
   ========================================================================== */
.filter-container { 
    text-align: center; 
    padding: 16px 5%; 
    background: var(--card-bg); 
    position: sticky; 
    top: 75px; 
    z-index: 900; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.03); 
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.filter-btn { 
    padding: 10px 22px; 
    margin: 5px; 
    border: 1px solid var(--border-color); 
    background: var(--color-btn-filter); 
    border-radius: var(--radius-lg); 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: var(--transition); 
    color: white; 
}

.filter-btn:hover { 
    background: #1e3550; 
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--text-color);
    color: var(--card-bg);
    border-color: var(--text-color);
}

/* ==========================================================================
   6. SECCIÓN DE PRODUCTOS (CATÁLOGO)
   ========================================================================== */
.products { 
    padding: 40px 5% 60px 5%; 
}

.product-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 30px; 
}

/* Tarjeta Individual */
.product-card { 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: var(--radius-md); 
    text-align: center; 
    box-shadow: var(--shadow-md); 
    position: relative; 
    border: 1px solid var(--border-color);
    transition: var(--transition); 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover { 
    transform: translateY(-6px); 
    box-shadow: var(--shadow-lg);
}

/* Imagen del Producto */
.product-card img { 
    width: 100%; 
    height: 220px; 
    object-fit: cover; 
    border-radius: var(--radius-sm); 
    background: #f1f5f9;
    transition: var(--transition);
}

.product-card:hover img {
    transform: scale(1.02);
}

/* Precio y Textos */
.product-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-top: 14px;
    color: var(--text-color);
}

.price { 
    color: var(--color-accent); 
    font-size: 1.4rem; 
    font-weight: 800; 
    margin: 10px 0 16px 0; 
}

/* Botón Añadir */
.add-cart { 
    background: var(--text-color); 
    color: var(--card-bg); 
    border: none; 
    padding: 14px; 
    border-radius: var(--radius-sm); 
    cursor: pointer; 
    width: 100%; 
    font-weight: 700; 
    font-size: 14px;
    letter-spacing: 0.3px;
    transition: var(--transition);
}

.add-cart:hover { 
    background: var(--color-brand);
    color: #fff;
}

/* ==========================================================================
   7. CONTROLES DE ADMINISTRADOR (OVERLAY)
   ========================================================================== */
.admin-actions { 
    position: absolute; 
    top: 14px; 
    right: 14px; 
    display: none; 
    flex-direction: column; 
    gap: 6px; 
    z-index: 5; 
}

.btn-edit, .btn-del { 
    border: none; 
    padding: 8px 12px; 
    border-radius: 6px; 
    cursor: pointer; 
    font-size: 11px; 
    font-weight: bold; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: var(--transition);
}

.btn-edit { background: #f39c12; color: white; }
.btn-edit:hover { background: #d6870f; }

.btn-del { background: #e74c3c; color: white; }
.btn-del:hover { background: #c0392b; }

/* ==========================================================================
   8. CARRITO LATERAL & INPUTS DE ENVÍO
   ========================================================================== */
.overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(4px); 
    display: none; 
    z-index: 2500; 
}

.cart-sidebar { 
    position: fixed; 
    top: 0; 
    right: -420px; 
    width: 100%;
    max-width: 380px; 
    height: 100%; 
    background: var(--card-bg); 
    color: var(--text-color);
    z-index: 3000; 
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    padding: 24px; 
    display: flex; 
    flex-direction: column; 
    box-shadow: -10px 0 30px rgba(0,0,0,0.08); 
}

.cart-sidebar.active { right: 0; }

.cart-sidebar h2 {
    font-weight: 800;
    font-size: 22px;
}

.cart-item { 
    display: flex; 
    align-items: center; 
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color); 
}

.cart-item img { 
    width: 55px; 
    height: 55px; 
    object-fit: cover; 
    margin-right: 15px; 
    border-radius: var(--radius-sm); 
    background: #f1f5f9;
}

/* Campos del Formulario de Envíos Estilizados */
#datos-envio input {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
    padding: 10px !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

#datos-envio input:focus {
    border-color: var(--color-brand) !important;
    box-shadow: 0 0 0 3px rgba(7, 103, 140, 0.15);
}

/* ==========================================================================
   9. ANIME & PANELS & FOOTER
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

#admin-panel { 
    transition: opacity 0.4s ease, transform 0.4s ease; 
}

.admin-panel-out { 
    opacity: 0; 
    transform: translateY(-20px); 
}

footer { 
    background: var(--navbar-bg); 
    color: rgba(255,255,255,0.7); 
    text-align: center; 
    padding: 40px 20px; 
    margin-top: 60px; 
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] footer { background: #050505; }

/* ==========================================================================
   10. OPTIMIZACIÓN COMPLETA PARA MÓVILES (Responsivo Premium)
   ========================================================================== */
/* ==========================================================================
   10. OPTIMIZACIÓN COMPLETA PARA MÓVILES (Responsivo Premium)
   ========================================================================== */
@media (max-width: 680px) {
    /* Estructura limpia tipo app para la barra superior */
    .navbar {
        height: auto;
        padding: 12px 4%;
        display: grid;
        grid-template-columns: 1fr auto; /* Deja espacio al logo y utilidades arriba */
        row-gap: 10px;
    }

    /* Ajuste de alineación y tamaño del logo en móviles */
    .logo {
        grid-column: 1;
        grid-row: 1;
        display: flex;
        align-items: center; 
        justify-content: flex-start;
        gap: 8px;           
        font-size: 18px;          /* Reducción clave para que entre sin desbordar */
        font-weight: 800;
        letter-spacing: -0.5px;
    }

    /* Forzamos el tamaño circular compacto en celular */
    .logo-img {
        width: 28px !important;    /* Tamaño ideal en móvil */
        height: 28px !important;   /* Mantiene proporción idéntica */
        border-radius: 50%;  
        object-fit: cover;   
        border: 2px solid rgba(255, 255, 255, 0.15); 
    }

    /* Mueve los botones utilitarios (luna y carrito) a la esquina derecha superior */
    .nav-links {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 14px;
        width: auto;
    }

    /* Escondemos la palabra "Inicio" para salvar espacio valioso */
    .nav-links li:first-child {
        display: none !important;
    }

    .nav-links li {
        margin-left: 0 !important; /* Resetea el margen lateral de PC */
    }

    /* El buscador se despliega completo en la segunda fila */
    .search-bar {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
        height: 42px;
        display: flex;
        justify-content: space-between; 
        align-items: center;
        padding: 3px 3px 3px 14px;
    }

    /* La barra de escritura se expande para devorar el espacio libre negro */
    .search-bar input {
        flex: 1;                 
        width: 100%;             
        font-size: 13px;
        padding-right: 10px;     
    }

    /* El botón rojo se ancla fijo en su esquina derecha */
    .search-bar button {
        padding: 8px 20px;
        font-size: 13px;
        flex-shrink: 0;          
    }

    /* Carrusel de marcas fluido y deslizable de forma horizontal con el dedo */
    .filter-container {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        white-space: nowrap;
        padding: 12px 15px;
        gap: 8px;
        top: 114px; /* Ajuste preciso según la nueva altura de la navbar móvil */
        justify-content: flex-start;
    }

    /* Oculta la barra gris tosca de scroll en celulares */
    .filter-container::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        display: inline-block;
        padding: 8px 18px;
        font-size: 12px;
        margin: 0;
    }

    /* Reajuste de altura del Banner Principal */
    .hero {
        
        height: 50vh;
        min-height: 300px;
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center center;
    }
    
    .hero-content h1 {
        font-size: 26px;
    }
}