/* Responsive Design - La Terracita Nica */

/* --- Mobile Menu Toggle --- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0.5rem;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2a1305;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-nav-logo-item {
    display: none !important;
}

/* Asegurar que el logo solo aparezca en móvil */
@media (min-width: 769px) {
    .mobile-nav-logo-item {
        display: none !important;
    }
}

/* Tablet & Mobile Styles */
@media (max-width: 1024px) {
    .header-container {
        padding: 0 2rem;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content h1 span {
        font-size: 3.5rem;
    }
}

/* Mobile Proper (< 768px) */
@media (max-width: 768px) {

    /* Header & Nav */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .header-container {
        padding: 0 1.5rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    /* Optimizar header para móvil - Fondo dorado en lugar de SVG */
    header {
        background: linear-gradient(135deg, #e18d31 0%, #c67a20 100%) !important;
    }

    /* Mobile Menu Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }

    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height para móviles */
        background: rgba(10, 10, 10, 0.85);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid rgba(225, 141, 49, 0.2);
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Cambiar de center a flex-start */
        align-items: center;
        z-index: 1000;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
        overflow-y: auto; /* Permitir scroll si es necesario */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        padding: 1.5rem 0; /* Reducir padding vertical */
        padding-top: max(1.5rem, env(safe-area-inset-top)); /* Safe area superior */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE y Edge */
    }

    /* Ocultar scrollbar en Chrome, Safari y Opera */
    nav::-webkit-scrollbar {
        display: none;
    }

    nav.active {
        left: 0;
    }

    /* Overlay for the rest of the screen */
    nav::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.6);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        z-index: -1;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.4s ease 0.1s;
        /* Slight delay to avoid jump */
    }

    nav.active::before {
        opacity: 1;
        pointer-events: auto;
        left: 280px;
        /* Offset by sidebar width */
        width: calc(100vw - 280px);
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem; /* Reducir gap para más compactación */
        width: 100%;
        padding: 0 1.5rem 1rem 1.5rem; /* Añadir padding inferior */
        padding-bottom: max(1rem, env(safe-area-inset-bottom)); /* Safe area para dispositivos con notch */
    }

    .mobile-nav-logo-item {
        display: block !important;
        width: 100%;
        margin-bottom: 0.5rem; /* Reducir margen inferior */
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        order: -1; /* Coloca el logo al principio del menú */
    }

    .mobile-nav-logo-link {
        display: flex !important;
        align-items: center;
        justify-content: center;
        padding: 0.5rem !important;
        background: none !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
        color: inherit !important;
    }

    .mobile-nav-logo {
        width: 80px; /* Reducir tamaño del logo */
        height: 80px;
        max-width: 100%;
        object-fit: cover;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(225, 141, 49, 0.3);
    }

    nav li {
        width: 100%;

        /* Black Glass Box (Container) */
        background-color: rgba(0, 0, 0, 0.6);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        transition: all 0.3s ease;
    }

    nav li:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(225, 141, 49, 0.2);
        border-color: rgba(225, 141, 49, 0.3);
    }

    .mobile-nav-logo-item:hover {
        transform: none;
        box-shadow: none;
        border-color: transparent;
    }

    nav a {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.85rem 1rem; /* Reducir padding vertical */

        /* Gradiente dorado optimizado para móvil */
        color: #e18d31 !important;
        background: linear-gradient(135deg, #f2a945 0%, #e18d31 50%, #c67a20 100%);
        -webkit-background-clip: text !important;
        background-clip: text !important;
        -webkit-text-fill-color: transparent !important;

        font-size: 1.1rem; /* Reducir ligeramente el tamaño de fuente */
        text-transform: uppercase;
        letter-spacing: 2px;
        font-weight: 700;
        transition: opacity 0.3s ease;
    }

    nav a:hover {
        /* No transform here, handled by li */
        opacity: 0.8;
    }

    /* Hero Section */
    .hero {
        padding: 0 3% 0 1.8rem !important;
        /* Force override */
        justify-content: center;
        text-align: center;
        min-height: 100vh;
        /* Adjust height */
        background-image: url('../assets/hero-poster.png') !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }

    /* Ocultar video en móvil para mejorar rendimiento */
    .hero-video {
        display: none !important;
    }

    .hero-content h1 {
        font-size: 2.2rem;
        letter-spacing: 1px;
        text-align: center;
    }

    /* Efecto Byzz SmartAI - luz brillante deslizándose */
    .hero .hero-content h1 span {
        font-size: 2.8rem !important;
        background: none !important;
        color: #4b240c !important;
        font-weight: 700 !important;
        -webkit-text-stroke: 1px #e18d31 !important;
        -webkit-background-clip: initial !important;
        background-clip: initial !important;
        -webkit-text-fill-color: initial !important;
        animation: none !important;
        display: block !important;
        text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important;
    }

    .hero-location {
        font-size: 1rem;
        margin-bottom: 2.5rem;
        text-align: center;
    }

    .hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }

    .hero-content .btn {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        margin: 0 0 1rem 0;
        max-width: 300px;
        text-align: center;
    }

    /* Optimizar botón reservar para móvil - Gradiente en lugar de SVG */
    .hero-content .btn-reservar {
        background: linear-gradient(135deg, #f2a945 0%, #e18d31 50%, #c67a20 100%) !important;
        color: #2a1305;
    }

    /* Optimizar títulos de sección para móvil */
    .section-title {
        font-size: 2rem !important;
        padding: 1rem 2rem !important;
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        margin: 0 auto 2rem auto !important;
    }

    /* Grids to Single Column */
    .image-grid,
    .info-grid,
    .cards-grid,
    .testimonials-grid,
    .footer-content,
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .info-section,
    .cards-section,
    .banner-section,
    .variedad-section {
        padding: 4rem 1.5rem;
    }

    .info-content {
        text-align: center;
    }

    .info-content ul {
        padding: 0;
    }

    .info-content ul li {
        padding-left: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        text-align: center;
    }

    .info-content ul li::before {
        display: none;
    }

    .info-content .btn {
        margin: 1rem auto 0;
        display: inline-block;
    }

    /* Testimonials Horizontal Scroll */
    .testimonials-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 1.5rem;
        padding-bottom: 2rem;
        -webkit-overflow-scrolling: touch;
    }

    .testimonial {
        min-width: 85vw;
        scroll-snap-align: center;
        margin-right: 0;
    }

    /* Footer Stack */
    .footer-content {
        text-align: center;
        gap: 3rem;
    }

    .footer-left,
    .footer-right {
        text-align: center !important;
    }

    .footer-right .social-icons {
        justify-content: center !important;
    }

    /* Adjust Ticker */
    .hero-ticker {
        display: none;
        /* Hide ticker on mobile to save space/clutter */
    }

    /* Adjust Map iframe height */
    iframe {
        height: 300px;
    }

    /* Time Picker Mobile Styles */
    .time-picker-container {
        gap: 0.3rem;
        padding: 1rem;
        flex-wrap: wrap;
    }

    .time-picker-display {
        font-size: 1.5rem;
        min-width: 60px;
        padding: 0.4rem 0.3rem;
    }

    .time-picker-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .time-separator-large {
        font-size: 1.5rem;
        margin: 0 0.2rem;
        padding-top: 1.4rem;
    }

    .time-picker-column {
        gap: 0.3rem;
    }

    .time-picker-label {
        font-size: 0.65rem;
    }

    /* Chat Widget Mobile Styles - FULLSCREEN RESPONSIVE */
    #chat-bubble {
        bottom: 20px !important;
        right: 15px !important;
        width: 50px !important;
        height: 50px !important;
        z-index: 1001 !important;
    }

    #chat-window {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -100vw !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        background: rgba(10, 10, 10, 0.95) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        backdrop-filter: blur(12px) !important;
        z-index: 100 !important;
        pointer-events: none !important;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), z-index 0s linear 0s !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    #chat-window.open {
        right: 0 !important;
        left: 0 !important;
        z-index: 10000 !important;
        pointer-events: auto !important;
    }

    .chat-header {
        padding: 1rem;
        min-height: 60px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-shrink: 0;
    }

    .chat-header h3 {
        font-size: 1rem;
    }

    .chat-messages {
        flex: 1;
        padding: 1rem;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        min-height: 0;
    }

    .chat-message {
        max-width: 90%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .chat-input-area {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        flex-shrink: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .chat-input-area form {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }

    .chat-input-area input {
        flex: 1;
        min-width: 0;
        padding: 0.75rem;
        font-size: 1rem;
    }

    .chat-input-area button {
        padding: 0 0.75rem;
        min-width: 44px;
        height: 44px;
    }

    /* Prevent body scroll when chat is open */
    .chat-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

    /* Optimizar burbujas de chat y cookies para móvil - Gradiente en lugar de SVG */
    #chat-bubble {
        background: linear-gradient(135deg, #f2a945 0%, #e18d31 50%, #c67a20 100%) !important;
    }

    #cookie-bubble {
        background: linear-gradient(135deg, #f2a945 0%, #e18d31 50%, #c67a20 100%) !important;
    }
}