/* =========================================
   1. MATERIAL DESIGN 3 (M3) TOKENS
   ========================================= */
:root {
    /* --- COLOR PALETTE (Light Mode) --- */
    --md-sys-color-primary: #855d00;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #ffddb3;
    --md-sys-color-on-primary-container: #291800;

    --md-sys-color-secondary: #6f5b40;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #fadebc;
    --md-sys-color-on-secondary-container: #271904;

    /* Backgrounds (No Pure White/Black) */
    --md-sys-color-background: #fffbff;
    --md-sys-color-on-background: #1f1b16;
    --md-sys-color-surface: #fffbff;
    --md-sys-color-on-surface: #1f1b16;
    --md-sys-color-surface-variant: #f0e0cf;
    --md-sys-color-on-surface-variant: #4f4539;

    --md-sys-color-outline: #817567;
    --md-sys-color-outline-variant: #d3c4b4;
    --bg-overlay: rgba(0, 0, 0, 0.6);

    /* --- ELEVATION --- */
    --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);
    --elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15);
    --elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.15);

    /* --- SHAPES & LAYOUT --- */
    --shape-sm: 8px;
    --shape-md: 12px;
    --shape-xl: 28px; /* Pill Shape */
    --shape-card: 24px;
    
    --header-height: 72px;
    --sidebar-width: 280px;
    --container-max: 1200px;
    --transition-standard: 0.3s cubic-bezier(0.2, 0.0, 0, 1.0);
}

/* --- DARK MODE (Auto-Switching) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --md-sys-color-primary: #ffb951;
        --md-sys-color-on-primary: #452b00;
        --md-sys-color-primary-container: #634100;
        --md-sys-color-on-primary-container: #ffddb3;

        --md-sys-color-secondary: #ddc2a1;
        --md-sys-color-on-secondary: #3e2d16;
        --md-sys-color-secondary-container: #56442a;
        --md-sys-color-on-secondary-container: #fadebc;

        --md-sys-color-background: #1f1b16;
        --md-sys-color-on-background: #eae1d9;
        --md-sys-color-surface: #1f1b16;
        --md-sys-color-on-surface: #eae1d9;
        --md-sys-color-surface-variant: #4f4539;
        --md-sys-color-on-surface-variant: #d3c4b4;

        --md-sys-color-outline: #9c8f80;
    }
}

/* =========================================
   2. GLOBAL RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--md-sys-color-background);
    color: var(--md-sys-color-on-background);
    line-height: 1.5;
    overflow-x: hidden; /* Prevent horizontal scroll */
    transition: background-color 0.3s ease;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
.container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* =========================================
   3. SIDEBAR (The Fix: High Z-Index)
   ========================================= */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%; /* Start Hidden */
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    z-index: 9999; /* Highest Priority - Above everything */
    transition: left 0.3s ease-in-out; /* Smooth slide */
    display: flex;
    flex-direction: column;
    box-shadow: var(--elevation-3);
    overflow-y: auto;
}

.sidebar.active {
    left: 0; /* Slide In */
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.sidebar-close {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}
.sidebar-close:hover { background-color: var(--md-sys-color-surface-variant); }

.sidebar-menu { flex: 1; padding: 16px; }

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin-bottom: 4px;
    border-radius: var(--shape-xl);
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
}

.sidebar-menu-item:hover, .sidebar-submenu-item:hover {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.sidebar-menu-item i { width: 24px; margin-right: 16px; text-align: center; color: var(--md-sys-color-primary); }

/* Sidebar Footer */
.mobile-book-btn {
    margin: 16px;
    text-align: center;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    padding: 12px;
    border-radius: var(--shape-xl);
    font-weight: 600;
    display: block;
}
.sidebar-footer {
    padding: 20px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

/* Submenu */
.submenu { padding-left: 10px; }
.sidebar-submenu-item {
    display: flex; align-items: center; padding: 10px 20px 10px 50px;
    font-size: 14px; border-radius: var(--shape-xl);
}
.submenu-arrow { margin-left: auto; font-size: 12px; }

/* Overlay */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-overlay);
    z-index: 9998; /* Just below sidebar */
    display: none; /* Default Hidden */
    backdrop-filter: blur(2px);
}
.overlay.active { display: block; }

/* =========================================
   4. HEADER & NAV
   ========================================= */
.header {
    height: var(--header-height);
    background-color: var(--md-sys-color-surface);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--elevation-1);
    display: flex; align-items: center;
}

.header-content {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
}
.logo img { height: 44px; }

/* Desktop Nav */
.nav-menu { display: flex; gap: 8px; }
.nav-menu a {
    padding: 8px 16px; border-radius: var(--shape-xl); font-weight: 500; font-size: 15px;
}
.nav-menu a:hover {
    background-color: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* Dropdown */
.nav-menu li.dropdown { position: relative; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0;
    background: var(--md-sys-color-surface);
    box-shadow: var(--elevation-2);
    border-radius: var(--shape-md);
    min-width: 200px; padding: 8px 0;
    display: none;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; border-radius: 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 48px; padding: 0 32px;
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border-radius: var(--shape-xl);
    font-weight: 500; border: none; cursor: pointer;
    box-shadow: var(--elevation-1);
}
.btn:hover { box-shadow: var(--elevation-2); opacity: 0.95; }

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none; /* Hidden on Desktop */
    font-size: 24px; padding: 8px; cursor: pointer;
}

/* =========================================
   5. BOOKING FORM (The Responsive Fix)
   ========================================= */
.booking-bar {
    padding: 30px 0;
    position: relative;
    z-index: 10;
}

.booking-form {
    background: var(--md-sys-color-surface);
    padding: 24px;
    border-radius: var(--shape-card);
    box-shadow: var(--elevation-2);
    border: 1px solid var(--md-sys-color-outline-variant);
    
    /* Desktop: 4 Columns */
    display: grid;
    grid-template-columns: repeat(5, 1fr); 
    gap: 16px;
    align-items: end;
}

.form-group label {
    display: block; font-size: 12px; font-weight: 700;
    text-transform: uppercase; margin-bottom: 8px;
    color: var(--md-sys-color-on-surface-variant);
}

.form-control {
    width: 100%; height: 56px; padding: 0 16px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--shape-sm);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 16px; font-family: inherit;
}

.booking-form-btn .btn { width: 100%; height: 56px; }

/* =========================================
   6. ROOMS & FOOTER
   ========================================= */
.rooms { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 50px; }
.section-subtitle { color: var(--md-sys-color-primary); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; font-size: 14px; }
.section-heading { font-size: 36px; margin: 10px 0; color: var(--md-sys-color-on-surface); }
.section-description { color: var(--md-sys-color-on-surface-variant); max-width: 600px; margin: 0 auto; }

.rooms-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px;
}

.room-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--shape-card);
    overflow: hidden; border: 1px solid var(--md-sys-color-outline-variant);
    transition: 0.3s;
}
.room-card:hover { transform: translateY(-5px); box-shadow: var(--elevation-3); }
.room-image { height: 240px; overflow: hidden; }
.hotel-image { height: 540px; overflow: hidden; }
.room-image img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.room-card:hover img { transform: scale(1.05); }
.room-details { padding: 24px; }
.room-title { font-size: 20px; margin-bottom: 8px; color: var(--md-sys-color-on-surface); }
.room-description { color: var(--md-sys-color-on-surface-variant); margin-bottom: 20px; font-size: 14px; }
.room-details .btn { width: 100%; background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-on-secondary-container); }
.room-details .btn:hover { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }

/* Footer */
.footer {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    padding: 60px 0 20px; margin-top: 60px;
    border-radius: 32px 32px 0 0;
}
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer h3 { font-size: 18px; color: var(--md-sys-color-on-surface); margin-bottom: 20px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.footer-social a {
    width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.05); color: var(--md-sys-color-on-surface);
}
.footer-social a:hover { background: var(--md-sys-color-primary); color: #fff; }
.footer-bottom { text-align: center; border-top: 1px solid var(--md-sys-color-outline-variant); padding-top: 20px; font-size: 14px; }

/* Floating Buttons */
.floating-buttons { position: fixed; bottom: 30px; right: 30px; display: flex; flex-direction: column; gap: 15px; z-index: 100; }
.floating-btn { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: var(--elevation-2); font-size: 24px; }
.call-btn { background: var(--md-sys-color-primary); }
.whatsapp-btn { background: #25D366; }

/* Top Bar (Desktop) */
.top-bar { background: var(--md-sys-color-surface-variant); color: var(--md-sys-color-on-surface-variant); padding: 8px 0; font-size: 13px; display: none; }
@media (min-width: 992px) { .top-bar { display: block; } }
.top-bar-right { display: flex; gap: 20px; align-items: center; }

/* =========================================
   7. RESPONSIVE MEDIA QUERIES (CRITICAL FIXES)
   ========================================= */
@media (max-width: 992px) {
    /* Hide Desktop Nav */
    .nav-menu, .desktop-book-btn { display: none !important; }
    
    /* Show Mobile Menu Button */
    .mobile-menu-btn { display: block; }

    /* Fix Booking Form Layout (Stack Vertically) */
    .booking-form {
        grid-template-columns: 1fr; /* 1 Column */
        gap: 20px;
    }

    .booking-bar { margin-top: 0; }
    
    /* Adjust Headings */
    .section-heading { font-size: 30px; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .rooms-grid { grid-template-columns: 1fr; }
}