/* HOB — shared mobile / cross-browser polish
   Link from every guest-facing page. Safe beside inline styles. */

:root {
  --hob-safe-top: env(safe-area-inset-top, 0px);
  --hob-safe-right: env(safe-area-inset-right, 0px);
  --hob-safe-bottom: env(safe-area-inset-bottom, 0px);
  --hob-safe-left: env(safe-area-inset-left, 0px);
}

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

body {
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safari / iOS: unlock compositor scrolling */
  -webkit-overflow-scrolling: touch;
}

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

/* Do NOT set height:auto on video — breaks absolute cover films and jitters layout */
video {
  max-width: 100%;
  object-fit: cover;
}

/* Prevent iOS zoom on focus — inputs must be ≥16px */
input, select, textarea, button {
  font-size: 16px;
  max-width: 100%;
}

input, select, textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 12px;
}

button, a, [role="button"], label {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* —— Floating nav —— */
.hob-nav {
  position: fixed;
  top: calc(10px + var(--hob-safe-top)) !important;
  box-sizing: border-box;
}

.hob-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(58, 42, 32, 0.75);
}

.hob-nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hob-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(43, 27, 18, 0.08);
  color: #2B1B12;
  cursor: pointer;
  flex: none;
}

.hob-nav-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
}

.hob-nav-toggle .hob-icon-close { display: none; }
.hob-nav.is-open .hob-nav-toggle .hob-icon-open { display: none; }
.hob-nav.is-open .hob-nav-toggle .hob-icon-close { display: block; }

.hob-nav-drawer {
  display: none;
}

/* WhatsApp fab — CSS owns default bottom-right forever.
   JS only overrides left/top after the user actually drags. */
.hob-wa {
  position: fixed !important;
  z-index: 57;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 16px 34px rgba(37, 211, 102, 0.42);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.hob-wa:not(.hob-wa-placed) {
  right: calc(14px + var(--hob-safe-right)) !important;
  left: auto !important;
  bottom: calc(16px + var(--hob-safe-bottom)) !important;
  top: auto !important;
}

.hob-wa-order:not(.hob-wa-placed) {
  bottom: calc(96px + var(--hob-safe-bottom)) !important;
}

.hob-wa.hob-wa-placed {
  right: auto !important;
  bottom: auto !important;
}

.hob-wa-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hob-wa-draggable.hob-wa-snapping {
  transition: left 0.24s cubic-bezier(0.22, 0.9, 0.32, 1), top 0.24s cubic-bezier(0.22, 0.9, 0.32, 1) !important;
}

.hob-wa-draggable.is-dragging {
  cursor: grabbing;
  z-index: 80 !important;
  transition: none !important;
  opacity: 0.96;
  will-change: left, top;
}

.hob-wa svg {
  pointer-events: none;
  display: block;
}

.hob-wa-hint {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  left: auto;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 30px rgba(120, 96, 74, 0.2);
  font-size: 13px;
  font-weight: 500;
  color: #2B1B12;
  white-space: nowrap;
  max-width: min(62vw, 220px);
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  animation: hobPop 9s ease 2.4s forwards;
}

.hob-wa.hob-wa-side-left .hob-wa-hint {
  right: auto;
  left: 0;
}

/* Sticky cart / bottom bars */
.hob-cart-bar {
  bottom: calc(12px + var(--hob-safe-bottom)) !important;
  width: min(94vw, 620px) !important;
  box-sizing: border-box;
}

/* Hero: use small viewport (svh) so mobile chrome show/hide doesn't resize/jitter */
#top[data-scene="hero"] {
  min-height: 100vh;
  min-height: 100svh;
  height: 100vh;
  height: 100svh;
}

/* Horizontal chip scroller — hide scrollbar but keep swipe */
.hob-hscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.hob-hscroll::-webkit-scrollbar { display: none; }

@media (max-width: 900px) {
  .hob-nav {
    width: min(96vw, 1240px) !important;
    padding: 10px 12px 10px 16px !important;
    gap: 10px !important;
    border-radius: 22px !important;
  }

  .hob-nav-toggle { display: inline-flex; }

  .hob-nav-links,
  .hob-nav-actions > a:not(.hob-nav-call) {
    display: none !important;
  }

  .hob-nav.is-open .hob-nav-drawer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    padding: 12px;
    border-radius: 22px;
    background: rgba(255, 252, 248, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 22px 48px rgba(120, 96, 74, 0.22);
  }

  .hob-nav-drawer a {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #2B1B12;
  }

  .hob-nav-drawer a:active,
  .hob-nav-drawer a:hover {
    background: rgba(43, 27, 18, 0.06);
    color: #2C8C7C;
  }

  .hob-nav-call {
    padding: 10px 16px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 720px) {
  /* Book / order hero media frames */
  .hob-hero-frame {
    border-radius: 22px !important;
    border-width: 4px !important;
    aspect-ratio: 4 / 3 !important;
  }

  .hob-hero-copy {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
  }

  /* Menu item grids that used minmax(320px) overflow phones */
  .hob-menu-grid,
  [data-hob-grid="menu"] {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Qty steppers — larger hit targets */
  .hob-stepper button,
  button[aria-label="one less"],
  button[aria-label="one more"],
  button[aria-label="add"] {
    min-width: 36px !important;
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
  }

  /* Sticky category chips under shorter mobile nav */
  .hob-sticky-cats {
    top: calc(68px + var(--hob-safe-top)) !important;
    margin-left: 3vw !important;
    margin-right: 3vw !important;
    padding: 10px 12px !important;
    background: rgba(240, 232, 222, 0.98) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 8px 24px rgba(120, 96, 74, 0.1);
  }

  .hob-sticky-cats .hob-hscroll {
    gap: 6px !important;
  }

  .hob-sticky-cats .hob-hscroll button {
    padding: 10px 14px !important;
    font-size: 12px !important;
  }

  /* Tighter page rhythm on phones */
  .hob-section-head {
    margin-bottom: 20px !important;
  }

  [data-card] {
    border-radius: 22px !important;
    padding: 20px 18px !important;
    box-shadow: 0 14px 32px rgba(120, 96, 74, 0.12) !important;
  }

  .hob-menu-item {
    gap: 8px !important;
    padding: 14px 0 !important;
  }

  .hob-menu-item-price {
    min-width: 52px !important;
    font-size: 14px !important;
  }

  /* Solid nav — blur layers jitter on scroll */
  .hob-nav {
    background: rgba(255, 252, 248, 0.96) !important;
  }

  /* Checkout / room form stacks */
  .hob-form-grid {
    grid-template-columns: 1fr !important;
  }

  /* Room section CTA column full width */
  .hob-cta-stack {
    width: 100% !important;
    min-width: 0 !important;
  }

  .hob-cta-stack a {
    width: 100%;
    text-align: center;
  }

  /* Keep floating WA clear of cart bar on order */
  .hob-wa-order:not(.hob-wa-placed) {
    bottom: calc(110px + var(--hob-safe-bottom)) !important;
  }

  /* Book hero overlay text */
  .hob-hero-frame > div:last-child {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
  }
}

@media (max-width: 480px) {
  .hob-nav-call span.hob-call-full { display: none; }
  .hob-nav-call span.hob-call-short { display: inline; }

  .hob-wa-hint { display: none !important; }

  .hob-cart-bar {
    border-radius: 20px !important;
    padding: 12px 12px !important;
  }
}

@media (min-width: 481px) {
  .hob-nav-call span.hob-call-short { display: none; }
}

/* Landscape phones — don't force tall hero */
@media (max-height: 500px) and (orientation: landscape) {
  #top[data-scene="hero"] {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
  }
}

@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;
  }
}

/* Print: hide chrome */
@media print {
  .hob-nav, .hob-wa, .hob-cart-bar, .hob-nav-toggle, .hob-nav-drawer { display: none !important; }
}

/* Media save / download discouragement (paired with hob-protect.js) */
img, video, picture, canvas, svg {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  user-drag: none;
  -webkit-touch-callout: none;
}
