:root {
    --primary: #ff6b6b;
    --secondary: #4ecdc4;
    --accent: #ffe66d;
    --dark: #1a1a1a;
    --light: #fefae0;
    --gray: #ccc;
    --gradient-1: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    --gradient-2: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    scroll-behavior: smooth;
}

/* Header & Nav */
header {
    background: rgba(26, 26, 26, 0.95);
    color: white;
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.5rem; font-weight: bold; }
.logo span { color: var(--primary); }

.nav-links { list-style: none; display: flex; gap: 20px; }
.nav-links li { margin-left: 20px; }
.nav-links a { color: white; text-decoration: none; transition: 0.3s; position: relative; }
.nav-links a:hover { color: var(--primary); }
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: 0.3s;
}
.nav-links a:hover::after { width: 100%; }

.favorites-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--gradient-1);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}
.favorites-counter:hover { transform: scale(1.1); }
.favorites-counter i { color: white; }
.favorites-counter span { color: white; font-weight: bold; }

.cart-btn {
    position: relative;
    background: var(--gradient-2);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    margin-left: 10px;
}

.cart-btn:hover {
    transform: scale(1.1);
}

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

.cart-btn span {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hero Section con Galería */
.hero {
    height: 70vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero-gallery {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.gallery-slide.active { opacity: 1; }

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.3s;
    z-index: 10;
}
.gallery-nav:hover { background: var(--primary); transform: translateY(-50%) scale(1.1); }
.gallery-nav.prev { left: 20px; }
.gallery-nav.next { right: 20px; }

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0,0,0,0.7), rgba(0,0,0,0.4));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

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

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient-1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 107, 0.4);
}

/* Menu Section */
.menu-section { padding: 80px 5%; }
.section-title { 
    text-align: center; 
    margin-bottom: 40px; 
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-1);
    margin: 10px auto 0;
    border-radius: 2px;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border: 2px solid var(--primary);
    background: transparent;
    cursor: pointer;
    border-radius: 25px;
    transition: 0.3s;
    font-weight: 600;
    color: var(--dark);
}

.filter-btn.active, .filter-btn:hover {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.menu-item {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.menu-item:hover { 
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.2);
}

.menu-item img { 
    width: 100%; 
    height: 220px; 
    object-fit: cover; 
    transition: transform 0.4s;
}

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

.image-container {
    position: relative;
    overflow: hidden;
}

.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.favorite-btn i {
    color: #ccc;
    font-size: 1.2rem;
    transition: 0.3s;
}

.favorite-btn:hover i,
.favorite-btn.active i {
    color: var(--primary);
}

.favorite-btn.active {
    background: var(--primary);
}

.favorite-btn.active i {
    color: white;
}

.item-info { 
    padding: 25px; 
}

.item-info h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.item-info p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.price { 
    color: var(--primary); 
    font-weight: bold; 
    font-size: 1.4rem; 
    display: block;
    margin-bottom: 15px;
}

.details-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px solid var(--secondary);
    border-radius: 10px;
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.details-btn:hover {
    background: var(--secondary);
    color: white;
}

/* Ocultar items por filtro */
.hidden { 
    display: none; 
    animation: fadeOut 0.3s;
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    justify-content: center;
    align-items: flex-start; /* Cambia de center a flex-start para que el scroll empiece arriba */
    overflow-y: auto;        /* Habilita el scroll vertical cuando el contenido exceda el alto */
    padding: 20px 0;         /* Espacio para que el modal no pegue de los bordes al scrolear */
    animation: fadeIn 0.3s;
}

.modal.show { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    position: relative;
    margin: auto;            /* Centra el contenido horizontalmente */
    animation: slideUp 0.4s;
    margin-top: 50px;        /* Espacio superior */
    margin-bottom: 50px;     /* Espacio inferior para alcanzar el botón de enviar */
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: 0.3s;
}

.modal-close:hover { color: var(--primary); transform: rotate(90deg); }

.modal-content img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--dark);
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-price {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 20px;
}

.modal-btn {
    width: 100%;
}

/* Selector de cantidad */
.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    border: 2px solid var(--primary);
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary);
    transition: 0.3s;
}

.quantity-selector button:hover {
    background: var(--primary);
    color: white;
}

.quantity-selector span {
    font-size: 1.5rem;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .nav-links { display: none; }
    .menu-item:hover { transform: translateY(-5px); }
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 3000;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-icon i {
    color: white;
    font-size: 1.5rem;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: bold;
    color: var(--dark);
    font-size: 1.1rem;
}

.toast-message {
    color: #666;
    font-size: 0.9rem;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0 0 0 10px;
    transition: 0.3s;
}

.toast-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

/* Carrito Lateral */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 1500;
}

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

.cart-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100%;
    height: 100%;
    background: white;
    box-shadow: -10px 0 40px rgba(0,0,0,0.2);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cart-panel.open {
    right: 0;
}

.cart-header {
    padding: 20px;
    background: var(--gradient-1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: 0.3s;
}

.cart-close:hover {
    transform: rotate(90deg);
}

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

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 15px;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

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

.cart-item-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.cart-item-qty button {
    width: 25px;
    height: 25px;
    border: 1px solid var(--primary);
    background: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--primary);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-qty button:hover {
    background: var(--primary);
    color: white;
}

.cart-item-qty span {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.cart-item-price {
    color: var(--primary);
    font-weight: bold;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    align-self: flex-start;
}

.cart-item-remove:hover {
    color: var(--primary);
}

.cart-empty {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}

.cart-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: white;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.cart-total span:last-child {
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
}

/* Delivery option */
.delivery-option {
    margin-bottom: 15px;
}

.delivery-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.delivery-option select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    background: white;
}

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

.delivery-fee {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px dashed #ddd;
    margin-top: 10px;
}

.delivery-fee span:last-child {
    color: var(--primary);
    font-weight: bold;
}

/* Checkout Form */
.checkout-form {
    max-width: 500px;
}

.checkout-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 50px;
}

.site-footer p {
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-footer i {
    color: var(--primary);
}

.site-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.site-footer a:hover {
    color: var(--primary);
}

/* Map Container */
.map-container {
    margin-top: 10px;
}

#map {
    width: 100%;
    height: 200px; /* Reducirlo a 200px ayuda a que el botón se vea más rápido */
    border-radius: 10px;
    margin-bottom: 10px;
    z-index: 1;
}

.map-instruction {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-container input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: #f9f9f9;
    cursor: pointer;
}

.map-container input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Fix para Leaflet */
.leaflet-container {
    font-family: inherit;
    border-radius: 10px;
}

.btn-location {
    width: 100%;
    background: var(--gradient-2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: 0.3s;
}

.btn-location:hover {
    filter: brightness(1.1);
}

#map {
    border-radius: 0 0 10px 10px; /* Redondear solo las esquinas inferiores */
}