/* Electronics store — builds on the public site tokens in website/css/public.css */

.store-site { --store-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ── Store bar ─────────────────────────────────────────── */
.store-bar { background: var(--pub-deep); color: #fff; position: sticky; top: 64px; z-index: 1010; }
.store-bar-inner { display: flex; align-items: center; gap: 1rem; padding: .55rem 0; }
.store-bar-brand { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.store-bar-brand:hover { color: var(--pub-mint-2); }
.store-search { flex: 1; display: flex; align-items: center; gap: .5rem; background: #fff; border-radius: var(--pub-radius-sm); padding: .2rem .25rem .2rem .7rem; max-width: 720px; }
.store-search i { color: var(--pub-muted); }
.store-search input { flex: 1; border: 0; outline: 0; min-width: 0; padding: .3rem 0; color: var(--pub-ink); background: transparent; }
.store-cart-link { color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; font-weight: 600; }
.store-cart-link:hover { color: var(--pub-mint-2); }
.store-cart-count { background: var(--pub-amber); color: #1b1300; border-radius: 999px; padding: 0 .45rem; font-size: .8rem; font-weight: 700; }

/* ── Hero ──────────────────────────────────────────────── */
.store-hero { background: linear-gradient(135deg, var(--pub-mint) 0%, #fff 70%); padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--pub-line); }
.store-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 800; color: var(--pub-deep); max-width: 22ch; }
.store-hero .lead { color: var(--pub-ink-soft); max-width: 60ch; }
.store-hero-search { display: flex; gap: .5rem; max-width: 680px; margin: 1.5rem 0 1rem; }
.store-hero-search input { flex: 1; min-width: 0; border: 1px solid var(--pub-line); border-radius: var(--pub-radius-sm); padding: .75rem 1rem; font-size: 1.05rem; box-shadow: var(--pub-shadow-sm); }
.store-hero-search input:focus { outline: 2px solid var(--pub-green); outline-offset: 1px; }
.store-hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: var(--pub-ink-soft); font-size: .95rem; }
.store-hero-points i { color: var(--pub-green); margin-right: .3rem; }

/* ── Category grid & cards ─────────────────────────────── */
.store-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.store-category-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); background: #fff; text-decoration: none; color: var(--pub-ink); transition: box-shadow var(--pub-transition), border-color var(--pub-transition); }
.store-category-card:hover { box-shadow: var(--pub-shadow); border-color: var(--pub-green); color: var(--pub-deep); }
.store-category-card img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.store-category-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--pub-mint); color: var(--pub-green-mid); font-size: 1.35rem; }
.store-category-card small { color: var(--pub-muted); }

.store-sku-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.store-sku-card { background: #fff; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); padding: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.store-sku-card p { margin: 0; color: var(--pub-ink-soft); font-size: .92rem; flex: 1; }
.store-sku-card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }

.store-coming-soon { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; padding: 1.75rem; border: 1px dashed var(--pub-green); border-radius: var(--pub-radius); background: var(--pub-surface); }
.store-coming-soon h2 { font-size: 1.4rem; }

/* ── Listing ───────────────────────────────────────────── */
.store-crumbs { font-size: .88rem; color: var(--pub-muted); margin-bottom: .5rem; }
.store-crumbs a { color: var(--pub-green-mid); }
.store-listing h1, .store-product-layout h1 { font-weight: 800; color: var(--pub-deep); font-size: clamp(1.5rem, 2.6vw, 2.2rem); }
.store-h1-sm { font-weight: 800; color: var(--pub-deep); font-size: 1.6rem; margin-bottom: 1rem; }
.store-h2 { font-size: 1.3rem; font-weight: 700; margin-top: 2rem; color: var(--pub-deep); }
.store-listing-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
.store-filters { position: sticky; top: 125px; max-height: calc(100vh - 140px); overflow: auto; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); padding: 1rem; background: #fff; }
.store-filter-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.store-filter-head a { font-size: .85rem; color: var(--pub-green-mid); }
.store-filter-toggle { display: flex; gap: .5rem; align-items: center; font-weight: 600; padding-bottom: .75rem; border-bottom: 1px solid var(--pub-line); width: 100%; }
.store-facet { border: 0; padding: .75rem 0 0; margin: 0; }
.store-facet legend { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--pub-muted); margin-bottom: .35rem; float: none; }
.store-facet-options { max-height: 210px; overflow: auto; display: flex; flex-direction: column; gap: .1rem; }
.store-facet-options label { display: flex; align-items: center; gap: .45rem; font-size: .92rem; padding: .15rem .2rem; border-radius: 4px; cursor: pointer; }
.store-facet-options label:hover { background: var(--pub-surface); }
.store-facet-options span { flex: 1; font-family: var(--store-mono); font-size: .88rem; }
.store-facet-options small { color: var(--pub-muted); }
.store-results-head { display: flex; justify-content: space-between; margin-bottom: .6rem; color: var(--pub-ink-soft); }
.store-results.htmx-request { opacity: .55; transition: opacity 120ms; }

/* ── Tables ────────────────────────────────────────────── */
/* position: relative keeps absolutely-positioned children (e.g. visually-hidden button
   labels) inside the scroll box; otherwise they widen the whole page on mobile. */
.store-table-wrap { position: relative; overflow-x: auto; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); background: #fff; }
.store-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.store-table th { background: var(--pub-surface); color: var(--pub-ink-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: .6rem .75rem; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--pub-line); }
.store-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--pub-line); vertical-align: middle; }
.store-table tbody tr:last-child td { border-bottom: 0; }
.store-table tbody tr:hover { background: #fbfdfd; }
.store-table .num { text-align: right; white-space: nowrap; }
.store-part-cell { min-width: 180px; }
.store-part-cell small { display: block; color: var(--pub-muted); font-size: .8rem; }
.store-part-link { font-family: var(--store-mono); font-weight: 700; color: var(--pub-deep); text-decoration: none; }
.store-part-link:hover { color: var(--pub-green); text-decoration: underline; }
.store-sku-code { font-family: var(--store-mono); }
.store-price { font-weight: 700; color: var(--pub-ink); }
.store-empty { text-align: center; color: var(--pub-muted); padding: 2rem !important; }

.store-stock { font-size: .82rem; font-weight: 600; white-space: nowrap; }
.store-stock.in { color: #15803d; }
.store-stock.out { color: #b91c1c; }
.store-stock.sourced { color: #a16207; }

.store-add-cell { min-width: 140px; }
.store-add-form { display: flex; gap: .3rem; }
.store-add-form input { width: 76px; }
.store-add-result { font-size: .78rem; margin-top: .2rem; min-height: 1em; }
.store-unavailable { color: var(--pub-muted); font-size: .85rem; }
.store-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

/* ── Product ───────────────────────────────────────────── */
.store-product-layout { display: grid; grid-template-columns: minmax(220px, 340px) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: .5rem; }
.store-product-gallery { border: 1px solid var(--pub-line); border-radius: var(--pub-radius); background: #fff; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.store-product-gallery img { width: 100%; height: 100%; object-fit: contain; }
.store-product-placeholder { font-size: 4rem; color: var(--pub-line); }

/* ── Cart ──────────────────────────────────────────────── */
.store-cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.store-qty-form input { width: 86px; }
.store-summary { border: 1px solid var(--pub-line); border-radius: var(--pub-radius); padding: 1.25rem; background: var(--pub-surface); position: sticky; top: 125px; }
.store-summary h2 { font-size: 1.1rem; font-weight: 700; }
.store-summary dl { margin: 0 0 .75rem; }
.store-summary dl div { display: flex; justify-content: space-between; padding: .3rem 0; }
.store-summary dt { font-weight: 400; color: var(--pub-ink-soft); }
.store-summary dd { margin: 0; }
.store-summary-total { border-top: 1px solid var(--pub-line); margin-top: .3rem; padding-top: .6rem !important; font-size: 1.15rem; font-weight: 800; }
.store-summary-total dt { font-weight: 800; color: var(--pub-ink); }
.store-free-ship { color: var(--pub-green-mid); font-weight: 600; }
.store-empty-box { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--pub-line); border-radius: var(--pub-radius); }


/* ── Checkout ──────────────────────────────────────────── */
.store-steps { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.25rem; font-size: .88rem; color: var(--pub-muted); flex-wrap: wrap; }
.store-steps li { display: flex; align-items: center; gap: .5rem; }
.store-steps li + li::before { content: "›"; color: var(--pub-line); }
.store-steps li.done, .store-steps li.done a { color: var(--pub-green-mid); }
.store-steps li.current { color: var(--pub-deep); font-weight: 700; }
.store-checkout-form fieldset { border: 1px solid var(--pub-line); border-radius: var(--pub-radius); padding: 1.1rem 1.25rem 1.25rem; margin-bottom: 1rem; background: #fff; }
.store-checkout-form legend { float: none; width: auto; font-size: 1rem; font-weight: 700; padding: 0 .4rem; margin: 0 0 .25rem -.4rem; color: var(--pub-deep); }
.store-summary-items { list-style: none; padding: 0; margin: 0 0 .75rem; max-height: 260px; overflow: auto; border-bottom: 1px solid var(--pub-line); }
.store-summary-items li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; font-size: .9rem; }
.store-summary-items small { display: block; color: var(--pub-muted); font-size: .78rem; }
.store-pay-box { border: 1px solid var(--pub-line); border-radius: var(--pub-radius); padding: 1.25rem; background: #fff; }
.store-dev-box { border: 1px dashed #d97706; background: #fffbeb; border-radius: var(--pub-radius-sm); padding: .9rem 1rem; }
.store-order-head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.store-track { list-style: none; display: flex; padding: 0; margin: 0; counter-reset: step; }
.store-track li { position: relative; padding: 2rem .9rem 0; font-size: .82rem; color: var(--pub-muted); text-align: center; min-width: 84px; }
.store-track li::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--pub-surface); border: 2px solid var(--pub-line); font-weight: 700; font-size: .78rem; }
.store-track li.done { color: var(--pub-green-mid); font-weight: 600; }
.store-track li.done::before { content: "✓"; background: var(--pub-green); border-color: var(--pub-green); color: #fff; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 991px) {
    .store-bar { top: 56px; }
    .store-listing-layout, .store-cart-layout, .store-product-layout { grid-template-columns: minmax(0, 1fr); }
    .store-filters, .store-summary { position: static; max-height: none; }
}
@media (max-width: 640px) {
    .store-bar-inner { flex-wrap: wrap; }
    .store-search { order: 3; flex-basis: 100%; max-width: none; }
    .store-bar-brand { flex: 1; }
    .store-hero-search { flex-direction: column; }
}

/* ── PCB/IC early access & policies ───────────────────── */
.store-hero-compact { padding: 2.5rem 0 2rem; }
.store-services-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 2rem; align-items: start; }
.store-service-cards { display: grid; gap: 1rem; }
.store-service-cards article { display: grid; grid-template-columns: 44px 1fr; column-gap: 1rem; padding: 1.1rem; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); background: #fff; }
.store-service-cards .store-category-icon { grid-row: span 2; }
.store-service-cards h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .25rem; color: var(--pub-deep); }
.store-service-cards p { margin: 0; color: var(--pub-ink-soft); font-size: .92rem; }
.store-policy-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 2.5rem; align-items: start; }
.store-policy-nav { position: sticky; top: 125px; display: flex; flex-direction: column; gap: .15rem; border-left: 2px solid var(--pub-line); }
.store-policy-nav a { padding: .35rem .9rem; color: var(--pub-ink-soft); text-decoration: none; font-size: .92rem; margin-left: -2px; border-left: 2px solid transparent; }
.store-policy-nav a:hover { color: var(--pub-deep); }
.store-policy-nav a.active { color: var(--pub-deep); font-weight: 700; border-left-color: var(--pub-green); }
.store-policy h1 { font-size: 1.8rem; font-weight: 800; color: var(--pub-deep); }
.store-policy h2 { font-size: 1.15rem; font-weight: 700; margin-top: 1.75rem; color: var(--pub-deep); }
@media (max-width: 991px) {
    .store-services-layout, .store-policy-layout { grid-template-columns: minmax(0, 1fr); }
    .store-policy-nav { position: static; flex-direction: row; flex-wrap: wrap; border-left: 0; gap: .5rem; }
    .store-policy-nav a { border: 1px solid var(--pub-line); border-radius: 999px; margin: 0; }
    .store-policy-nav a.active { border-color: var(--pub-green); }
}

/* ── Guides on the home page ───────────────────────────── */
.store-guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.store-guide-card { display: flex; flex-direction: column; gap: .4rem; padding: 1.2rem; border: 1px solid var(--pub-line); border-radius: var(--pub-radius); background: #fff; color: var(--pub-ink); text-decoration: none; transition: box-shadow var(--pub-transition), border-color var(--pub-transition); }
.store-guide-card:hover { box-shadow: var(--pub-shadow); border-color: var(--pub-green); color: var(--pub-ink); }
.store-guide-card small { color: var(--pub-green-mid); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.store-guide-card strong { font-size: 1.05rem; line-height: 1.35; color: var(--pub-deep); }
.store-guide-card span { color: var(--pub-ink-soft); font-size: .92rem; }

/* ── Order tracking ────────────────────────────────────── */
.store-lookup-layout { display: grid; grid-template-columns: minmax(0, 640px) 320px; gap: 2rem; align-items: start; }
.store-milestones { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 0; margin: 1.75rem 0 0; }
.store-milestones li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; color: var(--pub-muted); font-size: .86rem; padding: 0 .25rem; }
.store-milestones li::before { content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px; background: var(--pub-line); }
.store-milestones li:first-child::before { display: none; }
.store-milestones li.done::before, .store-milestones li.current::before { background: var(--pub-green); }
.store-milestone-dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 3px solid var(--pub-line); font-weight: 700; font-size: .82rem; margin-bottom: .3rem; }
.store-milestones li.done { color: var(--pub-ink); }
.store-milestones li.done .store-milestone-dot { background: var(--pub-green); border-color: var(--pub-green); color: #fff; }
.store-milestones li.current { color: var(--pub-deep); }
.store-milestones li.current .store-milestone-dot { border-color: var(--pub-green); color: var(--pub-green-mid); box-shadow: 0 0 0 4px var(--pub-mint); }
.store-milestones small { color: var(--pub-muted); font-size: .76rem; }
.store-shipment dl { margin: 0 0 .75rem; display: grid; gap: .3rem; }
.store-shipment dl div { display: flex; gap: .75rem; }
.store-shipment dt { width: 130px; font-weight: 400; color: var(--pub-ink-soft); flex-shrink: 0; }
.store-shipment dd { margin: 0; font-weight: 600; }
.store-timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--pub-line); }
.store-timeline li { position: relative; padding: 0 0 1rem .9rem; }
.store-timeline li:last-child { padding-bottom: 0; }
.store-timeline li::before { content: ""; position: absolute; left: calc(-1.1rem - 6px); top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--pub-line); border: 2px solid #fff; }
.store-timeline li:first-child::before { background: var(--pub-green); }
.store-timeline time { display: block; font-size: .78rem; color: var(--pub-muted); }
.store-timeline p { margin: .15rem 0 0; color: var(--pub-ink-soft); font-size: .92rem; }
@media (max-width: 991px) { .store-lookup-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .store-milestones { grid-template-columns: 1fr; gap: .9rem; }
    .store-milestones li { flex-direction: row; text-align: left; gap: .6rem; align-items: center; }
    .store-milestones li::before { top: -1rem; left: 15px; right: auto; width: 3px; height: 1rem; }
    .store-milestone-dot { margin: 0; flex-shrink: 0; }
    .store-milestones small { margin-left: auto; }
}

/* ── Accounts ──────────────────────────────────────────── */
.store-account-narrow { max-width: 760px !important; }
.store-account-login { max-width: 460px !important; }
.store-account-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 2rem; align-items: start; margin-top: 1rem; }
.store-address-cards { display: grid; gap: .75rem; }
.store-billing-same { padding: .6rem .8rem .6rem 2.2rem; border: 1px solid var(--pub-line); border-radius: var(--pub-radius-sm); background: var(--pub-surface); }
.store-billing-same .form-check-input { width: 1.15em; height: 1.15em; margin-top: .2em; }
.store-billing-same .form-check-input:checked { background-color: var(--pub-green); border-color: var(--pub-green); }
.store-billing-same label { font-weight: 600; cursor: pointer; }
@media (max-width: 991px) { .store-account-layout { grid-template-columns: minmax(0, 1fr); } }
