/* ------------------------------------- */
/* VARIABLES GLOBALES Y RESET DE JCI VENEZUELA */
/* ------------------------------------- */
:root {
    /* Colores primarios de la web JCI Venezuela */
    --primary: #009CFF; /* Azul claro */
    --light: #F3F6F9;
    --dark: #191C24;

    /* Colores específicos de JCI/Tienda */
    --jci-blue: #004d99; /* Azul oscuro JCI (usado en títulos/botones) */
    --jci-orange: #f7931e; /* Naranja/Amarillo de acento */
}

html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box; 
    overflow-x: hidden; /* CRÍTICO: Evita el recorte/scroll horizontal */
}
body {
    /* Usamos una tipografía sencilla y legible */
    font-family: 'Arial', sans-serif; 
    background: var(--light); 
    color: var(--dark);
    text-align: center;
    padding: 20px;
    padding-top: 60px; /* Margen superior para el header fijo/sticky de la web */
}

/* Títulos con color primario JCI */
h1, h2, h3 {
    color: var(--jci-blue); 
}


/* ------------------------------------- */
/* ESTILOS DEL HEADER (SITE-HEADER) */
/* ------------------------------------- */

.site-header {
    background: #FFFFFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    position: fixed; /* Aseguramos que sea fijo/sticky */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px; /* Ancho máximo similar al contenido */
    margin: 0 auto;
    padding: 0 20px;
}

.brand .logo {
    height: 40px; /* Ajuste del tamaño del logo */
    width: auto;
}

/* Desktop Navigation */
.main-nav {
    display: flex; /* Asegura que en desktop sea horizontal */
}

.main-nav a {
    color: var(--dark);
    text-decoration: none;
    padding: 10px 15px;
    font-weight: 500;
    transition: color 0.3s, background-color 0.3s;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover {
    color: var(--jci-blue);
    border-color: var(--jci-blue);
}

.main-nav a.active {
    color: var(--jci-orange);
    border-color: var(--jci-orange);
    font-weight: 700;
}

/* Ocultar botón de toggle en desktop, visible solo en móvil */
.menu-toggle {
    display: none; 
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--jci-blue);
}

/* ------------------------------------- */
/* Responsive para el Header (Móvil) */
/* ------------------------------------- */
@media (max-width: 991.98px) {
    
    .menu-toggle {
        display: block; /* Muestra el botón de menú */
    }
    
    .main-nav {
        display: none; /* Ocultamos la navegación por defecto en móvil */
        
        position: absolute;
        top: 60px; /* Debajo del header, asumiendo 60px de altura */
        left: 0;
        width: 100%; /* Ocupa todo el ancho */
        
        background-color: #FFFFFF;
        box-shadow: 0 4px 4px rgba(0, 0, 0, 0.05);
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 0;
    }
    
    /* REGLA CRÍTICA AÑADIDA: Despliega el menú cuando el JS añade la clase 'open' */
    .main-nav.open {
        display: flex; 
    }
    
    .main-nav a {
        width: 100%;
        padding: 10px 20px;
        border-bottom: none;
        border-left: 5px solid transparent;
    }
    .main-nav a.active {
        border-left-color: var(--jci-orange);
    }
}


/* ------------------------------------- */
/* CARRITO FLOTANTE (Adaptado de index.php) */
/* ------------------------------------- */
.carrito-flotante {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--jci-orange); 
    color: white;
    padding: 15px;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    line-height: 1;
    transition: all 0.3s;
}

.carrito-flotante:hover {
    background-color: #d87d00; /* Tono más oscuro de naranja */
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.carrito-count {
    display: block;
    font-size: 0.6em;
    font-weight: bold;
    margin-top: 2px;
}

/* ------------------------------------- */
/* BOTONES Y ESTILOS GENERALES (BASE DE LA WEB) */
/* ------------------------------------- */

/* Clase .btn adaptada a JCI */
.btn {
    /* Adoptando la transición de la plantilla JCI */
    transition: .5s; 
    display: inline-block;
    padding: 10px 20px;
    background: var(--jci-blue); 
    color: white !important;
    text-decoration: none;
    border-radius: 5px; 
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn:hover { 
    background: var(--primary); /* El azul claro de la variable JCI */
}


/* ------------------------------------- */
/* ESTILOS DE PRODUCTOS Y TIENDA */
/* ------------------------------------- */
.productos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.producto {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
}
.producto:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.producto img {
    max-width: 100%; 
    height: auto; 
    border-radius: 4px;
    margin-bottom: 10px;
    object-fit: cover;
}

.producto h3 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 8px;
}

.producto p {
    margin: 5px 0;
}

.producto p.desc {
    font-size: 0.9em;
    color: #6c757d;
    min-height: 50px; /* Asegura un espacio mínimo para la descripción */
    overflow: hidden;
    text-overflow: ellipsis;
}

.producto .precio-bs {
    color: #28a745; /* Verde para el precio en Bs */
    font-weight: bold;
    font-size: 1.1em;
}

.producto form {
    margin-top: 15px;
    padding: 0;
    box-shadow: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: none;
}
.producto form label {
    font-weight: 500;
    color: var(--dark);
    white-space: nowrap;
}
.producto form input[type="number"] {
    width: 60px !important;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-left: 5px;
    margin-right: 10px;
}
.producto form .btn {
    flex-grow: 1;
    margin: 0;
}

/* Estilos de stock bajo */
.producto p[style*="color: red"] {
    margin-top: 10px;
    padding: 5px;
    background-color: #ffeaea;
    border-radius: 4px;
    border: 1px solid red;
    display: inline-block;
}

/* Estilos de la tabla de carrito */
table {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    border: 1px solid var(--light);
    padding: 12px;
    text-align: center;
}
th {
    background-color: var(--jci-blue);
    color: white;
    font-weight: 600;
}
tfoot td {
    font-size: 1.2em;
    background-color: var(--light);
    color: var(--dark);
    font-weight: bold;
}

/* ------------------------------------- */
/* MEDIA QUERIES: Adaptación a Móviles (Tabla) */
/* ------------------------------------- */
@media (max-width: 768px) {
    .productos {
        padding: 10px;
        gap: 15px;
    }
    
    .producto {
        width: 100%; 
        max-width: none;
    }
    
    .producto form {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .producto form label,
    .producto form input[type="number"] {
        width: auto;
    }
    
    /* Responsive Table (Ocultar encabezados de tabla para móvil) */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { border: 1px solid #ddd; margin-bottom: 10px; }
    
    td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50%; 
        text-align: right;
    }
    
    td:before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%; 
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: var(--jci-blue);
    }
}

/* ------------------------------------- */
/* CLASES DE LA PLANTILLA GENERAL (Mantenidas para compatibilidad) */
/* ------------------------------------- */

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}

/* Las clases de Spinner, Layout, y Navbar relacionadas con el sidebar 
    no son necesarias para la tienda pero se mantienen por si la web las usa.
*/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.btn.btn-primary {
    color: #FFFFFF;
}

.btn-square {
    width: 38px;
    height: 38px;
}
/* ... otras clases de botones square ... */

/* Estilos de Sidebar y Content (Si la tienda usa un layout diferente) */
/* ... mantenidos pero probablemente no relevantes para esta página ... */
