/* Load list page. Two panes on wide screens: every size with its list price on the left, the
   ticket on the right (a stone sheet that stays in view and scrolls on its own). On phones and
   tablets the ticket comes first and the sizes follow. Built on the site.css tokens. */

/* ---------- title ---------- */
.ll-hero { padding-bottom: clamp(28px, 3.4vw, 44px); }
.ll-facts {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 30px;
  margin-top: 24px; font-size: var(--fs-small);
}
.ll-phone { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- the two panes ---------- */
.ll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 31vw, 440px);
  gap: 0 var(--gap);
  align-items: start;
  padding-bottom: var(--section);
}
.catalog { grid-column: 1; grid-row: 1; min-width: 0; }
.ticket { grid-column: 2; grid-row: 1; min-width: 0; }

.catalog-head h2, .ticket-head h2 { font-size: clamp(24px, 2.2vw, 30px); line-height: 1.1; letter-spacing: -0.015em; }

/* ---------- the ticket ---------- */
/* The ticket scrolls on its own, and hands the wheel back to the page at its ends (no
   overscroll containment), so the page never stops scrolling under the pointer. */
.ticket {
  position: sticky; top: calc(var(--head-h) + 16px);
  max-height: calc(100vh - var(--head-h) - 32px);
  overflow-y: auto;
  scroll-padding: 84px 0 150px;   /* focus clears the pinned title and total */
  background: var(--stone);
  scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent;
}
.ticket-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 24px 26px 14px; background: var(--stone);
}
.ticket-count { font-size: var(--fs-small); color: var(--grey); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticket-body { padding: 0 26px 26px; }

/* the drawing of the load */
.load-art { margin: 2px 0 12px; }
.load-art:empty { display: none; }
.load-art svg { width: 100%; height: clamp(88px, 8vw, 116px); }
.load-art .pc-new { animation: piece-in 0.55s cubic-bezier(0.2, 0.75, 0.25, 1); }
@keyframes piece-in { from { opacity: 0; transform: translateY(-1.4px); } }

/* lines: Qty | Item | Total, like the yard's own tickets */
.lines { list-style: none; }
.lines:not(:empty) { border-top: 1px solid var(--ink); }
.line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "step label total" "step unit remove";
  align-items: baseline; gap: 1px 14px;
  padding: 11px 0 10px; border-bottom: 1px solid var(--rule);
}
.line .stepper { grid-area: step; align-self: center; }
.line .stepper button { width: 34px; height: 34px; }
.line .stepper output { min-width: 2.7em; font-size: 15.5px; }
.stepper button[aria-disabled="true"] { opacity: 0.35; cursor: not-allowed; }
.stepper button[aria-disabled="true"]:hover { background: none; }
.line-label { grid-area: label; font-weight: 600; line-height: 1.3; }
.line-total { grid-area: total; text-align: right; font-variant-numeric: tabular-nums; }
.line-unit { grid-area: unit; font-size: 14.5px; line-height: 1.35; color: var(--grey); }
.line.is-unpriced .line-unit { color: var(--ink); }
.line-remove { grid-area: remove; justify-self: end; }
.line.is-new { animation: line-in 1.6s ease-out; }
@keyframes line-in { from { background-color: var(--white); } }
.more-sizes { display: none; margin-top: 8px; }

.link-btn {
  padding: 4px 0; border: 0; background: none; cursor: pointer;
  font-size: 14.5px; font-weight: 600; line-height: 1.2;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.link-btn:hover { text-decoration-thickness: 2px; }
.line-remove { flex: none; color: var(--grey); }
.line-remove:hover { color: var(--ink); }

/* empty */
.ticket-empty { padding: 18px 0 4px; border-top: 1px solid var(--ink); }
.ticket-empty-title { font-weight: 600; font-size: 18px; }
.ticket-empty p + p { margin-top: 6px; color: var(--grey); }
.ticket-empty .btn { margin-top: 18px; }

/* sums */
.sum { margin: 0; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0 12px; }
.sum dt { font-size: var(--fs-small); }
.sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.sum-delivery .sum-row { padding-top: 4px; }
.unpriced-note { margin: -4px 0 12px; padding-left: 12px; border-left: 3px solid var(--rule-strong); font-size: 14.5px; }

/* delivery or pickup */
.f-delivery { padding-top: 18px; border-top: 1px solid var(--rule); }
.how legend { margin-bottom: 10px; }
.town-field .field { margin-top: 14px; }
.town-field .hint { margin-top: 6px; min-height: 0; color: var(--grey); }
.town-field + datalist { display: none; }

/* the estimated total stays in view at the foot of the ticket */
.grand {
  position: sticky; bottom: 0; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px;
  margin: 6px -26px 0; padding: 14px 26px 16px;
  background: var(--stone); border-top: 1.5px solid var(--ink);
}
.grand-label { font-weight: 600; }
.grand-num { font-family: var(--display); font-weight: 500; font-size: clamp(32px, 2.9vw, 42px); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.grand-note { grid-column: 1 / -1; font-size: 14.5px; line-height: 1.4; color: var(--grey); }
.terms-note { margin-top: 10px; font-size: 14.5px; color: var(--grey); }
.terms-note a { color: var(--ink); font-weight: 600; white-space: nowrap; }

/* sending */
.f-contact { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--rule); }
.f-title { font-size: 17px; }
.f-contact .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.f-contact .field-row .field { min-width: 0; }
.f-send { margin-top: 22px; }
.f-send .form-error { margin: 0 0 12px; background: var(--white); }
.send { width: 100%; }
.ticket.is-empty .f-send { margin-top: 20px; }
.ticket.is-empty .send { background: var(--white); color: var(--ink); }
.sent { padding-top: 22px; }
.sent:focus { outline: none; }
.sent:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.sent h3 { font-family: var(--display); font-weight: 500; font-size: 28px; letter-spacing: -0.015em; }
.sent p { margin-top: 8px; }
.sent .btn { margin-top: 18px; }

/* ---------- the catalog ---------- */
.catalog-head { padding-top: 24px; }
.catalog-sub { margin-top: 8px; font-size: var(--fs-small); color: var(--grey); }

.cat-tools {
  position: sticky; top: var(--head-h); z-index: 5;
  display: grid; gap: 12px;
  margin: 6px -10px 0 0; padding: 16px 10px 14px 0;
  background: var(--white); border-bottom: 1px solid var(--ink);
}
.tools-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }
.search { flex: 1 1 340px; min-width: 0; }   /* wide enough for the whole placeholder, or its own row */
.search input {
  padding-left: 42px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23191b1d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E") no-repeat 14px 50% / 18px 18px;
}
.dia { display: flex; align-items: center; gap: 12px; }
.dia-label { font-weight: 600; font-size: var(--fs-small); }
.dia .pick-list, .type-picks { gap: 6px; }
.result-count { margin-top: 14px; min-height: 1.5em; font-size: var(--fs-small); color: var(--grey); }

.cat { margin-top: 34px; }
.cat:first-child { margin-top: 18px; }
.cat-head { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 0 20px; }
.cat-art { display: block; width: 64px; height: 64px; background: var(--stone); }
.cat-art svg { width: 100%; height: 100%; }
.cat-title h3 { font-size: 18px; line-height: 1.25; }
.cat-title h3 a { text-decoration: none; }
.cat-title h3 a:hover { text-decoration: underline; }
.cat-note { margin-top: 2px; font-size: 14.5px; color: var(--grey); }
.cat-note.is-new { color: var(--red-ink); font-weight: 600; }
.cat-link { font-size: 14.5px; font-weight: 600; white-space: nowrap; }

.rows { list-style: none; margin: 12px -10px 0 70px; border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 128px; align-items: center; gap: 4px 20px;
  min-height: 56px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--rule);
}
.row.is-on { background: var(--stone); box-shadow: inset 3px 0 0 var(--red); }
.row-label { display: block; font-weight: 500; line-height: 1.3; }
.row-detail { display: block; margin-top: 1px; font-size: 14.5px; line-height: 1.35; color: var(--grey); }
.row-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ctl { display: flex; justify-content: flex-end; }
.ctl .btn-add { min-width: 76px; }

.no-results { margin-top: 18px; padding: 20px 22px; background: var(--stone); }
.no-results-title { font-weight: 600; }
.no-results p + p { margin-top: 6px; }
.no-results .btn { margin-top: 16px; }

/* ---------- tablets and phones: the ticket first, then the sizes ---------- */
@media (max-width: 1080px) {
  .ll-grid { grid-template-columns: minmax(0, 1fr); gap: 48px; }
  .catalog, .ticket { grid-column: 1; grid-row: auto; }
  .ticket { position: relative; top: auto; max-height: none; overflow: visible; }
  .ticket-head, .grand { position: static; }
  .cat-tools { position: static; }
  .catalog-head { padding-top: 0; }
  .more-sizes { display: inline-block; }
}
@media (min-width: 1081px) {
  #find-sizes { display: none; }   /* the search is right beside the ticket */
}
@media (max-width: 720px) {
  .ll-hero { padding-bottom: 24px; }
  .ll-facts { gap: 6px 22px; margin-top: 18px; }
  .ll-grid { gap: 40px; }
  .ticket { margin-inline: calc(-1 * var(--gutter)); }
  .ticket-head { padding: 20px var(--gutter) 10px; }
  .ticket-body { padding: 0 var(--gutter) 22px; }
  .grand { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .load-art { margin-bottom: 8px; }
  .load-art svg { height: 84px; }
  .line { column-gap: 12px; }
  .line .stepper button { width: 32px; }
  .line .stepper output { min-width: 2.5em; }
  .f-contact { margin-top: 18px; padding-top: 16px; }
  .ticket .field { margin-top: 14px; }
  .tools-row { gap: 14px; }
  .search { flex-basis: 100%; }
  .dia { flex-direction: column; align-items: flex-start; gap: 8px; }
  /* rules and the on-list band run edge to edge, like the ticket above; text keeps the gutter */
  .cat-tools { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .cat { margin-top: 30px; }
  .cat-head { grid-template-columns: 52px minmax(0, 1fr); gap: 0 14px; }
  .cat-art { width: 52px; height: 52px; }
  .cat-link { grid-column: 2; justify-self: start; margin-top: 2px; }
  .rows { margin: 12px calc(-1 * var(--gutter)) 0; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 10px var(--gutter); }
  .row-price { grid-column: 1; grid-row: 2; text-align: left; font-size: 15.5px; }
  .ctl { grid-column: 2; grid-row: 1 / span 2; }
}

@media print {
  .ll-facts, .catalog, .load-art, .f-delivery, .f-contact, .f-send, .sent, .ticket-empty .btn,
  .stepper button, .line-remove, .more-sizes, #t-add-town { display: none !important; }
  .ll-grid { display: block; padding-bottom: 0; }
  .ticket { position: static; max-height: none; overflow: visible; background: none; }
  .ticket-head, .ticket-body, .grand { position: static; padding-inline: 0; margin-inline: 0; background: none; }
  .stepper { border: 0; }
}


/* ---------- filters, stacked: product type, then diameter, then search ---------- */
.cat-tools.is-stacked {
  position: static;
  display: grid; gap: 10px; justify-items: start;
  margin: 8px 0 0; padding: 6px 0 20px;
}
.cat-tools.is-stacked .type-picks,
.cat-tools.is-stacked .dia .pick-list { gap: 10px; }
.cat-tools.is-stacked .dia { display: block; }
.cat-tools.is-stacked .pick span { min-height: 52px; min-width: 58px; padding: 0 18px; font-size: 18px; }
.cat-tools.is-stacked .search { width: min(100%, 340px); flex: none; margin-top: 4px; }
@media (max-width: 720px) {
  .cat-tools.is-stacked { justify-items: stretch; }
  .cat-tools.is-stacked .type-picks, .cat-tools.is-stacked .dia .pick-list { gap: 8px; }
  .cat-tools.is-stacked .pick span { min-height: 44px; min-width: 48px; padding: 0 13px; font-size: 16px; }
  .cat-tools.is-stacked .search { width: 100%; }
}
