/* Visit estimate: the idea of the page made usable. Price rows on the left, the running total set large on the right. */
.brxe-section.st-estimate { display: block; width: 100%; padding: var(--section-gap-s) 0 var(--space-3xl); background: var(--color-paper); font-family: var(--font-body); font-weight: 400; color: var(--color-ink); }
.brxe-container.st-estimate__inner { display: block; width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--section-inset); }
.brxe-block.st-estimate__head { display: block; margin-bottom: var(--space-2xl); }
.brxe-heading.st-estimate__title {
  max-width: 22ch; margin: 0;
  font-family: var(--font-display); font-size: var(--text-section); font-weight: var(--display-weight); font-synthesis: none;
  letter-spacing: var(--tracking-display); line-height: 1.08; text-wrap: balance; overflow-wrap: break-word; min-width: 0; color: var(--color-ink);
}
.brxe-text-basic.st-estimate__lede { max-width: 52ch; margin: var(--space-md) 0 0; font-family: var(--font-body); font-size: var(--text-lead); font-weight: 400; line-height: 1.45; color: var(--color-ink-2); }

.st-est { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-2xl); align-items: start; font-family: var(--font-body); }
.st-est__main { min-width: 0; }

/* Tabs by category. Without the script they stay hidden and every group is a plain list. */
.st-est__tabs { display: flex; gap: var(--space-lg); overflow-x: auto; border-bottom: var(--rule-hair) solid var(--color-rule); scrollbar-width: none; }
.st-est__tabs::-webkit-scrollbar { display: none; }
.st-est:not(.is-ready) .st-est__tabs { display: none; }
.st-est__tab {
  appearance: none; flex: 0 0 auto; min-height: 48px; margin: 0 0 -1px; padding: var(--space-sm) 0;
  border: 0; border-bottom: 2px solid transparent; background: none;
  font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: 1.2; color: var(--color-muted); white-space: nowrap; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .st-est__tab:hover { color: var(--color-ink); }
  .st-est__row:hover .st-est__name { text-decoration: underline; text-decoration-thickness: var(--rule-hair); text-underline-offset: 0.2em; }
}
.st-est__tab[aria-selected="true"] { color: var(--color-ink); border-bottom-color: var(--color-ink); }
.st-est__tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.st-est__form { margin: 0; }
.st-est__group { min-width: 0; margin: 0; padding: 0; border: 0; }
.st-est__group[hidden] { display: none; }

/*
 * With tabs (the home page) the price list is a scroll window a little taller than the estimate card beside it:
 * the list column takes no height of its own (contain: size), the row takes the card's height plus a margin, and the
 * list fills it. As lines are added the card grows and the window with it. The Prices page (list layout) is untouched.
 * Scrolling in the Apple manner: a thin rounded thumb that shows on hover, and soft fades where more rows wait.
 */
@property --st-est-fade-top { syntax: '<length>'; inherits: false; initial-value: 0px; }
@property --st-est-fade-bottom { syntax: '<length>'; inherits: false; initial-value: 40px; }
.st-est.is-ready .st-est__form {
  --st-est-thumb: color-mix(in oklab, var(--color-ink) 22%, transparent);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable;
  padding-right: var(--space-sm);
  scrollbar-width: thin; scrollbar-color: transparent transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--st-est-fade-top), #000 calc(100% - var(--st-est-fade-bottom)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--st-est-fade-top), #000 calc(100% - var(--st-est-fade-bottom)), transparent 100%);
  transition: scrollbar-color var(--dur-micro) var(--ease-out);
}
.st-est.is-ready .st-est__form:hover,
.st-est.is-ready .st-est__form:focus-within { scrollbar-color: var(--st-est-thumb) transparent; }
.st-est.is-ready .st-est__form::-webkit-scrollbar { width: 10px; }
.st-est.is-ready .st-est__form::-webkit-scrollbar-track { background: transparent; }
.st-est.is-ready .st-est__form::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: transparent; background-clip: padding-box; }
.st-est.is-ready .st-est__form:hover::-webkit-scrollbar-thumb,
.st-est.is-ready .st-est__form:focus-within::-webkit-scrollbar-thumb { background-color: var(--st-est-thumb); }
.st-est.is-ready .st-est__form::-webkit-scrollbar-thumb:hover { background-color: color-mix(in oklab, var(--color-ink) 40%, transparent); }
/* The top fade appears once the list has scrolled, the bottom one goes at the end (scroll-driven where supported). */
@supports (animation-timeline: scroll()) {
  .st-est.is-ready .st-est__form { animation: st-est-fades linear both; animation-timeline: scroll(self); }
  @keyframes st-est-fades {
    0%   { --st-est-fade-top: 0px; --st-est-fade-bottom: 40px; }
    6%   { --st-est-fade-top: 28px; }
    94%  { --st-est-fade-bottom: 40px; }
    100% { --st-est-fade-top: 28px; --st-est-fade-bottom: 0px; }
  }
}
@media (min-width: 60.0625rem) {
  .st-est.is-ready { align-items: stretch; }
  .st-est.is-ready .st-est__main { contain: size; display: flex; flex-direction: column; min-height: 0; }
  .st-est.is-ready .st-est__tabs { flex: 0 0 auto; }
  .st-est.is-ready .st-est__form { flex: 1 1 auto; min-height: 0; }
  /* The margin is what makes the window "a little taller" than the card. */
  .st-est.is-ready .st-est__sum { align-self: start; margin-bottom: var(--space-2xl); }
}
@media (max-width: 60rem) {
  .st-est.is-ready .st-est__form { max-height: min(60svh, 34rem); }
}
@media (prefers-reduced-motion: reduce) {
  .st-est.is-ready .st-est__form { transition: none; }
}
.st-est__group + .st-est__group { margin-top: var(--space-2xl); }
.st-est__legend { padding: 0; margin-bottom: var(--space-xs); font-family: var(--font-display); font-size: var(--text-title); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); }
.st-est.is-ready .st-est__legend { display: none; }
.st-est__sub { margin: var(--space-lg) 0 var(--space-3xs); font-size: var(--text-md); font-weight: var(--weight-strong); line-height: 1.4; color: var(--color-ink-2); }
.st-est__sub:first-of-type { margin-top: var(--space-md); }

.st-est__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-md);
  min-height: 56px; padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); cursor: pointer;
  /* The Bricks theme styles every <label> grey and 18px; the row states its own. */
  color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); font-weight: 400; line-height: 1.4;
}
/* A listed price that cannot be added (dollars only, "за запитом"): no checkbox, so its name starts where the others do. */
.st-est__row--info { grid-template-columns: minmax(0, 1fr) auto; padding-left: calc(22px + var(--space-md)); cursor: default; }
.st-est__check { width: 22px; height: 22px; margin: 0; accent-color: var(--color-accent); cursor: pointer; }
.st-est__check:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.st-est__name { font-size: var(--text-md); line-height: 1.4; }
.st-est__price { font-size: var(--text-md); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--color-ink-2); }
.st-est__row:has(.st-est__check:checked) .st-est__name { font-weight: var(--weight-strong); }

/* The estimate: a tinted well, the total at display size. */
.st-est__sum { position: sticky; top: var(--space-xl); min-width: 0; padding: var(--space-xl); border-radius: var(--radius-card); background: var(--color-paper-2); }
.st-est__sum-title { margin: 0; font-family: var(--font-display); font-size: var(--text-title); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.2; }
.st-est__empty { margin: var(--space-md) 0 0; color: var(--color-muted); }
.st-est__lines { margin: var(--space-md) 0 0; padding: 0; list-style: none; }
.st-est__lines[hidden], .st-est__empty[hidden] { display: none; }
.st-est__lines li { display: flex; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) 0; border-top: var(--rule-hair) solid var(--color-rule); font-size: var(--text-md); line-height: 1.4; }
.st-est__lines li .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-est__total { display: flex; flex-direction: column; gap: var(--space-3xs); margin: var(--space-lg) 0 0; padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-ink); }
.st-est__total-label { font-weight: var(--weight-strong); }
.st-est__total-value { font-family: var(--font-display); font-size: var(--text-display-s); font-weight: var(--display-weight); letter-spacing: var(--tracking-display); line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.st-est__note { margin: var(--space-md) 0 0; max-width: 40ch; font-size: var(--text-sm); line-height: 1.5; color: var(--color-muted); }
.st-est__cta { display: flex; width: 100%; margin-top: var(--space-lg); }

@media (max-width: 60rem) {
  .st-est { grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
  .st-est__sum { position: static; padding: var(--space-lg); }
}
