﻿/* Ready-mixed sand-concrete configurator, scoped to its own price lists. */
.sand-category {
  container-type: inline-size;
  container-name: sand-price;
}

.sand-category [hidden] { display: none !important; }
.sand-category .sand-intro { max-width: 86ch; }
.sand-category .sand-intro p,
.sand-category .sand-intro:where(p),
.sand-category .sand-hint,
.sand-category .sand-price-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.sand-category .sand-intro p + p { margin-top: 5px; }
.sand-category .sand-price-note { max-width: 88ch; }

.sand-category .sand-table { width: 100%; table-layout: fixed; }
.sand-category .sand-table th,
.sand-category .sand-table td { padding: 17px 12px; vertical-align: top; }
.sand-category .sand-table th { padding-block: 14px; font-size: 11px; line-height: 1.45; }
.sand-category .sand-table th:first-child { width: 90px; }
.sand-category .sand-table th:nth-child(2) { width: 70px; }
.sand-category .sand-table th:nth-child(4) { width: 150px; }
.sand-category .sand-table th:nth-child(5) { width: 164px; }
.sand-category .sand-table tbody tr:last-child td { border-bottom: none; }
.sand-category .sand-mark { grid-template-columns: minmax(0, 1fr); }
.sand-category .sand-class { padding-top: 17px; font-size: 14px; white-space: nowrap; }
.sand-category .sand-name {
  display: block;
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.sand-category .sand-composition {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.sand-category .sand-primary,
.sand-category .sand-options-grid,
.sand-category .sand-fibre-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.sand-category .sand-primary {
  grid-template-columns: minmax(0, 1fr);
  max-width: 320px;
  margin-top: 13px;
}
.sand-category .sand-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-width: 0;
  align-content: start;
}
.sand-category .sand-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.sand-category .sand-field:has([data-sand-field="mix"]),
.sand-category .sand-field:has([data-sand-field="sand"]),
.sand-category .sand-field--wide,
.sand-category .sand-options-grid > .sand-hint,
.sand-category .sand-fibre-fields { grid-column: 1 / -1; }
.sand-category .sand-fibre-fields {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.sand-category .sand-field :is(select, input, textarea),
.sand-category .sand-mark select {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(27, 33, 39, 0.15);
  border-radius: 9px;
  background-color: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.sand-category .sand-field select,
.sand-category .sand-mark select {
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
}
.sand-category .sand-mark select {
  min-width: 118px;
  padding-left: 8px;
  padding-right: 26px;
  font-size: 12px;
  font-weight: 700;
  text-overflow: clip;
}
.sand-category .sand-field textarea { min-height: 80px; resize: vertical; }
.sand-category .sand-field :is(input, textarea)::placeholder { color: #7b838a; font-size: 13px; }
.sand-category .sand-field :is(select, input, textarea):hover,
.sand-category .sand-mark select:hover { border-color: rgba(240, 138, 36, .6); }
.sand-category .sand-field :is(select, input, textarea):focus-visible,
.sand-category .sand-mark select:focus-visible,
.sand-category :is(.sand-options, .sand-specials) > summary:focus-visible,
.sand-category :is(.sand-order, .sand-use-volume):focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 3px;
}
.sand-category .sand-field :disabled {
  border-color: var(--line);
  background-color: #f0f2f3;
  color: #7b838a;
  cursor: not-allowed;
}

.sand-category .sand-options { min-width: 0; margin-top: 9px; }
.sand-category :is(.sand-options, .sand-specials) > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 6px 0;
  border-radius: 3px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.sand-category :is(.sand-options, .sand-specials) > summary::after {
  content: "";
  position: static;
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  border-radius: 0;
  background: none;
  transform: rotate(45deg);
}
.sand-category :is(.sand-options, .sand-specials)[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}
.sand-category :is(.sand-options, .sand-specials) > summary:hover { color: var(--brand-dark); }
.sand-category .sand-options > .sand-options-grid {
  margin-top: 8px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f6f7f8;
}
.sand-category .sand-price .price-tag {
  display: block;
  margin: 5px 0 0;
  font-size: 18px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sand-category .sand-quote-reason {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.sand-category .sand-specials {
  container-type: inline-size;
  container-name: sand-price;
  min-width: 0;
  margin-top: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fafbfc;
}
.sand-category .sand-specials > summary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
}
.sand-category .sand-specials > :is(.price-table-wrap, .sand-specials-body) {
  min-width: 0;
  margin: 0 12px 12px;
}
.sand-category .sand-reference,
.sand-category .sand-volume-preview {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.sand-category .sand-reference { padding-top: 10px; border-top: 1px solid var(--line); }
.sand-category .sand-reference strong { color: var(--text); font-weight: 700; }
.sand-category .sand-reference p { margin: 0; }
.sand-category .sand-reference p + p { margin-top: 5px; }
.sand-category .sand-area-calculation { display: grid; gap: 8px; min-width: 0; }
.sand-category .sand-volume-preview {
  padding: 10px 12px;
  border: 1px solid #e1e7eb;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
.sand-category .sand-order,
.sand-category .sand-use-volume {
  display: block;
  width: min(100%, 164px);
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #d8dfe4;
  border-radius: 9px;
  background: #fff;
  color: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.sand-category .sand-use-volume {
  grid-column: 1 / -1;
  justify-self: start;
  width: auto;
  max-width: 100%;
  margin-top: 0;
  font-size: 12px;
}
.sand-category :is(.sand-order, .sand-use-volume):hover {
  border-color: #e8b179;
  background: #fff8ef;
}
.sand-category :is(.sand-order, .sand-use-volume):disabled {
  border-color: var(--line);
  background: #f2f4f5;
  color: var(--muted);
  cursor: not-allowed;
}
.sand-category .sand-volume-min {
  display: block;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.sand-category .sand-volume-min + .sand-order { margin-top: 5px; }

@container sand-price (max-width: 820px) {
  .sand-category .sand-table th:first-child { width: 90px; }
  .sand-category .sand-table th:nth-child(2) { width: 60px; }
  .sand-category .sand-table th:nth-child(4) { width: 130px; }
  .sand-category .sand-table th:nth-child(5) { width: 140px; }
  .sand-category .sand-table th,
  .sand-category .sand-table td { padding-inline: 9px; }
  .sand-category .volume-control { grid-template-columns: 30px 56px 30px; }
  .sand-category .volume-step { width: 30px; }
  .sand-category .volume-input { width: 56px; }
}
@container sand-price (max-width: 760px) {
  .sand-category .price-table-wrap { overflow: visible; border: none; border-radius: 0; }
  .sand-category .sand-table { display: block; }
  .sand-category .sand-table thead { display: none; }
  .sand-category .sand-table tbody { display: grid; gap: 12px; }
  .sand-category .sand-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
  }
  .sand-category .sand-table tbody td {
    display: grid;
    gap: 5px;
    width: auto;
    min-width: 0;
    padding: 0;
    border: none;
    align-content: start;
    order: initial;
  }
  .sand-category .sand-table tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }
  .sand-category .sand-table tbody td[data-column="1"] { order: 0; grid-column: 1; }
  .sand-category .sand-table tbody td[data-column="2"] { order: 0; grid-column: 2; }
  .sand-category .sand-table tbody td[data-column="3"] { order: 1; grid-column: 1 / -1; }
  .sand-category .sand-table tbody td[data-column="4"] { order: 2; grid-column: 1; }
  .sand-category .sand-table tbody td[data-column="5"] { order: 2; grid-column: 2; }
  .sand-category .sand-table tbody td.sand-description::before { display: none; }
  .sand-category .sand-mark select { width: 100%; min-width: 0; max-width: 150px; }
  .sand-category .sand-class { align-content: center; font-size: 13px; font-weight: 700; }
  .sand-category .sand-price .price-tag { margin-top: 0; }
  .sand-category .volume-control { justify-self: start; }
}
@media (max-width: 760px) {
  .sand-category .sand-table tbody tr { padding: 14px; gap: 14px 12px; }
  .sand-category .sand-table tbody td::before { font-size: 10px; }
  .sand-category .sand-class { align-content: center !important; }
  .sand-category .sand-name { margin-top: 1px; }
  .sand-category .sand-options-grid,
  .sand-category .sand-fibre-fields { gap: 10px 8px; }
  .sand-category .sand-options > .sand-options-grid { padding: 11px; }
  .sand-category .sand-field :is(select, input, textarea),
  .sand-category .sand-mark select { min-height: 42px; }
  .sand-category .sand-price .price-tag { font-size: 17px; }
  .sand-category .volume-control { grid-template-columns: 30px minmax(34px, 1fr) 30px; max-width: 100%; }
  .sand-category .volume-step { width: 30px; min-height: 42px; }
  .sand-category .volume-input { width: 100%; min-width: 0; min-height: 42px; }
  .sand-category .volume-control.has-volume { grid-template-columns: 30px minmax(28px, 1fr) 30px 30px; }
  .sand-category .volume-control.has-volume .volume-jump { display: grid; place-items: center; width: 30px; min-height: 42px; }
}
@media (max-width: 430px) {
  .sand-category .sand-options-grid,
  .sand-category .sand-fibre-fields { grid-template-columns: minmax(0, 1fr); }
  .sand-category .sand-table tbody td[data-column="4"],
  .sand-category .sand-table tbody td[data-column="5"] { grid-column: 1 / -1; }
  .sand-category .volume-control { grid-template-columns: 34px 64px 34px; justify-self: start; width: auto; }
  .sand-category .volume-step { width: 34px; }
  .sand-category .volume-control.has-volume { grid-template-columns: 34px 64px 34px 34px; }
  .sand-category .volume-control.has-volume .volume-jump { width: 34px; }
  .sand-category .sand-order { min-height: 42px; font-size: 12px; }
  .sand-category .sand-specials > summary { padding: 12px; font-size: 13px; }
  .sand-category .sand-specials > :is(.price-table-wrap, .sand-specials-body) { margin-inline: 7px; }
}
@media (max-width: 380px) {
  .sand-category .sand-table tbody tr { padding: 12px; gap: 13px 9px; }
  .sand-category .sand-options-grid,
  .sand-category .sand-fibre-fields { grid-template-columns: minmax(0, 1fr); }
  .sand-category .sand-price .price-tag { font-size: 18px; }
}

/* Long specification names stay readable in the shared calculator. */
.price-layout:has([data-sand-category]) .price-calculator__stat { align-items: center; }
.price-layout:has([data-sand-category]) .price-calculator__stat > strong {
  min-width: 0;
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}
.price-layout:has([data-sand-category]) .price-calculator__item {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
}
.price-layout:has([data-sand-category]) .price-calculator__item > strong {
  grid-column: 1 / -1;
  min-width: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.price-layout:has([data-sand-category]) .price-calculator__item > em {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.price-layout:has([data-sand-category]) .price-calculator__item > span:not(.price-calculator__quote-note) {
  grid-column: 1;
  grid-row: 3;
  align-self: center;
}
.price-layout:has([data-sand-category]) .price-calculator__item .price-calculator__remove { grid-column: 2; grid-row: 3; }
.price-layout:has([data-sand-category]) .price-calculator__quote-note {
  grid-column: 1 / -1;
  grid-row: 4;
  min-width: 0;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Sticky aside spans the complete price list and releases at its end. */
.page-shell:has(.price-layout [data-sand-category]) { overflow-x: clip; overflow-y: visible; }
.price-layout:has([data-sand-category]) { align-items: start; overflow: visible; }
.price-layout:has([data-sand-category]) > .price-shell { min-width: 0; }
@media (min-width: 1081px) {
  .price-layout:has([data-sand-category]) > .price-calculator {
    position: sticky;
    top: 120px;
    align-self: start;
    min-width: 0;
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c8ced2 transparent;
  }
}
@media (max-width: 1080px) {
  .price-layout:has([data-sand-category]) > .price-calculator {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sand-category .sand-field :is(select, input, textarea),
  .sand-category .sand-mark select,
  .sand-category .sand-order,
  .sand-category .sand-use-volume { transition: none; }
}

/* Fixed grades share the baseline with the adjacent class. */
.sand-category .sand-fixed-mark {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}
