/* =========================================================
   NS Comfort Premium — Mobile-first responsive system
   Load last. Base = phones; min-width = larger devices.
   ========================================================= */

:root {
  --bp-xs: 360px;
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 980px;
  --bp-xl: 1200px;
  --bp-2xl: 1440px;
  --page-gutter: clamp(14px, 4vw, 28px);
  --touch-target: 44px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(72px + var(--safe-top));
}

body {
  min-width: 320px;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

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

.container,
.header-inner {
  width: min(100% - (var(--page-gutter) * 2), 1120px);
  margin-inline: auto;
}

.site-header {
  padding-top: var(--safe-top);
}

.site-header .nav-wrap {
  min-height: calc(64px + var(--safe-top));
  padding-inline: 0;
  gap: clamp(8px, 2vw, 14px);
}

.header-start {
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 96px);
}

.site-header .brand {
  min-width: 0;
}

.site-header .brand-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: clamp(0.72rem, 3.2vw, 1rem);
  line-height: 1.2;
  max-width: min(11rem, 46vw);
}

.site-header .brand-logo {
  height: 40px !important;
  width: auto !important;
  flex-shrink: 0;
}

.business-toggle__option {
  min-width: 2.75rem;
  min-height: var(--touch-target);
  padding: 8px 10px;
  font-size: 0.68rem;
}

.header-end {
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-login-btn,
.site-header .nav-toggle {
  min-width: var(--touch-target);
  min-height: var(--touch-target);
}

.header-login-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.site-header .nav-toggle {
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 10px;
}

.site-header .nav a {
  min-height: var(--touch-target);
}

.hero {
  min-height: calc((var(--vh, 1vh) * 100) - var(--announcement-height, 0px) - var(--safe-top));
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.hero-actions .btn {
  width: 100%;
  min-height: var(--touch-target);
  justify-content: center;
}

.section {
  padding-block: clamp(48px, 10vw, 88px);
}

.section-title {
  font-size: clamp(1.45rem, 5vw, 2.2rem);
}

.card-grid,
.reviews-grid,
.availability-floors {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 3vw, 20px);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.contact-map iframe {
  width: 100%;
  min-height: 260px;
  aspect-ratio: 4 / 3;
}

.floating-cta-stack {
  --chatbot-gutter: max(12px, var(--safe-right));
  right: var(--chatbot-gutter);
  bottom: max(12px, var(--safe-bottom));
}

.floating-cta-btn {
  min-width: 0;
  width: min(148px, 42vw);
  min-height: var(--touch-target);
}

.faq-question {
  min-height: var(--touch-target);
}

.btn,
button,
input,
select,
textarea {
  font-size: max(16px, 1rem);
}

input,
select,
textarea {
  width: 100%;
}

.availability-toolbar {
  flex-direction: column;
  align-items: stretch;
}

.availability-filters {
  width: 100%;
}

.availability-filter select {
  width: 100%;
  min-width: 0;
}

.room-tariff-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-header--hotel .header-inner {
  width: min(100% - (var(--page-gutter) * 2), 1280px);
}

.hotel-ix-card__top,
.hotel-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 24px);
}

.hotel-facilities-group__grid {
  grid-template-columns: 1fr;
}

.ix-sticky-bar {
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  padding-bottom: calc(12px + var(--safe-bottom));
}

.ix-sticky-bar__inner {
  width: 100%;
  flex-wrap: wrap;
}

.ix-sticky-bar__meta {
  flex: 1 1 140px;
}

.ix-sticky-bar .ix-booking-btn {
  width: 100%;
  min-height: var(--touch-target);
}

body.hotel-has-sticky {
  padding-bottom: 0;
}

body.hotel-has-sticky.hotel-sticky-visible {
  padding-bottom: calc(112px + var(--safe-bottom));
}

/* PG mobile header — logo + PG/Hotel toggle + login + menu (no overlap) */
@media (max-width: 979px) {
  .site-header:not(.site-header--hotel) .nav-wrap {
    gap: 8px;
    min-height: 56px;
    padding-block: 6px;
  }

  .site-header:not(.site-header--hotel) .header-start {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    max-width: calc(100% - 96px);
  }

  .site-header:not(.site-header--hotel) .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  .site-header:not(.site-header--hotel) .brand-text {
    display: none;
  }

  .site-header:not(.site-header--hotel) .brand-logo {
    height: 40px !important;
  }

  .site-header:not(.site-header--hotel) .business-toggle {
    flex-shrink: 0;
  }

  .site-header:not(.site-header--hotel) .header-end {
    flex-shrink: 0;
    gap: 6px;
    margin-left: auto;
  }

  .site-header:not(.site-header--hotel) .header-login-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  .site-header:not(.site-header--hotel) .nav-toggle {
    position: static !important;
    top: auto !important;
    right: auto !important;
  }
}

@media (max-width: 479px) {
  .site-header:not(.site-header--hotel) .header-start {
    max-width: calc(100% - 88px);
  }

  .site-header:not(.site-header--hotel) .business-toggle__option {
    min-width: 2.35rem;
    padding-inline: 7px;
    font-size: 0.62rem;
  }

  .site-header:not(.site-header--hotel) .header-login-btn {
    padding-inline: 8px;
    font-size: 0.7rem;
  }

  .business-toggle__option {
    min-width: 2.5rem;
    padding-inline: 8px;
  }

  .header-login-btn {
    padding-inline: 10px;
  }

  .floating-cta-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(100vw - 24px, 320px);
  }

  .floating-cta-btn {
    width: auto;
    flex: 1 1 calc(50% - 6px);
  }

  .hotel-facilities-group__grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) {
  .hero-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .hero-actions .btn {
    width: auto;
    flex: 1 1 calc(50% - 8px);
  }

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

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

  .hotel-facilities-group__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .site-header .brand-logo {
    height: 46px !important;
  }

  .site-header .brand-text {
    max-width: 14rem;
    -webkit-line-clamp: 1;
  }

  .hero-actions .btn {
    flex: 0 1 auto;
    width: auto;
  }

  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reviews-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hotel-ix-gallery__stack {
    grid-template-columns: 1fr 1fr;
  }

  .hotel-facilities-group__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ix-sticky-bar__inner {
    flex-wrap: nowrap;
  }

  .ix-sticky-bar .ix-booking-btn {
    width: auto;
  }
}

@media (min-width: 980px) {
  .site-header .nav-wrap {
    justify-content: flex-start !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
  }

  .site-header .brand-logo {
    height: 52px !important;
  }

  .site-header .brand-text {
    font-size: clamp(0.8rem, 1.1vw, 1rem);
    line-height: 1.2;
    max-width: min(15rem, 20vw);
    -webkit-line-clamp: 2;
  }

  .header-start {
    max-width: none;
    flex: 0 1 auto;
  }

  .header-end {
    margin-left: 0;
  }

  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hotel-ix-card__top {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .hotel-contact-grid {
    grid-template-columns: 1fr 1.1fr;
  }
}

@media (min-width: 1200px) {
  .container {
    width: min(100% - 48px, 1120px);
  }

  .site-header--hotel .header-inner {
    width: min(100% - 48px, 1280px);
  }
}

@media (min-width: 1440px) {
  .container,
  .header-inner {
    width: min(100% - 64px, 1200px);
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .site-header .nav-wrap {
    min-height: 56px;
  }

  .hero {
    min-height: auto;
    padding-block: 24px !important;
  }

  .site-header .nav {
    padding-top: calc(56px + var(--safe-top)) !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .floating-cta-btn:hover,
  .site-header .nav a:hover {
    transform: none;
  }

  .btn:active,
  .floating-cta-btn:active {
    transform: scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
  }
}

/* =========================================================
   Mobile polish — overflow, header, hero, panels, tables
   ========================================================= */

html,
body {
  overflow-x: clip;
}

body:has(.floating-cta-stack) {
  padding-bottom: calc(108px + var(--safe-bottom));
}

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

.hero-container {
  width: min(100% - (var(--page-gutter) * 2), 1240px) !important;
  padding-inline: 0 !important;
}

.hero-inner {
  padding-inline: 0 !important;
}

.hero-title {
  max-width: none !important;
}

.hero-tagline {
  max-width: none !important;
}

/* Announcement bar — mobile overrides handled in style.css */

/* Mobile nav — slide-in drawer (override legacy centered menu) */
@media (max-width: 979px) {
  .site-header .nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: min(88vw, 360px) !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: calc(72px + var(--safe-top)) 18px calc(24px + var(--safe-bottom)) !important;
    border-radius: 0 !important;
    transform: translateX(100%) !important;
    opacity: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.12) !important;
  }

  .site-header .nav.open {
    transform: translateX(0) !important;
    max-height: none !important;
  }

  .site-header .nav a {
    width: 100% !important;
    justify-content: flex-start !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
  }

  .site-header .nav a + a {
    margin-top: 2px !important;
  }

  .site-header .nav a.nav-cta {
    margin-top: 12px !important;
    justify-content: center !important;
  }
}

/* Header controls on small phones */
@media (max-width: 479px) {
  .header-login-btn {
    font-size: 0;
    padding: 0;
    width: var(--touch-target);
    min-width: var(--touch-target);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%234338ca' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4v4M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
  }
}

/* Floating quick actions */
@media (max-width: 720px) {
  .floating-cta-panel:not(.is-custom-position),
  html:not([data-floating-cta-custom="1"]) .floating-cta-panel,
  .floating-cta-panel__open:not(.is-custom-position),
  html:not([data-floating-cta-custom="1"]) .floating-cta-panel__open {
    left: max(12px, var(--safe-left)) !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(max(12px, var(--safe-bottom)) + var(--chatbot-launcher-size, 96px) + 10px) !important;
    max-width: min(calc(100vw - 24px), 300px);
  }

  .floating-cta-panel .floating-cta-buttons {
    padding: 8px;
  }

  .floating-cta-btn {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    font-size: 13px;
  }

  .chatbot-launcher {
    width: 88px !important;
    height: 88px !important;
  }

  .chatbot-logo {
    width: 96px !important;
    height: 96px !important;
  }
}

/* Welcome popup */
@media (max-width: 640px) {
  .ns-pg-popup {
    padding: max(12px, var(--safe-top)) max(12px, var(--safe-right)) max(12px, var(--safe-bottom))
      max(12px, var(--safe-left));
    align-items: flex-end;
  }

  .ns-pg-popup__dialog {
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px);
    padding: 22px 16px calc(16px + var(--safe-bottom));
  }

  .ns-pg-popup__diet-grid {
    grid-template-columns: 1fr !important;
  }

  .ns-pg-popup__close {
    width: 40px;
    height: 40px;
  }
}

/* Dining + tariff tables */
@media (max-width: 767px) {
  .dining-table td::before {
    min-width: 88px;
    max-width: 42%;
  }

  .dining-table td {
    font-size: 13px;
  }

  .room-tariff-table-wrap {
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  .room-tariff-table {
    min-width: 560px;
    font-size: 13px;
  }

  .room-tariff-table th,
  .room-tariff-table td {
    padding: 10px 12px;
  }
}

/* Contact + maps */
@media (max-width: 767px) {
  .contact-map,
  .contact-map iframe {
    width: 100%;
    max-width: 100%;
  }

  .about-glass-card,
  .about-glass-card-inner {
    max-width: 100%;
  }

  .about-glass-card-inner img {
    width: 100%;
    height: auto;
  }
}

/* Discover grids */
@media (max-width: 767px) {
  .discover-lanes {
    grid-template-columns: 1fr;
  }

  .pricing-note {
    font-size: 13px;
    padding-inline: 4px;
    line-height: 1.55;
  }
}

/* CTA sections */
@media (max-width: 599px) {
  .cta-banner {
    padding: 24px 0 32px;
  }

  .cta-btn {
    width: 100%;
    max-width: none;
  }
}
