/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000;
    --secondary-color: #fff;
    --accent-color: #000;
    --text-color: #333;
    --text-light: #888;
    --border-color: #f0f0f0;
    --background-light: #fafafa;
    --shadow: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
    --offer-color: #dc3545;
    --featured-color: #28a745;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0rem 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 60px;
} 

.logo {
    flex-shrink: 0;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.logo-image {
    height: 80px;
    width: auto;
    max-width: 225px;
    object-fit: contain;
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Navegación Desktop */
.desktop-nav {
    display: flex;
    flex: 1;
    justify-content: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links li a:hover {
    background: var(--background-light);
    color: var(--primary-color);
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.search-container {
    display: flex;
    align-items: center;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    min-width: 150px;
    transition: all 0.3s ease;
    position: relative;
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.search-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-toggle:hover {
    background: var(--primary-color);
    color: white;
}

/* Mostrar toggle solo en móviles */
@media (max-width: 480px) {
    .search-toggle {
        display: flex !important;
    }
}

.search-input {
    border: none;
    outline: none;
    flex: 1;
    padding: 0.3rem;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.search-btn:hover {
    background: var(--primary-color);
    color: white;
}

.cart-container {
    position: relative;
}

.cart-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn:hover {
    background: var(--text-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 20px;
}

/* Backdrop para búsqueda móvil */
.search-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

/* ===== RESPONSIVE DESIGN ===== */


/* Dropdown mejorado */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease; /* Transición más rápida */
    min-width: 200px;
    z-index: 1000;
    padding: 0.5rem 0;
}

/* Cerrar inmediatamente cuando se desactiva */
.dropdown:not(.active) .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: none !important; /* Sin transición al cerrar */
}

/* Asegurar que el dropdown se oculte cuando el nav está oculto */
.desktop-nav[style*="opacity: 0"] .dropdown-menu,
.desktop-nav[style*="visibility: hidden"] .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
}

/* Forzar cierre de dropdown activo cuando el nav se oculta */
.desktop-nav[style*="opacity: 0"] .dropdown.active,
.desktop-nav[style*="visibility: hidden"] .dropdown.active {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.desktop-nav[style*="opacity: 0"] .dropdown.active .dropdown-menu,
.desktop-nav[style*="visibility: hidden"] .dropdown.active .dropdown-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: none !important;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.8rem 1.5rem;
    color: var(--text-color) !important;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: transparent !important;
}

.dropdown-menu a:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: none;
}

/* Mensaje cuando no hay productos */
.no-products {
    text-align: center !important;
    padding: 60px 20px !important;
    color: var(--text-light) !important;
    font-size: 1.1rem !important;
    font-style: italic !important;
    grid-column: 1 / -1 !important;
}

/* Categories Section */
.categories-section {
    padding: 2rem 0;
    background: #f8f9fa;
}

.categories-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0;
}

.category-card {
    background: white;
    border-radius: 8px;
    width: 220px;
    height: 250px;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    transform: translateY(-4px);
}

.category-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
    background: white;
    flex: 1;
    opacity: 1;
}

.category-content {
    padding: 0.5rem;
    text-align: center;
    background: white;
    flex-shrink: 0;
}

.category-content h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

.category-content h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
}

/* Hero Section */
.hero {
    background: var(--background-light);
    padding: 3rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-text h2 {
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.hero-text p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.cta-btn {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
    font-weight: 400;
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
}

.cta-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.hero-image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 4px;
}

/* Filtros */
.filters-section {
    background: var(--secondary-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    background: var(--secondary-color);
    font-size: 0.85rem;
    min-width: 160px;
    color: var(--text-color);
}

.filters select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.clear-filters {
    background: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    padding: 0.6rem 1.2rem;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 400;
    transition: var(--transition);
    font-size: 0.85rem;
}

.clear-filters:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* Secciones */
.featured-section,
.all-products-section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 1px;
    background: var(--primary-color);
}

/* Grid de Productos */
.products-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(198px, 1fr));
    gap: 1.1rem;
    margin-bottom: 2rem;
}

/* IMPORTANTE: Estilos específicos para pocos productos - REMOVIDO PARA EVITAR CONFLICTOS */
/* El CSS para few-products ahora está únicamente en index.html */

/* Grid horizontal para productos destacados */
.products-grid.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.1rem;
    padding: 1rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.products-grid.horizontal-scroll .product-card {
    flex: 0 0 198px;
    min-width: 198px;
}

/* Estilos para el scrollbar horizontal */
.products-grid.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.products-grid.horizontal-scroll::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 4px;
}

.products-grid.horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.products-grid.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Sección de productos destacados con scroll */
.featured-section {
    margin-bottom: 3rem;
}

.featured-section .container {
    position: relative;
}

/* Gradientes para indicar scroll */
.featured-section::before,
.featured-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
}

.featured-section::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.9), transparent);
}

.featured-section::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
}

.product-card {
    background: var(--secondary-color);
    border-radius: 22px; /* Más redondeado, estilo iOS */
    overflow: hidden;
    border: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10); /* Sombra suave tipo iOS */
    transition: box-shadow 0.25s cubic-bezier(.4,0,.2,1), transform 0.18s cubic-bezier(.4,0,.2,1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
}

.product-card:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 32px rgba(0,0,0,0.13);
    border-color: transparent;
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 144px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: none;
    border-radius: 18px;
    background: white;
    opacity: 1;
}

.product-card:hover .product-image img {
    transform: scale(1.02);
}

.product-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.product-badge {
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    width: fit-content;
}

.product-badge.destacado {
    background: var(--featured-color);
}

.product-badge.oferta {
    background: var(--offer-color);
}

.product-info {
    padding: 0.72rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    justify-content: flex-start;
    min-height: unset;
    max-height: unset;
    overflow: visible;
}

.product-brand {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 1px;
}

.product-name {
    font-size: 0.765rem;
    font-weight: 400;
    margin-bottom: 0.45rem;
    line-height: 1.3;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    height: auto;
    margin-bottom: 0.45rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    flex-shrink: 0;
}

.price-current {
    font-size: 0.99rem;
    font-weight: 600;
    color: var(--primary-color);
}

.price-original {
    font-size: 0.765rem;
    color: var(--text-light);
    text-decoration: line-through;
}

.discount {
    background: var(--offer-color);
    color: var(--secondary-color);
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 0.7rem;
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: auto;
}

.btn {
    padding: 0.45rem 0.72rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    font-weight: 400;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    background: var(--secondary-color);
    color: var(--text-color);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
    flex: 1;
}

.btn-primary:hover {
    background: var(--text-color);
    border-color: var(--text-color);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

.btn-secondary:hover {
    background: var(--background-color);
    border-color: var(--text-color);
}

.btn-whatsapp {
    background: #25d366;
    color: var(--secondary-color);
    border-color: #25d366;
    width: 32.4px;
    height: 32.4px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.6px;
}

.btn-whatsapp:hover {
    background: #20b958;
    border-color: #20b958;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--secondary-color);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-color);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: var(--accent-color);
}

.modal-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
}

.modal-product-image img {
    width: 100%;
    border-radius: 8px;
}

.modal-product-details h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-product-brand {
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.modal-product-description {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-product-price {
    margin-bottom: 2rem;
}

.attributes {
    margin-bottom: 2rem;
}

.attributes h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.attribute-name {
    font-weight: 500;
}

.attribute-value {
    color: var(--text-light);
}

/* Carrito Lateral */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--secondary-color);
    z-index: 2001;
    transition: var(--transition);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.cart-item-price {
    color: var(--accent-color);
    font-weight: 600;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.quantity-btn {
    background: var(--background-light);
    border: 1px solid var(--border-color);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item {
    background: #dc3545;
    color: var(--secondary-color);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.cart-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.whatsapp-btn {
    width: 100%;
    background: #25d366;
    color: var(--secondary-color);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.1rem;
}

.whatsapp-btn:hover {
    background: #20b958;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet y pantallas medianas */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 2rem;
        padding: 0 1rem;
        justify-content: space-between;
        align-items: center;
    }
    
    .search-container {
        order: 1;
        min-width: 140px;
        flex-shrink: 0;
    }
    
    .logo {
        order: 2;
        flex: 1;
        display: flex;
        justify-content: center;
    }
    
    .cart-container {
        order: 3;
        flex-shrink: 0;
    }
    
    .desktop-nav {
        order: 4;
        flex: 1 1 100%;
        justify-content: center;
        margin-top: 0rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li a {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Móviles - Version Limpia */
@media (max-width: 480px) {
    .header .header-content {
        padding: 0 1rem !important;
        gap: 10px !important;
        justify-content: space-between !important;
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        grid-template-areas: "search logo cart" "nav nav nav" !important;
        width: 100% !important;
        position: relative !important;
        flex-direction: initial !important;
        min-height: 60px !important;
    }
    
    .header .header-content .search-container {
        order: 1 !important;
        grid-area: search !important;
        justify-self: start !important;
        flex-shrink: 0 !important;
        min-width: 40px !important;
        width: 40px !important;
        height: 40px !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        transition: all 0.3s ease !important;
        overflow: visible !important;
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        margin-right: auto !important;
    }
    
    .header .header-content .logo {
        order: 2 !important;
        grid-area: logo !important;
        justify-self: center !important;
        flex-shrink: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex: initial !important;
        width: auto !important;
        margin: 0 20px !important;
    }
    
    .header .header-content .cart-container {
        order: 3 !important;
        grid-area: cart !important;
        justify-self: end !important;
        flex-shrink: 0 !important;
        width: 50px !important;
        display: flex !important;
        justify-content: end !important;
        margin-left: auto !important;
    }
    
    .header .header-content .desktop-nav {
        order: 4 !important;
        grid-area: nav !important;
        justify-self: center !important;
        width: 100% !important;
        justify-content: center !important;
        /* margin-top: 0.5rem !important; */
        flex: initial !important;
    }
    
    .header .header-content .search-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        background: var(--background-light) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 6px !important;
        width: 40px !important;
        height: 40px !important;
        color: var(--primary-color) !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        margin: 0 !important;
    }
    
    .header .header-content .search-toggle:hover {
        background: var(--primary-color) !important;
        color: white !important;
        transform: scale(1.05) !important;
    }
    
    .header .header-content .cart-btn {
        padding: 0.6rem !important;
        font-size: 1.1rem !important;
        border-radius: 6px !important;
        transition: all 0.3s ease !important;
        width: 44px !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .header .header-content .cart-btn:hover {
        transform: scale(1.05) !important;
    }
    
    .header .header-content .search-container.expanded {
        position: absolute !important;
        left: 1rem !important;
        right: 1rem !important;
        width: calc(100% - 2rem) !important;
        min-width: auto !important;
        max-width: none !important;
        background: var(--background-light) !important;
        border: 1px solid var(--border-color) !important;
        padding: 0.4rem 0.6rem !important;
        border-radius: 6px !important;
        z-index: 1001 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        grid-area: search / search / search / cart !important;
        justify-self: stretch !important;
    }
    
    .header .header-content .search-input {
        display: none !important;
        font-size: 14px !important;
        flex: 1 !important;
        padding: 0.3rem !important;
        border: none !important;
        outline: none !important;
        background: transparent !important;
    }
    
    .header .header-content .search-container.expanded .search-input {
        display: block !important;
    }
    
    .header .header-content .search-container.expanded .search-toggle {
        display: none !important;
    }
    
    .header .header-content .search-btn {
        display: none !important;
        padding: 0.3rem !important;
        background: none !important;
        border: none !important;
        color: var(--primary-color) !important;
        cursor: pointer !important;
    }
    
    .header .header-content .search-container.expanded .search-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .header .header-content .logo h1 {
        font-size: 1.4rem !important;
    }
    
    .header .header-content .logo-image {
        height: 80px !important;
        max-width: 180px !important;
        transition: transform 0.3s ease !important;
    }
    
    .header .header-content .logo-image:hover {
        transform: scale(1.05) !important;
    }
    
    .header .header-content .nav-links {
        gap: 0.5rem !important;
    }
    
    .header .header-content .nav-links li a {
        font-size: 0.8rem !important;
        padding: 0.3rem 0.6rem !important;
    }
    
    .header .header-content .dropdown-menu {
        min-width: 180px !important;
    }
    
    /* Backdrop para búsqueda expandida */
    .header .header-content .search-container.expanded + .search-backdrop {
        display: block !important;
        opacity: 1 !important;
    }
    
    /* Estilos específicos para pocos productos en móviles */
    #all-products.few-products {
        grid-template-columns: repeat(2, 1fr) !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    #all-products.few-products .product-card {
        max-width: none !important;
        width: 100% !important;
    }
}


@media (max-width: 360px) {
    .header-content {
        padding: 0 0.8rem;
        gap: 0;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        width: 100%;
        position: relative;
    }
    
    .search-container {
        order: 1;
        grid-column: 1;
        justify-self: start;
        flex-shrink: 0;
        width: 36px;
        height: 36px;
    }
    
    .search-container.expanded {
        position: absolute;
        left: 0.8rem;
        right: 0.8rem;
        width: auto;
        min-width: auto;
        max-width: none;
        z-index: 1001;
        top: 50%;
        transform: translateY(-50%);
        grid-column: 1 / -1;
        justify-self: stretch;
    }
    
    .logo {
        order: 2;
        grid-column: 2;
        justify-self: center;
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .cart-container {
        order: 3;
        grid-column: 3;
        justify-self: end;
        flex-shrink: 0;
    }
    
    .desktop-nav {
        order: 4;
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        justify-content: center;
       /*  margin-top: 0.5rem; */
    }
    
    .search-toggle {
        width: 36px;
        height: 36px;
        padding: 0;
        font-size: 0.9rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .logo-image {
        height: 42px;
        max-width: 150px;
    }
    
    .dropdown-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 320px) {
    .header-content {
        padding: 0 0.6rem;
        gap: 0;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        width: 100%;
        position: relative;
    }
    
    .search-container {
        order: 1;
        grid-column: 1;
        justify-self: start;
        width: 32px;
        height: 32px;
    }
    
    .search-container.expanded {
        position: absolute;
        left: 0.6rem;
        right: 0.6rem;
        width: auto;
        min-width: auto;
        max-width: none;
        z-index: 1001;
        top: 50%;
        transform: translateY(-50%);
        grid-column: 1 / -1;
        justify-self: stretch;
    }
    
    .logo {
        order: 2;
        grid-column: 2;
        justify-self: center;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .cart-container {
        order: 3;
        grid-column: 3;
        justify-self: end;
    }
    
    .desktop-nav {
        order: 4;
        grid-column: 1 / -1;
        justify-self: center;
        width: 100%;
        margin-top: 0.4rem;
    }
    
    .search-toggle {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .logo h1 {
        font-size: 1rem;
    }
    
    .logo-image {
        height: 38px;
        max-width: 130px;
    }
    
    .cart-icon {
        width: 18px;
        height: 18px;
    }
    
    .banner-image {
        height: 130px;
    }
    
    .dropdown-btn {
        padding: 0.6rem 0.7rem;
        font-size: 0.8rem;
    }
}

/* Banner Promocional */
.banner-section {
    margin: 3rem 0;
    padding: 0;
}

.banner-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.banner-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border: none;
    margin: 0;
    padding: 0;
    display: block;
    transition: transform 0.3s ease;
}

.banner-image:hover {
    transform: scale(1.02);
}

/* Responsive para banner */
@media (max-width: 1024px) {
    .banner-image {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .banner-section {
        margin: 2rem 0;
    }
    
    .banner-image {
        height: 280px;
    }
}

@media (max-width: 640px) {
    .banner-image {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .banner-section {
        margin: 1.5rem 0;
    }
    
    .banner-image {
        height: 180px;
        border-radius: 0;
    }
    
    .banner-image:hover {
        transform: none;
    }
}

@media (max-width: 360px) {
    .banner-image {
        height: 150px;
    }
}

@media (max-width: 320px) {
    .banner-image {
        height: 130px;
    }
}

/* ===== PAGINACIÓN MODERNA ===== */
.pagination-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    margin-top: 2rem;
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 400;
    text-align: center;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-btn {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.page-btn:disabled {
    background: var(--background-light);
    color: var(--text-light);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.6;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-number {
    background: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-number:hover {
    background: var(--background-light);
    border-color: var(--text-color);
    transform: translateY(-1px);
}

.page-number.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.dots {
    color: var(--text-light);
    font-weight: 600;
    padding: 0 0.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    user-select: none;
}

/* Responsive para paginación */
@media (max-width: 768px) {
    .pagination-controls {
        padding: 1.5rem 0;
        gap: 1rem;
    }
    
    .pagination-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .page-numbers {
        order: -1;
        margin: 0;
    }
    
    .page-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        min-width: 120px;
        justify-content: center;
    }
    
    .page-number {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
        min-width: 36px;
    }
}

@media (max-width: 480px) {
    .pagination-info {
        font-size: 0.8rem;
    }
    
    .page-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-width: 100px;
    }
    
    .page-number {
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
        min-width: 32px;
    }
    
    .dots {
        padding: 0 0.3rem;
        font-size: 1rem;
    }
}

/* ===== FOOTER ===== */
.footer {
    background: #000;
    border-top: 1px solid #333;
    margin-top: 4rem;
    padding: 3rem 0 1.5rem;
    color: #fff;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.footer-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.footer-section p i {
    color: #fff;
    font-size: 0.85rem;
    width: 16px;
    text-align: center;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #333;
    border: 1px solid #555;
    border-radius: 2px;
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
    font-size: 1.1rem;
}

.social-links a:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: #ccc;
    font-size: 0.85rem;
    margin: 0;
    font-weight: 400;
}

/* Footer Responsive */
@media (max-width: 768px) {
    .footer {
        padding: 2.5rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section p {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 3rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-section h3 {
        font-size: 1.5rem;
        color: #fff;
    }
    
    .footer-section h4 {
        font-size: 0.85rem;
        color: #fff;
    }
    
    .footer-section p {
        font-size: 0.85rem;
        color: #ccc;
    }
    
    .social-links a {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: #333;
        border-color: #555;
        color: #fff;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
        color: #ccc;
    }
}

/* Mantener grid para nav en mobile si es necesario, pero el orden principal es el de arriba */
@media (max-width: 480px) {
    .header .header-content {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0 !important;
    }
    .header .header-content .search-container {
        order: 1 !important;
    }
    .header .header-content .logo {
        order: 2 !important;
    }
    .header .header-content .cart-container {
        order: 3 !important;
    }
}


