/* ===========================================================================
   Panino's — Single Food Item Page
   Loaded by paninos_scripts() only on is_singular('food'). Every value comes
   from the token files in css/tokens/, so this page reads as part of the same
   system as the menu it was clicked from.
   ========================================================================= */

/* ===== Section: Breadcrumb ===== */
.food-crumbs {
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.food-crumbs .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.food-crumbs a {
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  transition: color var(--dur-fast) var(--ease-out);
}
.food-crumbs a:hover {
  color: var(--brand-primary);
}
.food-crumbs span[aria-hidden="true"] {
  color: var(--ink-300);
}
.food-crumbs-current {
  color: var(--text-heading);
  font-weight: var(--fw-bold);
}

/* ===== Section: Item detail (photo + everything about the item) ===== */
.food-detail {
  background: var(--bg-page);
  padding: 56px 0 80px;
}
.food-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 56px;
  /* start, not stretch: a stretched grid item is exactly as tall as its own
     grid area, leaving a sticky box nowhere to travel. */
  align-items: start;
}
.food-media {
  position: sticky;
  /* Clears the site header, which is 91px tall and 79px once .scrolled. */
  top: 100px;
}
.food-media-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  /* Never taller than the space under the header, or its lower half could
     never be reached and it would scroll away instead of sticking. */
  max-height: calc(100vh - 130px);
  overflow: hidden;
  border: var(--border-card);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  box-shadow: var(--shadow-md);
}
.food-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.food-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-300);
  box-shadow: none;
}

/* ===== Section: Item info column ===== */
.food-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.food-cat {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--brand-primary-ink);
  background: var(--red-50);
  border: 1px solid var(--red-100);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  transition:
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.food-cat:hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.food-title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 32px;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text-heading);
  margin: 0;
}
.food-headline-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: 30px;
  line-height: 1.2;
  color: var(--price);
  margin: 14px 0 0;
}
.food-headline-note {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.food-description {
  font-family: var(--font-body);
  font-size: var(--fs-lead);
  line-height: var(--lh-body);
  color: var(--text-body);
  margin-top: 18px;
  max-width: 62ch;
}

/* ===== Section: Sizes & add-ons (the "title + rows" groups) ===== */
.food-options {
  margin-top: 32px;
  padding: 24px 26px;
  background: var(--surface-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}
/* The size list is the page's primary answer — give it the brand edge. */
.food-options-sizes {
  border-left: 3px solid var(--brand-primary);
}
.food-options-addons {
  background: var(--surface-sunken);
  border-left: 3px solid var(--brand-secondary);
  box-shadow: none;
}
.food-options-title {
  font-family: var(--font-body);
  font-weight: var(--fw-extra);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.food-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.food-option {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
}
.food-option:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.food-option-name {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: 16.5px;
  color: var(--text-heading);
}
/* Dotted leader ties a long name to its price the way a printed menu does. */
.food-option-dots {
  flex: 1 1 auto;
  min-width: 24px;
  border-bottom: 1px dotted var(--border-strong);
  transform: translateY(-5px);
}
.food-option-price {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: 17px;
  color: var(--price);
  white-space: nowrap;
}
.food-options-addons .food-option-price {
  color: var(--brand-secondary-ink);
}

/* Category-level notes — the garlic-knot line on every pasta, the dressing
   rules on every wing order. A neutral card rather than a coloured one: this
   is reference information, not another priced choice to pick. The red rule
   under the title and the green bullets carry the brand without shouting. */
.food-options-notes {
  background: var(--paper-2);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}
.food-options-notes .food-options-title {
  color: var(--brand-primary);
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.food-notes-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.food-notes-list li {
  position: relative;
  padding: 6px 0 6px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: var(--lh-snug);
  color: var(--ink-800);
}
.food-notes-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-secondary);
}

/* ===== Section: Lunch note ===== */
.food-lunch-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  padding: 12px 16px;
  background: var(--paper-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--ink-800);
}
/* Red icon is the whole accent here — the line is short enough that a tinted
   background would over-weight it next to the neutral notes card above. */
.food-lunch-note svg {
  flex-shrink: 0;
  color: var(--brand-primary);
}

/* ===== Section: Actions ===== */
.food-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* ===== Section: More from this category ===== */
.food-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.food-related-card {
  display: flex;
  align-items: stretch;
  background: var(--surface-card);
  border: var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition:
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.food-related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.food-related-card:hover h3 {
  color: var(--brand-primary);
}
.food-related-img {
  position: relative;
  flex: 0 0 108px;
  min-height: 108px;
  overflow: hidden;
  background: var(--surface-sunken);
}
.food-related-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.food-related-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
}
.food-related-card h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 17px;
  line-height: 1.3;
  color: var(--text-heading);
  margin: 0 0 8px;
  transition: color var(--dur-fast) var(--ease-out);
}
.food-related-price {
  margin-top: auto;
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: 15.5px;
  color: var(--price);
}

/* ===== Section: Mobile order bar =====
   Hidden on desktop, where the Order Online button is already in view. Below
   the breakpoint the button scrolls away, so it comes back pinned. */
.food-order-bar {
  display: none;
}

/* ===== Section: Responsive ===== */
@media (max-width: 1000px) {
  .food-detail-grid {
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 36px;
  }
  .food-title {
    font-size: 42px;
  }
  .food-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .food-detail {
    padding: 32px 0 56px;
  }
  .food-detail-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  /* Single column — nothing to sit alongside, so release it. */
  .food-media {
    position: static;
  }
  .food-media-frame {
    max-height: none;
    aspect-ratio: 16 / 10;
  }
  .food-title {
    font-size: 34px;
  }
  .food-headline-price {
    font-size: 26px;
  }
  .food-description {
    font-size: 16.5px;
  }
  .food-actions {
    display: none; /* replaced by the pinned bar below */
  }

  .food-order-bar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-sticky);
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    box-shadow: 0 -6px 20px rgba(30, 24, 19, 0.12);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .food-order-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--maxw);
    margin: 0 auto;
  }
  .food-order-bar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .food-order-bar-name {
    font-family: var(--font-body);
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
    color: var(--text-heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .food-order-bar-price {
    font-family: var(--font-body);
    font-weight: var(--fw-extra);
    font-size: 15px;
    color: var(--price);
  }
  .food-order-bar .btn {
    flex-shrink: 0;
    padding: 13px 22px;
    font-size: 15px;
    min-height: 46px;
  }

  /* Keep the pinned bar from covering the end of the footer. */
  body.single-food {
    padding-bottom: 76px;
  }
}

@media (max-width: 640px) {
  .food-crumbs .wrap {
    gap: 6px;
    font-size: var(--fs-xs);
  }
  .food-title {
    font-size: 28px;
  }
  .food-options {
    margin-top: 24px;
    padding: 18px 18px;
  }
  .food-option {
    padding: 11px 0;
  }
  .food-option-name {
    font-size: 15.5px;
  }
  .food-option-price {
    font-size: 16px;
  }
  .food-related-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .food-related-img {
    flex-basis: 96px;
    min-height: 96px;
  }
}
