/* Shared structure for all three stores. Each site's theme.css sets the
   variables below and adds its own personality; keep layout here. */
:root {
    --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: var(--font-body);
    --ink: #14181f;
    --muted: #5b6472;
    --line: #e3e6eb;
    --bg: #ffffff;
    --surface: #f5f6f8;
    --brand: #1d3f8f;
    --brand-ink: #ffffff;
    --accent: #c62a2f;
    --radius: 10px;
    --wrap: 1200px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--brand);
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    margin: 0.2em 0 0.4em;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

.narrow {
    max-width: 760px;
}

.section {
    padding: 40px 16px;
}

.wrap.section {
    padding-left: 16px;
    padding-right: 16px;
}

.muted {
    color: var(--muted);
}

.sr-only,
.skip:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10;
    background: var(--bg);
    padding: 8px 12px;
}

/* Header */
.topbar {
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 0.875rem;
}

.topbar .wrap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.topbar a {
    color: inherit;
    font-weight: 600;
}

.site-header {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.brand img {
    display: block;
    max-height: 56px;
    width: auto;
}

.brand span {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ink);
}

.brand {
    text-decoration: none;
    flex-shrink: 0;
}

.search {
    flex: 1;
    display: flex;
    max-width: 560px;
}

.search input {
    flex: 1;
    min-width: 0;
    font: inherit;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.search button {
    font: inherit;
    font-weight: 600;
    padding: 10px 16px;
    border: 0;
    background: var(--brand);
    color: var(--brand-ink);
    border-radius: 0 var(--radius) var(--radius) 0;
    cursor: pointer;
}

.cart-link {
    margin-left: auto;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-count {
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    min-width: 1.5em;
    padding: 1px 6px;
    text-align: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
    padding: 0 0 12px;
    margin: 0;
}

.main-nav a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.main-nav .nav-highlight {
    margin-left: auto;
}

.main-nav .nav-highlight a {
    color: var(--accent);
}

.main-nav a:hover {
    color: var(--brand);
}

/* Buttons */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--radius);
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-ghost {
    border-color: currentColor;
    color: var(--brand);
    background: transparent;
}

.btn-block {
    display: block;
    width: 100%;
}

.link-button {
    background: none;
    border: 0;
    color: var(--brand);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* Home */
.hero {
    background: var(--surface);
    padding: 56px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 48px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.4rem);
}

.lede {
    font-size: 1.15rem;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.finder {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) * 1.5);
    padding: 24px;
    box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.35);
}

.finder h2 {
    margin-top: 0;
    font-size: 1.3rem;
}

.finder input {
    width: 100%;
    font: inherit;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.finder .btn {
    width: 100%;
}

.category-grid {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.category-grid a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    height: 100%;
}

.category-grid img {
    aspect-ratio: 4 / 3;
    object-fit: contain;
    width: 100%;
}

.category-grid a:hover {
    border-color: var(--brand);
}

.trust {
    background: var(--surface);
    padding: 36px 0;
    margin-top: 24px;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.trust-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trust-grid span {
    color: var(--muted);
    font-size: 0.95rem;
}

/* Product grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.product-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.product-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    background: var(--bg);
}

.product-card:hover {
    border-color: var(--brand);
    box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.4);
}

.product-card-img {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: calc(var(--radius) - 4px);
    overflow: hidden;
}

.product-card-img img {
    max-height: 100%;
    object-fit: contain;
}

.product-card-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.product-card-price {
    color: var(--accent);
    font-weight: 700;
    margin-top: auto;
}

.chip-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
}

.chip-list a {
    display: block;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.9rem;
}

.crumbs {
    font-size: 0.875rem;
    color: var(--muted);
}

.crumbs a {
    color: var(--muted);
}

/* Product page */
.product-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    margin-top: 16px;
}

.gallery-main {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.gallery-empty {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    background: var(--surface);
    border-radius: var(--radius);
    color: var(--muted);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gallery-thumbs button {
    width: 72px;
    height: 72px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.gallery-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    margin: 0;
}

.sku {
    color: var(--muted);
    margin: 0;
}

.price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
    margin: 16px 0;
}

.price s {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 400;
    margin-left: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-weight: 600;
}

.field select,
.field input {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.tiles {
    border: 0;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.tiles legend {
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.tile input {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.tile span {
    font-weight: 600;
}

.tile small {
    color: var(--muted);
}

.tile:has(input:checked) {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 1px var(--brand);
    background: var(--surface);
}

.tile:has(input:focus-visible) {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.qty-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.qty-row .qty input {
    width: 90px;
}

.qty-row .btn {
    flex: 1;
    margin-bottom: 14px;
}

.added {
    background: var(--surface);
    padding: 10px 14px;
    border-radius: var(--radius);
}

.notice {
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.ship-notes {
    color: var(--muted);
    font-size: 0.95rem;
    padding-left: 18px;
}

.subsection {
    padding-top: 40px;
}

.fit-list {
    columns: 3 240px;
    column-gap: 28px;
    padding: 0;
    list-style: none;
}

.fit-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    break-inside: avoid;
}

.manual-list {
    columns: 2 320px;
    column-gap: 32px;
    padding: 0;
    list-style: none;
}

.manual-list li {
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    break-inside: avoid;
}

.prose {
    max-width: 75ch;
}

.prose table {
    border-collapse: collapse;
}

.prose td,
.prose th {
    border: 1px solid var(--line);
    padding: 6px 10px;
}

/* Cart and checkout */
.cart-lines {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cart-line {
    display: grid;
    grid-template-columns: 72px 1fr 90px 100px auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cart-line-img img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.cart-line-info {
    display: flex;
    flex-direction: column;
}

.cart-line-qty input {
    width: 80px;
    font: inherit;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.cart-line-total {
    font-weight: 700;
    text-align: right;
}

.cart-summary {
    margin-top: 24px;
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: start;
}

.checkout-summary {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 16px;
}

.checkout-summary h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.error {
    color: #a3141a;
    font-weight: 600;
}

/* Footer */
.site-footer {
    margin-top: 56px;
    background: var(--ink);
    color: #d6dae1;
    padding: 40px 0 20px;
}

.site-footer a {
    color: #fff;
}

.site-footer ul {
    list-style: none;
    padding: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.site-footer address {
    font-style: normal;
}

.footer-base {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 24px;
    padding-top: 16px;
    font-size: 0.85rem;
}

@media (max-width: 860px) {
    .header-row {
        flex-wrap: wrap;
    }

    .search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .hero-grid,
    .product-layout,
    .checkout-layout,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .trust-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-note {
        display: none;
    }

    .cart-line {
        grid-template-columns: 56px 1fr auto;
    }

    .cart-line-total,
    .cart-line .link-button {
        grid-column: 2 / -1;
        text-align: left;
    }
}
