@media (max-width: 768px){
  /* Consistent fixed header on mobile for both header styles */
  nav.fixed-header, nav#main-nav { position: fixed; top: 0; left: 0; right: 0; height: 64px; padding: 0.5rem 1rem; z-index: 1000; background: rgba(5,5,5,0.95); display: flex; align-items: center; }
  nav.fixed-header img, nav#main-nav img { height: 40px; }
  /* Ensure header stays above hero imagery on mobile */
  nav.fixed-header { z-index: 1100; }

  /* Replace desktop link list with slide-in mobile menu */
  .nav-links { position: fixed; top: 0; right: -100%; width: 70%; height: 100vh; background: rgba(5,5,5,0.98); flex-direction: column; justify-content: center; padding-left: 2rem; border-left: 1px solid rgba(176,169,144,0.1); transition: right 0.35s ease; display: flex; gap: 16px; }
  .nav-links.active { right: 0; }
  .mobile-toggle, #mobile-menu-btn { display: block !important; }
  #mobile-menu { display: block !important; }

  /* ensure content is not hidden under header */
  body { padding-top: 64px !important; }

  /* Cinematic full-screen hero for pages (keeps desktop unchanged) */
  .hero, .page-hero, .hero-spacer, .mobile-hero { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; }

  /* Calendar responsiveness: allow horizontal scroll for full week view */
  .calendar-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .calendar-grid { min-width: 700px; }

  /* Gallery column adjustments on small screens */
  #gallery.masonry { column-width: 180px; column-gap: 10px; }

  /* Posters and grids adjust to single column for readability */
  .poster-box { width: 100%; }
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr !important; }

  /* Make WhatsApp/book anchor visible and consistent like Home header button */
  nav.fixed-header a.whatsapp-center,
  nav.fixed-header a[href*="wa.me"] {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 9999px;
    background: #c4a77d;
    color: #050505 !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    border: 1px solid rgba(0,0,0,0.06);
    z-index: 1110;
  }

  /* Add visible text label for icon-only anchors */
  nav.fixed-header a.whatsapp-center::after {
    content: "BOOK";
    margin-left: 6px;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 2px;
    color: inherit;
  }
}

/* Global header layout to match landing: logo left, BOOK centered, nav right */
nav.fixed-header {
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 1rem;
}
nav.fixed-header .nav-links { margin-left: auto; }
nav.fixed-header a[href*="wa.me"], nav.fixed-header a.whatsapp-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 1110;
}

/* Ensure logo remains left-aligned and clickable */
nav.fixed-header > a:first-child { z-index: 1111; }

/* On very small screens, slightly offset the center pill to avoid overlap */
@media (max-width: 360px) {
  nav.fixed-header a[href*="wa.me"], nav.fixed-header a.whatsapp-center { left: 52%; }
}

/* User-provided navigation styles (merged) */
nav.fixed-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(5, 5, 5, 0.95) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1000;
  border-bottom: 1px solid rgba(176, 169, 144, 0.15);
  padding: 1rem 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav.fixed-header img { height: 50px; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { color: #b0a990; font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; text-decoration: none; transition: 0.3s; }
.nav-links a:hover, .nav-links a.current { color: #f8f8f8; }
.nav-links a.current { color: #9f1239 !important; font-weight: 600; }

.nav-dropdown { position: relative; display: inline-block; }
.dropdown-content { 
  display: none; 
  position: absolute; 
  background: linear-gradient(180deg, rgba(8,8,8,0.98), rgba(14,14,14,0.98)); 
  min-width: 200px; 
  right: 0; 
  box-shadow: 0 12px 40px rgba(0,0,0,0.6); 
  border: 1px solid rgba(176, 169, 144, 0.06);
  border-radius: 8px;
  overflow: hidden;
  padding: 6px 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  transform-origin: top right;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
}
.nav-dropdown:hover .dropdown-content { display: block; opacity: 1; transform: translateY(0) scale(1); }
.dropdown-content a { display: block; padding: 10px 14px; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.02); color: var(--khaki); }
.dropdown-content a:last-child { border-bottom: none; }
.dropdown-content a:hover { background: rgba(255,255,255,0.02); color: var(--soft-white); }

/* make chevron smaller and aligned */
.nav-dropdown > a i.fa-chevron-down { font-size: 0.7rem; margin-left: 6px; }

/* Mobile Menu overrides */
.mobile-toggle { display: none; flex-direction: column; gap: 6px; cursor: pointer; }
.mobile-toggle span { width: 25px; height: 2px; background: #b0a990; transition: 0.3s; }

@media (max-width: 768px) {
  .mobile-toggle { display: flex; z-index: 1002; }
  .nav-links { 
    position: fixed; top: 0; right: -100%; width: 80%; height: 100vh; 
    background: #050505; flex-direction: column; justify-content: center; 
    padding-left: 2rem; transition: 0.4s; z-index: 1001;
  }
  .nav-links.active { right: 0; }
  .dropdown-content { position: static; background: transparent; border: none; box-shadow: none; padding-left: 1rem; }
}

/* Final mobile safety overrides to prevent horizontal overflow and ensure header/nav render correctly */
@media (max-width: 768px) {
  html, body {
    width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box;
  }

  /* Force header to fit within viewport and use box-sizing to include padding */
  nav.fixed-header {
    left: 0 !important;
    right: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
  }

  /* Keep the center BOOK pill centered without causing overflow */
  nav.fixed-header a[href*="wa.me"], nav.fixed-header a.whatsapp-center {
    left: 50% !important;
    transform: translateX(-50%) !important;
    position: absolute !important;
  }

  /* Ensure nav-links cannot push the page width when closed */
  .nav-links { width: 78% !important; right: -100% !important; }
  .nav-links.active { right: 0 !important; }
}
