/* Sendero Café - Estilos personalizados */
/* Flat Design Orgánico y Aventura Vintage */
/* Paleta "Sendero Logo": #f0f4e8 #849A8F #DCA344 #4A5A50 */

* {
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #f0f4e8;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(168, 192, 154, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 146, 127, 0.08) 0%, transparent 50%);
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: #4A5A50;
    color: #f0f4e8;
    padding: 12px 16px;
    z-index: 100;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    font-weight: 600;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ============================== */
/* HERO */
/* ============================== */

#hero-bg {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ============================== */
/* MAPA DE CHILE */
/* ============================== */

.chile-map {
    filter: sepia(0.25) saturate(0.7) hue-rotate(50deg) opacity(0.92);
    transition: filter 0.3s ease;
}

.chile-map:hover {
    filter: sepia(0.1) saturate(0.85) hue-rotate(30deg) opacity(1);
}

.map-hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease;
    pointer-events: auto;
}

.map-hotspot:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.hotspot-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DCA344;
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px rgba(74, 90, 80, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

@media (max-width: 1023px) {
    .hotspot-dot {
        width: 20px;
        height: 20px;
        border-width: 3px;
        box-shadow: 0 0 0 3px rgba(240, 244, 232, 0.98), 0 3px 8px rgba(0, 0, 0, 0.5);
    }
}

.map-hotspot.is-active .hotspot-dot {
    background: #c46b4d;
    border-color: #4A5A50;
    width: 14px;
    height: 14px;
    animation: hotspotPulse 1.8s ease-in-out infinite;
}

@media (max-width: 1023px) {
    .map-hotspot.is-active .hotspot-dot {
        width: 22px;
        height: 22px;
    }
}

.map-hotspot:hover .hotspot-dot {
    background: #849A8F;
    transform: scale(1.2);
}

@keyframes hotspotPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(240, 244, 232, 0.95), 0 0 0 6px rgba(192, 57, 43, 0.3); }
    50% { box-shadow: 0 0 0 2px rgba(240, 244, 232, 0.95), 0 0 0 12px rgba(192, 57, 43, 0); }
}

@media (max-width: 1023px) {
    @keyframes hotspotPulse {
        0%, 100% { box-shadow: 0 0 0 3px rgba(240, 244, 232, 0.98), 0 0 0 8px rgba(192, 57, 43, 0.4); }
        50% { box-shadow: 0 0 0 3px rgba(240, 244, 232, 0.98), 0 0 0 16px rgba(192, 57, 43, 0); }
    }
}

.hotspot-label {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(240, 244, 232, 0.96);
    border: 1px solid rgba(61, 79, 48, 0.4);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Special Elite', monospace;
    font-size: 9px;
    color: #4A5A50;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(61, 79, 48, 0.15);
    pointer-events: none;
}

@media (max-width: 1023px) {
    .hotspot-label {
        font-size: 12px;
        padding: 4px 8px;
        border-width: 1.5px;
        border-radius: 6px;
        box-shadow: 0 3px 8px rgba(61, 79, 48, 0.25);
    }
}

.hotspot-label--right {
    left: calc(100% + 4px);
}

.hotspot-label--left {
    right: calc(100% + 4px);
}

@media (max-width: 1023px) {
    .hotspot-label--right {
        left: calc(100% + 8px);
    }
    .hotspot-label--left {
        right: calc(100% + 8px);
    }
}

.map-hotspot.is-active .hotspot-label {
    background: #f0f4e8;
    border-color: #c0392b;
    color: #c0392b;
    font-weight: bold;
}

@media (max-width: 1023px) {
    #map-modal > div {
        max-height: 92vh;
        max-width: 100%;
    }

    #map-modal .chile-map {
        filter: sepia(0.15) saturate(0.8) hue-rotate(40deg) opacity(0.95);
    }
}

/* ============================== */
/* SCROLLY EXPERIENCE - Escenas autocontenidas */
/* ============================== */

.scene {
    position: relative;
    height: 200vh;
    width: 100%;
}

.scene-sticky {
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 1rem 1.5rem;
    z-index: 1;
}

.scene-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transform: scale(1.15);
    opacity: 0;
    filter: blur(8px);
    transition:
        transform 1.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #849A8F;
    will-change: transform, opacity, filter;
}

.scene.is-visible .scene-bg {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    animation: kenBurns 16s ease-out forwards;
}

.scene.is-leaving .scene-bg {
    opacity: 0;
    filter: blur(12px);
    transform: scale(1.08);
}

@keyframes kenBurns {
    0%   { transform: scale(1); }
    100% { transform: scale(1.12); }
}

.scene-transition-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(61, 79, 48, 0.12) 50%,
        transparent 100%
    );
    mix-blend-mode: multiply;
}

.scene.is-transitioning .scene-transition-overlay {
    opacity: 1;
    animation: overlayPulse 1.4s ease-out;
}

@keyframes overlayPulse {
    0%   { opacity: 0; }
    30%  { opacity: 1; }
    100% { opacity: 0; }
}

.scene-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    background: #f0f4e8;
    border: 2px solid #4A5A50;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(61, 79, 48, 0.3);
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.7s ease 0.1s, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.scene.is-visible .scene-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (min-width: 1024px) {
    .scene-sticky {
        padding: 0 2rem 2rem;
    }
    .scene-card {
        max-width: 480px;
    }
}

/* ============================== */
/* BOTONES DE NAVEGACIÓN */
/* ============================== */

.mountain-nav-btn {
    will-change: transform;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.mountain-nav-tooltip {
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-4px);
}

.mountain-nav-btn:hover .mountain-nav-tooltip {
    transform: translateX(0);
}

/* ============================== */
/* ESTILOS DEL MENÚ */
/* ============================== */

.category-pill {
    background: #f0f4e8;
    color: #4A5A50;
    border: 2px solid #849A8F;
    position: relative;
}

.category-pill:hover {
    background: #849A8F;
    color: #4A5A50;
    transform: translateY(-1px);
}

.category-pill.active {
    background: #849A8F;
    color: #f0f4e8;
    border-color: #849A8F;
}

.menu-item {
    position: relative;
    background: #ffffff;
    border: 1.5px solid rgba(61, 79, 48, 0.2);
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #849A8F 20%, #DCA344 50%, #849A8F 80%, transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px 14px 0 0;
}

.menu-item:hover,
.menu-item:focus-within {
    border-color: rgba(168, 192, 154, 0.6);
    box-shadow: 0 4px 12px rgba(61, 79, 48, 0.12);
    transform: translateY(-2px);
}

.menu-item:hover::before,
.menu-item:focus-within::before {
    opacity: 1;
}

.menu-item.destacado {
    background: linear-gradient(135deg, #ffffff 0%, rgba(168, 192, 154, 0.15) 100%);
    border-color: rgba(168, 192, 154, 0.6);
}

.menu-item .badge-destacado {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(212, 146, 127, 0.18);
    color: #4A5A50;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Special Elite', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(212, 146, 127, 0.4);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-item {
    animation: fadeInUp 0.4s ease backwards;
}

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

/* Aside de notas - fondo mint green para diferenciarse */
.menu-notes {
    background: #849A8F;
    border: 2px solid rgba(61, 79, 48, 0.25);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 12px rgba(61, 79, 48, 0.08);
}

/* ============================== */
/* UTILIDADES */
/* ============================== */

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

#modal {
    animation: fadeIn 0.2s ease;
}

#modal > div {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

*:focus-visible {
    outline: 3px solid #849A8F;
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    .category-pill, #back-to-top, #lang-toggle, #modal,
    #map-fab, #menu-fab, #map-modal, #mountain-nav,
    .scene-sticky, .scene {
        display: none !important;
    }
    body { background: white; color: black; }
}
