/* ============================================================
   GRILL & GREEN — MENU PAGE
   Hero · Sticky tabs (centered) · Filter (centered) · Panel sections
   ============================================================ */

/* ============================================================
   MENU PAGE HERO (compact)
   ============================================================ */

.menu-hero {
  background: var(--field);
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}

.menu-hero__sun {
  position: absolute;
  top: -20px;
  right: 5%;
  width: 80px;
  height: 80px;
  color: #fff;
  opacity: 0.09;
  pointer-events: none;
}

.menu-hero .section-heading {
  font-size: clamp(36px, 5vw, 60px);
  margin-bottom: 12px;
}

.menu-hero .section-intro {
  margin-bottom: 0;
}

/* ============================================================
   STICKY TAB + FILTER WRAPPER
   ============================================================ */

.menu-tabs-wrapper {
  position: sticky;
  top: var(--nav-h);
  z-index: var(--z-tabs);
  background: var(--field);
  border-bottom: 1px solid var(--stone);
  box-shadow: 0 2px 8px rgba(30, 43, 23, 0.06);
  padding: 14px 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  .menu-tabs-wrapper {
    transition: padding var(--t-fast);
  }
}

/* ============================================================
   PRIMARY CATEGORY TABS — centered, wrap on small screens
   ============================================================ */

.menu-toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(16px, 4vw, 48px) 12px;
}

.menu-tabs-scroll {
  flex: 1;
  min-width: 0;
  position: relative;
}

.menu-tabs-scroll::before,
.menu-tabs-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  pointer-events: none;
  z-index: 1;
  display: none;
}

.menu-tabs-scroll::before {
  left: 0;
  background: linear-gradient(to right, var(--field), transparent);
}

.menu-tabs-scroll::after {
  right: 0;
  background: linear-gradient(to left, var(--field), transparent);
}

.menu-search-toggle,
.menu-filters-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--linen);
  border: 1.5px solid var(--stone);
  border-radius: var(--r-pill);
  cursor: pointer;
  min-height: 36px;
  padding: 0 12px;
  gap: 4px;
}

.menu-search-toggle {
  width: 36px;
  padding: 0;
}

.menu-search-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--dust);
}

.menu-filters-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--ember);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.menu-filters-toggle__badge[hidden] {
  display: none;
}

.menu-filters-panel {
  position: relative;
}

/* ============================================================
   PRIMARY CATEGORY TABS — centered, wrap on small screens
   ============================================================ */

.menu-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0;
}

.menu-tab {
  scroll-snap-align: start;
  font-family: var(--ff-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--dust);
  padding: 8px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid transparent;
  background: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

@media (prefers-reduced-motion: no-preference) {
  .menu-tab {
    transition: background-color var(--t-fast), color var(--t-fast),
                border-color var(--t-fast);
  }
}

.menu-tab:hover {
  background: var(--field-dk);
  color: var(--ink-2);
}

.menu-tab.active {
  background: var(--ink-2);
  color: #fff;
  border-color: var(--ink-2);
}

/* ============================================================
   DIETARY FILTER ROW — centered, compact chips, always visible
   ============================================================ */

.menu-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 8px clamp(16px, 4vw, 48px) 12px;
  border-top: 1px solid rgba(204, 199, 188, 0.55);
}

.filter-chip {
  font-family: var(--ff-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid var(--stone);
  background: transparent;
  color: var(--dust);
  min-height: 26px;
  display: inline-flex;
  align-items: center;
}

@media (prefers-reduced-motion: no-preference) {
  .filter-chip {
    transition: background-color var(--t-fast), color var(--t-fast),
                border-color var(--t-fast);
  }
}

.filter-chip:hover {
  border-color: var(--ink-2);
  color: var(--ink-2);
}

.filter-chip.active {
  background: var(--ink-2);
  color: #fff;
  border-color: var(--ink-2);
}

/* Per-tag accent colors when active */
.filter-chip[data-filter="GF"].active { background: var(--grove);    border-color: var(--grove); }
.filter-chip[data-filter="DF"].active { background: #4E7AA0;          border-color: #4E7AA0; }
.filter-chip[data-filter="NF"].active { background: #8B6A2E;          border-color: #8B6A2E; }
.filter-chip[data-filter="VG"].active { background: var(--grove);    border-color: var(--grove); }
.filter-chip[data-filter="SF"].active { background: var(--ink-3);    border-color: var(--ink-3); }

/* ============================================================
   MENU BODY
   ============================================================ */

.menu-body {
  padding: 40px 0 80px;
  background: var(--field);
  min-height: 60vh;
}

/* ============================================================
   PANEL SYSTEM
   All sections hidden by default — JS adds .panel-active to show
   ============================================================ */

.menu-section {
  display: none;
}

.menu-section.panel-active {
  display: block;
}

/* ============================================================
   MENU SECTION CONTENT
   ============================================================ */

.menu-section__header {
  margin-bottom: 28px;
}

.menu-section__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 8px;
}

.menu-section__eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 1px;
  background: var(--ember);
  flex-shrink: 0;
}

.menu-section__title {
  font-family: var(--ff-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 400;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.menu-section__sub {
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--dust);
  font-style: italic;
  margin-bottom: 6px;
}

.menu-section__note {
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--dust);
  background: var(--linen);
  border: 1px solid var(--stone);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  display: inline-block;
  margin-top: 8px;
}

.menu-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.menu-section__grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ============================================================
   DRINKS PANEL — multiple sub-sections shown together,
   separated by a subtle divider
   ============================================================ */

.menu-section.panel-active + .menu-section.panel-active {
  border-top: 1px solid rgba(204, 199, 188, 0.4);
  padding-top: 40px;
  margin-top: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 640px) {
  .menu-section__grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .menu-card__img-wrap {
    height: 150px;
  }

  .menu-tabs-scroll::before,
  .menu-tabs-scroll::after {
    display: block;
  }

  .menu-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 2px;
  }

  .menu-tabs::-webkit-scrollbar {
    display: none;
  }

  .menu-tab {
    font-size: 12px;
    padding: 7px 14px;
    min-height: 34px;
    flex-shrink: 0;
  }
}

@media (max-width: 400px) {
  .menu-section__grid {
    grid-template-columns: 1fr;
  }
}

/* Add drink group differentiation */
.menu-section[data-drink-group="smoothies"] .menu-section__eyebrow {
  color: var(--grove);
}
.menu-section[data-drink-group="smoothies"] {
  background-color: #EDF1E8;
  padding: 40px;
  border-radius: var(--r-lg);
  margin-bottom: 24px;
}

/* Search Row */
.menu-search-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.menu-search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.menu-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--stone);
}

.menu-search-input {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  background: var(--linen);
  border: 1.5px solid var(--stone);
  padding: 0 40px 0 40px;
  font-family: var(--ff-body);
  font-size: 14px;
  color: var(--ink-2);
  outline: none;
}

.menu-search-input:focus {
  border-color: var(--ember);
}

.menu-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 18px;
  color: var(--stone);
  cursor: pointer;
}

.menu-search-count {
  margin-top: 8px;
  font-family: var(--ff-ui);
  font-size: 12px;
  color: var(--dust);
}

.menu-search-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--dust);
  font-family: var(--ff-body);
  font-size: 16px;
  font-weight: 300;
}

/* Dim tabs during active search */
.menu-tabs-wrapper.search-active .menu-tabs {
  opacity: 0.3;
  pointer-events: auto; /* Allow clicks to clear search */
}

/* ============================================================
   COMPACT TOOLBAR — activated on scroll into menu items
   ============================================================ */

.menu-tabs-wrapper--compact {
  padding: 6px 0 0;
}

/* Mobile compact: slim icon + tabs + filters row */
@media (max-width: 640px) {
  .menu-tabs-wrapper--compact .menu-search-row {
    display: none;
    margin-bottom: 0;
  }

  .menu-tabs-wrapper--compact.search-expanded .menu-search-row {
    display: flex;
    padding: 0 clamp(16px, 4vw, 48px) 8px;
  }

  .menu-tabs-wrapper--compact .menu-search-toggle,
  .menu-tabs-wrapper--compact .menu-filters-toggle {
    display: inline-flex;
  }

  .menu-tabs-wrapper--compact .menu-toolbar-row {
    padding: 0 clamp(12px, 4vw, 48px) 8px;
  }

  .menu-tabs-wrapper--compact .menu-tab {
    font-size: 11px;
    padding: 6px 12px;
    min-height: 32px;
  }

  .menu-tabs-wrapper--compact .menu-filters-panel {
    display: none;
  }

  .menu-tabs-wrapper--compact.filters-open .menu-filters-panel {
    display: block;
    position: absolute;
    left: clamp(12px, 4vw, 48px);
    right: clamp(12px, 4vw, 48px);
    top: 100%;
    z-index: 2;
    background: var(--field);
    border: 1px solid var(--stone);
    border-radius: var(--r-md);
    box-shadow: 0 8px 24px rgba(30, 43, 23, 0.12);
    margin-top: 4px;
  }

  .menu-tabs-wrapper--compact.filters-open .menu-filters {
    border-top: none;
    padding: 12px;
    flex-wrap: wrap;
  }
}

/* Desktop compact: keep search, collapse filters behind toggle */
@media (min-width: 641px) {
  .menu-tabs-wrapper--compact {
    padding: 8px 0 0;
  }

  .menu-tabs-wrapper--compact .menu-search-row {
    margin-bottom: 8px;
  }

  .menu-tabs-wrapper--compact .menu-search-input {
    height: 36px;
  }

  .menu-tabs-wrapper--compact .menu-filters-toggle {
    display: inline-flex;
  }

  .menu-tabs-wrapper--compact .menu-toolbar-row {
    padding-bottom: 8px;
  }

  .menu-tabs-wrapper--compact .menu-tab {
    font-size: 12px;
    padding: 6px 14px;
    min-height: 32px;
  }

  .menu-tabs-wrapper--compact:not(.filters-open) .menu-filters-panel {
    display: none;
  }

  .menu-tabs-wrapper--compact.filters-open .menu-filters-panel {
    display: block;
  }

  .menu-tabs-wrapper--compact.filters-open .menu-filters {
    border-top: 1px solid rgba(204, 199, 188, 0.55);
  }
}

.btn-order {
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-family: var(--ff-ui);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
}

.btn-order.toast { background: #E75A00; }
.btn-order.doordash { background: #FF3008; }
.btn-order.grubhub { background: #FF8000; }

.badge--customize {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--ember);
  color: #fff;
  padding: 4px 8px;
  font-size: 10px;
  border-radius: var(--r-sm);
  font-family: var(--ff-ui);
}

.menu-card__search-pill {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(255,255,255,0.9);
  padding: 4px 8px;
  font-size: 10px;
  border-radius: var(--r-sm);
  font-family: var(--ff-ui);
  color: var(--ink-2);
  z-index: 1;
}

.menu-card__view-details {
  font-family: var(--ff-ui);
  font-size: 12px;
  color: var(--ember);
  margin-top: 12px;
  font-weight: 600;
}
