/* =========================================
   MARKETPLACE GLOBAL STYLES
   ========================================= */

body {
    background-color: #0f172a !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* 1. NAVBAR MARKETPLACE (Estilo Glass Oscuro) */
.navbar-marketplace {
    background: rgba(15, 23, 42, 0.85); /* Un poco más oscuro para legibilidad */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-top: 15px;
    padding-bottom: 15px;
    transition: all 0.3s ease;
}

/* 2. HERO SECTION */
.marketplace-hero {
    position: relative;
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 80%);
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    margin-bottom: 40px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.hero-glow {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

/* 3. BUSCADOR */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 18px 25px 18px 55px;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 10px 40px rgba(0,0,0,0.4);
    background: #1e293b;
    outline: none;
}

.search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.2rem;
}

/* 4. TARJETAS (CARDS) */
.dish-card, .restaurant-card{
    background: #172033; /* Fondo unificado elegante */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dish-card:hover, .restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--accent);
}

/* Imágenes */
.rest-banner, .dish-img-wrap {
    overflow: hidden;
    position: relative;
    background-color: #334155;
}

/* Asegurar que el contenedor del banner tenga posición */
.rest-banner {
    position: relative;
    height: 130px;
    background-color: #334155;
}

.dish-img-wrap { height: 160px; }

.rest-banner img, .dish-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.dish-card:hover .dish-img-wrap img { transform: scale(1.1); }

/* Contenido Interno */
.card-body-custom, .rest-content {
    background: transparent !important;
    padding: 15px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Logos Flotantes */
.rest-logo-wrapper {
    width: 70px; height: 70px;
    margin: -35px auto 10px;
    position: relative;
    z-index: 10;
    background: #172033;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.rest-logo-wrapper img {
    width: 100%; height: 100%;
    border-radius: 50%; object-fit: cover;
    background-color: #fff;
}

/* 5. TIPOGRAFÍA ALTO CONTRASTE */
.dish-card h6, 
.restaurant-card h4, 
.offer-card h5,
.rest-content h4 {
    color: #ffffff !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.dish-card p, .restaurant-card p, .rest-content p, .text-muted {
    color: #e2e8f0 !important; /* Blanco hueso */
    opacity: 0.9 !important;
    font-weight: 400;
}

/* 6. BOTONES PREMIUM */

/* Botón Flecha Redonda (Neon) */
.btn-premium-arrow {
    width: 45px; height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    text-decoration: none;
}
.btn-premium-arrow:hover {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent);
    transform: scale(1.1) rotate(-45deg);
}

/* Botón "Ver Menú" (Píldora con Contraste) */
.view-menu-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 24px;
    border-radius: 50px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #cbd5e1;
    font-size: 0.85rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}
.restaurant-card:hover .view-menu-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #0f172a !important; /* TEXTO OSCURO PARA CONTRASTE */
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}
.view-menu-btn i { transition: transform 0.3s ease; }
.restaurant-card:hover .view-menu-btn i { transform: translateX(3px); }

/* Precio Brillante */
.price-tag-glow {
    color: var(--accent);
    font-weight: 800; font-size: 1.2rem;
    text-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* 7. SECCIONES */
.section-header {
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 25px; padding-bottom: 10px;
}
.section-title {
    color: #fff; font-weight: 700; font-size: 1.5rem;
}

/* 8. FOOTER MINIMALISTA */
.footer-mini {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #0b1120;
    padding: 40px 0;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}
.footer-glow-mini {
    position: absolute;
    bottom: -50px; left: 50%; transform: translateX(-50%);
    width: 300px; height: 100px;
    background: var(--accent);
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
}
.footer-link-social {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    color: #94a3b8;
    margin: 0 5px;
    transition: 0.3s;
    text-decoration: none;
}
.footer-link-social:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* Badge de Descuento (La etiqueta roja) */
.offer-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444; /* Rojo vibrante */
    color: white;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    pointer-events: none; /* Evita parpadeos si el mouse toca el badge */
}

/* 1. CLASE UTILITARIA PARA EL LINK MAGICO (BOOTSTRAP STYLE) */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1; /* Nivel bajo */
    content: "";
}

/* 2. ARREGLAR LA TARJETA (Evitar que se superponga) */
.restaurant-card {
    background: #172033;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative; /* Clave para el stretched-link */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Eliminamos z-index base para evitar conflictos de pila */
}

/* Efecto Hover Suave */
.restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
    z-index: 2; /* Solo sube un poco al hacer hover */
}


.fade-in-up { animation: fadeInUp 0.6s ease forwards; opacity: 0; transform: translateY(20px); }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

/* --- EXTRAS GEOLOCALIZACIÓN --- */

/* Botón Filtro GPS (En el buscador) */
.btn-gps-filter {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246, 0.2);
    color: #fff;
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 8px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-gps-filter:hover, .btn-gps-filter.active {
    background: var(--accent);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

/* Ajuste del input para que no tape el botón */
.search-input {
    padding-right: 140px; /* Espacio para el botón */
}

/* 3. BOTÓN DE MAPA (Hacer que funcione sobre el link principal) */
.btn-map-float {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    transition: 0.3s;
    
    /* TRUCO: Z-index mayor que el stretched-link (1) */
    z-index: 5; 
    position: relative; /* Necesario para que z-index funcione en algunos contextos */
}
.btn-map-float:hover {
    background: var(--accent);
    transform: scale(1.1);
    color: white;
}

/* Link Wrapper Global */
.card-link-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; /* Cubre toda la tarjeta */
}
/* Elevamos botones internos para que funcionen */
.btn-map-float, .view-menu-btn {
    position: relative;
    z-index: 10;
}

/* Badge de Distancia */
.distance-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 5px;
}

/* =========================================
   🎨 MODAL DE ALERTAS PREMIUM
   ========================================= */

.custom-alert-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fondo oscuro */
    backdrop-filter: blur(8px); /* Efecto borroso elegante */
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-alert-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-alert-box {
    background: #1e293b; /* Color Slate Oscuro */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.active .custom-alert-box {
    transform: scale(1);
}

.alert-icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px auto;
}

.alert-title {
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.alert-msg {
    color: #cbd5e1; /* Gris claro */
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.alert-btn {
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.alert-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

/* =========================================
   ESTILOS DE OFERTAS (TARJETAS PREMIUM)
   ========================================= */

.offer-card {
    background: #1e293b; /* Fondo oscuro (Slate 800) */
    border-radius: 16px;
    overflow: hidden; /* CRUCIAL: Evita que el zoom rompa el diseño */
    position: relative; /* CRUCIAL: Para que el badge se quede dentro */
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(59, 130, 246, 0.3); /* Brillo azul al pasar mouse */
}

/* Contenedor del Banner (Imagen) */
.offer-banner-wrap {
    height: 160px; /* Altura fija para uniformidad */
    width: 100%;
    position: relative;
    overflow: hidden; /* CRUCIAL: Aquí sucede la magia del zoom sin romper nada */
}

.offer-banner-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Efecto Zoom Suave */
.offer-card:hover .offer-banner-wrap img {
    transform: scale(1.1);
}


/* Cuerpo de la tarjeta */
.card-body-custom {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: linear-gradient(180deg, rgba(30,41,59,0) 0%, rgba(15,23,42,0.5) 100%);
}

.card-body-custom h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Botón Ver Oferta */
.btn-outline-light {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.8);
}

.btn-outline-light:hover {
    background: white;
    color: black;
    border-color: white;
}

/* =========================================
   ARREGLO DE ESPACIADO (Títulos Voladores)
   ========================================= */
.section-header {
    margin-bottom: 1rem !important; /* Estaba muy separado */
}
section {
    margin-bottom: 2.5rem !important; /* Reducimos separación entre secciones */
}

/* =========================================
   CARRUSEL PREMIUM (ESTILO WOW)
   ========================================= */
.premium-carousel {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.premium-offer-slide {
    height: 400px; /* Altura imponente */
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Overlay Degradado Profesional */
.premium-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 50%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
}

.premium-content {
    position: relative;
    z-index: 2;
    height: 100%;
    padding: 20px;
    display: flex;
    align-items: center;
}

/* Tipografía y Badges */
.text-shadow {
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.big-badge {
    display: inline-block;
    background: #ef4444; /* Rojo Netflix */
    color: white;
    font-size: 2rem;
    font-weight: 900;
    padding: 5px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
    transform: rotate(-2deg); /* Un toque rebelde */
}

/* Animaciones de Entrada (Efecto WOW) */
.carousel-item.active .animate-pop { animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.carousel-item.active .animate-slide-right { animation: slideRight 0.8s ease forwards; opacity: 0; animation-delay: 0.2s; }
.carousel-item.active .animate-fade-in { animation: fadeIn 1s ease forwards; opacity: 0; animation-delay: 0.4s; }
.carousel-item.active .animate-bounce-up { animation: bounceUp 0.8s ease forwards; opacity: 0; animation-delay: 0.6s; }

@keyframes popIn {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    100% { transform: scale(1) rotate(-2deg); opacity: 1; }
}
@keyframes slideRight {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes bounceUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Responsivo para móviles */
@media (max-width: 768px) {
    .premium-offer-slide { height: 350px; }
    .display-5 { font-size: 2rem; } /* Título más pequeño en celular */
    .big-badge { font-size: 1.5rem; }
}

.section-title {
    margin-bottom: 0 !important;
}

/* =========================================
   ANIMACIONES Y CONTROLES PREMIUM
   ========================================= */

/* 1. Indicadores (Las líneas abajo) */
.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators button {
    width: 40px !important;       /* Más largo */
    height: 4px !important;       /* Más fino */
    border-radius: 10px;          /* Bordes redondeados */
    background-color: rgba(255, 255, 255, 0.3) !important; /* Transparente inactivo */
    border: none !important;
    margin: 0 6px !important;
    transition: all 0.4s ease;    /* Animación suave */
    opacity: 1 !important;
}

/* Estado Activo del Indicador */
.carousel-indicators .active {
    background-color: #f59e0b !important; /* Color Amarillo/Naranja Premium */
    width: 60px !important;       /* Crece cuando está activo */
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.6); /* Brillo neón */
}

/* 2. Flechas de Control (Glassmorphism) */
.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0, 0, 0, 0.5) !important; /* Fondo semitransparente */
    backdrop-filter: blur(5px); /* Efecto vidrio */
    border: 1px solid rgba(255,255,255,0.1);
    width: 3rem;
    height: 3rem;
    background-size: 50%;
    border-radius: 50%; /* Circulares */
    transition: all 0.3s ease;
}

.carousel-control-prev:hover .carousel-control-prev-icon,
.carousel-control-next:hover .carousel-control-next-icon {
    background-color: #f59e0b !important; /* Se ponen amarillos al pasar el mouse */
    transform: scale(1.1); /* Crecen un poco */
}

/* 3. Efecto Ken Burns (Zoom Lento en la imagen de fondo) */
/* Esto hace que la foto nunca esté 100% quieta, se ve muy caro */
@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.carousel-item.active .premium-offer-slide {
    animation: kenBurns 6s ease-out forwards;
}

/* =========================================
   ARREGLO DE UX (BOTÓN VS FLECHAS)
   ========================================= */

/* 1. Reducir el área invisible de las flechas (Era muy ancha) */
.carousel-control-prev,
.carousel-control-next {
    width: 60px !important; /* Ahora solo ocupa 60px, no el 15% de la pantalla */
    z-index: 10; /* Nivel intermedio */
}

/* 2. Forzar que el botón esté SIEMPRE encima de todo */
.premium-content .btn {
    position: relative;
    z-index: 100 !important; /* Nivel superior: Gana el clic sobre la flecha */
}

/* 3. (Opcional) Mover un poco el contenido a la derecha para separarlo de la flecha izquierda */
.premium-content {
    padding-left: 20px; /* Un pequeño respiro extra */
}

@media (min-width: 768px) {
    .premium-content {
        padding-left: 40px; /* Más espacio en PC */
    }
}