:root {
  color-scheme: light;
  --violet: #26243b;
  --mint: #57d1ce;
  --teal: #086e75;
  --ink: #253342;
  --muted: #526571;
  --paper: #fff;
  --surface: #f3f6f8;
  --line: #dce5e9;
  --header: linear-gradient(90deg, #293f4c, #2b2741 84%);
  font: 1rem/1.5 "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 91px; }
body { margin: 0; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.17; letter-spacing: -.027em; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.masthead :focus-visible, .site-footer :focus-visible { outline-color: var(--mint); }
.wrap { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 4; padding: 10px 16px; background: var(--paper); transform: translateY(-155%); }
.skip-link:focus { transform: none; }
.icon { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.masthead { position: sticky; top: 0; z-index: 2; background: var(--header); color: #f7f7fb; border-bottom: 1px solid #ffffff23; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand img { width: 118px; height: auto; }
.brand span { border-left: 1px solid #ffffff40; color: #e1eaee; padding-left: 14px; font-size: .9rem; font-weight: 600; }
.top-nav { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 36px); font-size: .91rem; }
.top-nav a, .top-nav button, .site-footer button, .site-footer a { color: inherit; background: none; border: 0; padding: 0; text-decoration: none; }
.top-nav a, .top-nav button { display: inline-flex; align-items: center; min-height: 40px; white-space: nowrap; }
.top-nav [hidden] { display: none; }
.top-nav :is(a,button):hover, .top-nav a[aria-current], .site-footer :is(a,button):hover { color: #98eeea; }
.top-nav a[aria-current] { font-weight: 700; }
.cart-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 11px; min-height: 43px; border: 1px solid #57d1ce70; border-radius: 7px; background: #57d1ce0f; color: #f5fcfc; font-size: .89rem; font-weight: 650; }
.cart-toggle:hover { background: #57d1ce29; }
.cart-toggle .icon { color: #9fe9e7; }
.cart-count { min-width: 22px; padding: 1px 5px; border-radius: 20px; background: var(--mint); color: #212d3c; text-align: center; font-size: .8rem; }

.intro { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 7% 115%, #28606a 0%, transparent 68%), var(--header); color: #faf9fc; }
.intro::before { content: ""; position: absolute; z-index: -1; inset: 0 0 0 44%; background: url('assets/pcb-layout.webp') center 47% / cover no-repeat; opacity: .56; mask-image: linear-gradient(90deg, transparent 1%, #000 67%); }
.intro-inner { padding-block: 25px 28px; }
.eyebrow { color: #9be7e3; text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; font-weight: 750; }
.intro h1 { margin-top: 5px; font-size: clamp(2.25rem, 4.75vw, 3.12rem); font-weight: 700; }
.intro p:last-child { max-width: 62ch; margin-top: 7px; color: #ebeff5; font-size: 1.02rem; }
.demo-bar { background: #e7f3f3; color: #35555e; border-bottom: 1px solid #d4e7e9; font-size: .85rem; }
.demo-bar .wrap { display: flex; align-items: baseline; gap: 8px; padding-block: 9px; }
.demo-dot { flex: 0 0 6px; height: 6px; border-radius: 50%; align-self: center; background: #0b777c; }
.demo-bar strong { white-space: nowrap; }

.shop-layout { display: grid; grid-template-columns: 225px minmax(0, 1fr); gap: 28px; padding-block: 27px 64px; }
.sidebar { display: grid; align-content: start; gap: 16px; }
.categories, .help-box { background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.categories h2 { padding: 16px 15px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
.categories nav { display: grid; padding: 6px; }
.category { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; min-height: 43px; border: 0; border-radius: 5px; font-size: .91rem; text-align: left; background: none; }
.category:hover { background: #f0f6f7; }
.category[aria-pressed="true"] { color: #075b60; background: #e3f4f3; font-weight: 700; }
.category-count { color: var(--muted); font-size: .77rem; }
.help-box { padding: 15px; }
.help-box h2 { font-size: .99rem; }
.help-box p { margin: 7px 0 9px; font-size: .87rem; color: var(--muted); }
.help-box a, .content-link { color: var(--teal); font-weight: 650; text-underline-offset: .19em; }
.help-box a { font-size: .87rem; }
.catalog-heading, .catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.catalog-heading h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); }
.search-field { display: flex; align-items: center; gap: 6px; min-width: 0; width: min(100%, 260px); padding-inline: 11px; border: 1px solid #cad7de; border-radius: 7px; background: var(--paper); color: var(--muted); }
.search-field:focus-within { outline: 2px solid var(--teal); outline-offset: 2px; }
.search-field input { min-width: 0; width: 100%; min-height: 41px; border: 0; outline: none; color: var(--ink); font-size: .91rem; }
.search-field input::placeholder { color: var(--muted); }
.catalog-toolbar { padding: 10px 0 13px; font-size: .85rem; color: var(--muted); }
.sort-field { display: flex; align-items: center; gap: 8px; }
.sort-field select { min-height: 34px; color: var(--ink); border: 1px solid #cad7de; border-radius: 6px; background: var(--paper); padding-inline: 7px; }

.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-card { display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); overflow: hidden; box-shadow: 0 2px 3px #26243b07; }
.product-card:hover { border-color: #a4c8cb; }
.product-image { display: block; width: 100%; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: #eaf2f4; }
.product-image:focus-visible { outline-offset: -4px; }
.product-image img { width: 100%; aspect-ratio: 2; object-fit: cover; }
.card-body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 7px; padding: 14px; }
.card-category { color: var(--teal); font-size: .73rem; font-weight: 750; }
.product-title { font-size: 1.04rem; }
.product-title button { background: none; border: 0; text-align: left; padding: 0; font-weight: 700; line-height: 1.23; }
.product-title button:hover { color: var(--teal); text-decoration: underline; text-underline-offset: .14em; }
.description { color: var(--muted); font-size: .87rem; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid #ebeff2; }
.price { color: var(--violet); font-size: 1.25rem; font-weight: 750; letter-spacing: -.025em; white-space: nowrap; }
.tax-label { display: block; font-size: .71rem; color: var(--muted); }
.add-button, .button, .button-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 7px 12px; font-size: .88rem; font-weight: 700; text-decoration: none; }
.add-button, .button { background: var(--mint); color: #173439; }
.add-button { padding-inline: 9px; }
.add-button .icon { width: 16px; height: 16px; }
.add-button:hover, .button:not(:disabled):hover { background: #86e1de; }
.button:disabled { background: #e2e8eb; color: #4e626e; }
.button-secondary { border-color: #c9d7df; background: var(--paper); }
.button-secondary:hover { background: var(--surface); }
.empty { grid-column: 1 / -1; display: grid; justify-items: start; gap: 9px; padding: 25px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }

.site-footer { color: #f0f7f8; background: var(--header); font-size: .88rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; padding-block: 28px; }
.site-footer p { color: #cad7e0; margin-top: 4px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 21px; }
.site-footer span { color: var(--mint); }
.shop-legal { padding-block: 32px 64px; max-width: 720px; }
.shop-legal h1 { margin: 18px 0 12px; }
.shop-legal p + p { margin-top: 12px; }

dialog { width: min(580px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 22px 65px #17203650; }
dialog::backdrop { background: #161625a8; }
body:has(dialog[open]) { overflow: hidden; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper); }
.dialog-header h2 { font-size: clamp(1.24rem, 4vw, 1.55rem); }
.close-button { width: 38px; height: 38px; font-size: 1.5rem; line-height: 1; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.dialog-content { display: grid; gap: 14px; padding: 20px; }
.dialog-content p { font-size: .94rem; }
.dialog-content .product-illustration { width: 100%; max-height: 195px; object-fit: cover; border-radius: 7px; }
.notice { padding: 10px 12px; color: #385962; background: #e8f5f5; border-radius: 6px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cart-lines, .checkout-lines { margin: 0; padding: 0; list-style: none; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding-block: 11px; border-bottom: 1px solid var(--line); }
.line-name { font-weight: 650; overflow-wrap: anywhere; }
.line-unit { display: block; color: var(--muted); font-size: .81rem; }
.quantity { display: inline-flex; align-items: center; gap: 7px; }
.quantity output { min-width: 20px; text-align: center; }
.quantity button { min-width: 34px; min-height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 5px; }
.remove-line { justify-self: end; padding: 3px 0; background: none; border: none; font-size: .81rem; color: var(--teal); text-decoration: underline; }
.checkout-lines li, .summary > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.checkout-lines li { padding-block: 7px; border-bottom: 1px solid var(--line); }
.summary { display: grid; gap: 4px; margin: 0; }
.summary dd { margin: 0; white-space: nowrap; }
.summary .total { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); font-weight: 750; color: var(--violet); }
.checkout-form { display: grid; gap: 12px; }
.checkout-form fieldset { margin: 0; padding: 3px 10px 8px; border: 1px solid var(--line); border-radius: 6px; }
.checkout-form legend { font-weight: 650; font-size: .9rem; padding-inline: 4px; }
.delivery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.delivery label { display: grid; gap: 4px; font-size: .85rem; }
.checkout-form .delivery input { min-width: 0; width: 100%; padding: 6px 8px; border: 1px solid #cad7de; border-radius: 5px; }
.checkout-error { color: #8b2b22; }
.checkout-error:empty { display: none; }
.payment-options { display: flex; flex-wrap: wrap; gap: 0 15px; }
.payment-options label, .terms-check { display: flex; align-items: center; gap: 8px; min-height: 38px; font-size: .89rem; }
.terms-check { align-items: start; padding-top: 6px; }
.checkout-form input { margin: 0; accent-color: var(--teal); }
.terms-check input { flex: none; margin-top: 4px; }
.project-scope { margin: 0; padding-left: 21px; }
.toast { position: fixed; z-index: 3; right: 20px; bottom: 20px; max-width: min(390px, calc(100% - 40px)); padding: 11px 16px; border-radius: 7px; background: var(--violet); color: white; box-shadow: 0 6px 20px #17152542; font-size: .9rem; pointer-events: none; }
.toast:empty { padding: 0; box-shadow: none; }

@media (max-width: 1060px) {
  .shop-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 750px) {
  html { scroll-padding-top: 12px; }
  .wrap { width: calc(100% - 34px); }
  .masthead { position: static; }
  .header-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding-top: 8px; }
  .brand { gap: 9px; }
  .brand img { width: 98px; }
  .brand span { padding-left: 9px; font-size: .79rem; }
  .cart-toggle { grid-column: 2; grid-row: 1; }
  .top-nav { grid-column: 1 / -1; grid-row: 2; gap: 20px; }
  .intro-inner { padding-block: 21px 25px; }
  .intro::before { left: 20%; opacity: .25; }
  .intro p:last-child { font-size: .97rem; }
  .shop-layout { grid-template-columns: 1fr; padding-block: 19px 45px; }
  .categories h2 { font-size: .98rem; padding: 11px; }
  .categories nav { display: flex; flex-wrap: wrap; }
  .category { min-height: 39px; gap: 5px; font-size: .83rem; }
  .help-box { display: none; }
  .demo-bar .wrap { flex-wrap: wrap; gap: 3px 7px; }
  .demo-divider { display: none; }
  .demo-bar .wrap > :last-child { flex-basis: 100%; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 500px) {
  .catalog-heading { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .sort-field label { font-size: .78rem; }
  .products { gap: 10px; }
  .card-body { padding: 10px; }
  .product-title { font-size: .95rem; }
  .description { font-size: .8rem; }
  .card-bottom { align-items: stretch; flex-direction: column; }
  .add-button { justify-content: center; }
  .price { font-size: 1.12rem; }
}
@media (max-width: 440px) {
  .brand span { display: none; }
  .delivery { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 340px) {
  .cart-toggle { gap: 5px; padding-inline: 7px; }
  .products { grid-template-columns: minmax(0, 1fr); }
  .top-nav { gap: 12px; }
}
