/* =========================================================
   LE-GARDEN INN — RESPONSIVE SAFETY LAYER
   Loaded after the page-specific stylesheets.
   Keeps the existing desktop design and fixes tablet/mobile.
   ========================================================= */

html {
  width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

iframe {
  border: 0;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

.container,
.nav,
.navbar,
.nav-menu,
.hero-grid,
.contact-layout,
.booking-layout,
.booking-sidebar,
.form-grid,
.footer-grid,
.gallery-intro-grid,
.property-gallery-grid {
  min-width: 0;
}

/* Long text, URLs and email addresses must never create horizontal scroll. */
p,
li,
a,
h1,
h2,
h3,
h4,
span,
strong {
  overflow-wrap: anywhere;
}

/* Google map */
.map-placeholder {
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  display: block !important;
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.map-placeholder > div {
  width: 100%;
}

.map-placeholder h2 {
  margin: 0;
  padding: 18px 20px;
  font-size: clamp(20px, 4vw, 26px);
  text-align: left;
}

.map-placeholder iframe,
.map-frame {
  display: block;
  width: 100% !important;
  height: 340px !important;
  min-height: 280px;
}

/* Avoid content being hidden behind floating buttons. */
.footer,
.site-footer {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* =========================================================
   TABLET / MOBILE NAVIGATION
   ========================================================= */
@media (max-width: 1050px) {
  :root {
    --mobile-header-height: 78px;
  }

  .header,
  .site-header {
    width: 100%;
  }

  .nav,
  .navbar {
    position: relative;
    width: min(100% - 28px, 1180px) !important;
    height: var(--mobile-header-height) !important;
    min-height: var(--mobile-header-height) !important;
    gap: 14px !important;
  }

  .header .brand,
  .site-header .brand {
    width: 160px !important;
    min-width: 0 !important;
    height: var(--mobile-header-height) !important;
    padding: 5px 0 !important;
    border: 0 !important;
    justify-content: flex-start !important;
    overflow: hidden;
  }

  .header .brand-icon,
  .site-header .brand-icon,
  .header .brand img,
  .site-header .brand img {
    display: block;
    width: auto !important;
    max-width: 158px !important;
    height: auto !important;
    max-height: 70px !important;
    object-fit: contain;
  }

  .hamburger {
    position: relative;
    z-index: 1102;
    flex: 0 0 44px;
    width: 44px !important;
    height: 44px !important;
    display: grid !important;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    touch-action: manipulation;
  }

  .header .hamburger,
  .site-header .hamburger {
    color: #fff !important;
    background: #171b77 !important;
  }

  .header .nav-menu,
  .site-header .nav-menu {
    position: fixed !important;
    z-index: 1100;
    top: var(--mobile-header-height) !important;
    right: 0 !important;
    left: auto !important;
    width: min(360px, 100%) !important;
    height: calc(100dvh - var(--mobile-header-height)) !important;
    max-height: calc(100dvh - var(--mobile-header-height));
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    flex-direction: column !important;
    gap: 4px !important;
    margin: 0 !important;
    padding: 18px 18px calc(24px + env(safe-area-inset-bottom)) !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: -18px 22px 46px rgba(16, 26, 77, 0.22) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%) !important;
    transition: transform .3s ease, opacity .3s ease, visibility .3s ease !important;
  }

  .header .nav-menu.open,
  .header .nav-menu.active,
  .site-header .nav-menu.open,
  .site-header .nav-menu.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0) !important;
  }

  body.menu-open {
    overflow: hidden;
  }

  body.menu-open::before {
    content: "";
    position: fixed;
    z-index: 900;
    inset: var(--mobile-header-height) 0 0;
    background: rgba(4, 15, 35, .46);
    backdrop-filter: blur(2px);
  }

  .header .nav-link,
  .site-header .nav-link {
    width: 100%;
    min-height: 46px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 12px 13px !important;
    border-radius: 8px;
    color: #101a4d !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .header .nav-link:hover,
  .header .nav-link.active,
  .site-header .nav-link:hover,
  .site-header .nav-link.active {
    color: #171b77 !important;
    background: #eaf8ff !important;
  }

  .header .nav-link::after,
  .site-header .nav-link::after {
    display: none !important;
  }

  .dropdown {
    width: 100%;
  }

  .header .dropdown-menu,
  .site-header .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    display: none !important;
    margin: 4px 0 6px !important;
    padding: 6px !important;
    overflow: hidden;
    border: 1px solid #c7e9f6 !important;
    border-radius: 10px !important;
    background: #f2fbff !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .header .dropdown.open > .dropdown-menu,
  .site-header .dropdown.open > .dropdown-menu {
    display: block !important;
  }

  .header .dropdown:not(.open):hover > .dropdown-menu,
  .site-header .dropdown:not(.open):hover > .dropdown-menu {
    display: none !important;
  }

  .header .dropdown-menu a,
  .site-header .dropdown-menu a {
    width: 100%;
    display: block;
    padding: 11px 13px !important;
    border: 0 !important;
    border-radius: 7px;
    color: #243142 !important;
    font-size: 13px;
    font-weight: 500 !important;
  }

  .header .dropdown-menu a:hover,
  .site-header .dropdown-menu a:hover {
    padding-left: 13px !important;
    color: #171b77 !important;
    background: #dff5ff !important;
  }

  .book-top,
  .header-cta {
    width: 100% !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 8px 0 0 !important;
    padding: 12px 18px !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center;
  }

  .header + main {
    padding-top: var(--mobile-header-height) !important;
  }

  /* Two-column tablet grids */
  .hotel-card-grid,
  .card-grid,
  .rooms-grid,
  .place-grid,
  .event-grid,
  .temple-card-grid,
  .heritage-masonry,
  .property-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .icon-grid,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-grid,
  .grid-2,
  .experience-grid,
  .temple-layout,
  .contact-layout,
  .booking-layout,
  .gallery-intro-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .booking-sidebar {
    position: static !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-mini-card {
    justify-self: start !important;
  }
}

/* =========================================================
   PHONE LAYOUT
   ========================================================= */
@media (max-width: 768px) {
  :root {
    --mobile-header-height: 72px;
  }

  .container {
    width: min(100% - 28px, 1180px) !important;
  }

  .section,
  .hotel-switch {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  .section-title {
    margin-bottom: 30px !important;
  }

  .section-title h2,
  .section-heading h2,
  .form-card-head h2 {
    font-size: clamp(26px, 8vw, 36px) !important;
    line-height: 1.18 !important;
  }

  .section-title p,
  .banner p,
  .hero p,
  .room-content > p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  .header .brand,
  .site-header .brand {
    width: 145px !important;
    height: var(--mobile-header-height) !important;
  }

  .header .brand-icon,
  .site-header .brand-icon,
  .header .brand img,
  .site-header .brand img {
    max-width: 142px !important;
    max-height: 64px !important;
  }

  .header .nav-menu,
  .site-header .nav-menu {
    width: min(330px, 100%) !important;
  }

  /* Hero and page banners */
  .hero {
    min-height: auto !important;
    padding: 70px 0 !important;
    background-position: center !important;
  }

  .hero-grid {
    gap: 24px !important;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
    padding: 26px 22px !important;
    border-left-width: 4px !important;
    border-radius: 2px 16px 16px 2px !important;
  }

  .hero h1 {
    font-size: clamp(36px, 12vw, 52px) !important;
    line-height: 1.08 !important;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-mini-card {
    width: 100% !important;
    padding: 22px !important;
  }

  .banner,
  .local-hero {
    height: auto !important;
    min-height: 350px !important;
    padding: 70px 0 !important;
    background-position: center !important;
  }

  .banner h1 {
    font-size: clamp(34px, 11vw, 48px) !important;
    line-height: 1.08;
  }

  /* All primary content grids become one column. */
  .hotel-card-grid,
  .card-grid,
  .rooms-grid,
  .place-grid,
  .event-grid,
  .icon-grid,
  .gallery,
  .temple-gallery,
  .form-grid,
  .temple-card-grid,
  .heritage-masonry,
  .route-grid,
  .steps-grid,
  .booking-sidebar,
  .property-gallery-grid,
  .gallery-highlights,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .field.full {
    grid-column: auto !important;
  }

  /* Cards */
  .hotel-card,
  .info-card,
  .room-card,
  .event-card,
  .place-card,
  .icon-card,
  .property-card,
  .tariff-card,
  .form-card,
  .step-card,
  .property-gallery-card {
    width: 100%;
    min-width: 0;
  }

  .hotel-card-image,
  .info-card img,
  .room-card img,
  .event-card img {
    height: 220px !important;
  }

  .hotel-logo {
    left: 16px !important;
  }

  .hotel-card.gold .hotel-logo {
    left: 16px !important;
    width: min(215px, calc(100% - 32px)) !important;
    height: 110px !important;
    padding-right: 0 !important;
    transform: none !important;
  }

  .hotel-card-content {
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  .hotel-card-content p {
    min-height: 0 !important;
  }

  .experience-photo img,
  .about-img img {
    height: 290px !important;
  }

  .feature-list div {
    grid-template-columns: 48px minmax(0, 1fr) !important;
    padding: 14px !important;
  }

  .feature-list i {
    width: 44px !important;
    height: 44px !important;
  }

  .cta,
  .gallery-cta {
    align-items: stretch !important;
    flex-direction: column !important;
    padding: 30px 22px !important;
    text-align: center;
  }

  .cta .btn,
  .gallery-cta .btn {
    width: 100%;
  }

  /* Temple and image layouts */
  .photo-mosaic {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .photo-mosaic img,
  .photo-mosaic img:nth-child(1),
  .photo-mosaic img:nth-child(5) {
    grid-row: auto !important;
    height: 170px !important;
  }

  .temple-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .temple-strip img,
  .temple-strip img:nth-child(even) {
    height: 200px !important;
    margin-top: 0 !important;
  }

  .temple-card,
  .heritage-masonry .temple-card:nth-child(5n+1),
  .heritage-masonry .temple-card:nth-child(2n),
  .temple-card:nth-child(3n+1),
  .temple-card:nth-child(4n+2) {
    min-height: 340px !important;
    margin-top: 0 !important;
  }

  .route-board {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .orbit-grid {
    min-height: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
  }

  .orbit-grid::before {
    display: none !important;
  }

  .orbit-grid span {
    position: static !important;
    margin: 0 !important;
    transform: none !important;
  }

  .orbit-center {
    flex: 0 0 126px;
    width: 126px !important;
    height: 126px !important;
    margin: 0 100% 8px !important;
  }

  /* Forms */
  .form-wrap,
  .form-card {
    padding: 24px 18px !important;
    border-radius: 18px !important;
  }

  .form-grid {
    gap: 15px !important;
  }

  input,
  select,
  textarea,
  .input-wrap input,
  .input-wrap select,
  .input-wrap textarea {
    min-width: 0 !important;
    font-size: 16px !important; /* prevents iOS input zoom */
  }

  .input-wrap {
    min-width: 0;
  }

  .form-section-title {
    align-items: flex-start !important;
  }

  .consent-check {
    line-height: 1.5;
  }

  /* Contact page */
  .contact-layout {
    gap: 30px !important;
  }

  .contact-info {
    gap: 18px !important;
  }

  .contact-line {
    min-width: 0;
    gap: 13px !important;
  }

  .contact-line > div:last-child {
    min-width: 0;
  }

  .contact-icon {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
  }

  .map-placeholder {
    margin-top: 8px !important;
    border-radius: 14px !important;
  }

  .map-placeholder iframe,
  .map-frame {
    height: 300px !important;
    min-height: 300px !important;
  }

  /* Reservation page */
  .reservation {
    min-height: 440px !important;
    background-position: center !important;
  }

  .room-content {
    padding-block: 65px !important;
  }

  .room-content h1 {
    max-width: 100%;
    font-size: clamp(38px, 12vw, 58px) !important;
    line-height: 1.05 !important;
  }

  .room-badges {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .room-badges span {
    width: 100%;
  }

  .booking-section,
  .booking-steps {
    padding: 60px 0 !important;
  }

  .booking-sidebar {
    position: static !important;
  }

  .property-image-wrap {
    height: 220px !important;
  }

  .property-content,
  .tariff-card {
    padding: 22px 18px !important;
  }

  .property-features {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .price-item {
    min-width: 0;
  }

  .support-box {
    min-width: 0;
  }

  /* Rooms */
  .room-bottom {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 14px;
  }

  .room-bottom .btn {
    width: 100%;
  }

  /* Facilities slider */
  .hospitality-slider {
    height: 320px !important;
    border-radius: 16px !important;
  }

  .hospitality-slider-overlay {
    right: 18px !important;
    left: 18px !important;
    bottom: 54px !important;
  }

  .hospitality-arrow {
    width: 40px !important;
    height: 40px !important;
  }

  /* Gallery page */
  .gallery-hero {
    height: 540px !important;
    min-height: 0 !important;
  }

  .gallery-hero h1 {
    font-size: clamp(40px, 13vw, 60px) !important;
  }

  .modern-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: 205px !important;
  }

  .gallery-item.gallery-wide {
    grid-column: span 2 !important;
  }

  .gallery-lightbox {
    padding: 70px 14px 28px !important;
  }

  .lightbox-arrow {
    top: auto !important;
    bottom: 16px !important;
    transform: none !important;
  }

  .lightbox-prev {
    left: calc(50% - 62px) !important;
  }

  .lightbox-next {
    right: calc(50% - 62px) !important;
  }

  .lightbox-caption {
    margin-bottom: 58px !important;
  }

  /* Footer and floating controls */
  .footer {
    padding-top: 48px !important;
  }

  .footer-grid {
    gap: 28px !important;
  }

  .copyright {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 20px 0 !important;
    text-align: left !important;
  }

  .floating-whatsapp,
  .back-top {
    right: 14px !important;
  }

  .floating-whatsapp {
    bottom: 74px !important;
    width: 52px !important;
    height: 52px !important;
  }

  .back-top {
    bottom: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }
}

/* =========================================================
   SMALL PHONE
   ========================================================= */
@media (max-width: 480px) {
  .container {
    width: min(100% - 22px, 1180px) !important;
  }

  .header .brand,
  .site-header .brand {
    width: 132px !important;
  }

  .header .brand-icon,
  .site-header .brand-icon,
  .header .brand img,
  .site-header .brand img {
    max-width: 130px !important;
  }

  .hamburger {
    width: 42px !important;
    height: 42px !important;
    flex-basis: 42px;
  }

  .header .nav-menu,
  .site-header .nav-menu {
    width: 100% !important;
  }

  .section,
  .hotel-switch {
    padding-top: 48px !important;
    padding-bottom: 48px !important;
  }

  .btn {
    min-height: 46px;
    padding: 12px 18px !important;
  }

  .hero {
    padding: 56px 0 !important;
  }

  .hero-content {
    padding: 22px 18px !important;
  }

  .hero h1 {
    font-size: clamp(34px, 12vw, 44px) !important;
  }

  .banner,
  .local-hero {
    min-height: 320px !important;
    padding: 58px 0 !important;
  }

  .banner h1 {
    font-size: clamp(31px, 10vw, 42px) !important;
  }

  .hotel-card-image,
  .info-card img,
  .room-card img,
  .event-card img {
    height: 205px !important;
  }

  .photo-mosaic,
  .temple-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .photo-mosaic img,
  .photo-mosaic img:nth-child(1),
  .photo-mosaic img:nth-child(5),
  .temple-strip img {
    height: 220px !important;
  }

  .stats {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .gallery-hero {
    height: 500px !important;
  }

  .modern-gallery {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: 240px !important;
  }

  .gallery-item.gallery-wide,
  .gallery-item.gallery-tall {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .gallery-filter {
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    flex: 0 0 auto;
  }

  .price-item {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  .price-item strong {
    white-space: normal !important;
  }

  .support-box {
    align-items: flex-start !important;
  }

  .map-placeholder iframe,
  .map-frame {
    height: 280px !important;
    min-height: 280px !important;
  }

  .hospitality-slider {
    height: 285px !important;
  }
}

/* Reduce motion for users who request it and for low-power mobile devices. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* FINAL FIX: hamburger click/open state */
@media (max-width: 1050px) {
  .header,
  .site-header {
    z-index: 1200 !important;
  }

  .hamburger {
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  .header .nav-menu.open,
  .header .nav-menu.active,
  .header .nav-menu.is-open,
  .site-header .nav-menu.open,
  .site-header .nav-menu.active,
  .site-header .nav-menu.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
    right: 0 !important;
  }
}
