/* Variables base */
:root { --primary: #0f172a; --accent: #0284c7; --bg: #f8fafc; --text: #334155; }
body { font-family: sans-serif; background: var(--bg); color: var(--text); margin:0; padding:0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   ENCABEZADO
   ========================================= */
.top-bar { background-color: #8c9096; color: white; font-size: 0.8rem; padding: 8px 0; }
.top-bar-container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: white; text-decoration: none; margin-left: 20px; }
.top-bar a:hover { text-decoration: underline; }

.main-header { background: white; padding: 15px 0; border-bottom: 2px solid #f1f5f9; position: sticky; top: 0; z-index: 1000; }
.header-container { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; text-decoration: none; }

.main-nav { display: flex; gap: 20px; font-weight: bold; }
.nav-link { color: #1a202c; text-decoration: none; font-size: 0.95rem; }
.nav-link:hover { color: #e53e3e; }

.header-search { flex-grow: 1; max-width: 500px; position: relative; display: flex; align-items: center; }
.header-search input { width: 100%; padding: 12px 15px 12px 40px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 0.95rem; outline: none; }
.header-search input:focus { border-color: #e53e3e; }
.header-search .search-icon { position: absolute; left: 12px; color: #e53e3e; font-size: 1.1rem; }

.header-actions { display: flex; gap: 20px; }
.btn-header-whatsapp { background-color: #25d366; color: white; padding: 10px 20px; border-radius: 6px; text-decoration: none; font-weight: bold; display: flex; align-items: center; gap: 8px; font-size: 0.95rem; transition: 0.3s; }
.btn-header-whatsapp:hover { background-color: #128c7e; transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-primary { background: white; color: #1a202c; border: 2px solid #1a202c; padding: 12px 25px; border-radius: 30px; font-weight: bold; display: inline-flex; align-items: center; gap: 8px; transition: 0.3s; margin-top: 15px; text-decoration: none; }
.btn-primary:hover { background: #25d366; border-color: #25d366; color: white; }

/* =========================================
   CARRUSEL
   ========================================= */
.banner-carousel { position: relative; width: 100%; height: 500px; background: #1a202c; display: block; }
.carousel-container { position: relative; width: 100%; height: 100%; overflow: hidden; }
.banner-slide { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s ease-in-out; background-size: cover; background-position: center; display: flex; align-items: center; z-index: 0; }
.banner-slide.active { opacity: 1; z-index: 1; }
.banner-content { color: white; max-width: 700px; transform: translateY(20px); transition: all 0.8s ease-out; margin-left: 0; }
.banner-slide.active .banner-content { transform: translateY(0); }
.banner-content h1 { font-size: 2.8rem; margin-bottom: 15px; line-height: 1.1; }

.carousel-control { position: absolute; top: 50%; transform: translateY(-50%); background: transparent; color: white; border: none; font-size: 3rem; cursor: pointer; z-index: 10; opacity: 0.5; transition: 0.3s; }
.carousel-control:hover { opacity: 1; }
.carousel-control.prev { left: 2%; }
.carousel-control.next { right: 2%; }
.carousel-indicators { position: absolute; bottom: 25px; width: 100%; text-align: center; z-index: 10; }
.carousel-indicators .dot { display: inline-block; width: 14px; height: 14px; margin: 0 5px; background-color: transparent; border: 2px solid white; border-radius: 50%; cursor: pointer; transition: 0.3s; }
.carousel-indicators .dot.active { background-color: #e53e3e; border-color: #e53e3e; }

/* =========================================
   CATÁLOGO Y ESTRUCTURA DE MENÚ
   ========================================= */
.catalogue-section { padding: 50px 0; }
.catalogue-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.catalogue-header h2 { margin: 0; }

/* Estilos de Botones Ocultos en Escritorio */
.btn-mobile-filter { display: none; }
.close-sidebar { display: none; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; }

.catalogue-wrapper { display: flex; gap: 30px; margin-top: 20px; }
.categories-sidebar { width: 250px; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); height: fit-content; }
.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #f1f5f9; padding-bottom: 10px; }
.sidebar-header h3 { margin: 0; border: none; padding: 0; }
.categories-sidebar li { padding: 10px; cursor: pointer; border-bottom: 1px solid #eee; transition: 0.3s; }
.categories-sidebar li:hover { color: #e53e3e; }
.categories-sidebar li.active { color: #e53e3e; font-weight: bold; background: #f1f5f9; border-radius: 4px; border-bottom: none;}

.products-view { flex-grow: 1; }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 20px; }
.product-card { background: white; padding: 15px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: 0.3s; display: flex; flex-direction: column;}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.product-card h4 { margin: 10px 0; color: #0f172a; font-size: 1.1rem; }

/* Contacto */
.contact-section { background: white; padding: 50px 0; border-top: 1px solid #e2e8f0; }
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; background: #25d366; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration:none; box-shadow: 0 4px 10px rgba(0,0,0,0.2); z-index: 999; transition: 0.3s;}
.whatsapp-float:hover { transform: scale(1.1); background: #128c7e; }

/* =========================================
   PAGINACIÓN
   ========================================= */
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 30px; width: 100%; grid-column: 1 / -1; }
.page-btn { padding: 8px 15px; border: 1px solid #cbd5e1; background: white; border-radius: 4px; cursor: pointer; color: #1a202c; font-weight: bold; transition: 0.3s; }
.page-btn:hover { background: #f1f5f9; }
.page-btn.active { background: #e53e3e; color: white; border-color: #e53e3e; }

/* =========================================
   DISEÑO PARA MÓVILES (MENÚ DESPLEGABLE)
   ========================================= */
@media (max-width: 768px) {
    .top-bar { display: none; }
    .header-container { flex-direction: column; gap: 10px; }
    .header-search { width: 100%; max-width: 100%; }
    .banner-content h1 { font-size: 2.2rem; }
    .banner-carousel { height: 400px; }
    
    .catalogue-wrapper { flex-direction: column; }
    .catalogue-header h2 { font-size: 1.5rem; }
    
    /* Configuración del botón de apertura */
    .btn-mobile-filter { display: inline-flex; background: white; color: #1a202c; border: 2px solid #1a202c; padding: 8px 15px; border-radius: 4px; font-weight: bold; cursor: pointer; align-items: center; gap: 5px; font-size: 0.9rem; }
    
    /* Panel lateral flotante */
    .categories-sidebar {
        position: fixed;
        top: 0;
        left: -100%; /* Oculto por defecto */
        width: 80%;
        max-width: 320px;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        z-index: 2001; /* Queda sobre el overlay oscuro */
        transition: left 0.3s ease-in-out;
        overflow-y: auto;
    }
    
    /* Cuando se activa el menú */
    .categories-sidebar.open { left: 0; }
    .sidebar-overlay.active { display: block; }
    
    /* Botón de cierre */
    .close-sidebar { display: block; background: none; border: none; font-size: 2rem; cursor: pointer; color: #64748b; line-height: 1; padding: 0; }
}