/* ==========================================================================
   layout.css · paginaopbouw & responsive gedrag
   .layout-split   hoofdkolom + overzichtspaneel rechts (bestelflow)
   .layout-center  gecentreerde pagina zonder paneel (start, gastselectie)
   Breakpoint 960px: mobiele layout uit Figma "2026 HIFI V3 - Mobile"
   ========================================================================== */

.site-header {
  padding: 10px var(--gutter);
}
.site-header img { width: 101px; height: 80px; }

.main {
  display: grid;
  align-content: start;
  gap: var(--space-xl);
  width: 100%;
  padding: var(--space-xl) clamp(16px, 4.63vw, 70px) var(--space-2xl) var(--gutter);
}
.main > * { max-width: 1100px; }
.main > .btn { justify-self: start; }

.page-header {
  display: grid;
  gap: var(--space-md);
}
.page-header .lead { line-height: 1.5; }


/* Split layout (desktop) ---------------------------------------------- */
.layout-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-width);
  grid-template-rows: auto 1fr;
  /* paneelkleur + rode rand lopen door tot onderaan de pagina */
  background: linear-gradient(to left,
    var(--c-panel) calc(var(--panel-width) - 4px),
    var(--c-red) 0 var(--panel-width),
    var(--c-bg) 0);
}
.layout-split > .site-header,
.layout-split > .main { grid-column: 1; }

/* Paneel blijft staan tijdens scrollen */
.layout-split > .summary {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}


/* Gecentreerde layout ------------------------------------------------- */
.layout-center .main {
  justify-items: center;
  max-width: calc(979px + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.layout-center .main > * { width: 100%; }
.layout-center .page-header { justify-items: center; text-align: center; }

/* Startscherm: iets compacter boven en tussen de blokken */
.main--start {
  gap: 32px;
  padding-top: 10px;
}
.layout-center .main--start { max-width: none; }
.main--start .page-header { gap: 12px; }
.main--start > .contact { width: auto; max-width: none; }
.main--start > .choices { max-width: none; }
.main--start .page-header > *,
.choice h2 { text-box: none; }

/* Gast-pagina (pizza kiezen via gedeelde link) */
.page-header--intro { gap: var(--space-lg); }
.page-header--intro .lead { line-height: 1.4; }
.main--guest > .btn { justify-self: center; width: auto; }


/* ======================================================================
   Tablet & mobiel (≤ 960px)
   Eén kolom van max. 680px. Volgorde volgens het mobiele ontwerp:
   inhoud → overzichtskaart → terugknop → contactblok.
   ====================================================================== */
@media (max-width: 960px) {
  :root { --gutter: 20px; }

  /* Header: logo gecentreerd */
  .site-header {
    display: flex;
    justify-content: center;
    padding: 15px 0 0;
  }
  .site-header img { width: 63px; height: 50px; }

  /* Eén kolom; main en aside worden "doorzichtig" zodat hun kinderen
     in één grid komen en we de volgorde kunnen bepalen. */
  .layout-split {
    background: var(--c-bg);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    row-gap: 40px;
    padding: 0 max(var(--gutter), (100% - 680px) / 2) 40px;
  }
  .layout-split > .site-header { margin-bottom: -20px; }
  .layout-split > .main,
  .layout-split > .summary { display: contents; }
  .layout-split > .main > * { max-width: none; }

  .layout-split .summary__panel { order: 1; margin-top: -20px; }
  .layout-split :is(.main, .summary) > .btn--back { order: 2; justify-self: center; margin-top: -20px; }
  .layout-split .summary > .contact { order: 3; margin-top: -10px; }

  /* Overzicht als kaart */
  .summary__panel {
    padding: var(--space-lg) var(--space-md);
    border: 4px solid var(--c-red);
    border-radius: var(--radius-lg);
    background: var(--c-panel);
  }
  .summary__panel > h2 { font-size: var(--fs-h4); text-align: center; }
  .summary__total strong { font-size: 26px; }

  /* Details: op mobiel alleen de knop tonen */
  .summary__panel--cta-only {
    margin-top: 0 !important;
    padding: 0;
    border: 0;
    background: none;
  }
  .summary__panel--cta-only > :not(.btn) { display: none; }

  /* Kaarten direct onder elkaar: 20px */
  .layout-split .main > :is(.card, .tabs) + .card { margin-top: -20px; }

  /* Gecentreerde pagina's */
  .layout-center .main,
  .layout-center .main--start {
    gap: 40px;
    max-width: calc(680px + 2 * var(--gutter));
    padding: 20px var(--gutter) 40px;
  }
  .main--start .page-header { gap: 20px; }
  .main--start .page-header > * { text-box: trim-both cap alphabetic; }
  .choices { gap: 28px; }
  .main--start > .contact { flex-direction: column; }
  .main--start > .contact p { flex-basis: auto; }
  .main--guest > .btn { width: 100%; }
  .choice img { height: 125px; }
  .layout-split .main > .page-header:first-child { margin-top: 20px; }

  /* Stappenbalk: bolletjes met lijntjes + bijschrift */
  .progress {
    display: grid;
    justify-items: center;
    gap: var(--space-xs);
  }
  .progress--done { display: none; }
  .progress__caption {
    display: block;
    color: var(--c-muted);
    font-size: var(--fs-sm);
    font-weight: 600;
  }
  .steps { flex-wrap: nowrap; gap: 8px; }
  .steps li,
  .steps .is-done,
  .steps [aria-current="step"] {
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0;
  }
  .steps li::before {
    width: 35px;
    height: 35px;
    border-width: 3px;
    font-size: 19px;
    line-height: 22px;
  }
  .steps li:not(:last-child)::after {
    content: "";
    width: 16px;
    height: 3px;
    border-radius: 2px;
    background: #e5e0d1;
  }
  .steps .is-done {
    --_badge-bg: var(--c-chip);
    --_badge-bd: var(--c-muted);
    --_badge-fg: var(--c-muted);
  }
  .steps [aria-current="step"] {
    --_badge-bg: var(--c-red);
    --_badge-bd: var(--c-red);
  }

  /* Titels gecentreerd */
  .page-header { justify-items: center; text-align: center; }
  h1 { font-size: 28px; line-height: 1.4; }
  .page-header .lead { font-size: var(--fs-body); }

  /* Kaarten & formulieren */
  .card { padding: var(--space-lg) var(--space-md); }
  .card h2 { font-size: var(--fs-h4); }
  .card > .btn { justify-self: stretch; }
  .card--form,
  .card--form__group { grid-template-columns: minmax(0, 1fr); }
  .field > label { font-size: var(--fs-sm); }

  .card--list { padding: 0; }
  .card--list > .card__header { padding: var(--space-lg) var(--space-md) var(--space-md); }
  .counter { font-size: var(--fs-body); }

  /* Productrij: naam + veg, omschrijving, prijs + knop */
  .product {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name name"
      "desc desc"
      "price action";
    row-gap: var(--space-md);
    padding: var(--space-md);
  }
  .product > .product__desc { margin-top: -5px; }
  .product.is-selected { padding-left: 15px; }
  .product:last-child { padding-bottom: var(--space-lg); }
  .product__name { justify-content: space-between; }
  .product__price { text-align: left; }
  /* Zonder prijs (gastpagina): knop rechts */
  .product:not(:has(.product__price)) > :is(.qty, .btn) { grid-column: 2; }

  /* Meldingen: icoon + titel naast elkaar, tekst eronder */
  .alert,
  .alert--compact {
    grid-template-columns: var(--alert-icon) minmax(0, 1fr);
    align-items: center;
    gap: var(--space-md) 14px;
    padding: var(--space-md);
    font-size: 15px;
  }
  .alert--compact::before { grid-row: auto; }
  .alert--compact > :not(h2) { grid-column: 1 / -1; }
  .alert > h2 { font-size: var(--fs-h4); line-height: 1.4; }
  .alert--success { --alert-icon: 36px; --alert-glyph-size: 20px; }
}

@media (max-width: 640px) {
  .steps li:not(:last-child)::after { width: 16px; }

  .callout { grid-template-columns: 1fr; }
  .callout .btn { grid-column: 1; grid-row: auto; justify-self: start; }

  .btn { white-space: normal; }

  .choice { min-height: 0; }
  .choice .btn { margin-top: 24px; }
}
