/* ===================================
   EL BUEN SABOR - MENU.CSS
   Estilos específicos para la página del menú
   =================================== */

/* ===== VARIABLES ADICIONALES ===== */
:root {
    --menu-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --card-hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    --badge-hot: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    --badge-new: linear-gradient(135deg, #4facfe, #00f2fe);
    --badge-premium: linear-gradient(135deg, #ffd700, #ffed4e);
}

/* ===== HERO DEL MENÚ ===== */
.menu-hero {
    background: linear-gradient(135deg, #1a1f35 0%, #2d3748 100%);
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.menu-hero__content {
    position: relative;
    z-index: 1;
}

.menu-hero__title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.menu-hero__subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FILTROS DE CATEGORÍAS ===== */
.menu-filters {
    background: #fff;
    padding: 2rem 0;
    position: sticky;
    top: 80px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: var(--menu-transition);
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-color: #ff6b35;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.filter-btn i {
    font-size: 1.1rem;
}

/* ===== SECCIÓN DEL MENÚ ===== */
.menu-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.menu-category {
    margin-bottom: 5rem;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #ff6b35;
}

.category-header i {
    font-size: 2rem;
    color: #ff6b35;
}

.category-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    flex: 1;
}

.category-count {
    background: #ff6b35;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ===== GRID DEL MENÚ ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

/* ===== TARJETAS DE PRODUCTOS ===== */
.menu-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: var(--menu-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-hover-shadow);
}

/* Imagen del producto */
.menu-card__image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.menu-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.menu-card:hover .menu-card__image img {
    transform: scale(1.1);
}

/* Badges */
.menu-card__badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.menu-card__badge--hot {
    background: var(--badge-hot);
    color: #fff;
}

.menu-card__badge--new {
    background: var(--badge-new);
    color: #fff;
}

.menu-card__badge--premium {
    background: var(--badge-premium);
    color: #1a1f35;
}

.menu-card__badge i {
    font-size: 0.85rem;
}

/* Contenido de la card */
.menu-card__content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.menu-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.menu-card__description {
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

/* Detalles del producto */
.menu-card__details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #495057;
    font-weight: 500;
}

.detail-tag i {
    font-size: 0.85rem;
}

.detail-tag--spicy {
    background: #fff5f5;
    border-color: #feb2b2;
    color: #c53030;
}

.detail-tag--premium {
    background: #fffaf0;
    border-color: #fbd38d;
    color: #c05621;
}

.detail-tag--veggie {
    background: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
}

/* Footer de la card */
.menu-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.menu-card__price {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.price-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff6b35;
}

.btn-add-cart {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--menu-transition);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
    white-space: nowrap;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, #f7931e, #ff6b35);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-add-cart:active {
    transform: translateY(0);
}

.btn-add-cart i {
    font-size: 1rem;
}

/* ===== CARRITO LATERAL ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

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

.cart-sidebar__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
}

.cart-sidebar__header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.cart-sidebar__close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--menu-transition);
}

.cart-sidebar__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Banner de envío gratis */
.free-delivery-banner {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-bottom: 2px solid #c5e1a5;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #ddd;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #66bb6a, #43a047);
    transition: width 0.5s ease;
    border-radius: 50px;
}

.progress-bar.pulse {
    animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
    color: #2e7d32;
}

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

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Estado vacío del carrito */
.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.cart-empty i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.cart-empty p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.btn-primary-small {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--menu-transition);
}

.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.3);
}

/* Items del carrito */
.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: var(--menu-transition);
}

.cart-item:hover {
    background: #e9ecef;
}

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

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

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

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 0.25rem 0;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ff6b35;
    margin: 0 0 0.25rem 0;
}

.cart-item-subtotal {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border-radius: 8px;
    padding: 0.25rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #ff6b35;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--menu-transition);
}

.qty-btn:hover {
    background: #f7931e;
    transform: scale(1.1);
}

.qty-input {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    border: none;
    background: transparent;
    font-size: 0.95rem;
}

.qty-input:focus {
    outline: none;
}

/* Ocultar flechas del input number */
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input[type=number] {
    -moz-appearance: textfield;
}

.btn-remove {
    background: #dc3545;
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--menu-transition);
}

.btn-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Footer del carrito */
.cart-sidebar__footer {
    padding: 1.5rem;
    border-top: 2px solid #e9ecef;
    background: #f8f9fa;
}

.cart-totals {
    margin-bottom: 1.5rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    color: #495057;
    font-size: 0.95rem;
}

.cart-total-row--total {
    padding-top: 1rem;
    border-top: 2px solid #dee2e6;
    margin-top: 0.5rem;
    font-size: 1.25rem;
    color: #2d3748;
}

.btn-checkout {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--menu-transition);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-checkout:hover {
    background: linear-gradient(135deg, #128c7e, #25d366);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.btn-checkout i {
    font-size: 1.3rem;
}

.btn-clear-cart {
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--menu-transition);
    margin-top: 0.75rem;
}

.btn-clear-cart:hover {
    background: #dc3545;
    color: #fff;
    transform: translateY(-2px);
}

.btn-clear-cart i {
    font-size: 0.95rem;
}

/* Overlay del carrito */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: var(--menu-transition);
    z-index: 1000;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== BOTÓN DEL CARRITO EN HEADER ===== */
.btn-cart {
    position: relative;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--menu-transition);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-cart:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-cart i {
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #fff;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    /* Hero */
    .menu-hero {
        padding: 120px 0 60px;
    }
    
    .menu-hero__title {
        font-size: 2rem;
    }
    
    .menu-hero__subtitle {
        font-size: 1rem;
    }
    
    /* Filtros */
    .menu-filters {
        padding: 1.5rem 0;
        top: 70px;
    }
    
    .filters-wrapper {
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .filter-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Grid */
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Categoría */
    .category-header {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .category-header h2 {
        font-size: 1.5rem;
    }
    
    /* Carrito */
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
}

@media (max-width: 480px) {
    .menu-hero__title {
        font-size: 1.75rem;
    }
    
    .filter-btn {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
    }
    
    .menu-card__footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-add-cart {
        width: 100%;
        justify-content: center;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-down {
    animation: slideInDown 0.4s ease-out;
}

.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pulse {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
.cart-sidebar__content::-webkit-scrollbar {
    width: 6px;
}

.cart-sidebar__content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-sidebar__content::-webkit-scrollbar-thumb {
    background: #ff6b35;
    border-radius: 3px;
}

.cart-sidebar__content::-webkit-scrollbar-thumb:hover {
    background: #f7931e;
}