:root {
    --background: #09090b;
    --surface: #141416;
    --surface-light: #1d1d21;

    --text: #f4f5f7;
    --text-muted: #b0b0ba;

    --border: rgba(255, 255, 255, 0.08);

    --accent: #b91c35;
    --accent-hover: #d12441;
    --focus: #ff8395;
    --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2rem;
    --radius-control: 0.65rem;
    --radius-panel: 1rem;
    --control-height: 2.75rem;
    --transition-ui: 160ms ease;

    --container: 1320px;
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


a {
    color: inherit;
    text-decoration: none;
}


img {
    display: block;
    max-width: 100%;
}


.container {
    width: min(
        calc(100% - 48px),
        var(--container)
    );

    margin-inline: auto;
}


/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;

    background: rgba(11, 13, 16, 0.9);
    backdrop-filter: blur(18px);

    border-bottom: 1px solid var(--border);
}


.header-inner {
    height: 76px;

    display: flex;
    align-items: center;
}


.brand {
    font-size: 17px;
    font-weight: 800;

    letter-spacing: 0.08em;
}


.main-nav {
    display: flex;
    gap: 34px;

    margin-left: 70px;

    color: var(--text-muted);
    font-size: 14px;
}


.main-nav a {
    transition: color 150ms ease;
}


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


.cart-link {
    margin-left: auto;

    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 14px;
}


.cart-count {
    display: grid;
    place-items: center;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: var(--text);
    color: var(--background);

    font-size: 12px;
    font-weight: 700;
}


/* HERO */

.hero {
    border-bottom: 1px solid var(--border);
}


.hero-inner {
    min-height: 520px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;

    gap: 80px;
}


.eyebrow {
    display: block;

    margin-bottom: 20px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.18em;
}


.hero h1 {
    margin: 0;

    font-size: clamp(48px, 5vw, 76px);
    line-height: 0.98;

    letter-spacing: -0.055em;
}


.hero-copy p {
    max-width: 480px;

    margin: 28px 0 36px;

    color: var(--text-muted);

    font-size: 17px;
    line-height: 1.7;
}

.product-card-link {
    display: block;
}


.primary-button {
    display: inline-flex;

    padding: 15px 22px;

    background: var(--text);
    color: var(--background);

    border-radius: 7px;

    font-size: 14px;
    font-weight: 700;
}


.hero-card {
    position: relative;

    display: grid;
    place-items: center;

    min-height: 440px;
}


.hero-card img {
    position: relative;
    z-index: 2;

    max-height: 380px;
    width: auto;

    border-radius: 10px;

    filter: drop-shadow(
        0 30px 40px rgba(0, 0, 0, 0.45)
    );
}


/*
    TEMPORARY ambient glow.

    Later we'll make this derive from the
    actual product/card instead of using
    one fixed accent colour.
*/

.hero-glow {
    position: absolute;

    width: 330px;
    height: 400px;

    border-radius: 50%;

    background: var(--accent);

    filter: blur(110px);
    opacity: 0.18;

    pointer-events: none;
}


/* CART */

.cart-page {
    padding: 80px 0 120px;
    min-height: 70vh;
}


.cart-heading {
    margin-bottom: 45px;
}


.cart-heading .eyebrow {
    margin-bottom: 10px;
}


.cart-heading h1 {
    margin: 0;

    font-size: clamp(42px, 5vw, 64px);
    letter-spacing: -0.045em;
}


.cart-layout {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(320px, 400px);

    gap: 70px;
    align-items: start;
}


.cart-items {
    border-top: 1px solid var(--border);
}


.cart-item {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) auto;

    gap: 28px;

    padding: 28px 0;

    border-bottom: 1px solid var(--border);
}


.cart-item-image {
    width: 150px;
    height: 190px;

    display: grid;
    place-items: center;

    padding: 12px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 9px;
}


.cart-item-image img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}


.cart-item-info {
    align-self: center;
}


.cart-item-info h2 {
    margin: 8px 0;

    font-size: 21px;
    letter-spacing: -0.02em;
}


.cart-item-info p {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}


.cart-item-meta {
    display: flex;
    gap: 8px;

    margin-top: 15px;
}


.cart-item-meta span {
    padding: 5px 8px;

    background: var(--surface-light);

    border: 1px solid var(--border);
    border-radius: 5px;

    color: #c6cad1;

    font-size: 10px;
    text-transform: uppercase;
}


.cart-item-side {
    min-width: 110px;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 10px;

    padding-top: 4px;
}


.cart-item-side strong {
    font-size: 17px;
}


.cart-item-side > span {
    color: var(--text-muted);

    font-size: 12px;
}


.remove-button {
    padding: 0;

    border: 0;

    background: transparent;
    color: var(--text-muted);

    font: inherit;
    font-size: 12px;

    cursor: pointer;
}


.remove-button:hover {
    color: var(--text);
}


/* CART SUMMARY */

.cart-summary {
    position: sticky;
    top: 110px;

    padding: 28px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;
}


.cart-summary .eyebrow {
    margin-bottom: 24px;
}


.summary-row {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    border-bottom: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 13px;
}


.summary-row strong {
    color: var(--text);
}


.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: 22px;

    font-size: 16px;
}


.summary-total strong {
    font-size: 23px;
}


.checkout-button {
    display: block;
    box-sizing: border-box;
    width: 100%;

    margin-top: 28px;
    padding: 17px;

    border: 0;
    border-radius: 7px;

    text-align: center;
    text-decoration: none;
    

    

    

    background: var(--text);
    color: var(--background);

    font: inherit;
    font-weight: 750;

    cursor: pointer;
}


/* EMPTY CART */

.empty-cart {
    max-width: 500px;

    padding: 60px 0 100px;
}


.empty-cart h2 {
    margin: 0 0 12px;

    font-size: 30px;
}


.empty-cart p {
    margin: 0 0 28px;

    color: var(--text-muted);
}

/* PRODUCTS */

.products-section {
    padding: 90px 0 110px;
}


.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    margin-bottom: 42px;
}


.section-heading .eyebrow {
    margin-bottom: 10px;
}


.section-heading h2 {
    margin: 0;

    font-size: 36px;
    letter-spacing: -0.035em;
}


.product-count {
    color: var(--text-muted);
    font-size: 13px;
}


.product-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 40px 24px;
}


.product-card {
    min-width: 0;
}


.product-image {
    position: relative;

    aspect-ratio: 4 / 5;

    display: grid;
    place-items: center;

    padding: 26px;

    overflow: hidden;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;
}


.product-image img {
    max-height: 100%;

    object-fit: contain;

    transition:
        transform 220ms ease,
        filter 220ms ease;
}


.product-card:hover .product-image img {
    transform: translateY(-5px);

    filter: drop-shadow(
        0 16px 20px rgba(0, 0, 0, 0.35)
    );
}


.product-info {
    padding-top: 18px;
}


.product-type {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 700;

    letter-spacing: 0.14em;
    text-transform: uppercase;
}


.product-info h3 {
    margin: 8px 0 5px;

    font-size: 17px;
}



.card-set {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}


.product-meta {
    display: flex;
    gap: 8px;

    margin-top: 13px;
}


.product-meta span {
    padding: 5px 8px;

    background: var(--surface-light);

    border: 1px solid var(--border);
    border-radius: 5px;

    color: #c6cad1;

    font-size: 10px;

    text-transform: uppercase;
}


.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-top: 17px;
}


.price {
    font-size: 17px;
}


.last-item {
    color: var(--text-muted);

    font-size: 10px;
}


/* CATEGORIES */

.categories {
    padding: 0 0 100px;
}


.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}


.category-card {
    padding: 38px;

    border-right: 1px solid var(--border);
}


.category-card:last-child {
    border-right: 0;
}


.category-card > span {
    color: var(--text-muted);
    font-size: 11px;
}


.category-card h3 {
    margin: 50px 0 8px;

    font-size: 25px;
}


.category-card p {
    margin: 0;

    color: var(--text-muted);

    font-size: 13px;
}


/* FOOTER */

.site-footer {
    border-top: 1px solid var(--border);

    color: var(--text-muted);

    font-size: 12px;
}


.footer-inner {
    min-height: 100px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* PRODUCT DETAIL */

.product-detail {
    padding: 70px 0 110px;
}


.product-detail-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(380px, 0.8fr);

    gap: 80px;
    align-items: start;
}


.product-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 16px;
}


.gallery-image {
    min-height: 500px;

    display: grid;
    place-items: center;

    padding: 35px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 12px;
}


.gallery-image img {
    width: 100%;
    height: 100%;

    max-height: 650px;

    object-fit: contain;
}


.product-detail-info {
    position: sticky;
    top: 120px;
}


.product-detail-info h1 {
    margin: 0;

    font-size: clamp(38px, 4vw, 58px);

    line-height: 1;
    letter-spacing: -0.045em;
}


.detail-set {
    margin: 16px 0 0;

    color: var(--text-muted);

    font-size: 15px;
}


.detail-price {
    margin-top: 38px;

    font-size: 30px;
    font-weight: 750;
}


.detail-properties {
    margin-top: 32px;

    border-top: 1px solid var(--border);
}


.detail-properties > div {
    min-height: 52px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 20px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}


.detail-properties span {
    color: var(--text-muted);
}


.detail-properties strong {
    font-weight: 600;
}


.add-to-cart-button {
    width: 100%;

    margin-top: 28px;
    padding: 17px 20px;

    border: 0;
    border-radius: 7px;

    background: var(--text);
    color: var(--background);

    font: inherit;
    font-weight: 750;

    cursor: pointer;
}


.add-to-cart-button:hover {
    opacity: 0.9;
}



.product-description {
    margin-top: 42px;
}


.product-description h2 {
    margin: 0 0 12px;

    font-size: 16px;
}


.product-description p {
    margin: 0;

    color: var(--text-muted);

    font-size: 14px;
    line-height: 1.7;
}

/* =========================================================
   CHECKOUT
   ========================================================= */

.checkout-page {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 72px 0 100px;
}

.checkout-header {
    margin-bottom: 48px;
}

.checkout-header .eyebrow {
    display: block;
    margin-bottom: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: #9ca3af;
}

.checkout-header h1 {
    margin: 0 0 12px;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.checkout-header p {
    margin: 0;
    color: #9ca3af;
}

.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 72px;
    align-items: start;
}

.checkout-form-card {
    padding-top: 32px;
    border-top: 1px solid #262a30;
}

.checkout-form-card h2,
.checkout-summary h2 {
    margin: 0 0 28px;
    font-size: 1.15rem;
}

.checkout-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group:first-of-type,
.form-group:nth-of-type(2),
.form-group:nth-of-type(5),
.form-group:last-of-type {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #b4bac4;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 15px;
    border: 1px solid #2a2f36;
    border-radius: 8px;
    background: #111418;
    color: #f4f4f5;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #737b87;
    background: #15191e;
}

.field-errors,
.form-errors {
    font-size: 0.8rem;
    color: #f0a4a4;
}

.checkout-submit {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 16px 22px;
    border: 0;
    border-radius: 8px;
    background: #f4f4f5;
    color: #0b0d0f;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.checkout-submit:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}


/* Order summary */

.checkout-summary {
    position: sticky;
    top: 110px;
    padding: 30px;
    border: 1px solid #292d33;
    border-radius: 14px;
    background: #14171b;
}

.checkout-items {
    display: flex;
    flex-direction: column;
}

.checkout-item {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid #292d33;
}

.checkout-item:first-child {
    padding-top: 0;
}

.checkout-item > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkout-item strong {
    font-size: 0.9rem;
}

.checkout-item span {
    color: #969da8;
    font-size: 0.78rem;
}

.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
}

.checkout-total span {
    font-weight: 600;
}

.checkout-total strong {
    font-size: 1.5rem;
}

.checkout-note {
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid #292d33;
    color: #8e959f;
    font-size: 0.78rem;
    line-height: 1.6;
}


/* MOBILE */

@media (max-width: 900px) {


    .checkout-page {
        width: min(100% - 32px, 700px);
        padding-top: 48px;
    }

    .checkout-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .checkout-summary {
        position: static;
    }

    .main-nav {
        display: none;
    }


    .hero-inner {
        grid-template-columns: 1fr;

        padding-top: 80px;

        gap: 20px;
    }


    .hero-card {
        min-height: 420px;
    }


    .product-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


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


    .category-card {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    /* Product detail */

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .product-detail-info {
        position: static;
    }

    /* Cart */

    .cart-layout {
        grid-template-columns: 1fr;
        gap: 45px;
    }

    .cart-summary {
        position: static;
    }

}


@media (max-width: 540px) {


    .checkout-page {
        width: min(100% - 24px, 700px);
        padding-top: 36px;
    }

    .checkout-form {
        grid-template-columns: 1fr;
    }

    .form-group {
        grid-column: 1 / -1;
    }

    .checkout-summary {
        padding: 22px;
    }

    .container {
        width: min(
            calc(100% - 28px),
            var(--container)
        );
    }


    .header-inner {
        height: 64px;
    }


    .hero h1 {
        font-size: 48px;
    }


    .hero-card img {
        max-height: 340px;
    }


    .products-section {
        padding-top: 65px;
    }


    .product-grid {
        gap: 32px 12px;
    }


    .product-image {
        padding: 14px;
    }


    .product-info h3 {
        font-size: 14px;
    }


    .card-set {
        font-size: 11px;
    }


    .product-bottom {
        align-items: flex-start;
        flex-direction: column;

        gap: 6px;
    }

    /* Cart */

    .cart-item {
        grid-template-columns: 95px 1fr;
        gap: 16px;
    }

    .cart-item-image {
        width: 95px;
        height: 125px;
    }

    .cart-item-side {
        grid-column: 2;
        align-items: flex-start;
        padding-top: 0;
    }

}

.recognition-results {
    margin: 2rem 0;
}

.recognition-candidates {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.recognition-candidate {
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
}

.recognition-candidate-image {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.recognition-candidate-image img {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    border-radius: 12px;
}

.recognition-image-missing {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 260px;
    aspect-ratio: 63 / 88;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
}

.recognition-candidate-info h3 {
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 800px) {
    .recognition-candidates {
        grid-template-columns: 1fr;
    }
}

.card-listing-page {
    width: min(1400px, calc(100% - 3rem));
    margin: 0 auto;
    padding: 3rem 0 5rem;
}

.card-listing-header {
    max-width: 700px;
    margin-bottom: 2.5rem;
}

.card-listing-header h1 {
    margin: 0.4rem 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.card-listing-form {
    max-width: 900px;
}

.camera-section,
.card-image-upload {
    padding: 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
}

.upload-heading {
    margin-bottom: 1.5rem;
}

.upload-heading h2 {
    margin: 0.35rem 0 0.5rem;
}

.upload-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 180px;
    padding: 2rem;

    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.02);

    cursor: pointer;
    text-align: center;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.upload-dropzone:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.045);
    transform: translateY(-2px);
}

.upload-icon {
    display: grid;
    place-items: center;

    width: 44px;
    height: 44px;
    margin-bottom: 1rem;

    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);

    font-size: 1.5rem;
}

.upload-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.upload-hint {
    margin-top: 0.4rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}

/* Dölj Djangos vanliga fula filinput.
   Labeln ovan öppnar fortfarande filväljaren. */
#id_front_image {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.upload-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;

    margin-top: 1.25rem;
    padding: 1rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.03);
}

.upload-preview[hidden] {
    display: none;
}

.upload-preview-image {
    flex: 0 0 130px;
}

.upload-preview-image img {
    display: block;

    width: 130px;
    max-height: 180px;

    object-fit: contain;

    border-radius: 9px;
}

.upload-preview-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;

    min-width: 0;
}

.upload-preview-info strong {
    max-width: 100%;
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-divider {
    display: flex;
    align-items: center;
    gap: 1rem;

    margin: 1.5rem 0;

    color: rgba(255, 255, 255, 0.45);
}

.upload-divider::before,
.upload-divider::after {
    content: "";
    flex: 1;

    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

#identify-card {
    margin-top: 1.5rem;
}

@media (max-width: 700px) {
    .card-listing-page {
        width: min(100% - 1.5rem, 1400px);
        padding-top: 2rem;
    }

    .upload-preview {
        align-items: flex-start;
        flex-direction: column;
    }

    .upload-preview-image,
    .upload-preview-image img {
        width: 100%;
    }

    .upload-preview-image img {
        max-height: 320px;
    }
}

/* Bilden som användes för identifiering */
.recognition-comparison {
    margin: 1.5rem 0 2rem;
}

.submitted-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;

    padding: 1.25rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.025);
}

.submitted-card-image {
    flex: 0 0 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 180px;
    height: 240px;

    overflow: hidden;

    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.submitted-card-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

.submitted-card-filename {
    margin: 0;

    color: rgba(255, 255, 255, 0.65);

    font-size: 0.9rem;

    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .submitted-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .submitted-card-image {
        width: 160px;
        height: 215px;
        flex-basis: 215px;
    }
}

.confirmed-card-section {
    margin-top: 2rem;
}

.confirmed-card-heading {
    max-width: 720px;
    margin-bottom: 2rem;
}

.confirmed-card-heading h2 {
    margin: 0.35rem 0 0.6rem;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.confirmed-card-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 2rem;

    max-width: 900px;
}

.confirmed-card-panel {
    padding: 1.25rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.025);
}

.confirmed-card-image {
    display: flex;
    justify-content: center;
    align-items: center;

    height: 330px;
    margin-top: 0.75rem;

    overflow: hidden;
}

.confirmed-card-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
    border-radius: 12px;
}

.confirmed-card-filename {
    margin: 1rem 0 0;

    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;

    overflow-wrap: anywhere;
}

.confirmed-card-details {
    margin-top: 1rem;
}

.confirmed-card-details h3 {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
}

.confirmed-match-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;

    color: rgba(255, 255, 255, 0.65);
}

.confirmed-match-arrow span {
    font-size: 2rem;
}

.confirmed-match-arrow small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.confirmed-card-actions {
    max-width: 900px;
    margin-top: 1.5rem;
}

.confirmed-next-hint {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
}

@media (max-width: 800px) {
    .confirmed-card-comparison {
        grid-template-columns: 1fr;
    }

    .confirmed-match-arrow {
        transform: rotate(90deg);
    }

    .confirmed-match-arrow small {
        display: none;
    }

    .confirmed-card-image {
        height: 280px;
    }
}

.back-card-section {
    margin-top: 2rem;
}

.back-card-summary {
    display: flex;
    align-items: center;
    gap: 1.25rem;

    max-width: 600px;
    margin: 2rem 0;

    padding: 1rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.025);
}

.back-card-summary img {
    width: 90px;
    height: 125px;

    object-fit: contain;
    border-radius: 8px;
}

.back-card-summary h3 {
    margin: 0.25rem 0;
}

.back-capture-placeholder {
    max-width: 600px;

    padding: 2rem;

    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.02);
}

.back-capture-placeholder h3 {
    margin: 0.5rem 0;
}

/* =========================================================
   CARD LISTING - STEP 3: PRODUCT DETAILS
   ========================================================= */

.product-details-section {
    max-width: 900px;
    margin-top: 2rem;
}

.product-details-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;

    margin: 2rem 0;
}

.product-details-image-card {
    min-width: 0;
    padding: 1.25rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.025);
}

.product-details-image-card img {
    display: block;

    width: 100%;
    height: 360px;

    object-fit: contain;

    margin-top: 0.75rem;

    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}

.product-details-image-card > p:last-child {
    margin: 0.75rem 0 0;

    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;

    overflow-wrap: anywhere;
}


/* Produktinformationen */

.product-details-card {
    padding: 1.5rem;

    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.025);
}

.product-details-card-heading {
    padding-bottom: 1.25rem;
    margin-bottom: 1.5rem;

    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.product-details-card-heading h3 {
    margin: 0.25rem 0 0.4rem;
    font-size: 1.4rem;
}

.product-details-card-heading p {
    margin: 0.25rem 0;
}


/* Formulär */

.product-details-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.product-details-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    min-width: 0;
}

.product-details-field label {
    font-size: 0.9rem;
    font-weight: 600;
}

.product-details-field select,
.product-details-field input {
    width: 100%;
    min-height: 46px;

    padding: 0.7rem 0.85rem;

    color: #fff;

    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;

    background: rgba(0, 0, 0, 0.3);
}

.product-details-field select:focus,
.product-details-field input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.35);
}

.product-details-field select option {
    color: #111;
    background: #fff;
}


/* Pris + SEK */

.price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.price-input-wrapper input {
    flex: 1;
}

.price-input-wrapper span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    font-weight: 600;
}


/* Knapp och hjälptext */

.product-details-form .primary-button {
    grid-column: 1 / -1;

    margin-top: 0.5rem;
}

.product-details-form .primary-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.product-details-note {
    grid-column: 1 / -1;

    margin: -0.4rem 0 0;

    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    text-align: center;
}


/* Mobil */

@media (max-width: 700px) {
    .product-details-images,
    .product-details-form {
        grid-template-columns: 1fr;
    }

    .product-details-image-card img {
        height: 300px;
    }
}

/* Neuro TCG: shared identity. Product layouts remain in their existing sections. */
.neuro-store { font-family: var(--font-body); }
.neuro-store .site-header {
    background: rgba(9, 9, 11, 0.97);
    border-bottom: 1px solid rgba(185, 28, 53, 0.35);
}
.neuro-store .header-inner {
    height: 92px;
    min-height: 0;
    gap: var(--space-3);
    padding-block: 10px;
    flex-wrap: nowrap;
    min-width: 0;
}
.neuro-store .brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 70px;
    max-width: 100px;
    line-height: 0;
}
.neuro-store .site-header .brand img.brand-logo {
    display: block;
    width: auto;
    height: 70px;
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
    flex: 0 0 auto;
}
.neuro-store .main-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-2);
    margin-left: auto;
    font-size: 15px;
}
.neuro-store .main-nav a, .neuro-store .cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-height);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-control);
    color: var(--text);
    transition: background-color var(--transition-ui), color var(--transition-ui);
}
.neuro-store .main-nav a:hover { background: var(--surface-light); color: var(--focus); }
.neuro-store .cart-link { flex-shrink: 0; margin-left: var(--space-2); border: 1px solid var(--border); gap: var(--space-1); }
.neuro-store .cart-link:hover { border-color: var(--accent); background: var(--surface); }
.neuro-store .cart-count { background: var(--accent); color: #fff; }
.neuro-store :is(.primary-button, .checkout-button, .checkout-submit, .add-to-cart-button) {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    min-height: var(--control-height);
    transition: background-color var(--transition-ui);
}
.neuro-store :is(.primary-button, .checkout-button, .checkout-submit, .add-to-cart-button):hover {
    background: var(--accent-hover);
    color: #fff;
}
.neuro-store button:disabled { opacity: 0.6; cursor: not-allowed; }
.neuro-store :is(.form-group, .product-details-field) :is(input, select, textarea) {
    background: var(--surface);
    color: var(--text);
    border-color: #55555f;
    border-radius: var(--radius-control);
    font: inherit;
}
.neuro-store :is(input, textarea)::placeholder { color: var(--text-muted); opacity: 1; }
.neuro-store :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}
.neuro-store .form-errors, .neuro-store .field-errors { color: #ffb4bf; }
.neuro-store .site-footer {
    margin-top: var(--space-4);
    background: var(--surface);
    border-top: 1px solid rgba(185, 28, 53, 0.35);
    padding-block: var(--space-4);
}
.neuro-store .footer-inner { gap: var(--space-3); flex-wrap: wrap; color: var(--text-muted); }
.neuro-store .footer-brand { display: grid; gap: var(--space-1); }
.neuro-store .footer-brand strong { color: var(--text); font-size: 1.25rem; }
.neuro-store .footer-brand small { font-size: 0.8rem; }
.skip-link {
    position: fixed;
    top: var(--space-1);
    left: var(--space-1);
    z-index: 200;
    padding: var(--space-2);
    background: var(--surface);
    color: var(--text);
    transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }
@media (max-width: 700px) {
    .neuro-store .header-inner {
        height: auto;
        min-height: 116px;
        justify-content: space-between;
        gap: var(--space-1);
        flex-wrap: wrap;
    }
    .neuro-store .brand { height: 52px; max-width: 72px; }
    .neuro-store .site-header .brand img.brand-logo { height: 52px; max-height: 52px; width: auto; }
    .neuro-store .main-nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 0; }
    .neuro-store .main-nav a { padding-inline: var(--space-1); font-size: 0.875rem; }
    .neuro-store .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .neuro-store *, .neuro-store *::before, .neuro-store *::after {
        animation: none !important;
        transition: none !important;
    }
}


/* Phase 1 layout correction: bounded header and independent hero content. */
.neuro-store .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 72px);
    padding-block: 48px;
}
.neuro-store .hero-copy { min-width: 0; position: relative; z-index: 1; }
.neuro-store .hero h1 { line-height: 1.08; overflow-wrap: break-word; }
.neuro-store .hero-card { min-width: 0; isolation: isolate; }
.neuro-store .hero-glow { background: #b91c35; opacity: 0.12; max-width: 90%; }
@media (max-width: 900px) {
    .neuro-store .main-nav { gap: 4px; }
    .neuro-store .main-nav a { padding-inline: 8px; }
    .neuro-store .hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 40px; gap: 24px; }
}
@media (max-width: 700px) {
    .neuro-store .main-nav { flex-wrap: wrap; gap: 0; }
    .neuro-store .hero h1 { font-size: clamp(36px, 8vw, 52px); }
    .neuro-store .cart-link { margin-left: auto; }
}


/* Phase 2 homepage. Scoped independently of product cards and registration. */
.home-hero { border-bottom: 1px solid var(--border); overflow: hidden; }
.home-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.3fr);
    gap: 24px;
    align-items: center;
    padding-block: clamp(40px, 5vw, 72px);
}
.home-hero-copy { min-width: 0; position: relative; z-index: 1; }
.home-hero-copy .eyebrow { color: var(--focus); }
.home-hero h1 { margin: 0; font-size: clamp(38px, 4.4vw, 66px); line-height: 1.08; letter-spacing: -0.045em; }
.home-hero-copy p { color: var(--text-muted); line-height: 1.75; max-width: 440px; margin: 24px 0 28px; }
.home-hero-motto { display: block; margin-top: 24px; color: var(--text-muted); font-size: 0.875rem; }
.home-hero-art { position: relative; min-width: 0; }
.home-hero-art img { display: block; width: 100%; height: auto; object-fit: contain; }
.home-hero-art::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(90deg, var(--background), transparent 24%),
                linear-gradient(0deg, var(--background), transparent 12%),
                linear-gradient(180deg, var(--background), transparent 10%);
}
.home-categories { padding-block: 48px; }
.home-section-heading h2 { margin: 0 0 28px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.025em; }
.home-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.home-category {
    padding: 28px 24px; border: 1px solid var(--border); border-radius: var(--radius-panel);
    background: linear-gradient(135deg, rgba(185, 28, 53, 0.08), transparent 70%), var(--surface);
}
.home-category > span { color: var(--focus); font-size: 10px; letter-spacing: 0.1em; }
.home-category h3 { font-size: 26px; margin: 18px 0 12px; }
.home-category p { margin: 0; color: var(--text-muted); line-height: 1.6; font-size: 14px; }
.home-category:hover { border-color: rgba(185, 28, 53, 0.45); }
.home-empty { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); }
.home-empty h2 { font-size: 20px; margin: 0 0 12px; }
.home-empty p { color: var(--text-muted); margin: 0; line-height: 1.6; }
.home-brand { padding-block: 56px; border-top: 1px solid var(--border); }
.home-brand-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.home-brand h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); }
.home-brand p { color: var(--text-muted); line-height: 1.8; margin: 0; }
@media (max-width: 900px) {
    .home-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .home-hero-art { width: min(100%, 720px); margin-inline: auto; }
    .home-hero-art::after { background: linear-gradient(0deg, var(--background), transparent 14%), linear-gradient(180deg, var(--background), transparent 10%); }
    .home-brand-inner { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 480px) {
    .home-category-grid { grid-template-columns: minmax(0, 1fr); }
    .home-category { padding: 24px; }
    .home-categories { padding-block: 32px; }
}


/* Phase 2.5: deliberate emblem overhang, bounded independently of intrinsic image size. */
.neuro-store .site-header { overflow: visible; isolation: isolate; }
.neuro-store .header-inner { position: relative; padding-left: 180px; overflow: visible; }
.neuro-store .site-header .brand {
    position: absolute;
    top: 3px;
    left: 0;
    z-index: 2;
    width: 147px;
    max-width: 147px;
    height: 120px;
}
.neuro-store .site-header .brand img.brand-logo {
    width: auto;
    height: 120px;
    max-height: 120px;
    max-width: 147px;
    object-fit: contain;
}
@media (max-width: 900px) {
    .neuro-store .header-inner {
        height: auto;
        min-height: 136px;
        padding-left: 0;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }
    .neuro-store .site-header .brand {
        position: relative;
        top: 0;
        left: auto;
        width: 98px;
        max-width: 98px;
        height: 76px;
    }
    .neuro-store .site-header .brand img.brand-logo {
        height: 80px;
        max-height: 80px;
        max-width: 98px;
    }
    .neuro-store .main-nav {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .neuro-store .cart-link { margin-left: auto; }
}
@media (max-width: 375px) {
    .neuro-store .site-header .brand { width: 86px; max-width: 86px; height: 70px; }
    .neuro-store .site-header .brand img.brand-logo { height: 70px; max-height: 70px; max-width: 86px; }
}


/* Phase 3 catalog: reuse existing product cards without changing the homepage. */
.catalog-page { padding-block: 64px; min-height: 60vh; }
.catalog-page h1 { font-size: clamp(30px, 4vw, 48px); margin: 0 0 32px; }
.catalog-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); }
.catalog-filters > div { flex: 1 1 200px; min-width: 0; }
.catalog-filters label { display: block; margin-bottom: 8px; }
.catalog-filters input, .catalog-filters select { width: 100%; min-height: 46px; padding: 10px 12px; color: var(--text); background: var(--background); border: 1px solid #55555f; border-radius: var(--radius-control); font: inherit; }
.catalog-reset, .catalog-page .home-empty a { text-decoration: underline; text-underline-offset: 4px; display: inline-block; padding-block: 12px; margin-right: 12px; }
.catalog-results, .catalog-notice { color: var(--text-muted); margin-block: 24px; overflow-wrap: anywhere; }
.catalog-page .home-empty p { overflow-wrap: anywhere; }
a.home-category { display: block; }
a.home-category:focus-visible { border-color: var(--focus); }
/* Fit the extra navigation item without altering the approved emblem. */
.neuro-store .main-nav { gap: 4px; }
.neuro-store .main-nav a { padding-inline: 8px; }
@media (min-width: 901px) {
    .neuro-store .main-nav { flex-wrap: wrap; justify-content: flex-end; }
    .neuro-store .main-nav a { min-height: 32px; padding-block: 4px; font-size: 14px; }
}
@media (max-width: 480px) { .catalog-filters { padding: 16px; } }


/* Shared approved Backlight: centered image copy, no continuous motion. */
.backlight-definitions { position: absolute; pointer-events: none; }
.backlight-image-area {
    --backlight-inset: 26px;
    --backlight-blur: 13px;
    --backlight-scale: 1.20;
    --backlight-svg-filter: url("#neuro-backlight-compact");
    position: relative;
    isolation: isolate;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
}
.backlight-image-area.backlight-showcase {
    --backlight-blur: 18px;
    --backlight-scale: 1.28;
    --backlight-svg-filter: url("#neuro-backlight-showcase");
}
.gallery-image.backlight-image-area { --backlight-inset: 35px; }
.backlight-image-area .ambient-image,
.product-card:hover .backlight-image-area .ambient-image,
.product-card:focus-within .backlight-image-area .ambient-image {
    position: absolute;
    inset: 0;
    margin: auto;
    width: calc(100% - 2 * var(--backlight-inset));
    height: calc(100% - 2 * var(--backlight-inset));
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
    transform-origin: 50% 50%;
    transform: scale(var(--backlight-scale));
    filter: blur(var(--backlight-blur)) saturate(3);
    opacity: 0.4;
    transition: none;
    -webkit-mask-image: none;
    mask-image: none;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}
@supports (filter: url("#neuro-backlight-showcase")) {
    .backlight-image-area .ambient-image,
    .product-card:hover .backlight-image-area .ambient-image,
    .product-card:focus-within .backlight-image-area .ambient-image { filter: var(--backlight-svg-filter); }
}
/* Explicit comparison mode also works in browsers supporting SVG filters. */
.backlight-css-fallback .backlight-image-area .ambient-image,
.backlight-css-fallback .product-card:hover .backlight-image-area .ambient-image,
.backlight-css-fallback .product-card:focus-within .backlight-image-area .ambient-image {
    filter: blur(var(--backlight-blur)) saturate(3);
}
.backlight-image-area .product-image-sharp,
.product-card:hover .backlight-image-area .product-image-sharp,
.product-card:focus-within .backlight-image-area .product-image-sharp {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
    filter: none;
    transition: none;
}
.product-card .product-info { position: relative; z-index: 2; margin-top: 24px; }
/* Clip only at section boundaries, never at individual image edges. */
.products-section, .catalog-page, .product-detail, .backlight-preview { overflow-x: clip; }
@media (max-width: 480px) { .product-grid { grid-template-columns: minmax(0, 1fr); } }

/* Detail gallery only; approved Backlight variables remain unchanged. */
.product-gallery-interactive {
    /* Reserve space for the 92px header, section padding and thumbnail row. */
    --gallery-height: clamp(240px, calc(100vh - 310px), 560px);
    --gallery-height: clamp(240px, calc(100dvh - 310px), 560px);
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 16px;
}
.product-gallery-interactive .gallery-image {
    width: min(100%, calc(var(--gallery-height) * 0.8));
    height: var(--gallery-height);
    aspect-ratio: 4 / 5;
    min-height: 0;
    justify-self: center;
}
.product-gallery-interactive .gallery-thumbnails {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    position: relative;
    z-index: 2;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    padding: 8px;
    margin-top: 0;
}
.product-gallery-interactive [hidden] { display: none; }
.gallery-thumbnail {
    flex: 0 0 72px;
    width: 72px;
    height: 90px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--surface);
    cursor: pointer;
}
.gallery-thumbnail img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbnail[aria-pressed="true"] { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.gallery-thumbnail:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.gallery-caption { position: relative; z-index: 2; color: var(--text-muted); font-size: 14px; line-height: 1.6; }
.gallery-fallback-image { width: 100%; max-height: 650px; object-fit: contain; }
.product-gallery-interactive .gallery-empty { background: transparent; border: 0; }

@media (max-width: 900px) {
    .product-gallery-interactive {
        --gallery-height: clamp(220px, 52vh, 400px);
        --gallery-height: clamp(220px, 52dvh, 400px);
    }
}

/* Independent modal viewer; no changes to gallery sizing or Backlight. */
.gallery-open {
    position: absolute;
    inset: var(--backlight-inset);
    z-index: 3;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
}
.gallery-open:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
html.lightbox-open { overflow: hidden; }
.product-lightbox {
    width: calc(100% - 32px);
    max-width: 1500px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: none;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-panel);
    color: var(--text);
    background: var(--background);
    overflow: hidden;
}
.product-lightbox[open] { display: flex; flex-direction: column; gap: 12px; }
.product-lightbox::backdrop { background: rgba(0, 0, 0, 0.88); }
.lightbox-controls { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.product-lightbox button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-control);
    font: inherit;
    cursor: pointer;
}
.product-lightbox button:disabled { opacity: 0.45; cursor: default; }
.product-lightbox button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.lightbox-status { margin: 0; color: var(--text-muted); font-size: 14px; flex: 0 0 auto; }
.lightbox-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none; overscroll-behavior: contain; }
.lightbox-stage img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; object-fit: contain; user-select: none; }
.lightbox-stage.is-zoomed { cursor: grab; }
.lightbox-stage.is-dragging { cursor: grabbing; }
@media (max-width: 540px) {
    .product-lightbox { width: calc(100% - 16px); height: calc(100dvh - 16px); padding: 12px; }
    .product-lightbox button { font-size: 14px; }
}

/* Viewer controls occupy their own tracks, never covering the image. */
.lightbox-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.lightbox-header .lightbox-status { min-width: 0; overflow-wrap: anywhere; }
.product-lightbox .lightbox-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; font-size: 32px; line-height: 1; border-color: var(--focus); }
.lightbox-viewer { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 12px; flex: 1 1 auto; min-height: 0; }
.lightbox-viewer .lightbox-stage { grid-column: 2; grid-row: 1; }
.product-lightbox .lightbox-arrow { align-self: center; width: 44px; height: 44px; padding: 0; font-size: 32px; line-height: 1; }
.lightbox-prev { grid-column: 1; grid-row: 1; }
.lightbox-next { grid-column: 3; grid-row: 1; }
.lightbox-zoom { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
.lightbox-hint { margin: 0; color: var(--text-muted); text-align: center; font-size: 12px; flex: 0 0 auto; }
@media (max-width: 540px) {
    .lightbox-viewer { gap: 4px; }
    .product-lightbox .lightbox-controls button { font-size: 14px; }
}
