/* features.extras (docs/extras.md): the Drinks / Snacks / Shots sections on /menu/ and /order/.
   Same type and colours as the existing "Always on the menu" / "This week" group titles and the meal cards; nothing new. Ships only while the flag is on. */
.extras-group {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* Section headings (L1b): the card's h3 face - Fraunces 600, the display font of every other heading - not a small uppercase label.
   Menu = 28px (the card names under it are 22px, so the section reads above them); order page = the card h3 size, 22px. */
.extras-title,
.extras-pick-head h3 {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variation-settings: "opsz" 36, "SOFT" 20;
  color: var(--green-deep);
  margin: 0 0 20px;
}

.extras-pick-head h3 {
  font-size: 22px;
  margin: 0 0 6px;
}

/* The menu cards show the same allergen facts as the order rows: the May-contain line sits straight under Contains. */
.meal-card .contains + .may-contain-line {
  margin: 0 0 6px;
}

/* Snack bars are wide packs: their photo frame is the 8:5 shop-photo frame (the files are exported at 8:5, the bar fills the width) instead of the 4:5 dish frame. */
.extras-group[data-extras-category="snacks"] .meal-photo {
  aspect-ratio: 8 / 5;
}

.extras-pick-head {
  padding-top: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.extras-soon {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* The same quiet pill as the card control's tag (css/card-soon.css). */
.extras-soon-tag {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border: 1px solid #8d9289;
  border-radius: 999px;
  background: #fcfbf5;
  color: #4a4f48;
}

.extras-group[hidden],
.extras-pick-head[hidden] {
  display: none;
}

/* Shop view: the picker is a card grid, so a category heading spans the whole row. */
html[data-shop-live][data-shop-view="shop"] #meal-picker .extras-pick-head {
  grid-column: 1 / -1;
  padding-top: 20px;
  margin-top: 8px;
}

html[data-shop-live][data-shop-view="shop"] #meal-picker .extras-pick-head h3 {
  margin: 0;
}

/* A tall bottle is shown whole, not cropped to the wide card frame. */
.pick-row[data-extra="drinks"] .pick-photo img {
  object-fit: contain;
}

/* Product catalogue: opt-in markup only; the legacy extras rules above stay intact. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 16px;
  min-width: 0;
}

.product-grid > .product-card,
#order-form.product-shop .product-grid > .product-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  gap: 0;
  padding: 0;
  border: 1px solid #cfd9c8;
  border-radius: 4px;
  background: #fcfbf5;
  box-shadow: none;
  overflow: hidden;
  font-family: var(--body);
}

.product-card .product-photo,
#order-form.product-shop .product-card .product-photo,
.home-extra-card .product-photo {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  flex: none;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #cfd9c8;
  border-radius: 0;
  background: #fcfbf5;
}

.product-card .product-photo img,
#order-form.product-shop .product-card .product-photo img,
.home-extra-card .product-photo img {
  display: block;
  position: static;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-card[data-extra] .product-photo,
.home-extra-card .product-photo {
  background: #ddf5d3;
}

.product-card[data-extra] .product-photo img,
#order-form.product-shop .product-card[data-extra] .product-photo img,
.home-extra-card .product-photo img {
  object-fit: contain;
  padding: 10%;
}

.product-card .product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  gap: 10px;
}

.product-card .product-name,
.product-card label.product-name {
  display: block;
  margin: 0;
  color: #083c22;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.product-card .product-name a[href] {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.product-card .product-name a[href]:hover {
  text-decoration: underline;
  text-decoration-color: #fd3c8b;
  text-underline-offset: 5px;
}

.product-card .product-description {
  display: block;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
}

.product-card .product-info {
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.product-card .product-info p {
  margin: 0 0 6px;
  max-width: none;
  font-size: inherit;
}

.product-card .product-info summary {
  min-height: 44px;
  padding-block: 10px;
  cursor: pointer;
  color: #083c22;
}

.product-card .product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  font-size: 16px;
}

.product-card .product-price {
  margin: auto 0 0 auto;
  color: #083c22;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.product-card .product-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #cfd9c8;
}

.product-card .product-buy .stepper {
  max-width: 100%;
  border-radius: 4px;
}

.product-card .product-buy .stepper :is(button, input),
.product-card .product-buy .add-btn {
  min-width: 44px;
  min-height: 44px;
}

.product-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.product-filters button[data-product-filter] {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #cfd9c8;
  border-radius: 4px;
  background: #fcfbf5;
  color: #083c22;
  font-family: var(--body);
  font-size: 16px;
  font-weight: 700;
  box-shadow: none;
}

.product-filters button[data-product-filter]:hover {
  border-color: #083c22;
}

.product-filters button[aria-pressed="true"] {
  background: #083c22;
  color: #fcfbf5;
  border-color: #083c22;
  border-bottom-color: #fd3c8b;
}

.product-card :focus-visible,
.product-filters :focus-visible,
.home-extras :focus-visible {
  outline: 2px solid #083c22;
  outline-offset: 3px;
}

#order-form.product-shop .order-fields {
  min-width: 0;
}

#order-form.product-shop #meal-picker {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}

#order-form.product-shop .product-grid {
  gap: 20px 12px;
}

#order-form.product-shop .product-body {
  padding: 12px;
}

#order-form.product-shop .product-name {
  font-size: 20px;
}

.home-extras {
  padding-block: 48px;
  border-top: 1px solid #cfd9c8;
  background: #fcfbf5;
}

.home-extras-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-extra-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfd9c8;
  border-radius: 4px;
  background: #fcfbf5;
  color: #083c22;
  text-decoration: none;
  box-shadow: none;
}

.home-extra-card h3 {
  margin: 14px 12px 8px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.home-extra-card :is(.product-price, .home-extra-price) {
  margin: auto 12px 14px auto;
  padding-top: 8px;
  color: #083c22;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.product-filtered,
.product-grid[hidden],
.product-grid [hidden],
.product-filters[hidden],
.product-filters [hidden],
.home-extras[hidden],
.home-extras [hidden] {
  display: none !important;
}

@media (min-width: 901px) {
  #order-form.product-shop.order-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
  }
}

@media (max-width: 1099px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-extras-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #order-form.product-shop.order-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 539px) {
  .product-grid,
  #order-form.product-shop .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 10px;
  }
  .product-card .product-body,
  #order-form.product-shop .product-body {
    padding: 10px;
    gap: 8px;
  }
  .product-card .product-name,
  .product-card label.product-name,
  #order-form.product-shop .product-name {
    font-size: 18px;
  }
  .home-extras-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .home-extra-card h3 {
    font-size: 18px;
  }
  .home-extras {
    padding-block: 32px;
  }
}

/* Keep every supplied package visible inside its square tile. */
#order-form.product-shop .product-card[data-extra] .product-photo img { object-fit: contain; }
#order-form.product-shop .product-card .pick-name { padding: 0; }
html[data-shop-live][data-shop-view="shop"] #order-form.product-shop #meal-picker { display: block; }
html[data-shop-live][data-shop-view="shop"] #order-form.product-shop .product-card { display: flex; }

/* The extras hero line uses the existing mint on the deep-green panel. */
.hero-copy .hero-extras {
  margin: 0 0 12px;
  color: #ddf5d3;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.home-extra-card > div:last-child {
  display: flex;
  flex: 1;
  flex-direction: column;
}

/* Phone catalogue controls sit below the 80px header and its 6px rule. */
@media (max-width: 767px) {
  .product-filters {
    position: sticky;
    top: 86px;
    z-index: 30;
    flex-wrap: nowrap;
    gap: 4px;
    padding-block: 8px;
    background: #fcfbf5;
    border-bottom: 1px solid #cfd9c8;
  }
  html:has(#staff-chip:not([hidden])) .product-filters {
    top: 154px;
  }
  .product-filters button[data-product-filter] {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 8px 4px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
  }
}

@media (max-width: 539px) {
  .product-card .product-description,
  .product-card .product-info,
  .product-card .product-meta {
    font-size: 14px;
    line-height: 1.45;
  }
  .product-card .product-price {
    font-size: 20px;
  }
  .product-card .product-buy .stepper {
    width: 100%;
  }
  .product-card .product-buy .stepper button {
    flex: 1 0 44px;
  }
  .product-card .product-buy .stepper input {
    flex: 1 1 44px;
    width: 44px;
  }
  .product-card .product-buy .add-btn {
    width: 100%;
    padding-inline: 6px;
  }
}

/* Keep the same two-column rhythm on narrow phones without clipping controls. */
@media (max-width: 359px) {
  .product-grid,
  #order-form.product-shop .product-grid { gap: 16px 4px; }
  .product-card .product-body,
  #order-form.product-shop .product-body { padding: 2px; }
}
