/**
 * Estilos modernos para JVRacing - Tienda Online CORREGIDOS
 * Diseño minimalista, profesional y totalmente responsivo
 * VERSIÓN CORREGIDA: Búsqueda móvil funcionando
 * 
 * @package JVRacing
 * @version 2.1
 */

/* ==================== VARIABLES CSS ==================== */
:root {
    /* Colores principales */
    --primary-color: #1a1a1a;
    --secondary-color: #2563eb;
    --accent-color: #dc2626;
    --success-color: #059669;
    --warning-color: #d97706;
    
    /* Colores de texto */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --text-white: #ffffff;
    
    /* Colores de fondo */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --bg-dark: #111827;
    
    /* Colores de borde */
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    
    /* Tamaños de fuente */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    
    /* Espaciado */
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.25rem;     /* 20px */
    --space-6: 1.5rem;      /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-10: 2.5rem;     /* 40px */
    --space-12: 3rem;       /* 48px */
    --space-16: 4rem;       /* 64px */
    
    /* Otros */
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.2s ease-in-out;
    --sidebar-width: 300px;
    --header-height: 80px;
}

/* ==================== RESET Y BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== CONTENEDORES ==================== */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-8);
    }
}

/* ==================== HEADER MODERNO ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: var(--space-4);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--primary-color);
}

/* Menú hamburguesa */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: var(--text-xl);
    color: var(--text-primary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
}

/* BOTÓN DE BÚSQUEDA MÓVIL - NUEVO */
.mobile-search-btn {
    display: none;
    background: var(--secondary-color);
    border: none;
    color: var(--text-white);
    padding: var(--space-2);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--text-lg);
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.mobile-search-btn:hover {
    background: #1d4ed8;
}

.mobile-search-btn.active {
    background: var(--accent-color);
}

/* Barra de búsqueda mejorada */
.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 var(--space-4);
}

.search-form {
    display: flex;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    transition: var(--transition);
}

.search-input-wrapper:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    color: var(--text-light);
    margin-right: var(--space-2);
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: var(--text-sm);
    color: var(--text-primary);
    outline: none;
    padding: var(--space-3) 0;
}

.search-input-wrapper input::placeholder {
    color: var(--text-light);
}

.clear-search {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: 50%;
    transition: var(--transition);
    margin-left: var(--space-2);
}

.clear-search:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.search-btn {
    background: var(--secondary-color);
    border: none;
    color: var(--text-white);
    padding: 0 var(--space-4);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--text-sm);
}

.search-btn:hover {
    background: #1d4ed8;
}

/* Resultados de búsqueda */
.search-results {
    position: absolute;
    top: calc(100% + var(--space-1));
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
}

.search-result-item {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-category {
    font-size: var(--text-xs);
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

/* Acciones del header */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: var(--text-white);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-1) var(--space-2);
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ==================== HERO SECTION ==================== */
.hero {
    margin-top: var(--header-height);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    padding: var(--space-16) 0 var(--space-12);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e5e7eb" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>') center/100px;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h2 {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.hero-content p {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
}

.db-warning {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: rgba(234, 179, 8, 0.1);
    color: var(--warning-color);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius);
    border: 1px solid rgba(234, 179, 8, 0.2);
    font-size: var(--text-sm);
    font-weight: 500;
}

/* ==================== LAYOUT PRINCIPAL ==================== */
.main-container {
    padding: var(--space-8) 0;
    min-height: calc(100vh - var(--header-height) - 400px);
}

.main-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-8);
    align-items: start;
}

/* Overlay móvil */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==================== SIDEBAR CATEGORÍAS ==================== */
.categories-sidebar {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-height) + var(--space-4));
    transition: var(--transition);
}

.sidebar-header {
    background: var(--primary-color);
    color: var(--text-white);
    padding: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-white);
    font-size: var(--text-lg);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.close-sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-content {
    padding: var(--space-2) 0;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-8);
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.categories-nav {
    /* Sin padding adicional */
}

.category-item {
    display: block;
    padding: var(--space-4);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
    cursor: pointer;
    font-weight: 500;
}

.category-item:hover {
    background: var(--bg-secondary);
    color: var(--secondary-color);
}

.category-item.active {
    background: var(--secondary-color);
    color: var(--text-white);
    border-left: 4px solid var(--accent-color);
    font-weight: 600;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item small {
    display: block;
    margin-top: var(--space-1);
    opacity: 0.7;
    font-size: var(--text-xs);
    font-weight: 400;
}

.connection-warning {
    padding: var(--space-4);
    text-align: center;
    color: var(--warning-color);
    font-size: var(--text-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    background: rgba(234, 179, 8, 0.1);
    border-top: 1px solid rgba(234, 179, 8, 0.2);
}

/* ==================== SECCIÓN PRODUCTOS ==================== */
.products-section {
    /* Sin estilos adicionales por ahora */
}

.products-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.products-title-section h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.products-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.products-controls {
    display: flex;
    gap: var(--space-2);
}

.view-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: var(--space-2);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: var(--text-sm);
}

.view-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.view-toggle.active {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

/* Loading de productos */
.loading-products {
    text-align: center;
    padding: var(--space-16);
}

/* ==================== GRID DE PRODUCTOS ==================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
}

.products-grid.list-view {
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

.product-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
}

.products-grid.list-view .product-card {
    flex-direction: row;
    max-height: 200px;
}

.product-image {
    position: relative;
    width: 100%;
    height: 220px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.products-grid.list-view .product-image {
    width: 200px;
    height: 100%;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image span {
    font-size: 3rem;
    opacity: 0.3;
    color: var(--text-light);
}

.product-info {
    padding: var(--space-4);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-info h4 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    line-height: 1.3;
}

.product-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-3);
    flex: 1;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.products-grid.list-view .product-description {
    -webkit-line-clamp: 3;
}

.product-price {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: var(--space-2);
}

.product-stock {
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-4);
}

.product-stock.in-stock {
    color: var(--success-color);
}

.product-stock.out-of-stock {
    color: var(--accent-color);
}

.add-to-cart-btn {
    width: 100%;
    background: var(--secondary-color);
    color: var(--text-white);
    border: none;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--text-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.add-to-cart-btn:hover {
    background: #1d4ed8;
}

.add-to-cart-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

/* ==================== PAGINACIÓN ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-12);
    flex-wrap: wrap;
}

.pagination button {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    font-size: var(--text-sm);
    min-width: 40px;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.pagination button.active {
    background: var(--secondary-color);
    color: var(--text-white);
    border-color: var(--secondary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== MODALES ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: var(--space-4);
    overflow-y: auto;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 600px;
    margin: var(--space-8) auto;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--space-16));
}

.product-modal .modal-content {
    max-width: 900px;
}

.modal-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.close-btn {
    background: var(--bg-secondary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

/* ==================== CARRITO ==================== */
.cart-empty {
    text-align: center;
    padding: var(--space-16) var(--space-8);
    color: var(--text-secondary);
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

.cart-empty h3 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.cart-items {
    /* Sin estilos adicionales */
}

.cart-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) 0;
    border-bottom: 1px solid var(--border-light);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image span {
    font-size: var(--text-lg);
    opacity: 0.5;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-size: var(--text-sm);
    line-height: 1.4;
}

.cart-item-price {
    color: var(--accent-color);
    font-weight: 600;
    font-size: var(--text-sm);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.quantity-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-primary);
}

.quantity-btn:hover {
    background: var(--bg-tertiary);
}

.remove-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.remove-btn:hover {
    background: rgba(220, 38, 38, 0.1);
}

.cart-total {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-lg);
}

.total-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.total-amount {
    color: var(--text-primary);
    font-weight: 700;
    font-size: var(--text-xl);
}

.checkout-btn {
    background: var(--accent-color);
    color: var(--text-white);
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checkout-btn:hover {
    background: #b91c1c;
}

/* ==================== MODAL PRODUCTO ==================== */
.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
}

.product-detail-image {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-image span {
    font-size: 4rem;
    opacity: 0.3;
}

.product-detail-info h3 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    line-height: 1.3;
}

.product-detail-price {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--accent-color);
    margin: var(--space-4) 0;
}

.product-detail-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-6);
}

.product-detail-meta {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--text-sm);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-item span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-item strong,
.meta-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

.meta-item .in-stock {
    color: var(--success-color);
}

.meta-item .out-of-stock {
    color: var(--accent-color);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + var(--space-4));
    right: var(--space-4);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--accent-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast-icon {
    font-size: var(--text-lg);
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--accent-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-message {
    flex: 1;
    font-weight: 500;
    font-size: var(--text-sm);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: var(--text-sm);
    padding: var(--space-1);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-light);
    padding: var(--space-8) 0 var(--space-6);
    margin-top: var(--space-16);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-brand h3 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.footer-brand p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
}

.footer-links {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--text-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-light);
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.debug-info {
    font-size: var(--text-xs);
    color: var(--text-light);
    font-family: var(--font-mono);
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .main-layout {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .categories-sidebar {
        position: static;
        order: 2;
        margin-top: var(--space-6);
    }
    
    .products-section {
        order: 1;
    }
}

/* Móvil - CORREGIDO PARA BÚSQUEDA */
@media (max-width: 768px) {
    :root {
        --header-height: 70px;
        --space-4: 1rem;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    /* BOTÓN DE BÚSQUEDA MÓVIL - MOSTRAR */
    .mobile-search-btn {
        display: flex;
    }
    
    .header-content {
        position: relative;
    }
    
    /* BÚSQUEDA MÓVIL CORREGIDA */
    .search-container {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        margin: 0;
        max-width: none;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-light);
        padding: var(--space-4);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 1100;
        box-shadow: var(--shadow-md);
    }
    
    .search-container.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* Ajustar z-index para overlay cuando búsqueda está activa */
    .search-container.active ~ .mobile-overlay {
        z-index: 1050;
    }
    
    .categories-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80%;
        max-width: 320px;
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-xl);
        order: unset;
        margin-top: 0;
    }
    
    .categories-sidebar.active {
        transform: translateX(0);
    }
    
    .close-sidebar-btn {
        display: block;
    }
    
    .sidebar-header {
        padding-top: calc(var(--header-height) + var(--space-4));
    }
    
    .hero {
        padding: var(--space-12) 0 var(--space-8);
    }
    
    .hero-content h2 {
        font-size: var(--text-3xl);
    }
    
    .hero-content p {
        font-size: var(--text-base);
    }
    
    .main-container {
        padding: var(--space-6) 0;
    }
    
    .products-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .products-controls {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .modal {
        padding: var(--space-2);
    }
    
    .modal-content {
        margin: var(--space-4) auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-4);
    }
    
    .cart-item {
        flex-wrap: wrap;
        gap: var(--space-3);
    }
    
    .cart-item-quantity {
        order: 3;
        width: 100%;
        justify-content: space-between;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .toast-container {
        left: var(--space-2);
        right: var(--space-2);
        top: calc(var(--header-height) + var(--space-2));
    }
    
    .toast {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--space-3);
    }
    
    .hero {
        padding: var(--space-8) 0 var(--space-6);
    }
    
    .hero-content h2 {
        font-size: var(--text-2xl);
    }
    
    .products-grid {
        gap: var(--space-3);
    }
    
    .product-card {
        border-radius: var(--border-radius);
    }
    
    .action-btn .cart-text,
    .action-btn span:not(.cart-count) {
        display: none;
    }
    
    /* Ocultar texto del login en móviles muy pequeños */
    .login-btn span {
        display: none;
    }
}

/* ==================== UTILIDADES ==================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden { display: none !important; }
.block { display: block !important; }
.inline { display: inline !important; }
.inline-block { display: inline-block !important; }
.flex { display: flex !important; }

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInFromRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, to { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -8px, 0); }
    70% { transform: translate3d(0, -4px, 0); }
    90% { transform: translate3d(0, -2px, 0); }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-in-right { animation: slideInFromRight 0.3s ease-out; }
.animate-slide-in-left { animation: slideInFromLeft 0.3s ease-out; }
.animate-bounce { animation: bounce 1s; }