/* Shop - Pages/Shop.cshtml, Pages/Product.cshtml and Pages/Cart.cshtml.
   All set MainClass="page shop-page", which opts out of the .page prose-link blanket in
   layout.css; the .shop-page rules here put the underline back where it is wanted. */

.shop-page .empty a { color: var(--blue); text-decoration: underline; }

.shop-toolbar {
    margin-top: 2rem;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .75rem 1.25rem;
}
.shop-search {
    flex: 1 1 22rem; max-width: 34rem;
    display: flex; align-items: center; gap: .55rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: .7rem;
    padding: .3rem .3rem .3rem .85rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.shop-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent);
}
.shop-search-icon { width: 1.15rem; height: 1.15rem; flex: none; color: var(--muted); }
.shop-search-input {
    flex: 1 1 auto; min-width: 0; padding: .5rem 0;
    border: 0; background: none; color: var(--ink); font: inherit; font-size: .95rem;
}
.shop-search-input::placeholder { color: var(--muted); }
.shop-search-input:focus { outline: none; }
.shop-search-go {
    flex: none; border: 0; border-radius: .5rem; cursor: pointer;
    background: var(--red); color: #fff; padding: .55rem 1.1rem;
    font-family: var(--font-display); font-weight: 600; font-size: .78rem;
    letter-spacing: .08em; text-transform: uppercase;
    transition: background-color .15s ease;
}
.shop-search-go:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.shop-search-go:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.shop-count { margin: 0; display: inline-flex; align-items: center; gap: .8rem; font-size: .82rem; color: var(--muted); }
.shop-page .shop-clear { color: var(--blue); border-bottom: 1px solid currentColor; }
.shop-page .shop-clear:hover { color: var(--red); }

.shop-grid {
    margin-top: 2rem;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--surface);
    border: 1px solid var(--border); border-radius: 1rem; overflow: hidden;
    box-shadow: var(--shadow);
}
@media (min-width: 46rem) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.shop-cell {
    position: relative; display: flex; flex-direction: column; gap: .9rem;
    padding: 1.1rem 1.1rem 1.4rem;
    box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
    transition: background-color .15s ease;
}
/* Hover marks the cell with the brand red, wiping in from the left. */
.shop-cell::before {
    content: ""; position: absolute; inset: 0 auto auto 0; width: 0; height: 3px;
    background: var(--red); transition: width .2s ease;
}
.shop-cell:hover, .shop-cell:focus-visible { background: var(--surface-2); }
.shop-cell:hover::before, .shop-cell:focus-visible::before { width: 100%; }
.shop-cell:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.shop-media {
    position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden;
    border-radius: .7rem; background: var(--surface-2); transition: background-color .15s ease;
}

.shop-cell:hover .shop-media { background: var(--surface); }
.shop-media img {
    display: block; width: 100%; height: 100%; padding: 6%;
    object-fit: contain; transition: transform .25s ease;
}
.shop-cell:hover .shop-media img { transform: scale(1.04); }
.shop-stockflag {
    position: absolute; top: .5rem; left: .5rem;
    background: var(--ink); color: var(--bg);
    font-family: var(--font-display); font-size: .62rem; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    padding: .2rem .5rem; border-radius: .3rem;
}
.shop-body { display: flex; flex-direction: column; align-items: center; gap: .3rem; text-align: center; }
.shop-collection {
    font-family: var(--font-display); font-size: .64rem; font-weight: 600;
    letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.shop-name {
    font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
    line-height: 1.2; color: var(--ink); transition: color .15s ease;
}
.shop-cell:hover .shop-name { color: var(--blue); }
.shop-summary {
    font-size: .8rem; line-height: 1.45; color: var(--ink-soft);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.shop-price {
    margin-top: .4rem; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
    color: var(--ink); font-variant-numeric: tabular-nums;
}


.crumbs { margin: 0 0 1.5rem; }
.crumbs ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .82rem; }
.crumbs li { display: inline-flex; align-items: center; gap: .5rem; }
.crumbs svg { width: 1rem; height: 1rem; flex: none; color: var(--border); }
.shop-page .crumbs a { font-weight: 600; color: var(--muted); }
.shop-page .crumbs a:hover { color: var(--ink); }

.product { display: grid; gap: clamp(1.75rem, 4vw, 3rem); grid-template-areas: "intro" "figure" "form"; }
@media (min-width: 64rem) {
    .product {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "intro figure" "form figure";
        align-items: start;
    }
}
.product-intro { grid-area: intro; max-width: 34rem; }
.product-figure { grid-area: figure; align-self: center; }
.product-form { grid-area: form; max-width: 34rem; }

.product-title { font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.05; letter-spacing: -.015em; }
.product-facts { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; }
.product-price {
    margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
    color: var(--ink); font-variant-numeric: tabular-nums;
}
.product-collection {
    margin: 0; padding-left: 1rem; border-left: 1px solid var(--border);
    font-family: var(--font-display); font-size: .72rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.product-desc { margin: 1.35rem 0 0; color: var(--ink-soft); text-wrap: pretty; }
.product-stock { margin: 1.5rem 0 0; display: flex; align-items: center; gap: .55rem; font-size: .88rem; color: var(--muted); }
.product-stock svg { width: 1.2rem; height: 1.2rem; flex: none; color: var(--green); }
.product-stock.out svg { color: var(--red); }
.product-photo {
    display: block; width: 100%; aspect-ratio: 1 / 1; padding: 6%;
    object-fit: contain; border-radius: 1rem; border: 1px solid var(--border);
    background: var(--surface); box-shadow: var(--shadow-lg);
}

.option-set { margin: 0; padding: 0; border: 0; }
.option-set legend {
    padding: 0; font-family: var(--font-display); font-size: .72rem; font-weight: 600;
    letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.option-grid { margin-top: .8rem; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
/* The whole label is the hit target: the radio is stretched invisibly across it, and :has()
   pulls the checked/focus state up to the card. No JavaScript, no duplicated state. */
.option {
    position: relative; display: flex; align-items: flex-start; gap: .6rem;
    border: 1px solid var(--border); border-radius: .7rem; background: var(--surface);
    padding: .8rem .9rem; cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.option input { position: absolute; inset: 0; margin: 0; appearance: none; cursor: pointer; border-radius: inherit; }
.option:hover { border-color: color-mix(in srgb, var(--blue) 45%, var(--border)); }
.option:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.option:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.option-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.option-value { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.option-blurb { font-size: .78rem; line-height: 1.35; color: var(--muted); }
.option-check { width: 1.15rem; height: 1.15rem; flex: none; margin-top: .1rem; color: var(--blue); visibility: hidden; }
.option:has(input:checked) .option-check { visibility: visible; }

.size-guide { margin-top: .9rem; }
.size-guide summary {
    display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none;
    font-size: .85rem; color: var(--muted); transition: color .15s ease;
}
.size-guide summary::-webkit-details-marker { display: none; }
.size-guide summary:hover, .size-guide[open] summary { color: var(--ink); }
.size-guide summary svg { width: 1.1rem; height: 1.1rem; flex: none; }
.size-guide summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: .3rem; }
.size-guide p {
    margin: .7rem 0 0; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: .6rem;
    background: var(--surface-2); font-size: .85rem; color: var(--ink-soft); text-wrap: pretty;
}

.product-buy { display: block; width: 100%; margin-top: 1.75rem; }
.product-buy[disabled] {
    background: var(--surface-2); color: var(--muted); border-color: var(--border);
    box-shadow: none; cursor: not-allowed;
}
.product-buy[disabled]:hover { transform: none; background: var(--surface-2); box-shadow: none; }
.shop-page .notice a { color: var(--blue); text-decoration: underline; }
.notice {
    margin: .9rem 0 0; padding: .75rem 1rem;
    border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: .6rem;
    background: var(--surface-2); font-size: .85rem; color: var(--ink-soft); text-wrap: pretty;
}
.product-support {
    margin: 1.35rem 0 0; display: flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: var(--font-display); font-weight: 600; font-size: .9rem;
}
.product-support svg { width: 1.3rem; height: 1.3rem; flex: none; color: var(--muted); transition: color .15s ease; }
.product-support:hover svg { color: var(--red); }
.shop-page .product-support a { color: var(--blue); border-bottom: 2px solid var(--blue); padding-bottom: 2px; }
.shop-page .product-support a:hover { color: var(--red); border-color: var(--red); }

.product-details { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.product-details h2 { font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.shop-page .section-more a { color: var(--blue); border-bottom: 2px solid var(--blue); padding-bottom: 2px; }
.shop-page .section-more a:hover { color: var(--red); border-color: var(--red); }


/* ---------- Cart ---------- */
.cart-lines { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.cart-line {
    display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: .75rem 1rem; align-items: center;
    padding: 1.1rem 0; border-bottom: 1px solid var(--border);
}
.cart-thumb { display: block; aspect-ratio: 1; border-radius: .6rem; overflow: hidden; background: var(--surface-2); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-info { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.shop-page .cart-name { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.shop-page .cart-name:hover { color: var(--blue); }
.cart-variant { font-size: .82rem; color: var(--muted); }
.cart-price { font-size: .9rem; color: var(--ink-soft); }
.cart-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: .6rem; }
.cart-controls form { margin: 0; }
.cart-qty { display: flex; align-items: center; gap: .4rem; }
.cart-qty input {
    width: 4rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: .5rem;
    background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; text-align: center;
}
.cart-qty input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 22%, transparent); }
.cart-btn {
    border: 1px solid var(--border); border-radius: .5rem; background: var(--surface); color: var(--ink);
    padding: .4rem .8rem; cursor: pointer;
    font-family: var(--font-display); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
    transition: border-color .15s ease, color .15s ease;
}
.cart-btn:hover { border-color: var(--blue); }
.cart-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cart-remove:hover { border-color: var(--red); color: var(--red); }
@media (min-width: 46rem) {
    .cart-line { grid-template-columns: 6rem minmax(0, 1fr) auto; }
    .cart-controls { grid-column: auto; }
}

.cart-summary { margin: 1.75rem 0 0 auto; max-width: 22rem; }
.cart-subtotal { margin: 0; display: flex; justify-content: space-between; gap: 1rem; font-size: 1rem; color: var(--ink-soft); }
.cart-subtotal strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.cart-note { margin: .4rem 0 0; font-size: .8rem; color: var(--muted); }
.cart-checkout { display: block; margin-top: 1.1rem; text-align: center; }
.shop-page .cart-checkout { color: #fff; }
