@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800;900&display=swap');

/* ===================================================================
   VARIABLES CSS SIMPLIFICADAS
   =================================================================== */
:root {
    --primary-blue: #1e3c72;
    --secondary-blue: #2a5298;
    --accent-color: #667eea;
    --text-dark: #333;
    --white: #ffffff;
    --gray: #e2e2e2;
    --light-bg: #f8f9fa;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --border-radius: 15px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================================
   RESET UNIVERSAL
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3ff 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Corregir inputs en iOS para prevenir zoom */
input, select, textarea, button {
    font-size: 16px;
}

/* ===================================================================
   TOPBAR RESPONSIVE CON GRADIENTE DINÁMICO
   =================================================================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #10209e;
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    color: var(--white);
    padding: 0.5rem 0;
    z-index: 1001;
    height: 45px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.topbar.hidden {
    transform: translateY(-100%);
}

.topbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    height: 100%;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.topbar-item:hover {
    color: #3b82f6;
}

.social-links {
    display: flex;
    gap: 0.8rem;
}

.social-links a {
    color: var(--white);
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-links a:hover {
    color: #3b82f6;
    transform: scale(1.1);
}

/* ===================================================================
   HEADER CON BLUR ELEGANTE
   =================================================================== */
.header {
    position: fixed;
    top: 45px;
    left: 0;
    width: 100%;
    background: rgba(16, 32, 158, 0.95);
    backdrop-filter: blur(12px) saturate(130%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    height: 80px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.header.move-up {
    transform: translateY(-45px);
}

.header.scrolled {
    top: 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    height: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo a {
    display: inline-block;
}

.logo-img {
    height: 110px;
    width: auto;
    max-width: 240px;
    display: block;
}

/* ===================================================================
   NAVEGACIÓN RESPONSIVE
   =================================================================== */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

.nav-menu a,
.nav-menu button {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.nav-menu a:hover,
.nav-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ===================================================================
   CARRITO Y ACCIONES DEL HEADER
   =================================================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1002;
}

.desktop-cart,
.cart-link {
    background: rgba(255, 255, 255, 0.2) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 50px !important;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    color: var(--white);
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.desktop-cart:hover,
.cart-link:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px);
}

/* ===================================================================
   HAMBURGER MENU
   =================================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1002;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    align-items: center;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--white);
    transition: var(--transition);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================================================
   NUMERITO DEL CARRITO CON ANIMACIÓN
   =================================================================== */
.numerito {
    background: linear-gradient(135deg, #ff6b6b, #ffa8a8);
    animation: subtlePulse 3s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
}

@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================================================
   CONTENIDO PRINCIPAL ULTRA RESPONSIVE
   =================================================================== */
.main-container {
    width: 100%;
    max-width: 1400px;
    margin: 125px auto 0;
    padding: 1rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.08);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.titulo-principal {
    background: #10209e;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(102, 126, 234, 0.15));
    font-size: 2.5rem;
    font-weight: 700;
    
}

/* ===================================================================
   SOLUCIÓN DEFINITIVA - BOTONES DE CATEGORÍA CON ESTADO ACTIVO
   =================================================================== */

/* RESETEAR COMPLETAMENTE LOS BOTONES DE CATEGORÍA */
.boton-categoria {
    all: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding: 0.8rem 1.5rem !important;
    min-height: 44px !important;
    width: auto !important;
    max-width: none !important;
    font-family: 'Rubik', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--accent-color) !important;
    text-align: center !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    background: linear-gradient(145deg, #ffffff, #f8f9ff) !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
    border-radius: 50px !important;
    box-shadow: 3px 3px 8px rgba(102, 126, 234, 0.1), -1px -1px 4px rgba(107, 96, 96, 0.1) !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
}

/* CONTENEDOR DE FILTROS */
.filtros-container {
    display: flex !important;
    gap: 1rem !important;
    flex-wrap: wrap !important;
    margin-bottom: 2rem !important;
    justify-content: flex-start !important;
    padding: 1rem !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(8px) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.06) !important;
}

/* ÍCONOS DENTRO DE LOS BOTONES */
.boton-categoria i {
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

/* ESTADO HOVER */
.boton-categoria:hover {
    background: linear-gradient(145deg, var(--accent-color), #7c3aed) !important;
    color: var(--white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 4px 8px 16px rgba(102, 126, 234, 0.2), 0 0 20px rgba(102, 126, 234, 0.1) !important;
}

/* ESTADO ACTIVO - BOTÓN SELECCIONADO */
.boton-categoria.active {
    background: linear-gradient(145deg, var(--accent-color), #273583) !important;
    color: var(--white) !important;
    box-shadow: 4px 8px 16px rgba(102, 126, 234, 0.3), 0 0 20px rgba(102, 126, 234, 0.2) !important;
    transform: translateY(-1px) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
}

/* TEXTO E ÍCONOS EN ESTADO ACTIVO */
.boton-categoria.active i,
.boton-categoria.active span {
    color: var(--white) !important;
    position: relative !important;
    z-index: 2 !important;
}

/* MANTENER ESTILO ACTIVO EN HOVER */
.boton-categoria.active:hover {
    background: linear-gradient(145deg, var(--accent-color), #1e40af) !important;
    color: var(--white) !important;
    transform: translateY(-2px) !important;
    box-shadow: 4px 8px 16px rgba(102, 126, 234, 0.4), 0 0 25px rgba(102, 126, 234, 0.3) !important;
}

/* ASEGURAR VISIBILIDAD DEL CONTENIDO */
.boton-categoria span,
.boton-categoria i {
    position: relative !important;
    z-index: 1 !important;
    display: inline !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* ===================================================================
   RESPONSIVE CON !IMPORTANT PARA FORZAR
   =================================================================== */

@media (max-width: 768px) {
    .filtros-container {
        justify-content: center !important;
        gap: 0.8rem !important;
        padding: 1rem 0.8rem !important;
    }
    
    .boton-categoria {
        font-size: 0.9rem !important;
        padding: 0.6rem 1rem !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }
    
    .boton-categoria i {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .filtros-container {
        gap: 0.5rem !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        padding: 0.8rem 0.5rem !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        justify-content: flex-start !important;
    }
    
    .filtros-container::-webkit-scrollbar {
        display: none !important;
    }
    
    .boton-categoria {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.8rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        min-width: max-content !important;
        overflow: visible !important;
    }
    
    .boton-categoria i {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 360px) {
    .filtros-container {
        gap: 0.4rem !important;
        padding: 0.6rem 0.3rem !important;
    }
    
    .boton-categoria {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem !important;
        min-height: 36px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        overflow: visible !important;
    }
    
    .boton-categoria i {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 320px) {
    .filtros-container {
        gap: 0.3rem !important;
        padding: 0.5rem 0.2rem !important;
    }
    
    .boton-categoria {
        font-size: 0.65rem !important;
        padding: 0.3rem 0.5rem !important;
        min-height: 34px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        overflow: visible !important;
    }
    
    .boton-categoria i {
        font-size: 0.7rem !important;
    }
}

/* ===================================================================
   GRID DE PRODUCTOS DEFINITIVO
   =================================================================== */
.contenedor-productos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    width: 100%;
    padding: 0 0.5rem;
}

/* ===================================================================
   TARJETAS DE PRODUCTOS MODERNAS
   =================================================================== */
.producto {
    background: linear-gradient(145deg, #ffffff 0%, #fafbff 100%);
    border: 1px solid rgba(102, 126, 234, 0.08);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    width: 100%;
    max-width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

.producto:nth-child(1) { animation-delay: 0.1s; }
.producto:nth-child(2) { animation-delay: 0.15s; }
.producto:nth-child(3) { animation-delay: 0.2s; }
.producto:nth-child(4) { animation-delay: 0.25s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.producto::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.producto:hover::before {
    left: 100%;
}

.producto:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

/* Badge elegante */
.producto::after {
   /* content: 'NUEVO';*/
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ffa8a8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0;
    transform: scale(0) rotate(15deg);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    text-transform: uppercase;
}

.producto:hover::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.producto:hover::after {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.producto-imagen-wrapper {
    height: 190px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: var(--white);
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.producto-imagen {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    filter: brightness(1.02) contrast(1.05);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block;
}

.producto:hover .producto-imagen {
    filter: brightness(1.05) contrast(1.1);
    transform: scale(1.05);
}

.producto-detalles {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: var(--white);
}

.producto-titulo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 0.6rem 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6rem;
    transition: color 0.3s ease;
}

.producto:hover .producto-titulo {
    color: var(--accent-color);
}

.producto-precio {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(102, 126, 234, 0.2));
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0.3rem 0 1rem 0;
    flex-grow: 1;
}

/* ===================================================================
   BOTONES MODERNOS
   =================================================================== */
.producto-botones {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.btn-ver-producto {
    position: relative;
    overflow: hidden;
    background: #4e4d4d;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.25);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
}

.btn-ver-producto::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: width 0.3s ease, height 0.3s ease;
    transform: translate(-50%, -50%);
}

.btn-ver-producto:hover::before {
    width: 120px;
    height: 120px;
}

.btn-ver-producto:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.35);
}

.btn-ver-producto i {
    font-size: 12px;
}

.producto-agregar {
    width: 100%;
    background: #273583;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
    position: relative;
    overflow: hidden;
    border: none;
    color: var(--white);
    padding: 0.8rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.95rem;
    min-height: 44px;
}

.producto-agregar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.4s ease;
}

.producto-agregar:hover::before {
    left: 100%;
}

.producto-agregar:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

/* ===================================================================
   MODAL DEL CARRITO - ESTRUCTURA ORIGINAL
   =================================================================== */
.carrito-modal {
    display: none;
    position: fixed;
    z-index: 10050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.carrito-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.carrito-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideIn 0.3s ease;
    position: relative;
    z-index: 10051;
}

.carrito-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.carrito-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carrito-items {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

.carrito-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.carrito-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    text-align: center;
}

.carrito-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-vaciar,
.btn-comprar {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
}

.btn-vaciar {
    background: #f44336;
    color: white;
}

.btn-vaciar:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

.btn-comprar {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
}

.btn-comprar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.3);
}

/* ITEMS DEL CARRITO - ESTRUCTURA HORIZONTAL ORIGINAL */
.carrito-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.carrito-item:last-child {
    border-bottom: none;
}

.item-imagen {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-dark);
}

.item-precio {
    margin: 0;
    color: var(--accent-color);
    font-weight: 600;
}

.item-cantidad {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cantidad {
    width: 30px;
    height: 30px;
    border: 1px solid var(--accent-color);
    background: white;
    color: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: var(--transition);
}

.btn-cantidad:hover {
    background: var(--accent-color);
    color: white;
}

.item-subtotal {
    font-weight: bold;
    color: var(--primary-blue);
    min-width: 80px;
    text-align: right;
}

.btn-eliminar {
    background: #f44336;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-eliminar:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.carrito-vacio {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-dark);
}

.carrito-vacio p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #666;
}

.btn-seguir-comprando {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-seguir-comprando:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
}

/* ===================================================================
   RESPONSIVE PARA EL CARRITO ORIGINAL
   =================================================================== */
@media (max-width: 768px) {
    .carrito-content {
        width: 95%;
        margin: 1rem;
    }
    
    .carrito-header {
        padding: 1rem;
    }
    
    .carrito-header h2 {
        font-size: 1.3rem;
    }
    
    .carrito-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn-vaciar,
    .btn-comprar {
        min-width: 100px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .carrito-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .carrito-header {
        padding: 1rem;
    }
    
    .carrito-header h2 {
        font-size: 1.2rem;
    }
    
    .carrito-items {
        padding: 0.8rem;
        max-height: 300px;
    }
    
    .carrito-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .item-info {
        flex-basis: 100%;
        order: -1;
    }
    
    .item-info h4 {
        font-size: 0.9rem;
    }
    
    .item-precio {
        font-size: 0.8rem;
    }
    
    .item-imagen {
        width: 50px;
        height: 50px;
    }
    
    .btn-cantidad {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .btn-eliminar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .item-subtotal {
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .carrito-footer {
        padding: 1rem;
    }
    
    .carrito-total {
        font-size: 1.2rem;
    }
    
    .carrito-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn-vaciar, 
    .btn-comprar {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-width: 100px;
    }
}

@media (max-width: 360px) {
    .carrito-content {
        width: 98%;
        margin: 0.2rem;
    }
    
    .carrito-header {
        padding: 0.6rem;
    }
    
    .carrito-header h2 {
        font-size: 1rem;
    }
    
    .close-btn {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .carrito-items {
        padding: 0.4rem;
        max-height: 250px;
    }
    
    .carrito-item {
        padding: 0.4rem;
        gap: 0.4rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-imagen {
        width: 35px;
        height: 35px;
    }
    
    .item-info {
        width: 100%;
        order: 1;
    }
    
    .item-cantidad {
        order: 2;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
    
    .item-subtotal {
        order: 3;
        width: 100%;
        text-align: left;
        font-size: 0.8rem;
    }
    
    .btn-eliminar {
        order: 4;
        align-self: center;
    }
}

/* ===================================================================
   SWEETALERT Z-INDEX
   =================================================================== */
.swal2-container {
    z-index: 99999 !important;
}

.swal2-popup {
    z-index: 100000 !important;
}

.swal2-backdrop-show {
    z-index: 99998 !important;
}

/* ===================================================================
   MENÚ MÓVIL
   =================================================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    z-index: 999;
    transition: left 0.3s ease;
    display: none;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-content {
    padding-top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    overflow-y: auto;
    padding: 120px 1rem 2rem;
}

.mobile-menu-content a {
    width: 90%;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.mobile-menu-content a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* ===================================================================
   OVERLAYS
   =================================================================== */
.mobile-overlay,
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-overlay.active,
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.menu-open {
    overflow: hidden;
}

/* ===================================================================
   ANIMACIONES OPTIMIZADAS
   =================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===================================================================
   RESPONSIVE BREAKPOINTS OPTIMIZADOS
   =================================================================== */

/* TABLET Y MÓVIL GRANDE (768px y menor) */
@media (max-width: 768px) {
    /* Header */
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        display: none;
    }
    
    .mobile-menu {
        display: block;
    }
    
    /* Topbar */
    .topbar {
        animation-duration: 15s;
    }
    
    .topbar-container {
        padding: 0 0.8rem;
    }
    
    .topbar-left {
        gap: 0.8rem;
    }
    
    .topbar-item span {
        display: none;
    }
    
    /* Main content */
    .main-container {
        margin-top: 130px;
        padding: 0.8rem;
    }
    
    .content-header {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .titulo-principal {
        font-size: 1.7rem;
    }
    
    /* Grid productos - MANTENER 4 COLUMNAS MÁXIMO */
    .contenedor-productos {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .producto {
        min-height: 350px;
    }
    
    .producto-imagen-wrapper {
        height: 140px;
        padding: 0.8rem;
    }
    
    .producto-detalles {
        padding: 0.8rem;
    }
    
    .producto-titulo {
        font-size: 0.9rem;
    }
    
    .producto-precio {
        font-size: 1rem;
    }
    
    .producto-agregar {
        font-size: 0.75rem;
        padding: 0.6rem 0.8rem;
    }
    
    .btn-ver-producto {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    /* Filtros */
    .filtros-container {
        justify-content: center;
        gap: 0.8rem;
    }
    
    .boton-categoria {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Carrito */
    .carrito-content {
        width: 95%;
        margin: 1rem;
    }
    
    .carrito-header {
        padding: 1rem;
    }
    
    .carrito-header h2 {
        font-size: 1.3rem;
    }
    
    .carrito-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    /* Efectos más sutiles en móvil */
    .producto::before,
    .boton-categoria::before,
    .producto-agregar::before {
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    }
    
    .producto:hover {
        transform: translateY(-4px);
    }
    
    .boton-categoria:hover,
    .producto-agregar:hover,
    .btn-ver-producto:hover {
        transform: translateY(-1px);
    }
    
    .producto:hover .producto-imagen {
        transform: scale(1.02);
    }
    
    /* Reducir efectos costosos en móvil */
    .producto {
        will-change: auto;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .producto-imagen {
        will-change: auto;
    }
    
    .producto:hover {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    }
    
    /* Asegurar que el contenido no se superponga */
    .producto-detalles {
        position: relative;
        z-index: 2;
        background: var(--white);
    }
    
    .producto-imagen-wrapper {
        position: relative;
        z-index: 1;
    }
    
    .producto-botones {
        position: relative;
        z-index: 3;
    }
}

/* MÓVIL PEQUEÑO (480px y menor) */
@media (max-width: 480px) {
    /* Topbar mobile */
    .topbar {
        height: 35px;
    }
    
    .topbar-item:nth-child(3) {
        display: none;
    }
    
    .topbar-right .topbar-item {
        display: none;
    }
    
    /* Header mobile */
    .header {
        top: 35px;
        height: 70px;
    }
    
    .header.scrolled {
        top: 0;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-img {
        height: 200px;
        max-width: 180px;
    }
    
    /* Main content mobile */
    .main-container {
        margin-top: 110px;
        padding: 0.5rem;
    }
    
    .content-header {
        padding: 0.8rem;
        margin-bottom: 1.5rem;
    }
    
    .titulo-principal {
        font-size: 1.5rem;
    }
    
    /* Productos en móvil - DOS COLUMNAS */
    .contenedor-productos {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .producto {
        min-height: 320px;
    }
    
    .producto-imagen-wrapper {
        height: 120px;
        padding: 0.5rem;
    }
    
    .producto-detalles {
        padding: 0.6rem;
    }
    
    .producto-titulo {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    .producto-precio {
        font-size: 0.9rem;
        margin: 0.3rem 0 0.6rem 0;
    }
    
    .producto-agregar {
        font-size: 0.7rem;
        padding: 0.5rem;
    }
    
    .btn-ver-producto {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Filtros con scroll horizontal */
    .filtros-container {
        gap: 0.5rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 0.5rem 0.5rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .filtros-container::-webkit-scrollbar {
        display: none;
    }
    
    .boton-categoria {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    
    /* Carrito mobile */
    .carrito-content {
        width: 95%;
        margin: 0.5rem;
        max-height: 95vh;
    }
    
    .carrito-header {
        padding: 1rem;
    }
    
    .carrito-header h2 {
        font-size: 1.2rem;
    }
    
    .carrito-items {
        padding: 0.8rem;
        max-height: 300px;
    }
    
    .carrito-item {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .item-info {
        flex-basis: 100%;
        order: -1;
    }
    
    .item-info h4 {
        font-size: 0.9rem;
    }
    
    .item-precio {
        font-size: 0.8rem;
    }
    
    .item-imagen {
        width: 50px;
        height: 50px;
    }
    
    .btn-cantidad {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .btn-eliminar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .item-subtotal {
        font-size: 0.9rem;
        min-width: 70px;
    }
    
    .carrito-footer {
        padding: 1rem;
    }
    
    .carrito-total {
        font-size: 1.2rem;
    }
    
    .carrito-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .btn-vaciar, 
    .btn-comprar {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        min-width: 100px;
    }
    
    /* Numerito carrito */
    .numerito {
        min-width: 16px;
        height: 16px;
        font-size: 10px;
        padding: 1px 4px;
    }
    
    /* Desktop cart mobile */
    .desktop-cart {
        padding: 0.5rem 0.7rem !important;
        font-size: 0.8rem !important;
    }
    
    /* Header actions */
    .header-actions {
        gap: 0.5rem;
    }
    
    /* Eliminar animaciones costosas en móvil */
    .producto:hover {
        transform: none;
    }
    
    .producto:hover .producto-imagen {
        transform: none;
    }
    
    .btn-ver-producto:hover,
    .producto-agregar:hover {
        transform: translateY(-1px);
    }
    
    /* Corregir problemas de layout específicos */
    .contenedor-productos {
        overflow: hidden;
    }
    
    .producto {
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .producto-detalles {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 120px;
    }
    
    .producto-botones {
        margin-top: auto;
        flex-shrink: 0;
    }
    
    /* Mejorar accesibilidad táctil */
    .boton-categoria,
    .producto-agregar {
        min-height: 44px;
    }
    
    .btn-ver-producto {
        min-height: 36px;
    }
    
    /* Corregir inputs en iOS */
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* MÓVIL MUY PEQUEÑO (360px y menor) */
@media (max-width: 360px) {
    .main-container {
        padding: 0.3rem;
    }
    
    .content-header {
        padding: 0.6rem;
        margin-bottom: 1rem;
    }
    
    .titulo-principal {
        font-size: 1.3rem;
    }
    
    /* Una sola columna en pantallas muy pequeñas */
    .contenedor-productos {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .producto {
        min-height: 280px;
    }
    
    .producto-imagen-wrapper {
        height: 100px;
        padding: 0.4rem;
    }
    
    .producto-detalles {
        padding: 0.5rem;
    }
    
    .producto-titulo {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .producto-precio {
        font-size: 0.85rem;
        margin: 0.2rem 0 0.5rem 0;
    }
    
    .producto-agregar {
        font-size: 0.65rem;
        padding: 0.4rem;
    }
    
    .btn-ver-producto {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Filtros ultra compactos */
    .filtros-container {
        gap: 0.4rem;
        padding: 0 0.3rem 0.3rem;
    }
    
    .boton-categoria {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-height: 36px;
    }
    
    .boton-categoria i {
        font-size: 0.8rem;
    }
    
    /* Carrito muy compacto */
    .carrito-content {
        width: 98%;
        margin: 0.2rem;
    }
    
    .carrito-header {
        padding: 0.6rem;
    }
    
    .carrito-header h2 {
        font-size: 1rem;
    }
    
    .close-btn {
        width: 30px;
        height: 30px;
        font-size: 1.2rem;
    }
    
    .carrito-items {
        padding: 0.4rem;
        max-height: 200px;
    }
    
    .carrito-item {
        padding: 0.4rem;
        gap: 0.4rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .item-imagen {
        width: 35px;
        height: 35px;
    }
    
    .item-info {
        width: 100%;
        order: 1;
    }
    
    .item-cantidad {
        order: 2;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }
    
    .item-subtotal {
        order: 3;
        width: 100%;
        text-align: left;
        font-size: 0.8rem;
    }
    
    .btn-eliminar {
        order: 4;
        align-self: center;
    }
}

/* MÓVILES ULTRA PEQUEÑOS (320px y menor) */
@media (max-width: 320px) {
    .main-container {
        padding: 0.2rem;
        margin-top: 105px;
    }
    
    .content-header {
        padding: 0.5rem;
        margin-bottom: 0.8rem;
    }
    
    .titulo-principal {
        font-size: 1.2rem;
    }
    
    .contenedor-productos {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0;
    }
    
    .producto {
        min-height: 250px;
    }
    
    .producto-imagen-wrapper {
        height: 90px;
        padding: 0.3rem;
    }
    
    .producto-detalles {
        padding: 0.4rem;
    }
    
    .producto-titulo {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    
    .producto-precio {
        font-size: 0.8rem;
        margin: 0.1rem 0 0.4rem 0;
    }
    
    .producto-agregar {
        font-size: 0.6rem;
        padding: 0.3rem;
        min-height: 36px;
    }
    
    .btn-ver-producto {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
        min-height: 30px;
    }
    
    /* Filtros ultra compactos */
    .filtros-container {
        gap: 0.3rem;
        padding: 0 0.2rem 0.2rem;
    }
    
    .boton-categoria {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-height: 34px;
    }
    
    /* Header más compacto */
    .header {
        height: 60px;
    }
    
    .header-container {
        padding: 0 0.5rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 150px;
        max-width: 120px;
    }
}

/* ===================================================================
   UTILITIES PARA RESPONSIVE
   =================================================================== */
.hide-mobile {
    display: block;
}

@media (max-width: 480px) {
    .hide-mobile {
        display: none !important;
    }
}

.show-mobile {
    display: none !important;
}

@media (max-width: 480px) {
    .show-mobile {
        display: block !important;
    }
}

/* Prevenir desbordamiento horizontal */
* {
    max-width: 100%;
}