/* =========================================================
   IYYANGAR GUEST HOUSE - COMPLETE RESPONSIVE OVERRIDES
   Loaded after the page-specific stylesheet.
   ========================================================= */

html {
  -webkit-text-size-adjust: 100%;
}

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

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

img {
  height: auto;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

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

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
  min-width: 0;
}

/* ---------- Consistent header and logo ---------- */
.header,
.site-header {
  width: 100%;
  z-index: 5000 !important;
}

.header .nav,
.site-header .navbar {
  min-height: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header .brand,
.site-header .brand {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  height: 76px !important;
  padding: 1px 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 150px !important;
  overflow: hidden;
  border: 0 !important;
}

.header .brand img,
.site-header .brand img,
.header .brand-icon,
.site-header .brand-icon {
  display: block !important;
  width: 145px !important;
  max-width: 145px !important;
  height: auto !important;
  max-height: 74px !important;
  padding: 0 !important;
  margin: 0 auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

.header .nav-menu,
.site-header .nav-menu {
  min-width: 0;
}

.header .nav-link,
.site-header .nav-link,
.header .book-top,
.site-header .header-cta {
  font-weight: 500 !important;
}

.hamburger {
  position: relative;
  z-index: 5100;
  flex: 0 0 auto;
  touch-action: manipulation;
}

.hamburger:focus,
.hamburger:active {
  outline: 0 !important;
  box-shadow: none !important;
}

/* ---------- General content safety ---------- */
.hero-grid,
.grid-2,
.experience-grid,
.temple-layout,
.contact-layout,
.booking-layout,
.booking-sidebar,
.footer-grid,
.form-grid,
.hotel-card-grid,
.card-grid,
.rooms-grid,
.place-grid,
.event-grid,
.icon-grid,
.route-grid,
.temple-card-grid,
.photo-mosaic,
.temple-strip,
.steps-grid,
.property-features {
  min-width: 0;
}

.hero-grid > *,
.grid-2 > *,
.experience-grid > *,
.temple-layout > *,
.contact-layout > *,
.booking-layout > *,
.booking-sidebar > *,
.footer-grid > *,
.form-grid > *,
.hotel-card-grid > *,
.card-grid > *,
.rooms-grid > *,
.place-grid > *,
.event-grid > *,
.icon-grid > *,
.route-grid > *,
.temple-card-grid > *,
.steps-grid > * {
  min-width: 0;
}

.hero-content h1,
.banner h1,
.room-content h1,
.section-title h2,
.form-card-head h2,
.section-heading h2,
.hotel-card-title,
.room-body h3,
.step-card h3 {
  overflow-wrap: anywhere;
}

/* ---------- Forms ---------- */
.form-wrap,
.form-card,
.property-card,
.tariff-card {
  width: 100%;
  min-width: 0;
}

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

.field input,
.field select,
.field textarea,
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  min-width: 0;
}

textarea {
  resize: vertical;
}

/* ---------- Responsive Google Map ---------- */
.map-placeholder {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin-top: 24px;
  padding: 14px;
  display: block !important;
  overflow: hidden;
}

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

.map-placeholder h2 {
  margin: 0 0 12px;
  font-size: clamp(20px, 4vw, 28px);
}

.map-placeholder iframe,
.map-frame {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: clamp(280px, 42vw, 420px) !important;
  border: 0 !important;
  border-radius: 12px;
}

/* ---------- Footer ---------- */
.footer-grid > div {
  min-width: 0;
}

.footer li,
.footer p,
.footer a {
  overflow-wrap: anywhere;
}

/* =========================================================
   TABLET / MOBILE NAVIGATION
   ========================================================= */
@media (max-width: 1024px) {
  .container {
    width: min(960px, calc(100% - 32px));
  }

  .header .nav,
  .site-header .navbar {
    min-height: 74px;
    height: 74px;
  }

  .header .brand,
  .site-header .brand {
    width: 135px !important;
    min-width: 135px !important;
    max-width: 135px !important;
    height: 70px !important;
    flex-basis: 135px !important;
  }

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

  .hamburger {
    width: 44px !important;
    height: 44px !important;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 10px;
    background: var(--green, #336900) !important;
    color: #fff !important;
    font-size: 22px !important;
    cursor: pointer;
    pointer-events: auto !important;
  }

  .header .nav-menu,
  .site-header .nav-menu {
    position: fixed !important;
    top: 74px !important;
    right: 0 !important;
    left: auto !important;
    width: min(360px, 92vw) !important;
    max-width: 100% !important;
    height: calc(100dvh - 74px) !important;
    margin: 0 !important;
    padding: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: -14px 20px 36px rgba(0, 0, 0, 0.20) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(105%) !important;
    transition: transform .28s ease, opacity .28s ease, visibility .28s ease !important;
    z-index: 5050 !important;
  }

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

  body.nav-open {
    overflow: hidden !important;
  }

  /* Keep the mobile menu clean: no grey/blur frame over the page. */
  body.nav-open::after {
    content: none !important;
    display: none !important;
  }

  .header .nav-link,
  .site-header .nav-link {
    width: 100% !important;
    min-height: 48px;
    padding: 13px 10px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    color: #172235 !important;
    font-size: 14px !important;
    line-height: 1.35;
    border-bottom: 1px solid #ece8dc;
  }

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

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

  .header .dropdown-menu,
  .site-header .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    max-height: 0;
    margin: 0 !important;
    padding: 0 10px !important;
    display: block !important;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none;
    transform: none !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    background: #fff8e2 !important;
    transition: max-height .25s ease, padding .25s ease !important;
  }

  .header .dropdown.open .dropdown-menu,
  .site-header .dropdown.open .dropdown-menu {
    max-height: 260px;
    padding: 6px 10px 10px !important;
    pointer-events: auto;
  }

  .header .dropdown-menu a,
  .site-header .dropdown-menu a {
    padding: 11px 10px !important;
    font-weight: 400 !important;
    color: #243142 !important;
    border-bottom: 1px solid rgba(184, 137, 0, .15);
  }

  .header .book-top,
  .site-header .header-cta {
    width: 100% !important;
    min-height: 48px;
    margin: 12px 0 0 !important;
    padding: 13px 16px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 10px;
  }

  /* Header .header is fixed in standard pages. */
  .header + main,
  .header ~ main {
    padding-top: 74px !important;
  }

  .hero-grid,
  .grid-2,
  .experience-grid,
  .temple-layout,
  .contact-layout,
  .booking-layout {
    grid-template-columns: 1fr !important;
  }

  .hotel-card-grid,
  .card-grid,
  .rooms-grid,
  .place-grid,
  .event-grid,
  .icon-grid,
  .route-grid,
  .temple-card-grid,
  .steps-grid {
    grid-template-columns: repeat(2, 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;
  }

  .contact-info,
  .form-wrap {
    width: 100%;
  }

  .contact-layout {
    gap: 30px !important;
  }
}

/* =========================================================
   PHONE
   ========================================================= */
@media (max-width: 680px) {
  .container {
    width: calc(100% - 28px) !important;
  }

  .header .nav,
  .site-header .navbar {
    min-height: 70px !important;
    height: 70px !important;
    gap: 12px;
  }

  .header .brand,
  .site-header .brand {
    width: 125px !important;
    min-width: 125px !important;
    max-width: 125px !important;
    height: 66px !important;
    flex-basis: 125px !important;
  }

  .header .brand img,
  .site-header .brand img,
  .header .brand-icon,
  .site-header .brand-icon {
    width: 120px !important;
    max-width: 120px !important;
    height: auto !important;
    max-height: 62px !important;
  }

  .hamburger {
    width: 42px !important;
    height: 42px !important;
    font-size: 20px !important;
  }

  .header .nav-menu,
  .site-header .nav-menu {
    top: 70px !important;
    width: 100% !important;
    height: calc(100dvh - 70px) !important;
    padding: 18px 16px 28px !important;
  }

  .header + main,
  .header ~ main {
    padding-top: 70px !important;
  }

  .section,
  .booking-section,
  .booking-steps {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

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

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

  .banner,
  .local-hero {
    min-height: 340px !important;
  }

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

  .hero {
    min-height: auto !important;
    padding: 70px 0 !important;
  }

  .hero-content {
    width: 100%;
    padding: 24px 18px !important;
  }

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

  .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

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

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

  .hotel-card-grid,
  .card-grid,
  .rooms-grid,
  .place-grid,
  .event-grid,
  .icon-grid,
  .route-grid,
  .temple-card-grid,
  .heritage-masonry,
  .steps-grid,
  .booking-sidebar,
  .form-grid,
  .property-features {
    grid-template-columns: 1fr !important;
  }

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

  .temple-strip {
    grid-template-columns: 1fr !important;
  }

  .hotel-card,
  .room-card,
  .place-card,
  .event-card,
  .icon-card,
  .step-card,
  .form-wrap,
  .form-card,
  .property-card,
  .tariff-card {
    border-radius: 16px !important;
  }

  .hotel-card-image,
  .hotel-card-image img,
  .room-card > img,
  .event-card img,
  .place-card img {
    width: 100%;
  }

  .contact-line {
    align-items: flex-start;
    gap: 13px !important;
  }

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

  .contact-line h3 {
    font-size: 18px;
  }

  .contact-line p {
    font-size: 14px;
    line-height: 1.65;
  }

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

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

  .form-wrap,
  .form-card {
    padding: 24px 16px !important;
  }

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

  .btn,
  .submit-btn {
    min-height: 46px;
  }

  .reservation {
    min-height: auto !important;
  }

  .room-content {
    padding-top: 72px !important;
    padding-bottom: 72px !important;
  }

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

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

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

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

  .price-item {
    gap: 10px;
  }

  .footer {
    padding-top: 46px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .copyright {
    font-size: 13px;
    line-height: 1.6;
  }

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

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

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

/* Very small devices such as iPhone SE */
@media (max-width: 390px) {
  .container {
    width: calc(100% - 22px) !important;
  }

  .header .brand,
  .site-header .brand {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    height: 62px !important;
    flex-basis: 118px !important;
  }

  .header .brand img,
  .site-header .brand img,
  .header .brand-icon,
  .site-header .brand-icon {
    width: 112px !important;
    max-width: 112px !important;
    height: auto !important;
    max-height: 58px !important;
  }

  .hamburger {
    width: 40px !important;
    height: 40px !important;
  }

  .hero-content,
  .form-wrap,
  .form-card,
  .property-content,
  .tariff-card {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .photo-mosaic {
    grid-template-columns: 1fr !important;
  }

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

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

/* Landscape phones: keep menu usable. */
@media (max-width: 900px) and (orientation: landscape) {
  .header .nav-menu,
  .site-header .nav-menu {
    height: calc(100dvh - 70px) !important;
    padding-bottom: 20px !important;
  }
}
