:root {
  --night: #111b2d;
  --navy: #18263c;
  --ink: #142137;
  --muted: #536176;
  --red: #ba352e;
  --red-dark: #a12a24;
  --paper: var(--white);
  --soft: #f1f5fa;
  --rule: #dce4ee;
}

.site-header { background: var(--white); }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--red); }
.button.secondary:hover { background: var(--soft); border-color: #b5c2d2; }
.site-footer { background: var(--night); border-color: var(--navy); color: #d6e0ed; }
.site-footer a:focus-visible { outline-color: #ff9e97; }

.shop { padding-block: 20px 65px; min-height: 72vh; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); margin-bottom: 23px; }
.crumb a:hover { text-decoration: underline; }
.shop-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.shop-heading h1 { font-size: clamp(2.5rem, 6vw, 5.1rem); letter-spacing: -.045em; line-height: 1.01; }
.shop-heading p { color: var(--muted); margin-top: 9px; }
.pricing { border-left: 2px solid var(--red); padding: 0 0 0 13px; min-width: 160px; flex: 0 0 auto; }
.pricing p { margin: 0; font-size: .86rem; }
.pricing p strong { color: var(--ink); }
.text-link { display: inline-block; color: var(--red); background: none; padding: 0; border: 0; font-weight: 700; font-size: .86rem; text-align: left; }
.text-link:hover { text-decoration: underline; }
.switch { display: inline-flex; background: var(--soft); border-radius: var(--control-radius); padding: 3px; margin-top: 5px; gap: 3px; }
.switch button { background: transparent; border: 0; border-radius: var(--control-radius); padding: 5px 10px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.switch button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.catalog-pricing-store { display: grid; gap: 4px; width: min(260px, 100%); margin-top: 9px; }
.catalog-pricing-store label { font-size: .82rem; font-weight: 700; }
.catalog-pricing-store select { width: 100%; min-height: 38px; border: 1px solid var(--rule); border-radius: var(--control-radius); background: var(--white); color: var(--ink); padding: 6px 9px; }
.catalog-pricing-store p { color: var(--muted); font-size: .75rem; }
.product-price .catalog-price-placeholder { max-width: 100%; color: var(--muted); font-size: .82rem; font-weight: 700; }

.product-tools { display: flex; justify-content: space-between; align-items: end; gap: 16px; padding-block: 13px; border-block: 1px solid var(--rule); }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 680px; min-width: 0; gap: 9px; }
.category-label { display: grid; gap: 4px; min-width: 0; font-size: .82rem; font-weight: 700; }
.category-select { border: 1px solid var(--rule); border-radius: var(--control-radius); background: var(--white); color: var(--ink); min-height: 40px; min-width: 0; width: 100%; padding: 7px 9px; font-size: .84rem; font-weight: 500; text-overflow: ellipsis; }
.category-select:disabled { background: var(--soft); color: var(--muted); opacity: 1; }
.search { flex: 0 1 325px; min-width: 0; display: block; }
.search input, .checkout-fields input, .checkout-fields select { border-radius: var(--control-radius); border: 1px solid var(--rule); background: var(--soft); min-height: 40px; width: 100%; padding: 7px 11px; color: var(--ink); }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 55px; font-size: .84rem; color: var(--muted); }
.stock-mode { font-size: .76rem; margin-top: 1px; }
.results-bar select { background: transparent; min-height: 34px; color: var(--ink); border: 0; border-radius: var(--control-radius); font-weight: 700; font-size: .84rem; }
.products { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; align-items: start; }
.product { display: flex; flex-direction: column; min-width: 0; background: var(--white); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.product-media { background: var(--white); border-bottom: 1px solid var(--rule); padding: 10px 15px; }
.product-media img { width: 100%; height: clamp(130px, 13vw, 195px); object-fit: contain; }
.product-content { display: flex; flex-direction: column; flex: 1; padding: 13px; }
.product .eyebrow { font-size: .64rem; letter-spacing: .09em; }
.product-classification { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; overflow-wrap: anywhere; }
.product-classification span + span::before { content: "›"; margin-right: 5px; }
.product h2 { margin: 3px 0; font: 700 1.13rem/1.18 var(--display); letter-spacing: -.025em; }
.product h2, .product-reference { overflow-wrap: anywhere; }
.product-reference { color: var(--muted); font-size: .75rem; }
.product-description { margin-top: 8px; color: var(--muted); font-size: .8rem; }
.stock-details { margin-top: 12px; border-top: 1px solid var(--rule); font-size: .79rem; }
.stock-details summary { display: flex; align-items: center; gap: 5px; cursor: pointer; padding-top: 8px; font-weight: 700; }
.stock-details summary::before { content: ''; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); margin-right: 4px; flex-shrink: 0; }
.stock-details[open] summary::before { transform: rotate(135deg); }
.stock-details summary:hover { color: var(--red-dark); }
.stock-count { margin-left: auto; padding: 1px 5px; border-radius: 4px; background: #e2ebe3; color: #2d6341; }
.stock-count.unavailable { background: var(--soft); color: var(--muted); }
.store-stock { margin: 3px 0 0; padding-top: 4px; }
.store-stock div { display: flex; justify-content: space-between; gap: .4rem; padding-block: 3px; }
.store-stock div + div { border-top: 1px solid var(--rule); }
.store-stock dd { margin: 0; text-align: right; }
.store-stock .in-stock { color: #2d6341; font-weight: 700; }
.store-stock .out-of-stock { color: var(--muted); }
.product-bottom { margin-top: auto; padding-top: 15px; }
.product-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; margin-bottom: 9px; }
.product-price strong { font: 700 1.44rem/1 var(--display); }
.product-price span { color: var(--muted); font-size: .7rem; }
.product-price .client-value { color: var(--red); }
.product-bottom .button { min-height: 38px; }
.product-bottom .button:disabled, .pagination .button:disabled { cursor: default; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; column-gap: 13px; row-gap: 5px; margin-top: 20px; font-size: .88rem; }
.notice { border: 1px solid var(--rule); border-radius: 6px; padding: 27px; }
.notice p { margin: 4px 0 13px; color: var(--muted); }
.count { display: inline-flex; justify-content: center; align-items: center; min-width: 22px; min-height: 22px; padding-inline: 3px; border-radius: 4px; background: #ffffff2e; font-size: .77rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.modal { border: 1px solid var(--rule); border-radius: 8px; padding: 0; width: min(440px, calc(100vw - 26px)); max-height: calc(100dvh - 26px); margin: auto; color: var(--ink); background: var(--paper); }
.modal::backdrop { background: #111b2d80; }
.modal-inner { position: relative; padding: 27px; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.icon-button { display: inline-grid; place-items: center; border: 1px solid var(--rule); border-radius: var(--control-radius); width: 34px; height: 34px; font-size: 1.35rem; line-height: 1; background: var(--soft); }
.icon-button:hover { border-color: var(--ink); }
.modal h2 { font: 700 clamp(1.65rem, 5vw, 2rem)/1.06 var(--display); letter-spacing: -.04em; margin: 7px 24px 12px 0; }
.form-description { margin-block: 0 14px; color: var(--muted); font-size: .9rem; }
.form-error { margin-block: 5px 10px; color: var(--red-dark); }
.drawer { width: min(460px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0 0 0 auto; border-radius: 0; border: 0; }
.cart-row { display: grid; grid-template-columns: 1fr auto auto; align-items: start; gap: 10px; padding-block: 10px; border-top: 1px solid var(--rule); }
.cart-row:nth-child(1) { margin-top: 15px; }
.cart-row h3 { font-size: .96rem; line-height: 1.25; }
.cart-row p { color: var(--muted); font-size: .78rem; }
.qty { display: inline-flex; align-items: center; gap: 3px; font-size: .84rem; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--rule); border-radius: var(--control-radius); background: transparent; }
.qty button:hover { border-color: var(--ink); }
.qty span { min-width: 20px; text-align: center; }
.line-total { font-size: .9rem; text-align: right; white-space: nowrap; }
.total { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--rule); padding-block: 10px 3px; font-weight: 700; }
.total strong { font: 700 1.6rem/1.15 var(--display); }
.checkout-fields { padding: 11px 0 0; margin: 14px 0 14px; border: 0; border-top: 1px solid var(--rule); }
.checkout-fields legend { font-size: .94rem; font-weight: 700; padding-right: 8px; }
.checkout-fields label { display: block; font-size: .84rem; font-weight: 700; margin-bottom: 3px; }
.checkout-fields label span { font-weight: 400; color: var(--muted); }
.checkout-fields :is(input, select) + label { margin-top: 9px; }
.pickup-availability { margin: 5px 0 0; }
.pickup-availability.insufficient { color: var(--red-dark); }
.store-address { font-size: .82rem; color: var(--muted); margin-top: 3px; }
#checkout-submit:disabled { cursor: default; }
.demo-note { color: var(--muted); font-size: .76rem; margin-top: 7px; }
.order-success { border-top: 1px solid var(--rule); padding-top: 20px; }
.success-mark { background: #e2ebe3; color: #2d6341; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-size: 1.35rem; }
.order-success h3 { margin-top: 12px; font-size: 1.3rem; }
.order-success p { color: var(--muted); margin: 3px 0 13px; overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 16px; right: 16px; max-width: min(90vw, 370px); padding: 8px 14px; border-radius: 5px; background: var(--night); color: var(--white); font-size: .84rem; z-index: 2; box-shadow: 0 4px 18px #111b2d30; }

@media (max-width: 970px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop-heading h1 { max-width: 17ch; }
}
@media (max-width: 740px) {
  .shop-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 20px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-tools { gap: 10px; flex-direction: column-reverse; align-items: stretch; }
  .filters, .search { flex-basis: auto; }
  .product h2 { font-size: 1rem; }
  .product-description { display: none; }
}
@media (max-width: 390px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .category-label:last-child { grid-column: 1 / -1; }
  .product-content { padding-inline: 8px; }
  .product .button { padding-inline: 8px; }
  .modal-inner { padding: 21px; }
}
