:root {
    --mexican-red: #A6192E;
    --mexican-gold: #F4C430;
    --mexican-cream: #FDF7D4;
    --mexican-terra: #D2691E;
    --mexican-brown: #8B4513;
    --white: #FFFFFF;
    --whatsapp-green: #25D366;
    --shadow-light: rgba(166, 25, 46, 0.12);
    --shadow-medium: rgba(244, 196, 48, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--mexican-cream) 0%, #FFF8E1 100%);
    color: var(--mexican-brown);
    line-height: 1.5;
    padding: 20px 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 0;
    background: var(--white);
    border-radius: 24px;
    margin-bottom: 40px;
    box-shadow: 0 12px 40px var(--shadow-light);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2.4rem;
    color: var(--mexican-red);
    background: var(--mexican-gold);
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px var(--shadow-medium);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 600;
    background: linear-gradient(135deg, var(--mexican-red), var(--mexican-brown));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.location {
    font-size: 1.15rem;
    color: var(--mexican-brown);
    opacity: 0.85;
    font-weight: 400;
}

/* Filtros */
.filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 2px solid rgba(244, 196, 48, 0.3);
    color: var(--mexican-brown);
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--mexican-gold);
    border-color: var(--mexican-gold);
    color: var(--mexican-red);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--shadow-medium);
}

/* Grid de Productos */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
    margin-bottom: 60px;
}

/* Tarjetas de Producto Individuales */
.product-card {
    background: var(--white);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 48px var(--shadow-light);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 32px 80px var(--shadow-medium);
}

/* Imagen del producto */
.product-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08);
}

.category-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--whatsapp-green);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Info del producto */
.product-info {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--mexican-brown);
    margin-bottom: 8px;
}

.ingredients {
    color: var(--mexican-terra);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Footer del producto */
.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(166, 25, 46, 0.08);
}

.price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mexican-red);
}

.whatsapp-btn {
    background: var(--whatsapp-green);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.5);
}

/* Footer */
.contact {
    text-align: center;
    padding: 40px 0;
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 12px 40px var(--shadow-light);
}

.contact-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--mexican-brown);
    margin-bottom: 12px;
}

.contact-info i {
    color: var(--mexican-red);
    font-size: 1.3rem;
}

.delivery {
    font-size: 1rem;
    color: var(--mexican-terra);
    font-weight: 500;
    opacity: 0.9;
}

/* Responsive Perfecto */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto 40px;
        gap: 20px;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .filter-btn {
        width: 200px;
        justify-content: center;
    }
    
    header {
        margin-bottom: 30px;
        padding: 30px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .logo i {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 20px 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }
.product-card:nth-child(7) { animation-delay: 0.7s; }
.product-card:nth-child(8) { animation-delay: 0.8s; }

/* Opciones desplegables */
.options-group {
    margin: 16px 0;
    padding: 16px;
    background: rgba(244, 196, 48, 0.08);
    border-radius: 16px;
    border-left: 4px solid var(--mexican-gold);
}

.options-group label {
    display: block;
    font-weight: 600;
    color: var(--mexican-brown);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.option-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(166, 25, 46, 0.15);
    border-radius: 12px;
    background: var(--white);
    font-size: 1rem;
    font-weight: 500;
    color: var(--mexican-brown);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-select:focus {
    outline: none;
    border-color: var(--mexican-gold);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.15);
}

.dynamic-price {
    font-size: 1.4rem !important;
    transition: all 0.3s ease;
}

/* Responsive para opciones */
@media (max-width: 480px) {
    .options-group {
        padding: 12px;
    }
    
    .option-select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
}

.options-group label i {
    margin-right: 8px;
    color: var(--mexican-gold);
    width: 16px;
}

.dynamic-price {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--mexican-red) !important;
    transition: all 0.3s ease;
}

/* CARRITO FLOTANTE */
.cart-panel {
    position: fixed;
    right: -400px;
    top: 0;
    width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -8px 0 32px var(--shadow-light);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 24px;
    border-bottom: 1px solid rgba(166, 25, 46, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--mexican-brown);
}

.cart-items {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(244, 196, 48, 0.1);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
}

.cart-item-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.cart-item-info p {
    font-size: 0.85rem;
    color: var(--mexican-terra);
    margin-bottom: 8px;
}

.cart-item-controls {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--mexican-gold);
    background: var(--mexican-gold);
    color: var(--mexican-red);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--mexican-red);
    color: white;
    transform: scale(1.1);
}

.qty-input {
    width: 50px;
    text-align: center;
    border: 2px solid rgba(244, 196, 48, 0.3);
    border-radius: 6px;
    padding: 4px;
    font-weight: 600;
}

.remove-item {
    background: var(--mexican-red);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
}

.cart-total {
    padding: 20px 24px;
    border-top: 2px solid var(--mexican-gold);
    background: rgba(244, 196, 48, 0.1);
}

.cart-actions {
    padding: 24px;
    background: var(--mexican-cream);
}

.whatsapp-cart {
    width: 100%;
    background: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.whatsapp-cart:hover {
    background: #128C7E;
    transform: scale(1.02);
}

/* FAB BUTTON */
.fab-cart {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--whatsapp-green);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--mexican-red);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CANTIDAD en tarjetas */
.quantity-group {
    margin: 12px 0;
    padding: 12px;
    background: rgba(244, 196, 48, 0.08);
    border-radius: 12px;
    border-left: 4px solid var(--mexican-gold);
}

.quantity-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-input {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 2px solid rgba(244, 196, 48, 0.3);
    border-radius: 8px;
}

.add-to-cart {
    background: var(--mexican-gold) !important;
    color: var(--mexican-red) !important;
}

.add-to-cart i {
    color: var(--mexican-red) !important;
}

/* Responsive carrito */
@media (max-width: 480px) {
    .cart-panel {
        right: -100vw;
        width: 100vw;
    }
}

/* MENU HAMBURGUESA MODERNO */
.mobile-menu-toggle {
    display: none;
    margin-bottom: 20px;
}

.menu-toggle {
    width: 100%;
    background: var(--white);
    border: 2px solid rgba(244, 196, 48, 0.3);
    color: var(--mexican-brown);
    padding: 16px 20px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow-light);
}

.menu-toggle:hover {
    background: var(--mexican-gold);
    border-color: var(--mexican-gold);
    transform: translateY(-2px);
}

.filters-container {
    position: relative;
    margin-bottom: 40px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0;
    transition: all 0.4s ease;
}

/* MÓVIL SOLO */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .filters-container {
        margin-bottom: 80px; /* Espacio para menú desplegado */
    }
    
    .filters {
        /* ESTADO CERRADO por defecto */
        position: absolute;
        top: calc(100% + 24px);
        left: 50%;
        transform: translateX(-50%);
        width: 95%;
        max-width: 380px;
        background: var(--white);
        flex-direction: column;
        gap: 2px;
        padding: 0;
        border-radius: 20px;
        box-shadow: 0 20px 60px var(--shadow-medium);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        z-index: 100;
    }
    
    /* ESTADO ABIERTO */
    .filters.open {
        max-height: 450px;
        padding: 20px;
        opacity: 1;
        visibility: visible;
        gap: 8px;
    }
    
    .filter-btn {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 16px 20px !important;
        border-radius: 12px !important;
        border: 2px solid rgba(244, 196, 48, 0.2) !important;
        margin: 0 !important;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 2px 8px rgba(244, 196, 48, 0.1);
    }
    
    .filter-btn:hover,
    .filter-btn.active {
        background: linear-gradient(135deg, var(--mexican-gold), #ffeaa7) !important;
        transform: translateX(8px) !important;
        border-color: var(--mexican-gold) !important;
    }
}

/* DESKTOP: Filtros normales */
@media (min-width: 769px) {
    .filters {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .filter-btn {
        min-width: 120px;
        padding: 12px 20px;
    }
}

.address-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid rgba(244, 196, 48, 0.3);
    border-radius: 12px;
    font-size: 1rem;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
}

.address-input:focus {
    outline: none;
    border-color: var(--mexican-gold);
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.15);
}

.address-input::placeholder {
    color: var(--mexican-brown);
    opacity: 0.7;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.modal-content {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--mexican-brown);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    bottom: 0;
    background: white;
}

.modal-price {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--mexican-red);
}

.add-to-cart-btn {
    background: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 25px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background: #128C7E;
    transform: scale(1.03);
}

/* Estilo para las opciones dentro del modal */
.modal .options-group {
    margin-bottom: 20px;
}

.modal .options-group label {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

/* ==================== MODAL DE MENSAJES ==================== */
.message-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.message-content {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    max-width: 320px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.message-content #messageIcon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.message-content h3 {
    margin: 10px 0 15px;
    color: var(--mexican-brown);
}

.message-content p {
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.message-btn {
    background: var(--whatsapp-green);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.05rem;
    cursor: pointer;
}

.message-btn:hover {
    background: #128C7E;
}