.prices-page { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }

.prices-page [aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
  color: white;
}

.price-main {
  display: block;
  max-width: 1160px;
  margin-inline: auto;
  padding: clamp(34px, 6vw, 88px) 0 80px;
  width: calc(100% - var(--edge) * 2);
}

.price-intro {
  animation: appear var(--enter) var(--ease) both;
}

.price-intro > p {
  margin: 16px 0 clamp(22px, 4vw, 42px);
}

.materials {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.material-card {
  position: relative;
  display: grid;
  min-height: clamp(140px, 19vw, 235px);
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--panel);
  background: var(--ink);
  color: white;
}

.material-card > img,
.material-card::before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.material-card > img {
  object-fit: cover;
  z-index: -2;
  filter: saturate(.82) brightness(1.08);
  transition: transform 350ms var(--ease);
}

.material-card::before {
  content: "";
  z-index: -1;
  background:
    linear-gradient(transparent 36%, rgba(30, 14, 32, .88)),
    linear-gradient(135deg, #e89bc33b, #ffd5b020 65%);
}

.material-card > span {
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  font-size: clamp(16px, 2vw, 24px);
  font-weight: 800;
}

.material-card:is(:hover, :focus-visible) img { transform: scale(1.04); }

.price-list {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  margin-top: clamp(36px, 6vw, 80px);
}

.price-group {
  display: block;
  padding: clamp(12px, 3vw, 30px);
  scroll-margin-top: 18px;
  border: 1px solid #ffffffb8;
  border-radius: var(--panel);
  background: #fff8f1b8;
  backdrop-filter: blur(15px) saturate(130%);
  box-shadow: inset 0 1px 0 #fff9, 0 8px 28px #743a5a12;
}

.price-group:target h2 { color: var(--accent); }
#group-2 h2 { color: #000; }

.price-group h2 {
  margin: 4px 0 18px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.category-cart-status {
  margin: 0 0 16px;
  color: #60505a;
  font-size: 14px;
}

.price-group table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(14px, 1.5vw, 17px);
}

.price-group :is(th, td) {
  padding: 9px clamp(4px, 1.2vw, 14px);
  text-align: left;
  border-bottom: 1px solid #f0e3dc;
}

.price-group thead { background: #fff8f175; color: #554c57; }
.price-group tr > :nth-child(2) { width: 31%; text-align: right; overflow-wrap: anywhere; }
.has-category-items tr > :nth-child(2) { width: 16%; }
.price-summary-heading { width: 45%; }
.price-summary-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.price-summary-values small { display: block; color: #60505a; font-size: 12px; }
.price-summary-values strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.row-cart-button {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--accent-hover);
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
}
.row-cart-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.price-group tbody tr:last-child > * { border-bottom: 0; }
.price-group tbody tr { transition: background-color var(--hover); }
.price-group tbody tr:hover { background: #fff8f18c; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .material-card, .price-group tbody tr {
    transition: transform 180ms var(--ease), background-color 180ms var(--ease);
  }
  .material-card:hover { transform: scale(1.025); }
  .price-group tbody tr:hover { transform: scale(1.012); }
}

.product {
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.5vw, 16px);
  overflow-wrap: anywhere;
}

.product img {
  flex: none;
  width: clamp(46px, 7vw, 72px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.price-note { color: #60505a; }

.price-group tbody tr:has(.product-button) { cursor: pointer; }
.product-button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.prices-page button { cursor: pointer; }
.prices-page [hidden] { display: none; }
.prices-page button:focus-visible,
.prices-page input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.price-modal {
  width: min(calc(100% - 32px), 490px);
  max-height: calc(100% - 32px);
  padding: clamp(16px, 4vw, 30px);
  border: 1px solid white;
  border-radius: var(--panel);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 15px 60px #17182948;
}

.price-modal[open] { animation: appear 220ms var(--ease) both; }
.price-modal::backdrop { background: #17182975; backdrop-filter: blur(4px); }
.price-modal h2 { margin: 8px 44px 8px 0; line-height: 1.15; }
.price-modal p { margin: 10px 0 18px; font-size: 15px; }
.preview-image { object-fit: cover; border-radius: 12px; }
.close-dialog { position: absolute; top: 12px; right: 12px; }
.close-dialog button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--pill);
  background: #f5e2da;
  color: var(--ink);
  font-size: 24px;
}

.estimate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.estimate-fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 800; }
.estimate-fields input {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: 500 16px Manrope, Arial, sans-serif;
}
.estimate-fields input[readonly] { background: #f4e3db; color: var(--ink); }

.estimate-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: #f9e7df;
}

.estimate-total :is(output, strong) { font-size: 20px; font-weight: 800; }
.price-modal .estimate-note { color: #60505a; font-size: 13px; }
.price-modal .action { border: 0; font: 800 15px Manrope, Arial, sans-serif; }
.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-items li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: transform 180ms var(--ease), background-color 180ms var(--ease);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .cart-items li:hover { transform: scale(1.02); background: #f9e7df; }
}
.cart-items li > div { flex: 1 1 160px; }
.cart-items small { display: block; color: #60505a; }
.cart-items button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
}
.cart-next { display: grid; gap: 14px; margin-top: 16px; }
.cart-next fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
.cart-next legend { padding: 0 0 6px; font-size: 14px; font-weight: 800; }
.cart-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #f5e2da;
}
.cart-switch label { position: relative; cursor: pointer; }
.cart-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cart-switch span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px;
  border-radius: 10px;
  font-size: 14px;
  text-align: center;
}
.cart-switch input:checked + span { background: #fffdfa; color: var(--accent-hover); font-weight: 800; }
.cart-switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.cart-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-actions button { flex: 1 1 150px; justify-content: center; text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.prices-page) { scroll-behavior: smooth; }
}

@media (max-width: 680px) {
  .prices-page nav { flex-wrap: wrap; }
  .prices-page nav .glass { padding-inline: 10px; }
  .materials { grid-template-columns: 1fr; }
  .material-card { min-height: 114px; }
  .price-group tr > :nth-child(2) { width: 36%; }
}
@media (max-width: 860px) {
  .has-price-summaries tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(84px, 30%);
    align-items: center;
    border-bottom: 1px solid #f0e3dc;
  }
  .has-price-summaries tr > :nth-child(2) { width: auto; }
  .has-price-summaries tr > * { min-width: 0; border-bottom: 0; }
  .price-summary-heading, .price-summary:empty { display: none; }
  .price-summary {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    border-radius: 10px;
    background: #fff8f175;
  }
  .price-summary-values { font-size: 13px; }
}
@media (max-width: 360px) {
  .price-summary-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-cart-button { grid-column: 1 / -1; justify-self: end; }
}
@media (min-width: 681px) and (max-width: 860px) {
  .prices-page header { flex-wrap: wrap; }
  .prices-page nav { order: 3; width: 100%; }
}
