@layer base {
    html {
        scroll-behavior: smooth;
    }
    body { 
        background-color: white;
        color: #111827;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-family: 'DM Sans', sans-serif; 
    }
    h1, h2, h3, h4 { 
        font-family: 'Outfit', sans-serif;
        letter-spacing: -0.025em;
        color: inherit; /* Permite que clases como text-white funcionen */
    }
}

/* 🍎 Emil Kowal Animations & Easing */
:root {
    --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
    --duration-fast: 200ms;
    --duration-standard: 300ms;
    
    /* 🍗 Paleta Gastronómica 60-30-10 */
    --color-crisp: #FFFFFF;      /* 60% Dominante */
    --color-terracotta: #E2725B; /* 30% Secundario (Estimulador) */
    --color-sunny: #FFDD44;      /* 10% Acento (Conversion) */
}

.ease-ios {
    transition-timing-function: var(--ease-ios);
}

/* 🏔️ Estilos de Secciones */
section {
    position: relative;
    width: 100%;
}

/* 🎬 Animaciones de Revelado (Refinadas por Emil Kowal) */
.reveal {
    opacity: 0;
    transform: translateY(20px) scale(0.98); /* Nunca scale(0) */
    transition: opacity var(--duration-standard) var(--ease-ios), 
                transform var(--duration-standard) var(--ease-ios);
    will-change: transform, opacity;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ⚡ Delays Escalonados (Stagger) */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* 🖱️ Interacciones de Botones (Emil Kowal Pattern) */
.btn-premium {
    transition: all 0.2s ease-out;
}

.btn-premium:active {
    transform: scale(0.97);
}

/* 🌓 Utilidades de Fondo */
.bg-radial {
    background-image: radial-gradient(circle at center, var(--tw-gradient-from), var(--tw-gradient-to));
}

/* 📱 Ajustes de resolución */
@media (min-width: 1024px) {
    html { font-size: 16px; }
}

@media (min-width: 1920px) {
    html { font-size: 18px; }
}

@media (min-width: 3840px) {
    html { font-size: 24px; }
}

/* ♿ Reducción de Movimiento */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        transition-duration: 0.1ms !important;
        animation-duration: 0.1ms !important;
        animation-delay: 0ms !important;
        transition-delay: 0ms !important;
    }
    .reveal {
        opacity: 0;
        transform: none; /* Solo opacidad en movimiento reducido */
    }
    .reveal.active {
        opacity: 1;
    }
}

/* Estabilización de Scroll */
body {
    overflow-y: scroll;
}

/* 📱 Tablet: la sección de ganchos llena el viewport restante */
@media (min-width: 768px) and (max-width: 1023px) {
    #hero + div {
        min-height: calc(100vh - 60vh);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
/* 🍳 Food & Delivery Visual System */
.hero-mesh-bg {
    background-color: var(--color-terracotta);
    background-image: 
        radial-gradient(at 0% 0%, #ec8b77 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--color-sunny) 0px, transparent 50%),
        radial-gradient(at 50% 100%, #c95d48 0px, transparent 50%);
    position: relative;
}

.hero-mesh-bg::after {
    /* Textura de grano sutil para profundidad */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.hero-organic-shape {
    clip-path: ellipse(140% 100% at 50% 0%);
}

.footer-organic-shape {
    clip-path: ellipse(140% 100% at 50% 100%);
}

@media (min-width: 1024px) {
    .hero-organic-shape {
        clip-path: ellipse(120% 95% at 50% 0%);
    }
    .footer-organic-shape {
        clip-path: ellipse(120% 95% at 50% 100%);
    }
}
/* 🎨 Estilo de la Idea (Círculo sobre Blob) */
.idea-blob-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    aspect-ratio: 1/1;
}

.idea-blob-background {
    position: absolute;
    inset: 0;
    opacity: 1;
    transition: all 0.5s var(--ease-ios);
    background-color: #00A699; /* Var secondary fallback */
    opacity: 0.8;
}

.idea-img-circle {
    position: relative;
    z-index: 10;
    width: 85%;
    height: 85%;
    border-radius: 9999px; /* Forzado Circular */
    object-fit: cover;
    border: 4px solid white;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    transition: transform 0.5s var(--ease-ios);
}

.group:hover .idea-img-circle {
    transform: scale(1.05);
}

.blob-shape-1 { border-radius: 66% 34% 53% 47% / 54% 63% 37% 46%; }
.blob-shape-2 { border-radius: 41% 59% 41% 59% / 65% 42% 58% 35%; }
.blob-shape-3 { border-radius: 71% 29% 70% 30% / 46% 77% 23% 54%; }
.blob-shape-4 { border-radius: 37% 63% 25% 75% / 51% 29% 71% 49%; }

.group:hover .idea-blob-background {
    transform: scale(1.1) rotate(12deg);
}

/* 🎡 Swiper Transitions */
.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
/* 🎡 Effect: Rotating Card/Pill (BG + Border) on Hover */
.rotate-border-hover {
    position: relative;
    transition: transform 0.6s var(--ease-ios), box-shadow 0.4s ease;
    z-index: 1;
    transform-style: preserve-3d;
}

.rotate-border-hover:hover {
    transform: rotate(5deg);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
}

/* Rotate content back to stay upright */
.rotate-border-hover > * {
    transition: transform 0.6s var(--ease-ios);
    display: block; /* Ensure transform works */
    backface-visibility: hidden;
}

.rotate-border-hover:hover > * {
    transform: rotate(-5deg);
}

/* Fix for inline-flex/inline-block elements like pills */
span.rotate-border-hover {
    display: inline-block;
}

span.rotate-border-hover > * {
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   🔍 BUSCADOR INTELIGENTE — Modal de Resultados
   ═══════════════════════════════════════════════════════════════ */

/* Overlay de fondo */
.buscador-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(10, 10, 20, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: flex-end;          /* Mobile: panel desde abajo */
    justify-content: center;
    padding: 0;
    opacity: 0;
    pointer-events: none;           /* Evitar que bloquee clics cuando está oculto */
    visibility: hidden;             /* Ocultar del accessibility tree */
    transition: opacity 0.3s var(--ease-ios), visibility 0.3s var(--ease-ios);
}

.buscador-overlay--visible {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Panel del modal */
.buscador-panel {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 88dvh;
    border-radius: 24px 24px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Esto ya previene desbordamiento general */
    box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
    /* Posición inicial para la animación */
    transform: translateY(-100vh) scale(0.9);
    opacity: 0;
}

/* Clase para activar la animación de rebote */
.buscador-panel.animate-modal-drop {
    animation: modal-drop-bounce 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Desktop: panel centrado y con altura fija */
@media (min-width: 640px) {
    .buscador-overlay {
        align-items: center;
        padding: 1.5rem;
    }
    .buscador-panel {
        border-radius: 20px;
        max-height: 82dvh;
    }
}

/* Pantallas Grandes (Desktop XL) */
@media (min-width: 1280px) {
    .buscador-panel {
        max-width: 1200px;
    }
}

/* Pantallas Ultra-Anchas (4K) */
@media (min-width: 2560px) {
    .buscador-panel {
        max-width: 1800px;
    }
}

/* Cabecera */
.buscador-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.25rem 0.875rem;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    gap: 0.75rem;
}

.buscador-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow: hidden;
}

.buscador-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.buscador-query-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buscador-count-text {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-top: 1px;
}

.buscador-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f3f4f6;
    color: #374151;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s var(--ease-ios);
}

.buscador-close:hover {
    background: #e5e7eb;
    transform: scale(1.08);
}

/* Filtros de barrio */
.buscador-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    flex-shrink: 0;
    border-bottom: 1px solid #f3f4f6;
    max-width: 100%;
    overflow: hidden;               /* Protección extra */
}

.buscador-filtro-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1.5px solid #e5e7eb;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.buscador-filtro-pill:hover {
    border-color: var(--color-terracotta);
    color: var(--color-terracotta);
}

.buscador-filtro-pill.active {
    background: var(--color-terracotta);
    border-color: var(--color-terracotta);
    color: #ffffff;
}

/* Cuerpo de resultados con scroll */
.buscador-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Crucial para evitar scroll horizontal */
    padding: 0.75rem 1rem 1.5rem;
    scroll-behavior: smooth;
}

.buscador-body::-webkit-scrollbar {
    width: 4px;
}

.buscador-body::-webkit-scrollbar-track {
    background: transparent;
}

.buscador-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* ── Grupos por barrio ────────────────────────────────────── */
.buscador-barrio {
    margin-bottom: 1.5rem;
}

.buscador-negocios-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .buscador-negocios-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)); /* Forza a que las columnas sean exactamente iguales */
        gap: 1rem;
    }
    .buscador-negocios-grid--single .buscador-negocio-card {
        grid-column: span 2;
    }
}

.buscador-barrio-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.75rem 0.25rem 0.4rem;
    background: #ffffff;
    z-index: 2;
}

@media (min-width: 640px) {
    .buscador-barrio-header {
        position: sticky;
        top: 0;
    }
}

.buscador-barrio-pin {
    font-size: 0.9rem;
}

.buscador-barrio-nombre {
    font-family: 'Outfit', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    flex: 1;
}

.buscador-barrio-count {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 500;
    background: #f3f4f6;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
}

/* ── Tarjeta de negocio ──────────────────────────────────── */
.buscador-negocio-card {
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 0.875rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-ios);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.buscador-negocio-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

/* Variante: con oferta activa */
.buscador-negocio-card--oferta {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fffbf0 0%, #ffffff 60%);
}

.buscador-negocio-card--oferta:hover {
    border-color: #f59e0b;
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
}

/* Top de la tarjeta: logo + info */
.buscador-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

/* Logo empresa */
.buscador-logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1.5px solid #f0f0f0;
    display: block;
}

/* Inicial cuando no hay logo */
.buscador-logo-inicial {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-terracotta), #c95d48);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    flex-shrink: 0;
}

.buscador-card-info {
    flex: 1;
    overflow: hidden;
    min-width: 0; /* Permite que el flex-item se encoja y respete el elipsis */
}

.buscador-nombre-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    overflow: hidden;
}

.buscador-nombre {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1; /* Permite que el nombre se corte si es muy largo */
}

.buscador-estrella {
    font-size: 0.75rem;
    flex-shrink: 0; /* La estrella siempre visible */
}

.buscador-subinfo {
    display: flex;
    align-items: center;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    min-width: 0; /* Permite que los hijos flex con texto largo no empujen el contenedor */
}

.buscador-categoria {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.buscador-extracto {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 2;
}

.buscador-extracto-sep {
    font-size: 0.75rem;
    color: #9ca3af;
    flex-shrink: 0;
    margin: 0 4px;
}

/* ── Badge de oferta ─────────────────────────────────────── */
.buscador-oferta-badge {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    background: #fff8e6;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.buscador-oferta-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.buscador-oferta-info {
    flex: 1;
    overflow: hidden;
}

.buscador-oferta-titulo {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #92400e;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buscador-oferta-precios {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2px;
    flex-wrap: wrap;
}

.buscador-precio-tachado {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: line-through;
    font-weight: 500;
}

.buscador-precio-actual {
    font-size: 0.875rem;
    font-weight: 700;
    color: #059669;
}

.buscador-etiqueta {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--color-terracotta);
    color: #ffffff;
    padding: 0.15rem 0.4rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* El estilo se movió arriba a .buscador-subinfo */

/* ── Botones de acción ───────────────────────────────────── */
.buscador-acciones {
    display: flex;
    justify-content: flex-end; /* Alineación a la derecha */
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.75rem;
}

.buscador-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.875rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.buscador-btn--primary {
    background: var(--color-sunny);
    color: #111827;
}

.buscador-btn--primary:hover {
    background: #FFE477;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 221, 68, 0.25);
}

.buscador-btn--ofertas {
    background: #FE6B00;
    color: #ffffff;
}

.buscador-btn--ofertas:hover {
    background: #c15305;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(254, 107, 0, 0.3);
}

.buscador-btn--whatsapp {
    display: none; /* Oculto a petición del usuario */
    background: #25d366;
    color: #ffffff;
}

.buscador-btn--whatsapp:hover {
    background: #22c55e;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,211,102,0.3);
}

.buscador-btn--tel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.buscador-btn--tel:hover {
    background: #e5e7eb;
}

/* ── Estado vacío / Fallback ─────────────────────────────── */
.buscador-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    gap: 0.75rem;
}

.buscador-fallback-icon {
    font-size: 3rem;
    line-height: 1;
}

.buscador-fallback-msg {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 600;
    max-width: 300px;
    line-height: 1.4;
}

/* Nueva barra de búsqueda en fallback */
.buscador-fallback-form {
    display: flex;
    width: 100%;
    max-width: 400px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 0.4rem;
    gap: 0.4rem;
    margin: 1rem 0;
    transition: border-color 0.2s ease;
}

.buscador-fallback-form:focus-within {
    border-color: var(--color-sunny);
}

.buscador-fallback-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

.buscador-fallback-retry-btn {
    background: #111827;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.buscador-fallback-retry-btn:hover {
    background: var(--color-sunny);
    color: #111827;
    transform: scale(1.02);
}

@media (max-width: 480px) {
    .buscador-fallback-form {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
    }
    .buscador-fallback-input {
        background: #f9fafb;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        padding: 0.75rem;
        text-align: center;
    }
    .buscador-fallback-retry-btn {
        padding: 0.75rem;
    }
}

.buscador-fallback-tip {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-top: -0.25rem;
}

.buscador-fallback-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: 10px;
    background: var(--color-terracotta);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s var(--ease-ios);
    box-shadow: 0 4px 14px rgba(226,114,91,0.35);
}

.buscador-fallback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(226,114,91,0.45);
}

/* ♿ Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    .buscador-overlay,
    .buscador-panel,
    .buscador-negocio-card,
    .buscador-btn,
    .buscador-fallback-btn {
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
   🔍 AUTOCOMPLETE DROPDOWN
   ═══════════════════════════════════════════════════════════════ */
#autocomplete-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    z-index: 10050 !important;
    min-height: 0;
    height: auto;
    max-height: 16rem;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

#autocomplete-dropdown.hidden {
    display: none !important;
}

#autocomplete-dropdown .autocomplete-item {
    display: flex;
    align-items: center;
    width: 100%;
    flex: 0 0 auto;
    min-height: 2.875rem;
    transition: all 0.15s ease;
}

#autocomplete-dropdown .autocomplete-item > span {
    display: flex;
    align-items: center;
    width: 100%;
}

#autocomplete-dropdown .autocomplete-item:hover,
#autocomplete-dropdown .autocomplete-item.bg-gray-100 {
    background-color: #f3f4f6 !important;
}

#buscador-container {
    position: relative;
    z-index: 40;
}

/* Ensure hero links are below the dropdown */
#hero a {
    position: relative;
    z-index: 1;
}
