/* CASA PIZZA — PHASE 22
   Customer browse navigation, stable product detail layout, centered imagery,
   and distinct public-vs-table ordering presentation. */

/* Brand subtitle was intentionally removed from the customer UI. */
.brand-copy { justify-content: center; }
.brand-name { line-height: 1.05; }

/* Home category artwork: every source image stays fully visible and optically centered. */
body[data-page="home"] .home-category-grid .category-photo-wrap {
  display: grid !important;
  place-items: center !important;
  padding: 12px !important;
}
body[data-page="home"] .home-category-grid .category-photo-wrap img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 90% !important;
  max-height: 90% !important;
  margin: auto !important;
  padding: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  transform: none !important;
}

/* Category deep links from Home/footer land here instead of above the slideshow. */
#menu-browse { scroll-margin-top: calc(var(--header-h, 78px) + 12px); }

/* Menu category rail: visible keyboard/mouse controls with drag/touch scrolling retained. */
.menu-category-rail {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 9px;
  width: 100%;
}
.menu-category-tabs {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100%;
  min-width: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 4px 2px 7px !important;
  scroll-behavior: smooth;
  scroll-snap-type: none;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.menu-category-tabs::-webkit-scrollbar { display: none; }
.menu-category-tabs .category-tab {
  flex: 0 0 auto !important;
  scroll-snap-align: none;
}
.menu-category-arrow {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  transition: border-color .15s ease, background-color .15s ease;
}
.menu-category-arrow:hover,
.menu-category-arrow:focus-visible {
  border-color: color-mix(in srgb, var(--navy) 35%, var(--line));
  background: var(--surface-blue);
  transform: none !important;
}
:root[data-theme="dark"] .menu-category-arrow {
  border-color: #2b3743;
  background: #111820;
  color: #f6f8fa;
}
:root[data-theme="dark"] .menu-category-arrow:hover,
:root[data-theme="dark"] .menu-category-arrow:focus-visible { background: #172433; }

/* Keep promotional slideshow artwork smaller than the viewport and centered. */
body[data-page="menu"] .menu-slideshow__link picture {
  padding: clamp(30px, 5vw, 70px) clamp(84px, 9vw, 150px) 82px !important;
}
body[data-page="menu"] .menu-slideshow__image {
  width: auto !important;
  height: auto !important;
  max-width: min(940px, 70vw) !important;
  max-height: 78% !important;
  margin: auto !important;
  object-fit: contain !important;
  object-position: center !important;
}

/* Product page: reserve a permanent favorite-button column so its label cannot reflow the title. */
.product-title-block {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 118px !important;
  align-items: start !important;
  gap: 26px !important;
}
.product-title-block > div { min-width: 0; }
.product-editor-favorite {
  width: 118px !important;
  min-width: 118px !important;
  max-width: 118px !important;
  justify-self: end;
  white-space: nowrap;
}
.product-title-block h1 {
  margin: 0 !important;
  line-height: 1.04 !important;
}
.product-title-block .lead {
  margin: 30px 0 0 !important;
  line-height: 1.82 !important;
}

/* Only meaningful compact metadata remains below the product image. */
.product-visual-meta {
  min-height: 38px;
  align-items: center;
}
.product-visual-meta:empty { display: none; }

/* Four recommendation cards fit naturally on common desktop widths. */
.product-grid-related.product-scroll-track .product-card {
  flex-basis: clamp(250px, 22.5vw, 300px) !important;
  min-width: 250px !important;
  max-width: 300px !important;
}

/* Distinct checkout modes. */
:root[data-checkout-mode="restaurant"] .checkout-choice-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}
:root[data-checkout-mode="restaurant"] [data-fulfillment-card="dinein"] {
  max-width: 560px;
}
:root[data-checkout-mode="public"] .checkout-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 820px) {
  .menu-category-rail { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 6px; }
  .menu-category-arrow { width: 40px; height: 40px; border-radius: 11px; }
  body[data-page="menu"] .menu-slideshow__link picture { padding: 26px 52px 72px !important; }
  body[data-page="menu"] .menu-slideshow__image { max-width: 82vw !important; max-height: 74% !important; }
  .product-title-block {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
  }
  .product-editor-favorite {
    width: 118px !important;
    justify-self: start;
  }
  .product-title-block .lead { margin-top: 22px !important; }
  :root[data-checkout-mode="public"] .checkout-choice-grid { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-category-tabs { scroll-behavior: auto; }
}

/* Restaurant QR checkout is a distinct flow, not a test wizard. */
.restaurant-checkout-context--compact {
  display: grid;
  gap: 8px;
  margin: 0;
}
.restaurant-order-context-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-blue);
}
.restaurant-order-context-label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}
.restaurant-order-context-line strong {
  margin-left: auto;
  color: var(--navy);
  font-size: 1rem;
}
.restaurant-order-context-line .restaurant-table-state {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e8f6ed;
  color: #22683c;
  font-size: .78rem;
  font-weight: 900;
}
.restaurant-order-context-line:not(.is-assigned) .restaurant-table-state {
  background: #fff3dd;
  color: #795713;
}
.restaurant-order-context-note { margin: 0 4px !important; }
:root[data-theme="dark"] .restaurant-order-context-line {
  border-color: #2b3743;
  background: #111820;
}
:root[data-theme="dark"] .restaurant-order-context-line strong { color: #f7f9fb; }

/* Make the menu hero artwork deliberately smaller than the slide stage. */
body[data-page="menu"] .menu-slideshow__image {
  max-width: min(840px, 62vw) !important;
  max-height: 68% !important;
}
@media (max-width: 820px) {
  body[data-page="menu"] .menu-slideshow__image { max-width: 76vw !important; max-height: 68% !important; }
}
.restaurant-checkout-context--compact[hidden] { display: none !important; }


/* Phase 25 HOTFIX3: use designed vector chevrons instead of raw arrow glyphs. */
.ui-chevron {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}
.product-scroller__button .ui-chevron,
.menu-category-arrow .ui-chevron { width: 18px; height: 18px; }
body[data-page="menu"] .menu-slideshow__control .ui-chevron { width: 22px; height: 22px; }
