/* ===========================================================================
   Panino's — Single Deal Page
   Loaded by paninos_scripts() only on is_singular('deal'). Every value comes
   from the token files in css/tokens/, so this page reads as part of the same
   system as the card it was clicked from, and sits beside css/single-food.css
   as its sibling rather than sharing selectors with it.

   A deal is a fixed bundle, so this sheet carries no size list, no per-row
   prices and no dotted leader — those rules are not renamed here, they are
   absent.
   ========================================================================= */

/* ===== Section: Breadcrumb ===== */
.deal-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);
}
.deal-crumbs .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.deal-crumbs a {
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  transition: color var(--dur-fast) var(--ease-out);
}
.deal-crumbs a:hover {
  color: var(--brand-primary);
}
.deal-crumbs span[aria-hidden="true"] {
  color: var(--ink-300);
}
.deal-crumbs-current {
  color: var(--text-heading);
  font-weight: var(--fw-bold);
}

/* ===== Section: Deal detail (photo + everything about the deal) ===== */
.deal-detail {
  background: var(--bg-page);
  padding: 56px 0 80px;
}
.deal-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;
}
.deal-media {
  position: sticky;
  /* Clears the site header, which is 91px tall and 79px once .scrolled. */
  top: 100px;
}
.deal-media-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - 130px);
  overflow: hidden;
  border: var(--border-card);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.deal-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.deal-media-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-300);
  background: var(--surface-sunken);
  box-shadow: none;
}

/* ===== Section: Deal info column ===== */
.deal-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.deal-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);
}
.deal-cat:hover {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}
.deal-title {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text-heading);
  margin: 0;
}
.deal-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;
}
.deal-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: What's included ===== */
.deal-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);
}
/* A supporting list rather than the page's primary answer, so it takes the
   quieter of the two treatments. */
.deal-options-includes {
  background: var(--surface-sunken);
  border-left: 3px solid var(--brand-secondary);
  box-shadow: none;
}
.deal-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;
}
.deal-options-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.deal-option {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
}
.deal-option:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.deal-option-name {
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: 16.5px;
  color: var(--text-heading);
}

/* ===== Section: Terms ===== */
/* The fine print — the availability window's companion, one line per rule.
   A neutral card, matching .food-options-notes on the food item page, so the
   two "Good to Know" boxes read as the same component across the site. */
.deal-options-terms {
  background: var(--paper-2);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}
.deal-options-terms .deal-options-title {
  color: var(--brand-primary);
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.deal-terms-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.deal-terms-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);
}
.deal-terms-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-secondary);
}

/* ===== Section: Availability ===== */
/* Matches .food-lunch-note on the food item page: neutral card, the red icon
   is the whole accent. */
.deal-availability {
  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);
}
.deal-availability svg {
  flex-shrink: 0;
  color: var(--brand-primary);
}

/* ===== Section: Upgrade box =====
   Same dashed box as the one under the deals grid, so the two read as one
   component. The rules are copied from blocks/lunch-deals/style.css rather
   than shared: block stylesheets are only enqueued when their block is on the
   page, and no block renders here. `.deal-upgrade` carries no rules of its own
   — it is the hook to diverge with if this box ever needs to. */
.lx-upgrade {
  margin-top: 40px;
  padding: 24px 28px;
  border: 2px dashed var(--brand-primary);
  border-radius: var(--radius-md);
  background: var(--red-50);
  text-align: center;
}
.lx-upgrade h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--text-heading);
  margin: 0 0 6px;
}
.lx-upgrade p {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}
.lx-upgrade strong {
  color: var(--price);
}

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

/* ===== Section: More deals ===== */
.deal-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.deal-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);
}
.deal-related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.deal-related-card:hover h3 {
  color: var(--brand-primary);
}
.deal-related-img {
  position: relative;
  flex: 0 0 108px;
  min-height: 108px;
  overflow: hidden;
  background: var(--surface-sunken);
}
.deal-related-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.deal-related-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
}
.deal-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);
}
.deal-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 Now button is already in view. Below the
   breakpoint the button scrolls away, so it comes back pinned — ordering is
   this page's whole purpose. */
.deal-order-bar {
  display: none;
}

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

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

  .deal-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));
  }
  .deal-order-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: var(--maxw);
    margin: 0 auto;
  }
  .deal-order-bar-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  .deal-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;
  }
  .deal-order-bar-price {
    font-family: var(--font-body);
    font-weight: var(--fw-extra);
    font-size: 15px;
    color: var(--price);
  }
  .deal-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-deal {
    padding-bottom: 76px;
  }
}

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