/**
 * Responsive Design & Burger Menu
 * Mobile-first responsive styles for Rumah Mila
 */

/* ==========================================
   Screen Reader Only Class
   ========================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ==========================================
   Burger Menu Styles
   ========================================== */

.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2.75rem;   /* 44px WCAG compliant */
    height: 2.75rem;  /* 44px WCAG compliant */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
    position: relative;
    transition: transform 0.3s ease;
}

.burger-menu:hover {
    transform: scale(1.1);
}

.burger-menu:focus {
    outline: 2px solid var(--olivo);
    outline-offset: 4px;
}

.burger-line {
    width: 100%;
    height: 3px;
    background-color: var(--pizarra-oscura);
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: center;
}

/* Burger Menu Active State (X) */
.burger-menu.active .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */

/* Tablet & Mobile - Show burger menu */
@media (max-width: 1024px) {
    .burger-menu {
        display: flex;
    }

    .header-content {
        position: relative;
    }

    .nav {
        position: fixed;
        top: 0;
        left: auto !important;
        right: -100%;
        height: 100vh;
        width: 320px;
        max-width: 85vw;
        background-color: var(--blanco);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 6rem 2rem 2rem;
        gap: 0;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 150;
        overflow-y: auto;
    }

    .nav.active {
        right: 0;
    }

    .nav-link {
        padding: 1.25rem 1.5rem;
        border-bottom: 1px solid var(--arena-suave);
        font-size: 1.125rem;
        text-align: left;
        transition: all 0.3s ease;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: var(--marfil-estuco);
        color: var(--olivo);
        padding-left: 2rem;
    }

    .lang-toggle {
        margin-top: 2rem;
        width: 100%;
    }

    /* Mobile menu overlay */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 100;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ==========================================
   Responsive Typography
   ========================================== */

@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    h3 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .hero-title {
        font-size: 2.75rem;
    }

    .hero-subtitle {
        font-size: 1.125rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    section {
        padding: var(--spacing-lg) 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

/* ==========================================
   Hero Section Responsive
   ========================================== */

@media (max-width: 1024px) {
    .hero {
        min-height: 650px;
        height: 80vh;
    }

    .date-picker {
        padding: 1.5rem;
        gap: 1rem;
    }

    .date-input-group {
        min-width: 180px;
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 600px;
        height: auto;
        background-attachment: scroll;
    }

    .hero-content {
        padding: var(--spacing-sm);
    }

    .date-picker {
        flex-direction: column;
        padding: 1.5rem;
        width: 100%;
    }

    .date-input-group {
        width: 100%;
        min-width: auto;
    }

    .btn {
        width: 100%;
        padding: 1.125rem 2rem;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: 1rem;
    }

    .date-picker {
        padding: 1.25rem;
    }
}

/* ==========================================
   Grid Layouts Responsive
   ========================================== */

@media (max-width: 1024px) {
    .units-grid,
    .amenities-grid,
    .reviews-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .trust-badges {
        gap: 1.5rem;
    }

    .experience-item {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .experience-item:nth-child(even) {
        direction: ltr;
    }

    .experience-item-content {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .units-grid,
    .reviews-grid,
    .policies-grid,
    .location-details {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .amenities-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.25rem;
    }

    .quick-contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .rating-summary {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    .amenities-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .trust-badges {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ==========================================
   Cards & Components Responsive
   ========================================== */

@media (max-width: 768px) {
    .unit-card,
    .review-card,
    .policy-card,
    .location-item,
    .amenity-card {
        padding: 1.5rem;
    }

    .unit-image-container {
        height: 250px;
    }

    .quick-contact-card {
        padding: 2rem 1.5rem;
    }

    .quick-contact-card .icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .quick-contact-card .icon-wrapper svg {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .unit-content,
    .review-card,
    .policy-card,
    .location-item {
        padding: 1.25rem;
    }

    .unit-image-container {
        height: 220px;
    }

    .unit-title {
        font-size: 1.25rem;
    }

    .price-amount {
        font-size: 1.5rem;
    }

    .quick-contact-card {
        padding: 1.75rem 1.25rem;
    }
}

/* ==========================================
   Forms Responsive
   ========================================== */

@media (max-width: 768px) {
    .contact-form-container {
        padding: 2.5rem 2rem;
        border-radius: 16px;
    }

    .contact-form-container h3 {
        font-size: 1.875rem;
    }

    .form-row-inline {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 1rem 1.25rem;
    }

    .contact-form textarea {
        min-height: 150px;
    }
}

@media (max-width: 480px) {
    .contact-form-container {
        padding: 2rem 1.5rem;
    }

    .contact-form-container h3 {
        font-size: 1.5rem;
    }

    .form-subtitle {
        font-size: 0.875rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }
}

/* ==========================================
   Modal Responsive
   ========================================== */

@media (max-width: 768px) {
    .modal-content {
        margin: 10% 5%;
        padding: 2rem;
        max-width: 95%;
    }

    .modal-close {
        right: 1rem;
        top: 0.75rem;
        font-size: 1.75rem;
    }

    .price-calculator {
        padding: 1.5rem;
    }

    .calc-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .calc-row .date-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 5% 2.5%;
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
}

/* ==========================================
   Lightbox Responsive
   ========================================== */

@media (max-width: 768px) {
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 1rem;
    }

    .lightbox-next {
        right: 1rem;
    }

    .lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-counter {
        bottom: 1rem;
        font-size: 0.8125rem;
    }
}

/* ==========================================
   Touch Target Optimization (WCAG)
   ========================================== */

@media (max-width: 768px) {
    .nav-link,
    .btn,
    .lang-toggle,
    .burger-menu,
    .modal-close,
    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ==========================================
   Experience Section Responsive
   ========================================== */

@media (max-width: 768px) {
    .experience-item-title {
        font-size: 1.5rem;
    }

    .experience-item-content {
        padding: 1rem;
    }
}

/* ==========================================
   FAQ Responsive
   ========================================== */

@media (max-width: 768px) {
    .faq-question {
        padding: 1.25rem 1.5rem;
    }

    .faq-question h4 {
        font-size: 1rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 1.5rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .faq-question {
        padding: 1rem 1.25rem;
    }

    .faq-question h4 {
        font-size: 0.9375rem;
    }

    .faq-item.active .faq-answer {
        padding: 0 1.25rem 1rem;
    }

    .faq-answer p {
        font-size: 0.9375rem;
    }
}

/* ==========================================
   Host Profile Responsive
   ========================================== */

@media (max-width: 768px) {
    .host-profile {
        padding: 2rem;
    }

    .host-avatar {
        width: 100px;
        height: 100px;
    }

    .host-name {
        font-size: 1.75rem;
    }

    .host-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ==========================================
   Footer Responsive
   ========================================== */

@media (max-width: 768px) {
    .footer-grid {
        text-align: center;
    }

    .footer-text,
    .footer-link,
    .footer-link-flex {
        justify-content: center;
    }
}

/* ==========================================
   Video Play Button Overlay
   ========================================== */

.hero-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(111, 125, 98, 0.9);
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.hero-video-play:hover {
    background: rgba(168, 176, 154, 0.95);
    transform: translate(-50%, -50%) scale(1.1);
}

.hero-video-play:active {
    transform: translate(-50%, -50%) scale(0.95);
}

@media (max-width: 768px) {
    /* Prevent video overflow on mobile */
    .hero-video {
        max-width: 100%;
        width: 100%;
    }

    .hero-video-play {
        width: 64px;
        height: 64px;
    }

    .hero-video-play svg {
        width: 32px;
        height: 32px;
    }
}

/* ==========================================
   Landscape Orientation Support
   ========================================== */

@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: auto;
        min-height: 450px;
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .date-picker {
        padding: 1rem;
        gap: 0.75rem;
    }

    .date-input-group {
        min-width: 150px;
    }

    /* Adjust navigation menu height */
    .nav {
        max-height: 100vh;
        overflow-y: auto;
        padding: 4rem 2rem 2rem;
    }

    .nav-link {
        padding: 0.875rem 1.5rem;
    }
}

/* ==========================================
   Keyboard Navigation Focus Indicators
   ========================================== */

*:focus-visible {
    outline: 3px solid var(--olivo);
    outline-offset: 3px;
    border-radius: 4px;
}

.nav-link:focus-visible {
    outline: 2px solid var(--olivo);
    outline-offset: 4px;
    background-color: rgba(168, 176, 154, 0.1);
}

.btn:focus-visible {
    outline: 3px solid var(--olivo);
    outline-offset: 2px;
    box-shadow: 0 0 0 6px rgba(111, 125, 98, 0.2);
}

.burger-menu:focus-visible {
    outline: 2px solid var(--olivo);
    outline-offset: 4px;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--olivo);
    color: var(--blanco);
    padding: 1rem 2rem;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* ==========================================
   Performance: Reduced Motion
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .burger-menu,
    .burger-line,
    .nav,
    .nav-overlay,
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    .header,
    .burger-menu,
    .nav-overlay,
    .modal,
    .lightbox,
    .btn,
    .cookie-consent {
        display: none !important;
    }

    .hero {
        height: auto;
        min-height: auto;
        page-break-after: always;
    }

    body {
        background-color: white;
        color: black;
    }
}
