/*
 * Nairi Tours — Shared Mobile Responsive Styles
 * Aplica a todas las páginas del sitio
 */

/* ── Base touch & input fixes ───────────────────────────────────────── */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

button, a, select, input[type="submit"], label {
    touch-action: manipulation;
}

/* Prevent iOS auto-zoom on input focus (must be >= 16px) */
input, select, textarea {
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
}

/* Custom select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25em;
    padding-right: 2.5rem;
}

/* ── Mobile menu ─────────────────────────────────────────────────────── */
#mobile-menu { display: none; }
#mobile-menu.open { display: flex; }

/* ── Filter buttons: horizontal scroll on mobile ─────────────────────── */
#filter-buttons {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
}
#filter-buttons::-webkit-scrollbar { display: none; }
#filter-buttons button { scroll-snap-align: start; white-space: nowrap; flex-shrink: 0; }

@media (min-width: 768px) {
    #filter-buttons {
        flex-wrap: wrap;
        overflow-x: visible;
        scroll-snap-type: none;
    }
}

/* ── Sidebar sticky: only on desktop ─────────────────────────────────── */
@media (max-width: 1023px) {
    .sticky {
        position: relative !important;
        top: auto !important;
    }
}

/* ── Tour stats bar: stack 2x2 on mobile ────────────────────────────── */
@media (max-width: 639px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ── Booking form: full-width inputs with taller touch targets ────────── */
.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: white;
    transition: box-shadow 0.2s, border-color 0.2s;
    min-height: 52px;
    color: #0A2342;
}
.form-input:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ── Booking submit button: full width on mobile ─────────────────────── */
@media (max-width: 767px) {
    .btn-submit-full {
        width: 100% !important;
        justify-content: center;
    }
}

/* ── Card "Ver Detalles" button: larger touch target ─────────────────── */
.btn-card-action {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
}

/* ── Hero title: smaller on very small screens ───────────────────────── */
@media (max-width: 380px) {
    .hero-title { font-size: 1.75rem !important; line-height: 1.2; }
}

/* ── Booking form section on mobile: remove heavy padding ────────────── */
@media (max-width: 767px) {
    .form-container-mobile { padding: 1.5rem !important; }
    .testimonial-section { flex-direction: column !important; }
}

/* ── Breadcrumb: allow wrapping ──────────────────────────────────────── */
.breadcrumb { flex-wrap: wrap; }

/* ── Itinerary timeline: consistent left margin on mobile ────────────── */
@media (max-width: 639px) {
    .timeline-dot { left: -27px !important; }
}

/* ── Photo Gallery Carousel ── */
.gallery-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #0A2342;
}
.gallery-track-wrapper {
    overflow: hidden;
    width: 100%;
}
.gallery-track {
    display: flex;
    gap: 12px;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    padding: 0 4px;
}
.gallery-slide {
    flex: 0 0 auto;
    width: 280px;
    height: 210px;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(10,35,66,0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-slide:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 28px rgba(10,35,66,0.28);
}
.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.gallery-slide:hover img {
    transform: scale(1.05);
}
.gallery-slide .slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,35,66,0.45) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-slide:hover .slide-overlay {
    opacity: 1;
}
/* Nav arrows */
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(249,247,242,0.92);
    border: 1.5px solid rgba(212,175,55,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(10,35,66,0.18);
}
.gallery-btn:hover {
    background: #D4AF37;
    border-color: #D4AF37;
}
.gallery-btn:hover .material-symbols-outlined {
    color: #0A2342;
}
.gallery-btn .material-symbols-outlined {
    font-size: 22px;
    color: #0A2342;
}
.gallery-btn-prev { left: 10px; }
.gallery-btn-next { right: 10px; }
.gallery-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
/* Dot indicators */
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-top: 14px;
    flex-wrap: wrap;
}
.gallery-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(10,35,66,0.18);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}
.gallery-dot.active {
    background: #D4AF37;
    transform: scale(1.4);
}
/* Lightbox */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10,35,66,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.gallery-lightbox.open {
    opacity: 1;
    pointer-events: all;
}
.gallery-lightbox img {
    max-width: min(90vw, 900px);
    max-height: 85vh;
    border-radius: 0.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: 18px;
    right: 20px;
    background: rgba(249,247,242,0.15);
    border: 1px solid rgba(249,247,242,0.25);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(212,175,55,0.4); }
.lightbox-close .material-symbols-outlined { color: #F9F7F2; font-size: 24px; }
.lightbox-counter {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(249,247,242,0.6);
    font-size: 12px;
    font-family: 'Manrope', sans-serif;
    letter-spacing: 0.08em;
}
/* Mobile: slide adapts — 120px = section margin (20×2) + track wrapper padding (40×2) */
@media (max-width: 640px) {
    .gallery-slide {
        width: calc(100vw - 120px);
        height: 220px;
    }
}

/* Ampliar el área táctil del menú hamburguesa */
#mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Evitar solapamiento con la barra de reserva fija inferior en móviles */
@media (max-width: 1023px) {
    body:has(#mobile-cta) #whatsapp-floating-btn {
        bottom: 92px !important;
    }
    body:has(#mobile-cta) .fixed.bottom-6.left-6.z-50 {
        bottom: 92px !important;
    }
}

/* Prevenir desbordamiento y scroll horizontal accidental en pantallas móviles */
@media (max-width: 1023px) {
    html, body {
        overflow-x: hidden;
    }
}

/* ── Responsive Navbar Breakpoint Shifting (Mobile/Tablet < 1024px, Desktop >= 1024px) ── */

/* Para móviles y tablets (pantallas menores a 1024px) */
@media (max-width: 1023px) {
    #main-nav div.md\:flex {
        display: none !important; /* Ocultar enlaces de navegación del desktop */
    }
    #main-nav div.md\:block {
        display: none !important; /* Ocultar botón CTA "Reservar Ahora" del desktop */
    }
    #mobile-menu-btn {
        display: inline-flex !important; /* Mostrar botón hamburguesa en tablet */
    }
    #mobile-menu.open {
        display: flex !important; /* Permitir abrir el menú desplegable */
    }
}

/* Para pantallas grandes (pantallas >= 1024px) */
@media (min-width: 1024px) {
    #main-nav div.md\:flex {
        display: flex !important; /* Mostrar enlaces de navegación en desktop */
    }
    #main-nav div.md\:block {
        display: block !important; /* Mostrar botón CTA "Reservar Ahora" en desktop */
    }
    #mobile-menu-btn {
        display: none !important; /* Ocultar botón hamburguesa en desktop */
    }
    #mobile-menu {
        display: none !important; /* Ocultar menú desplegable en desktop */
    }
}
