/* =========================================================
   ANVI GUEST HOUSE — FINAL RESPONSIVE OVERRIDES
   Loaded after style.css on every page.
   ========================================================= */

:root {
  --mobile-header-height: 76px;
}

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

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

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

button,
input,
select,
textarea {
  font: inherit;
}

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

/* ---------- Header and exact-ratio logo ---------- */
.header {
  min-height: 86px;
}

.nav {
  min-height: 86px;
  height: auto;
}

.header .brand {
  width: 154px;
  height: 76px;
  flex: 0 0 154px;
  padding: 0 !important;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
}

.header .brand-logo {
  width: 150px !important;
  height: auto !important;
  max-width: 150px !important;
  max-height: 70px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block;
  object-fit: contain;
  object-position: left center;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.hamburger {
  position: relative;
  z-index: 1002;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.hamburger:focus-visible {
  outline: 3px solid rgba(0, 169, 235, .28);
  outline-offset: 3px;
}

/* ---------- Safe fluid content ---------- */
.hero-grid,
.about-grid,
.quick-grid,
.room-grid,
.icon-grid,
.card-grid,
.place-grid,
.gallery-grid,
.form-wrap,
.form-grid,
.footer-grid,
.hotel-card-grid,
.rooms-reference-grid,
.rooms-booking-cta {
  min-width: 0;
}

.hero-content,
.hero-panel,
.about-content,
.photo-stack,
.quick-item,
.room-card,
.icon-card,
.place-card,
.gallery-item,
.contact-panel,
.booking-form,
.map-card,
.hotel-card {
  min-width: 0;
}

.hero-content h1,
.page-hero h1,
.section-title h2,
.about-content h2,
.rooms-reference-content h1,
.hotel-card-title {
  overflow-wrap: anywhere;
}

.hero-panel img,
.room-image img,
.gallery-item img,
.place-card img,
.hotel-card-image img,
.photo-stack img {
  width: 100%;
}

/* ---------- Map and embeds ---------- */
.map-card {
  width: 100%;
  height: clamp(340px, 48vw, 500px);
  min-height: 340px;
  padding: 0 !important;
  overflow: hidden;
  display: block !important;
}

.map-card iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 340px;
  border: 0 !important;
}

.place-card iframe,
.place-info iframe {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* ---------- Forms ---------- */
.booking-form,
.contact-panel {
  width: 100%;
}

.field,
.field.full {
  min-width: 0;
}

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

/* ---------- Footer logo ---------- */
.footer-brand {
  width: 150px !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 0 16px;
  display: inline-flex;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.footer-brand .footer-logo {
  width: 150px !important;
  height: auto !important;
  max-height: 84px;
  padding: 0 !important;
  margin: 0 !important;
  object-fit: contain;
  object-position: left center;
  border-radius: 0 !important;
  background: transparent !important;
}

/* ---------- Tablet and mobile navigation ---------- */
@media (max-width: 980px) {
  :root {
    --mobile-header-height: 76px;
  }

  .container {
    width: min(100% - 30px, 920px);
  }

  .header {
    min-height: var(--mobile-header-height);
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav {
    min-height: var(--mobile-header-height);
    height: var(--mobile-header-height);
    gap: 14px;
  }

  .header .brand {
    width: 132px;
    height: 68px;
    flex-basis: 132px;
  }

  .header .brand-logo {
    width: 128px !important;
    max-width: 128px !important;
    max-height: 64px !important;
  }

  .hamburger {
    display: grid !important;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--secondary);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
  }

  .nav-menu {
    position: fixed !important;
    top: var(--mobile-header-height) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - var(--mobile-header-height));
    margin: 0 !important;
    padding: 16px 18px 24px !important;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: 0 18px 34px rgba(7, 18, 50, .13) !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-14px);
    transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
    z-index: 1001;
  }

  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

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

  .nav-link {
    width: 100%;
    min-height: 48px;
    padding: 13px 10px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    border-bottom: 1px solid #edf2f5;
    color: #1d2c40;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
  }

  .nav-link:hover,
  .nav-link.active {
    background: var(--soft);
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-menu {
    position: static !important;
    width: 100%;
    min-width: 0;
    margin: 0 0 5px !important;
    padding: 5px 8px 7px 18px !important;
    display: grid !important;
    gap: 2px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    background: #f7fbfd !important;
    border: 0 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }

  .dropdown-menu a {
    padding: 10px 10px !important;
    font-size: 13px;
    font-weight: 400;
    border-radius: 7px;
  }

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

  .hero-grid,
  .about-grid,
  .form-wrap,
  .rooms-reference-grid,
  .rooms-booking-cta {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .quick-grid,
  .icon-grid,
  .room-grid,
  .card-grid,
  .place-grid,
  .gallery-grid,
  .hotel-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

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

  .hero-panel,
  .photo-stack,
  .contact-panel,
  .booking-form {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .section {
    padding: 58px 0 !important;
  }

  .page-hero {
    padding-top: calc(var(--mobile-header-height) + 46px) !important;
    padding-bottom: 48px !important;
  }

  .page-hero h1 {
    font-size: clamp(30px, 10vw, 42px) !important;
    line-height: 1.12;
  }

  .hero {
    min-height: auto !important;
    padding: calc(var(--mobile-header-height) + 44px) 0 66px !important;
  }

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

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

  .hero-content p {
    font-size: 15px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .hero-panel img {
    height: clamp(230px, 72vw, 330px) !important;
    object-fit: cover;
  }

  .hero-mini {
    grid-template-columns: 1fr !important;
  }

  .quick-card {
    margin-top: -28px !important;
  }

  .quick-grid,
  .icon-grid,
  .room-grid,
  .card-grid,
  .place-grid,
  .gallery-grid,
  .hotel-card-grid,
  .footer-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .quick-item,
  .room-card,
  .icon-card,
  .place-card,
  .hotel-card,
  .booking-form,
  .contact-panel {
    border-radius: 20px;
  }

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

  .section-title h2,
  .about-content h2 {
    font-size: clamp(28px, 9vw, 38px) !important;
  }

  .photo-stack {
    min-height: 390px !important;
  }

  .photo-stack .big {
    width: 100% !important;
    height: 300px !important;
  }

  .photo-stack .small {
    width: 52% !important;
    height: 165px !important;
  }

  .room-foot {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 14px;
  }

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

  .gallery-grid {
    grid-auto-rows: 250px !important;
  }

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

  .form-wrap {
    gap: 24px !important;
  }

  .contact-panel,
  .booking-form {
    padding: 26px 20px !important;
  }

  .booking-form .btn {
    width: 100%;
  }

  .map-card {
    height: 330px !important;
    min-height: 330px !important;
    border-radius: 18px !important;
  }

  .map-card iframe {
    min-height: 330px !important;
  }

  .footer {
    padding: 54px 0 22px !important;
  }

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

  .footer-bottom {
    display: grid !important;
    gap: 8px;
    text-align: center;
  }

  .hotel-card-image img {
    height: 230px;
    object-fit: cover;
  }

  .rooms-reference-content h1 {
    font-size: clamp(34px, 10vw, 42px) !important;
  }

  .rooms-lightbox img {
    max-height: 72vh;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-header-height: 72px;
  }

  .container {
    width: calc(100% - 28px);
  }

  .header,
  .nav {
    min-height: var(--mobile-header-height);
    height: var(--mobile-header-height);
  }

  .header .brand {
    width: 116px;
    height: 62px;
    flex-basis: 116px;
  }

  .header .brand-logo {
    width: 112px !important;
    max-width: 112px !important;
    max-height: 60px !important;
  }

  .hamburger {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 19px;
  }

  .nav-menu {
    padding: 13px 14px 22px !important;
  }

  .hero {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .hero h1 {
    font-size: clamp(32px, 11vw, 40px) !important;
  }

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

  .quick-item {
    padding: 20px 17px !important;
  }

  .room-body,
  .place-content,
  .hotel-card-content {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .contact-list li {
    align-items: flex-start;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px; /* prevents iOS form zoom */
  }

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

  .footer-brand,
  .footer-brand .footer-logo {
    width: 132px !important;
  }
}

@media (max-width: 360px) {
  .container {
    width: calc(100% - 22px);
  }

  .header .brand {
    width: 106px;
    flex-basis: 106px;
  }

  .header .brand-logo {
    width: 103px !important;
    max-width: 103px !important;
  }

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

  .contact-panel,
  .booking-form {
    padding: 22px 16px !important;
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================================
   BOOKING NAVIGATION + MOBILE TAP SAFETY
   ========================================================= */
a,
button,
.btn,
.room-booking-link {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.room-card,
.room-body,
.room-foot {
  position: relative;
}

.room-card .room-foot,
.room-card .room-booking-link {
  z-index: 8;
}

.room-booking-link {
  pointer-events: auto !important;
  cursor: pointer;
}

.selected-room-note {
  display: none;
  margin: 8px 0 0;
  padding: 9px 11px;
  border: 1px solid rgba(0, 169, 235, .28);
  border-radius: 10px;
  background: #eefaff;
  color: #075a7b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.selected-room-note.show {
  display: block;
}

#booking-form {
  scroll-margin-top: 110px;
}

#booking-submit[disabled] {
  opacity: .72;
  cursor: wait;
  pointer-events: none;
}

@media (max-width: 768px) {
  #booking-form {
    scroll-margin-top: 88px;
  }

  .room-card .room-booking-link,
  .room-foot .btn {
    position: relative !important;
    width: 100% !important;
    min-height: 48px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }
}


/* =========================================================
   FINAL MOBILE INPUT TAP + LARGE LOGO FIX
   Prevents invisible closed-menu links from covering forms.
   ========================================================= */

/* Keep the reservation/contact form above decorative layers. */
.form-wrap {
  position: relative !important;
  z-index: 5 !important;
  isolation: isolate;
}

.booking-form,
.contact-form {
  position: relative !important;
  z-index: 20 !important;
  isolation: isolate;
  pointer-events: auto !important;
}

.booking-form::before,
.booking-form::after,
.contact-form::before,
.contact-form::after {
  pointer-events: none !important;
}

.booking-form .field,
.booking-form label,
.booking-form input,
.booking-form select,
.booking-form textarea,
.booking-form button,
.contact-form .field,
.contact-form label,
.contact-form input,
.contact-form select,
.contact-form textarea,
.contact-form button {
  position: relative;
  pointer-events: auto !important;
}

.booking-form input,
.booking-form select,
.booking-form textarea,
.contact-form input,
.contact-form select,
.contact-form textarea {
  z-index: 2;
  touch-action: auto !important;
  -webkit-user-select: text;
  user-select: text;
}

/* Larger logo with the original image ratio preserved. */
.header,
.header .nav {
  min-height: 92px !important;
  height: 92px !important;
}

.header .brand {
  width: 194px !important;
  height: 86px !important;
  flex: 0 0 194px !important;
  overflow: visible !important;
}

.header .brand-logo {
  width: 190px !important;
  height: 82px !important;
  max-width: 190px !important;
  max-height: 82px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

@media (max-width: 980px) {
  :root {
    --mobile-header-height: 86px;
  }

  .header,
  .header .nav {
    min-height: var(--mobile-header-height) !important;
    height: var(--mobile-header-height) !important;
  }

  .header .brand {
    width: 172px !important;
    height: 80px !important;
    flex: 0 0 172px !important;
  }

  .header .brand-logo {
    width: 168px !important;
    height: 76px !important;
    max-width: 168px !important;
    max-height: 76px !important;
  }

  /* A closed mobile menu must not leave invisible links over the page. */
  .nav-menu:not(.open) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .nav-menu:not(.open) *,
  .nav-menu:not(.open) .dropdown-menu,
  .nav-menu:not(.open) .dropdown-menu * {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .nav-menu.open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .nav-menu.open *,
  .nav-menu.open .dropdown-menu,
  .nav-menu.open .dropdown-menu * {
    visibility: visible !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 480px) {
  :root {
    --mobile-header-height: 84px;
  }

  .header,
  .header .nav {
    min-height: var(--mobile-header-height) !important;
    height: var(--mobile-header-height) !important;
  }

  .header .brand {
    width: 162px !important;
    height: 78px !important;
    flex: 0 0 162px !important;
  }

  .header .brand-logo {
    width: 158px !important;
    height: 74px !important;
    max-width: 158px !important;
    max-height: 74px !important;
  }

  .page-hero {
    padding-top: calc(var(--mobile-header-height) + 42px) !important;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 48px;
    font-size: 16px !important;
  }
}

@media (max-width: 360px) {
  .header .brand {
    width: 150px !important;
    height: 74px !important;
    flex-basis: 150px !important;
  }

  .header .brand-logo {
    width: 146px !important;
    height: 70px !important;
    max-width: 146px !important;
    max-height: 70px !important;
  }
}
