/* Chef Norbert v38 — mobile usability layer. Loaded after existing styles. */
@media (max-width: 820px) {
  html { scroll-padding-top: 115px; }
  body { overflow-x: clip; }
  img, video { max-width: 100%; height: auto; }
  .top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; height: auto; min-height: 0; padding: 10px 14px; }
  .top .brand { flex: 1 1 auto; min-width: 0; }
  .top .brand img { max-width: min(188px, 48vw); height: auto; }
  .top .navbtn { flex: 0 0 auto; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 13px; white-space: nowrap; }
  .top nav { order: 3; flex: 1 0 100%; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: thin; -webkit-overflow-scrolling: touch; padding: 2px 0 6px; }
  .top nav a { flex-shrink: 0; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; padding: 9px 10px; }
  .section, .catalogSection, .catalogHero { scroll-margin-top: 120px; }
  .catalogGrid, .categoryCards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogCard, .detailedCard, .bookingPanel, .summary { min-width: 0; }
  input, select, textarea, button { max-width: 100%; }
  input, select, textarea { font-size: 16px; }
  button, .primary, .secondary, .chooseMenuButton { min-height: 44px; }
  .bookingLayout { grid-template-columns: minmax(0,1fr); }
  .bookingLayout > * { min-width: 0; }
  .steps { overflow-x: auto; }
  .steps .step { min-width: max-content; }
  .checkoutLine { gap: 10px; }
  .checkoutLine strong { text-align: right; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  html { scroll-padding-top: 128px; }
  .top { padding: 8px 12px; }
  .top .brand img { max-width: min(158px, 43vw); }
  .top .navbtn { font-size: 12px; padding: 9px 10px; }
  .catalogGrid, .categoryCards { grid-template-columns: minmax(0, 1fr); }
  .catalogCard, .detailedCard { width: 100%; max-width: 100%; }
  .catalogHero, .catalogSection, .section { padding-left: 16px; padding-right: 16px; }
  .bookingLayout, .fields, .two, .sectionHead { grid-template-columns: minmax(0, 1fr); }
  .fields > *, .fields label { min-width: 0; }
  .bookingPanel, .summary { padding: 16px; }
  .btnline { display: flex; flex-wrap: wrap; gap: 10px; }
  .btnline > button, .btnline > a { flex: 1 1 180px; }
  .chefGoogleReviewLink { max-width: 100%; }
  .chefGoogleReviewButton { width: 100%; text-align: center; }
  .dishName, .detailedCardContent, .catalogCard { overflow-wrap: anywhere; }
  .chef-back-to-top { bottom: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .top nav { scroll-behavior: auto; }
}

/* ============================================================
   Chef Norbert v38.1 — corrections from real Galaxy S23 Ultra
   mobile screenshots. All rules limited to tablet/phone widths.
   ============================================================ */
@media (max-width: 820px) {
  /* The original stylesheet permits navigation links to wrap.
     Force a single swipeable row without hiding any links. */
  .top nav[aria-label="Main navigation"] {
    display: flex !important;
    flex-flow: row nowrap !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-bottom: 4px;
    gap: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .top nav[aria-label="Main navigation"] a {
    display: inline-flex;
    flex: 0 0 auto !important;
    min-height: 40px;
    padding: 8px 9px;
  }
  /* Maintain the logo + booking action on the first row. */
  .top .brand { min-width: 0; }
  .top .navbtn { flex: 0 0 auto; }
  /* Prevent a floating up-arrow from covering booking text. */
  .chef-back-to-top {
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0 !important;
    gap: 0;
    border-radius: 50%;
    font-size: 0 !important;
    line-height: 1;
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .chef-back-to-top span[aria-hidden="true"] {
    font-size: 22px;
    line-height: 1;
  }
}
@media (max-width: 600px) {
  /* Four booking steps across ONE row, including long step names. */
  .bookingPanel .steps {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 5px;
    flex-wrap: nowrap !important;
    overflow: visible;
    padding-bottom: 17px;
    margin-bottom: 22px;
  }
  .bookingPanel .steps .step {
    min-width: 0 !important;
    width: auto;
    display: flex;
    flex-direction: column;
    flex: initial;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    text-align: center;
    line-height: 1.25;
    font-size: 11px;
    white-space: normal;
  }
  .bookingPanel .steps .step span {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
  }
  .bookingPanel .btnline > button,
  .bookingPanel .btnline > a { min-width: 0; }
  /* Padding ensures long form content can clear Android bottom UI. */
  .bookingPanel { padding-bottom: 22px; }
  html { scroll-padding-top: 116px; }
  .section, .catalogSection, .catalogHero, #book {
    scroll-margin-top: 116px;
  }
}

/* ============================================================
   Chef Norbert v38.2 — final mobile visual refinements
   Based on real phone screenshots after Version 38.1.
   These rules only apply at mobile/tablet widths.
   ============================================================ */
@media (max-width: 820px) {
  /* Keep all eight links swipeable but remove the visible grey bar.
     A partial next link at the right edge still indicates more links. */
  .top nav[aria-label="Main navigation"] {
    scrollbar-width: none !important;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    padding-bottom: 0 !important;
  }
  .top nav[aria-label="Main navigation"]::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
  /* The floating back-to-top control otherwise sits over important
     booking actions. Hide it on narrow screens only. */
  .chef-back-to-top,
  .chef-back-to-top.is-visible {
    display: none !important;
  }
}
