/* BGI Theme 2.0 production hardening layer */
[hidden] { display: none !important; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid rgba(224, 34, 62, .42);
    outline-offset: 3px;
}

.bgi-price-inquiry {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid rgba(224, 34, 62, .22);
    border-radius: 12px;
    background: rgba(224, 34, 62, .07);
    color: #ca142e;
    font-weight: 800;
    line-height: 1.7;
}

.bgi-shop-filter__colors--labeled {
    display: grid;
    gap: 10px;
}
.bgi-shop-filter__colors--labeled label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    cursor: pointer;
}
.bgi-color-swatch {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border: 1px solid #d8dce5;
    border-radius: 50%;
    background: var(--bgi-color, #e5e7eb);
    box-shadow: inset 0 0 0 2px #fff;
}
.bgi-shop-filter__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 18px;
}
.bgi-shop-filter__actions a,
.bgi-shop-filter__submit {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
}
.bgi-shop-filter__actions a {
    padding-inline: 14px;
    border: 1px solid #dfe3eb;
    color: #586174;
    background: #fff;
}

.bgi-archive-card__stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 700;
}
.bgi-archive-card__stock::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.bgi-archive-card__stock.is-in-stock { color: #15803d; }
.bgi-archive-card__stock.is-out-of-stock { color: #b91c1c; }

.bgi-shop-seo-content {
    margin: 64px 0 24px;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid #e2e6ed;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(20, 31, 52, .06);
}
.bgi-shop-seo-content h2 {
    margin: 0 0 22px;
    color: #182135;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.45;
}
.bgi-shop-seo-content__body {
    color: #5d6679;
    font-size: 16px;
    line-height: 2.05;
}
.bgi-shop-seo-content__body > :first-child { margin-top: 0; }
.bgi-shop-seo-content__body > :last-child { margin-bottom: 0; }
.bgi-shop-seo-content__body h2,
.bgi-shop-seo-content__body h3,
.bgi-shop-seo-content__body h4 {
    margin: 32px 0 14px;
    color: #1c2538;
    line-height: 1.55;
}
.bgi-shop-seo-content__body a { color: #ca142e; text-underline-offset: 3px; }
.bgi-shop-seo-content__body ul,
.bgi-shop-seo-content__body ol { padding-right: 22px; }

.bgi-order-card-title {
    display: block;
    margin: 0;
    color: #172033;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.5;
}

.bgi-product-copy,
.bgi-product-description,
.bgi-product-long-description,
.bgi-product-short-description {
    overflow-wrap: anywhere;
}
.bgi-product-copy > :first-child,
.bgi-product-description > :first-child,
.bgi-product-long-description > :first-child,
.bgi-product-short-description > :first-child { margin-top: 0; }
.bgi-product-copy > :last-child,
.bgi-product-description > :last-child,
.bgi-product-long-description > :last-child,
.bgi-product-short-description > :last-child { margin-bottom: 0; }

.bgi-cart-inquiry-notice {
    margin: 16px 0;
    padding: 14px 16px;
    border-right: 4px solid #ca142e;
    border-radius: 10px;
    background: #fff4f5;
    color: #7f1d2d;
    line-height: 1.9;
}

.bgi-home-fallback-hero {
    padding: clamp(64px, 9vw, 120px) 0;
    text-align: right;
    background: linear-gradient(135deg, #fff 0%, #fff5f6 100%);
}
.bgi-home-fallback-hero__eyebrow { color: #ca142e; font-weight: 800; }
.bgi-home-fallback-hero h1 { max-width: 850px; margin: 12px 0; font-size: clamp(32px, 5vw, 58px); line-height: 1.45; }
.bgi-home-fallback-hero p { max-width: 760px; color: #646d7f; line-height: 2; }
.bgi-home-fallback-section { padding: clamp(56px, 8vw, 100px) 0; }
.bgi-home-fallback-section h2 { margin: 0 0 28px; }
.bgi-home-fallback-grid { display: grid; gap: 20px; }
.bgi-home-fallback-grid--categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bgi-home-fallback-grid--products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bgi-home-category-card,
.bgi-home-product-card {
    padding: 18px;
    border: 1px solid #e2e6ed;
    border-radius: 18px;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.bgi-home-category-card img,
.bgi-home-product-card img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.bgi-home-category-card strong,
.bgi-home-category-card span { display: block; margin-top: 8px; }
.bgi-home-category-card span { color: #727b8d; font-size: 14px; }
.bgi-home-product-card h3 { margin: 14px 0 8px; font-size: 17px; }
.bgi-home-product-card__price { min-height: 46px; margin-bottom: 14px; }
.bgi-button {
    min-height: 46px;
    padding: 10px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
}
.bgi-button--primary { background: #ca142e; color: #fff; }
.bgi-button--secondary { border: 1px solid #ca142e; color: #ca142e; background: #fff; }

@media (max-width: 991px) {
    .bgi-home-fallback-grid--products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bgi-home-fallback-grid--categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .bgi-shop-seo-content { margin-top: 42px; padding: 22px 18px; border-radius: 18px; }
    .bgi-shop-filter__actions { grid-template-columns: 1fr; }
    .bgi-home-fallback-grid { gap: 12px; }
    .bgi-home-category-card,
    .bgi-home-product-card { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Centralized pack-price output */
.bgi-archive-card__price .bgi-pack-price-label {
    display: block;
    margin-bottom: 5px;
    color: #687386;
    font-size: 11px;
    font-weight: 800;
}
.bgi-archive-card__price > strong,
.bgi-archive-card__price .woocommerce-Price-amount {
    color: #111827;
    font-size: 14px;
    font-weight: 950;
    white-space: nowrap;
}
.bgi-archive-card__price .bgi-price-inquiry {
    display: block;
    white-space: normal;
    line-height: 1.75;
}

/* Coupon and extension-safe cart output */
.bgi-cart-coupon {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #e5e9f0;
    border-radius: 14px;
    background: #f8fafc;
}
.bgi-cart-coupon input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #d7dce5;
    border-radius: 10px;
    background: #fff;
}
.bgi-cart-coupon button {
    min-height: 44px;
    padding: 9px 16px;
    border: 0;
    border-radius: 10px;
    background: #ca142e;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.bgi-cart-extension-output:empty { display: none; }
.bgi-cart-extension-output { margin-top: 24px; }

@media (max-width: 520px) {
    .bgi-cart-coupon { grid-template-columns: 1fr; }
}

/* Public form safety and feedback */
.bgi-form-honeypot{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:-1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important;
    border:0!important;
}
.bgi-form-status{
    margin:0 0 12px;
    padding:10px 12px;
    border:1px solid currentColor;
    border-radius:10px;
    font-size:13px;
    line-height:1.8;
}
.bgi-form-status.is-success{color:#087a42;background:#effcf5}
.bgi-form-status.is-error{color:#b42318;background:#fff4f2}
.bgi-newsletter-form label:not(.bgi-form-honeypot),
.bgi-contact-form-card form>label:not(.bgi-form-honeypot){display:block;min-width:0}
.bgi-newsletter-form input[type=email]{min-height:44px}


/* =========================================================
   BGI 2.1.1 — Product archive filter UI hardening
   ========================================================= */
.bgi-shop-filter,
.bgi-shop-filter *,
.bgi-shop-filter *::before,
.bgi-shop-filter *::after {
    box-sizing: border-box;
}

.bgi-shop-filter__form {
    min-width: 0;
}

/* Reset native fieldset/legend chrome without losing semantic grouping. */
.bgi-shop-filter fieldset.bgi-shop-filter__group {
    min-inline-size: 0;
    width: 100%;
    margin: 0 0 18px;
    padding: 0 0 18px;
    border: 0;
    border-bottom: 1px solid var(--bgi-border, #e2e6ed);
}

.bgi-shop-filter fieldset.bgi-shop-filter__group > legend {
    float: none;
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 13px;
    padding: 0;
    border: 0;
    color: #111827;
    font-size: 14px;
    font-weight: 950;
    line-height: 1.8;
    white-space: normal;
}

.bgi-shop-filter__sizes label,
.bgi-shop-filter__colors label {
    position: relative;
}

/* Keep native checkboxes keyboard/screen-reader accessible. */
.bgi-shop-filter__sizes label input,
.bgi-shop-filter__colors label input {
    display: block;
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
    white-space: nowrap;
}

.bgi-shop-filter__sizes label input:focus-visible + span,
.bgi-shop-filter__colors label input:focus-visible + .bgi-color-swatch {
    outline: 3px solid rgba(224, 34, 62, .34);
    outline-offset: 3px;
}

.bgi-shop-filter__sizes label span {
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.bgi-shop-filter__colors--labeled label {
    width: 100%;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color .18s ease, background-color .18s ease;
}

.bgi-shop-filter__colors--labeled label:hover,
.bgi-shop-filter__colors--labeled label:has(input:checked) {
    border-color: rgba(224, 34, 62, .16);
    background: rgba(224, 34, 62, .045);
}

.bgi-shop-filter__colors--labeled b {
    min-width: 0;
    color: #111827;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.bgi-shop-filter__prices,
.bgi-shop-filter__prices label,
.bgi-shop-filter__prices input {
    width: 100%;
    min-width: 0;
}

.bgi-shop-filter__prices input {
    appearance: textfield;
    -moz-appearance: textfield;
    direction: ltr;
    text-align: right;
}

.bgi-shop-filter__prices input::-webkit-outer-spin-button,
.bgi-shop-filter__prices input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

@media (min-width: 992px) {
    .bgi-shop-layout {
        grid-template-columns: clamp(280px, 21vw, 304px) minmax(0, 1fr);
        gap: 24px;
    }

    .bgi-shop-filter__panel {
        top: var(--bgi-fixed-header-bottom, 132px);
        max-height: calc(100vh - var(--bgi-fixed-header-bottom, 132px) - 16px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
}

@media (min-width: 992px) and (max-width: 1180px) {
    .bgi-shop-filter__prices {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bgi-shop-filter fieldset.bgi-shop-filter__group {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .bgi-shop-filter__prices {
        grid-template-columns: 1fr 1fr;
    }
}

/* BGI 2.2 — unified Stockholm icon system (layout neutral) */
.bgi-stockholm-icon{display:inline-block;vertical-align:middle;flex:0 0 auto;overflow:visible;color:inherit}
button .bgi-stockholm-icon,a .bgi-stockholm-icon,i .bgi-stockholm-icon,span .bgi-stockholm-icon{pointer-events:none}

/* Keep the archive filter action visible above mobile browser safe areas. */
@media (max-width: 900px) {
    body.bgi-filter-open .bgi-mobile-bottom-nav,
    body.bgi-filter-open .bgi-shop-bottom-nav {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .bgi-shop-filter.is-open {
        z-index: 100050;
    }

    .bgi-shop-filter__panel {
        display: flex;
        flex-direction: column;
        max-height: 86vh;
        max-height: min(86dvh, calc(100dvh - 16px));
        overflow: hidden;
        padding: 0;
    }

    .bgi-shop-filter__head {
        flex: 0 0 auto;
        margin: 0;
        padding: 16px 18px;
        border-bottom: 1px solid var(--bgi-border);
    }

    .bgi-shop-filter__scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 18px 18px 8px;
    }

    .bgi-shop-filter__actions {
        flex: 0 0 auto;
        margin: 0;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        background: #fff;
        border-top: 1px solid var(--bgi-border);
        box-shadow: 0 -8px 24px rgba(17, 24, 39, .06);
    }
}
