// Beat Storefront `.single-product ... table.variations th/td { display:list-item }`
// so label can sit BELOW swatches.
.single-product div.product table.variations,
.woocommerce div.product form.cart table.variations,
.woocommerce table.variations {
    display: block !important;
    table-layout: auto !important;
    width: 100%;
    max-width: 100%; // A wide row (e.g. a slider) must not push the form wider.
    min-width: 0; // Block add-to-cart forms are grids (min-width: auto).
    border: 0;
    margin: 0 0 1.25rem;
    border-collapse: collapse;

    tbody {
        display: block !important;
        width: 100%;
        max-width: 100%;
    }

    tr {
        display: flex !important;
        flex-direction: column !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0 0 1.15rem;

        &:last-child {
            margin-bottom: 0.25rem;
        }
    }

    // `display: contents` so label / swatches / Clear become flex siblings of `tr`
    // → order: swatches (1) → Flavour label (2) → Clear (3)
    th.label,
    th {
        display: contents !important;
        list-style: none !important;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.35;
        color: #1C1629;
        text-align: left;

        label {
            order: 2;
            display: block;
            width: 100%;
            margin: 0;
            padding: 0.5rem 0 0;
            font-size: inherit;
            font-weight: inherit;
            line-height: inherit;
            color: inherit;
            text-align: left;
        }

        // Selected value: "Flavour : Cocoa"
        .gs_item {
            display: inline;
            margin-left: 0.2em;
            font-weight: 500;
            color: rgba(28, 22, 41, 0.55);

            .gs_item-sep {
                margin-right: 0.25em;
                color: rgba(28, 22, 41, 0.35);
                font-weight: 500;
            }

            .gs_item-value {
                color: rgba(28, 22, 41, 0.72);
                font-weight: 500;
            }
        }
    }

    td.value,
    td {
        display: contents !important;
        list-style: none !important;

        > select {
            order: 1;
        }

        .gs-woo-variation-items-wrapper {
            order: 1;
            width: 100%;
            margin-bottom: 0;
            justify-content: flex-start;
            align-items: flex-start;
        }

        .gs-variable-items-wrapper {
            justify-content: flex-start;
            width: 100%;
        }

        .reset_variations {
            order: 3;
            display: inline-block;
            align-self: flex-start;
            margin-top: 0.35rem;
            font-size: 13px;
            font-weight: 500;
            text-decoration: none;
            color: rgba(28, 22, 41, 0.55);

            &:hover {
                color: #1C1629;
                text-decoration: underline;
            }
        }
    }
}

// Label position (Product Page → Attribute name position). Below is the default above.
body.gs-wvs-label-left form.variations_form.cart table.variations,
body.gs-wvs-label-above form.variations_form.cart table.variations {
    th.label label {
        order: 0;
        padding: 0;
    }
}

body.gs-wvs-label-above form.variations_form.cart table.variations {
    th.label label {
        padding-bottom: 0.6rem;
    }
}

body.gs-wvs-label-left form.variations_form.cart table.variations {
    --gs-wvs--label-gap: 12px;

    tr {
        flex-direction: row !important;
        flex-wrap: wrap;
        align-items: center;
        column-gap: var(--gs-wvs--label-gap);
    }

    // Stacked lists (radio rows): the name sits beside the first option, not mid-list.
    tr:has(.radio-variable-items-wrapper) {
        align-items: flex-start;

        th.label label {
            padding-top: 2px;
        }
    }

    th.label label {
        // As wide as the name, so the values follow right after it.
        flex: 0 0 auto;
        width: auto;
        max-width: 40%;
        overflow-wrap: anywhere;

        // Name + separator ("Color:") even before anything is picked.
        &:not(:has(.gs_item))::after {
            content: var(--gs-wvs--label-sep, ":");
        }

        // Once picked: "Color:" stays, the chosen value goes on its own line so the swatches never shift.
        .gs_item {
            display: inline;
            margin: 0;
            font-weight: inherit;
            color: inherit;

            // Same weight and color as the name: it reads "Color:".
            .gs_item-sep {
                margin: 0;
                font-weight: inherit;
                color: inherit;
            }

            .gs_item-value {
                display: block;
                margin: 2px 0 0;
                font-size: 12px;
                font-weight: 400;
                line-height: 1.3;
            }
        }
    }

    td.value {
        > select,
        .gs-woo-variation-items-wrapper,
        .gs-variable-items-wrapper {
            flex: 1 1 0;
            min-width: 0;
            width: auto;
        }

        // Own line under the row (labels are as wide as their text, so there is no fixed column to indent to).
        .reset_variations {
            flex: 0 0 100%;
            box-sizing: border-box;
        }
    }

}

// Swatch tooltips (theme set in JS; colors from Colors & size → Tooltip).
.tippy-box[data-theme~='gs-wvs'] {
    background-color: var(--gs-wvs--tooltip-bg, #333);
    color: var(--gs-wvs--tooltip-color, #fff);
    font-size: 13px;
    line-height: 1.3;
    border-radius: 6px;

    > .tippy-content {
        padding: 5px 10px;
    }

    > .tippy-arrow {
        color: var(--gs-wvs--tooltip-bg, #333);
    }
}

.gs-variable-items-wrapper {

    --gs-wvs--fields-gap: 5px;

    --gs-wvs--field-radius: 3px;
    --gs-wvs--field-width: 28px;
    --gs-wvs--field-height: 28px;

    --gs-wvs--field-color: #1C1629;
    --gs-wvs--field-color--selected: #fff;
    --gs-wvs--field-color--disabled: rgba(28, 22, 41, 0.2);
    --gs-wvs--field-color--disabled-selected: rgba(28, 22, 41, 0.2);

    --gs-wvs--field-br-color: #1C1629;
    --gs-wvs--field-br-color--selected: #1C1629;
    --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.2);
    --gs-wvs--field-br-color--disabled-selected: #1C1629;
    
    --gs-wvs--field-bg-color: transparent;
    --gs-wvs--field-bg-color--selected: #1C1629;
    --gs-wvs--field-bg-color--disabled: transparent;
    --gs-wvs--field-bg-color--disabled-selected: transparent;

    --gs-wvs--icon-size: 16px;
    --gs-wvs--field-font-size: 16px;
    --gs-wvs--tick-color: #fff;
    --gs-wvs--close-color: rgba(127, 127, 127, 0.4);

    * {
        box-sizing: border-box;
    }

    padding: 0 !important;
    margin: 0 !important;
        
    &.gs-shape-style-rounded_shape {
        --gs-wvs--field-radius: 1000px;
    }

    .variable-item--more-text {
        list-style: none;
        margin-left: 8px;
        cursor: pointer;
        color: #232323;
        font-size: 14px;
        a {
            color: inherit;
        }
    }


    & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
        list-style: none;
        transition: all .2s ease;
        border-radius: var(--gs-wvs--field-radius);

        &, label, input {
            cursor: pointer;
            user-select: none;
            position: relative;
        }

        &:not(:last-of-type) {
            margin-right: var(--gs-wvs--fields-gap);
        }

        svg.gswps--icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            opacity: 0;
            visibility: hidden;
            z-index: 2;
            width: var(--gs-wvs--icon-size);
            height: auto;
            filter: drop-shadow( 0px 0px 8px rgba(0, 0, 0, 0.7) );

            &.gswps--tick {
                --gs-wvs--icon-size: calc( var(--gs-wvs--field-height) * .6 );
            }
    
            &.gswps--close {
                --gs-wvs--icon-size: calc( var(--gs-wvs--field-height) * .5 );
            }

        }

        &.gs-not-available {
            svg.gswps--icon.gswps--close {
                opacity: 1;
                visibility: visible;
            }
        }

        &.selected:not(.gs-not-available) {
            svg.gswps--icon.gswps--tick {
                opacity: 1;
                visibility: visible;
            }
        }

        &.gs-not-available {
            .variable-item-contents {
                opacity: 0.5;
            }
        }

        &.selected,
        &.gs-not-available {
            .variable-item-contents {
                &:after {
                    opacity: 1;
                }
            }
        }

    }

    .variable-item-contents, .variable-item-span, .variable-item-image {
        border-radius: inherit;
    }

    &.color-variable-items-wrapper,
    &.button-variable-items-wrapper,
    &.image-variable-items-wrapper {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    &.color-variable-items-wrapper {

        --gs-wvs--field-br-color: rgba(28, 22, 41, 0.2);

        &.gs-shape-style-square_shape {
            --gs-wvs--field-radius: 5px;
        }

        .variable-item-span {
            width: var(--gs-wvs--field-width);
            height: var(--gs-wvs--field-height);
            display: block;
        }

        &.gs-field-style-style_one {

            --gs-wvs--fields-gap: 8px;
        
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

                border: 1px solid var(--gs-wvs--field-br-color);
                padding: 4px;
                background: #fff;
    
                &.selected {
                    border-color: var(--gs-wvs--field-br-color--selected);
                }
            }
    
        }

        &.gs-field-style-style_two {

            --gs-wvs--fields-gap: 6px;
            --gs-wvs--field-width: 22px;
            --gs-wvs--field-height: 22px;
            --gs-wvs--tick-color: #1C1629;
        
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

                border: 0;
                padding: 0;
                background: transparent;
    
                &.selected {
                    box-shadow: 0 0 0 2px var(--gs-wvs--field-br-color--selected, #1C1629);
                }
            }
    
        }

        &.gs-field-style-style_three {

            --gs-wvs--field-width: 30px;
            --gs-wvs--field-height: 30px;
            --gs-wvs--fields-gap: 4px;
            
            --gs-wvs--field-br-color--selected: rgba(28, 22, 41, 0.1);
        
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

                border: 6px solid transparent;
                padding: 0;
                background: transparent;
    
                &.selected {
                    border-color: var(--gs-wvs--field-br-color--selected);
                }

                .variable-item-span-color {
                    border: 1px solid rgba(28, 22, 41, 0.10);
                    background-size: 120% 120%;
                    background-position: center;
                    background-repeat: no-repeat;
                }
            }
    
        }

        &.gs-field-style-style_four {

            --gs-wvs--field-width: 30px;
            --gs-wvs--field-height: 30px;
            --gs-wvs--fields-gap: 12px;
            
            --gs-wvs--field-br-color--selected: #1C1629;
        
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

                border: 0;
                padding: 0;
                background: transparent;
    
                &.selected {
                    box-shadow:
                        0 0 0 2px #fff,
                        0 0 0 3.5px var(--gs-wvs--field-br-color--selected, #1C1629);
                }

                .variable-item-span-color {
                    border: 1px solid rgba(28, 22, 41, 0.12);
                }

            }
    
        }

    }

    &.image-variable-items-wrapper {

        --gs-wvs--field-br-color: rgba(28, 22, 41, 0.20);
        --gs-wvs--field-br-color--selected: #1C1629;
        --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.07);
        --gs-wvs--field-br-color--disabled-selected: #1C1629;

        --gs-wvs--field-bg-color: transparent;
        --gs-wvs--field-bg-color--selected: transparent;
        --gs-wvs--field-bg-color--disabled: transparent;
        --gs-wvs--field-bg-color--disabled-selected: transparent;

        .variable-item-image {
            width: var(--gs-wvs--field-width);
            height: var(--gs-wvs--field-height);
            object-fit: contain;
        }
        
        li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

            border: 1px solid var(--gs-wvs--field-br-color);
            background: var(--gs-wvs--field-bg-color);

            &.selected {
                border-color: var(--gs-wvs--field-br-color--selected);
                background: var(--gs-wvs--field-bg-color--selected);
            }

            &.gs-not-available {
                border-color: var(--gs-wvs--field-br-color--disabled);
                background: var(--gs-wvs--field-bg-color--disabled);
            }

            &.selected.gs-not-available {
                border-color: var(--gs-wvs--field-br-color--disabled-selected);
                background: var(--gs-wvs--field-bg-color--disabled-selected);
            }

        }

        &.gs-field-style-style_one {

            --gs-wvs--field-width: 22px;
            --gs-wvs--field-height: 22px;

            .variable-item-contents {
                line-height: 0;
                position: relative;

                &:after {
                    content: "";
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    border-radius: inherit;
                    background: rgba(28, 22, 41, 0.25);
                    opacity: 0;
                }
            }
        
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

                .variable-item-contents {
                    padding: 3px;
                }
    
                &.selected {
                    .variable-item-contents {
                        &:after {
                            opacity: 1;
                        }
                    }
                }
            }
    
        }

        &.gs-field-style-style_two {
            --gs-wvs--field-width: 28px;
            --gs-wvs--field-height: 28px;
            --gs-wvs--fields-gap: 6px;
            --gs-wvs--field-font-size: 13px;
            --gs-wvs--field-radius: 8px;
            --gs-wvs--image-radius: 5px;
            --gs-wvs--field-br-color: rgba(28, 22, 41, 0.12);
            --gs-wvs--field-br-color--selected: #1C1629;
            --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.08);
            --gs-wvs--field-br-color--disabled-selected: rgba(28, 22, 41, 0.35);
            --gs-wvs--field-bg-color: #fff;
            --gs-wvs--field-bg-color--selected: rgba(28, 22, 41, 0.05);
            --gs-wvs--field-bg-color--disabled: #fff;
            --gs-wvs--field-bg-color--disabled-selected: rgba(28, 22, 41, 0.03);
            --gs-wvs--field-color: #1C1629;
            --gs-wvs--field-color--selected: #1C1629;

            // Image + label rows (not accidental wrap from long names).
            flex-direction: column;
            align-items: stretch;
            flex-wrap: nowrap;
            width: 100%;
            gap: var(--gs-wvs--fields-gap);

            .variable-item-contents:after,
            .gs-stock-left-info,
            .gswps--icon.gswps--tick {
                display: none;
            }

            // Shape controls the thumbnail, not the whole chip.
            &.gs-shape-style-rounded_shape {
                --gs-wvs--field-radius: 8px;
                --gs-wvs--image-radius: 1000px;
            }

            &.gs-shape-style-square_shape {
                --gs-wvs--field-radius: 8px;
                --gs-wvs--image-radius: 5px;
            }

            .variable-item-image {
                width: var(--gs-wvs--field-width);
                height: var(--gs-wvs--field-height);
                flex-shrink: 0;
                object-fit: cover;
                border-radius: var(--gs-wvs--image-radius);
                background: rgba(28, 22, 41, 0.04);
            }

            .variable-item-contents {
                display: flex;
                align-items: center;
                gap: 10px;
                width: 100%;
                border-radius: 0;
            }

            .variable-item-span {
                margin: 0;
                flex: 1 1 auto;
                min-width: 0;
                line-height: 1.3;
                font-size: var(--gs-wvs--field-font-size);
                font-weight: 500;
                color: var(--gs-wvs--field-color);
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                width: 100%;
                margin-right: 0 !important;
                padding: 5px 12px 5px 5px;
                border-radius: var(--gs-wvs--field-radius);
                box-shadow: none;

                &:hover:not(.selected):not(.gs-not-available) {
                    background: rgba(28, 22, 41, 0.035);
                    border-color: rgba(28, 22, 41, 0.2);
                }

                &.selected {
                    border-color: var(--gs-wvs--field-br-color--selected);
                    background: var(--gs-wvs--field-bg-color--selected);
                    box-shadow: inset 0 0 0 1px var(--gs-wvs--field-br-color--selected);

                    .variable-item-span {
                        font-weight: 600;
                        color: var(--gs-wvs--field-color--selected);
                    }
                }

                &.gs-not-available {
                    border-color: var(--gs-wvs--field-br-color--disabled);

                    .variable-item-contents {
                        opacity: 1;
                    }

                    .variable-item-image {
                        opacity: 0.45;
                    }

                    .variable-item-span {
                        color: var(--gs-wvs--field-color--disabled);
                    }
                }

                &.selected.gs-not-available {
                    border-color: var(--gs-wvs--field-br-color--disabled-selected);
                    box-shadow: none;

                    .variable-item-span {
                        color: var(--gs-wvs--field-color--disabled-selected);
                    }
                }
            }

        }
    
        &.gs-field-style-style_three {
        
            --gs-wvs--fields-gap: 0;
            --gs-wvs--field-width: 30px;
            --gs-wvs--field-height: 30px;

            --gs-wvs--field-br-color: transparent;
            --gs-wvs--field-br-color--selected: rgba( 0, 0, 0, 0.07 );
            --gs-wvs--field-br-color--disabled: transparent;
            --gs-wvs--field-br-color--disabled-selected: transparent;

            --gs-wvs--field-bg-color: transparent;
            --gs-wvs--field-bg-color--selected: transparent;
            --gs-wvs--field-bg-color--disabled: transparent;
            --gs-wvs--field-bg-color--disabled-selected: transparent;

            &.gs-shape-style-square_shape {
                --gs-wvs--field-radius: 5px;
            }

            svg.gswps--icon {
    
                &.gswps--tick {
                    display: none;
                }
    
            }

            .variable-item-contents {
                line-height: 0;
            }
            
            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                border-width: 5px;
                border-color: transparent;
                background: transparent;

                &.selected {
                    border-color: var(--gs-wvs--field-br-color--selected);
                }
            }
    
        }

    }

    &.button-variable-items-wrapper {

        .variable-item-span {
            min-width: var(--gs-wvs--field-width);
            height: var(--gs-wvs--field-height);
            line-height: var(--gs-wvs--field-height);
            color: var(--gs-wvs--field-color);
            text-align: center;
            display: block;
            padding: 0px 5px;
            font-size: var(--gs-wvs--field-font-size);
            font-weight: 500;
        }

        .gswps--icon.gswps--tick {
            display: none;
        }

        li:not(.variable-item--more-text):not(.variable-item--more-arrow) {

            border: 1px solid var(--gs-wvs--field-br-color);
            background: var(--gs-wvs--field-bg-color);

            &.selected {
                background: var(--gs-wvs--field-bg-color--selected);
                border-color: var(--gs-wvs--field-br-color--selected);
                
                .variable-item-span {
                    color: var(--gs-wvs--field-color--selected);
                }

            }

            &.gs-not-available {
                background: var(--gs-wvs--field-bg-color--disabled);
                border-color: var(--gs-wvs--field-br-color--disabled);

                .variable-item-contents {
                    opacity: 1;
                }
    
                .variable-item-span {
                    color: var(--gs-wvs--field-color--disabled);
                }

            }

            &.selected.gs-not-available {
                background: var(--gs-wvs--field-bg-color--disabled-selected);
                border-color: var(--gs-wvs--field-br-color--disabled-selected);
    
                .variable-item-span {
                    color: var(--gs-wvs--field-color--disabled-selected);
                }

            }

        }

        &.gs-field-style-style_one {
            --gs-wvs--fields-gap: 8px;
            --gs-wvs--field-width: auto;
            --gs-wvs--field-height: 36px;
            --gs-wvs--field-font-size: 13px;
            --gs-wvs--field-radius: 8px;

            --gs-wvs--field-color: #1C1629;
            --gs-wvs--field-color--selected: #fff;
            --gs-wvs--field-color--disabled: rgba(28, 22, 41, 0.35);
            --gs-wvs--field-color--disabled-selected: rgba(255, 255, 255, 0.75);

            --gs-wvs--field-br-color: rgba(28, 22, 41, 0.14);
            --gs-wvs--field-br-color--selected: #1C1629;
            --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.1);
            --gs-wvs--field-br-color--disabled-selected: rgba(28, 22, 41, 0.35);

            --gs-wvs--field-bg-color: #fff;
            --gs-wvs--field-bg-color--selected: #1C1629;
            --gs-wvs--field-bg-color--disabled: #fff;
            --gs-wvs--field-bg-color--disabled-selected: rgba(28, 22, 41, 0.4);

            width: 100%;
            max-width: 100%;
            gap: var(--gs-wvs--fields-gap);

            &.gs-shape-style-square_shape {
                --gs-wvs--field-radius: 8px;
            }

            &.gs-shape-style-rounded_shape {
                --gs-wvs--field-radius: 1000px;
            }

            .variable-item-contents {
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: inherit;
            }

            .variable-item-span {
                min-width: 0;
                width: 100%;
                height: auto;
                min-height: var(--gs-wvs--field-height);
                line-height: 1.2;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 0 14px;
                font-weight: 500;
                letter-spacing: 0.01em;
                white-space: nowrap;
            }

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                margin-right: 0 !important;
                margin-bottom: 0 !important;
                overflow: hidden;
                transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;

                &:hover:not(.selected):not(.gs-not-available) {
                    border-color: rgba(28, 22, 41, 0.38);
                    background: rgba(28, 22, 41, 0.035);
                }

                &:focus-visible {
                    outline: 2px solid rgba(28, 22, 41, 0.45);
                    outline-offset: 2px;
                }

                &.selected {
                    box-shadow: 0 1px 3px rgba(28, 22, 41, 0.16);

                    .variable-item-span {
                        font-weight: 600;
                    }
                }

                &:active:not(.gs-not-available) {
                    transform: translateY(0.5px);
                }
            }
        }

        &.gs-field-style-style_two {
            --gs-wvs--fields-gap: 6px;
            --gs-wvs--field-width: auto;
            --gs-wvs--field-height: 36px;
            --gs-wvs--field-font-size: 13px;
            --gs-wvs--field-radius: 8px;

            --gs-wvs--field-color: #1C1629;
            --gs-wvs--field-color--selected: #1C1629;
            --gs-wvs--field-color--disabled: rgba(28, 22, 41, 0.35);
            --gs-wvs--field-color--disabled-selected: rgba(28, 22, 41, 0.45);

            // Text only (Figma): no border until selected, then a thin dark box.
            --gs-wvs--field-br-color: transparent;
            --gs-wvs--field-br-color--selected: #1C1629;
            --gs-wvs--field-br-color--disabled: transparent;
            --gs-wvs--field-br-color--disabled-selected: rgba(28, 22, 41, 0.35);

            --gs-wvs--field-bg-color: transparent;
            --gs-wvs--field-bg-color--selected: transparent;
            --gs-wvs--field-bg-color--disabled: transparent;
            --gs-wvs--field-bg-color--disabled-selected: transparent;

            width: 100%;
            max-width: 100%;
            gap: var(--gs-wvs--fields-gap);

            &.gs-shape-style-square_shape {
                --gs-wvs--field-radius: 4px;
            }

            &.gs-shape-style-rounded_shape {
                --gs-wvs--field-radius: 1000px;
            }

            .variable-item-contents {
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: inherit;
            }

            .variable-item-span {
                min-width: 0;
                width: 100%;
                height: auto;
                min-height: var(--gs-wvs--field-height);
                line-height: 1.2;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 0 10px;
                font-weight: 500;
                letter-spacing: 0.01em;
                white-space: nowrap;
            }

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                margin-right: 0 !important;
                margin-bottom: 0 !important;
                overflow: hidden;
                // Keep layout stable when border appears on select.
                border-width: 1px !important;
                border-style: solid;
                box-shadow: none !important;
                outline: none;
                transition: background-color .18s ease, border-color .18s ease, color .18s ease;

                &:hover:not(.selected):not(.gs-not-available) {
                    background: rgba(28, 22, 41, 0.04);
                    border-color: rgba(28, 22, 41, 0.08);
                }

                &:focus-visible {
                    outline: 2px solid rgba(28, 22, 41, 0.45);
                    outline-offset: 2px;
                }

                &.selected {
                    background: transparent;
                    border-color: var(--gs-wvs--field-br-color--selected);

                    .variable-item-span {
                        font-weight: 600;
                        color: var(--gs-wvs--field-color--selected);
                    }
                }

                &.gs-not-available {
                    .variable-item-span {
                        text-decoration: line-through;
                        text-decoration-color: rgba(28, 22, 41, 0.25);
                    }
                }

                &:active:not(.gs-not-available) {
                    transform: translateY(0.5px);
                }
            }
        }

        &.gs-field-style-style_three {
            --gs-wvs--fields-gap: 8px;
            --gs-wvs--field-width: auto;
            --gs-wvs--field-height: 34px;
            --gs-wvs--field-font-size: 13px;
            --gs-wvs--field-radius: 8px;

            --gs-wvs--field-color: #1C1629;
            --gs-wvs--field-color--selected: #1C1629;
            --gs-wvs--field-color--disabled: rgba(28, 22, 41, 0.35);
            --gs-wvs--field-color--disabled-selected: rgba(28, 22, 41, 0.45);

            --gs-wvs--field-br-color: rgba(28, 22, 41, 0.14);
            --gs-wvs--field-br-color--selected: #1C1629;
            --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.1);
            --gs-wvs--field-br-color--disabled-selected: rgba(28, 22, 41, 0.35);

            --gs-wvs--field-bg-color: #fff;
            --gs-wvs--field-bg-color--selected: transparent;
            --gs-wvs--field-bg-color--disabled: #fff;
            --gs-wvs--field-bg-color--disabled-selected: transparent;

            // Even wrap rhythm; center rows so uneven last lines don't look stair-stepped.
            gap: var(--gs-wvs--fields-gap);
            justify-content: center;

            &.gs-shape-style-square_shape {
                --gs-wvs--field-radius: 4px;
            }

            &.gs-shape-style-rounded_shape {
                --gs-wvs--field-radius: 1000px;
            }

            .variable-item-span {
                min-width: 0;
                height: auto;
                min-height: var(--gs-wvs--field-height);
                line-height: 1.25;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 0 16px;
                letter-spacing: 0.01em;
            }

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                margin-right: 0 !important;
                overflow: hidden;

                &:hover:not(.selected):not(.gs-not-available) {
                    border-color: rgba(28, 22, 41, 0.35);
                    background: rgba(28, 22, 41, 0.03);
                }

                // Outline selected (distinct from Style One solid fill).
                &.selected {
                    background: transparent;
                    border-color: var(--gs-wvs--field-br-color--selected);
                    box-shadow: inset 0 0 0 1px var(--gs-wvs--field-br-color--selected);

                    .variable-item-span {
                        font-weight: 600;
                        color: var(--gs-wvs--field-color--selected);
                    }
                }

                &.selected.gs-not-available {
                    box-shadow: none;
                }
            }
        }

    }

    &.radio-variable-items-wrapper {
        display: flex;
        flex-direction: column;
        align-items: flex-start; // keep rows content-width (no full-bleed selected chrome)
        gap: 10px; // Room between rows, so each option reads as its own tap target.

        .variable-item-radio-input-wrapper {
            display: inline-flex;
            align-items: center;
            gap: 0;
            margin: 0; // Themes often add a bottom margin to every <label>.
            line-height: 1.2;
        }

        .variable-item-radio-circle {
            border: 1px solid rgba(28, 22, 41, 0.3);
            width: 18px;
            height: 18px;
            flex: 0 0 18px;
            display: inline-flex;
            border-radius: 50%;
            align-items: center;
            justify-content: center;
            margin-right: 8px;

            &:after {
                content: "";
                width: 10px;
                height: 10px;
                border-radius: inherit;
                background: #1C1629;
                display: block;
                opacity: 0;
            }
        }

        & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
            display: inline-flex;
            align-items: center;
            width: auto;
            max-width: 100%;
            min-height: 0;
            height: auto;
            margin: 0 !important;
            padding: 0 !important;
            line-height: 1.2;
            border: 0 !important;
            box-shadow: none !important;
            outline: none !important;
            background: transparent !important;
            border-radius: 0;

            &:focus,
            &:focus-visible,
            &:active,
            &.selected,
            &.selected:focus,
            &.selected:focus-visible {
                border: 0 !important;
                box-shadow: none !important;
                outline: none !important;
                background: transparent !important;
            }

            .variable-item-contents {
                display: inline-flex;
                align-items: center;
                width: auto;
                padding: 0;
                border: 0;
                box-shadow: none;
                background: transparent;

                &:after {
                    display: none !important;
                    content: none !important;
                }
            }

            &.selected {
                .variable-item-radio-circle {
                    border-color: #1C1629;
                    &:after {
                        opacity: 1;
                    }
                }
            }

            &.gs-not-available {
                .variable-item-contents {
                    opacity: 1;
                }
                .variable-item-radio-circle {
                    border-color: rgba(#1C1629, 0.2);
                    &:after {
                        background-color: rgba(#1C1629, 0.2);
                    }
                }
                .variable-item-radio-value-wrapper {
                    color: rgb(28 22 41 / 20%);
                }
            }

        }
        
        .gswps--icon.gswps--tick,
        .gswps--icon.gswps--close {
            display: none;
        }

        // Stacked buttons (style two) and inline buttons (style three):
        // each option is a bordered box with the radio circle inside.
        &.gs-field-style-style_two,
        &.gs-field-style-style_three {
            --gs-wvs--field-radius: 8px;
            --gs-wvs--field-br-color: rgba(28, 22, 41, 0.14);
            --gs-wvs--field-br-color--selected: #1C1629;
            --gs-wvs--field-br-color--disabled: rgba(28, 22, 41, 0.08);
            --gs-wvs--field-bg-color: #fff;
            --gs-wvs--field-bg-color--selected: rgba(28, 22, 41, 0.03);
            --gs-wvs--field-color: #1C1629;
            gap: 8px;

            &.gs-shape-style-rounded_shape {
                --gs-wvs--field-radius: 1000px;
            }

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                padding: 10px 14px !important;
                border: 1px solid var(--gs-wvs--field-br-color) !important;
                border-radius: var(--gs-wvs--field-radius);
                background: var(--gs-wvs--field-bg-color) !important;
                transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;

                &:hover:not(.selected):not(.gs-not-available) {
                    border-color: rgba(28, 22, 41, 0.35) !important;
                }

                &:focus-visible {
                    outline: 2px solid rgba(28, 22, 41, 0.45) !important;
                    outline-offset: 2px;
                }

                &.selected,
                &.selected:focus,
                &.selected:focus-visible {
                    border-color: var(--gs-wvs--field-br-color--selected) !important;
                    background: var(--gs-wvs--field-bg-color--selected) !important;
                    box-shadow: inset 0 0 0 1px var(--gs-wvs--field-br-color--selected) !important;
                }

                &.gs-not-available {
                    border-color: var(--gs-wvs--field-br-color--disabled) !important;
                }

                .variable-item-radio-value-wrapper {
                    font-size: var(--gs-wvs--field-font-size);
                    font-weight: 500;
                    line-height: 1.3;
                    color: var(--gs-wvs--field-color);
                }

                &.selected .variable-item-radio-value-wrapper {
                    font-weight: 600;
                }
            }
        }

        &.gs-field-style-style_two {
            align-items: stretch;
            width: 100%;
            max-width: 420px;

            & > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
                width: 100%;

                .variable-item-contents,
                .variable-item-radio-input-wrapper {
                    width: 100%;
                }
            }
        }

        &.gs-field-style-style_three {
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
        }

    }



}

.gs-woo-variation-items-wrapper {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Shop / catalog / related loop swatches (Lite shop cards and Pro loop / embeds share this). */
.gs-archive-variations-wrapper {
    --gs-archive-gap: 0.45rem;
    --gs-archive-row-gap: 0.55rem;

    display: block;
    width: 100%;
    margin: 0.55rem 0 0.7rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2; // Above product-card link overlays in block themes.

    .variations {
        display: grid;
        gap: var(--gs-archive-row-gap);
        place-items: center;
        position: relative;
        width: 100%;
        min-height: 0;
        margin: 0;
    }

    .gs-woo-variation-items-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .gs-variable-items-wrapper {
        --gs-wvs--fields-gap: 6px;
        --gs-wvs--field-width: 30px;
        --gs-wvs--field-height: 30px;
        justify-content: center;
        width: 100%;
        margin: 0;
        padding: 0;
        gap: var(--gs-archive-gap);
    }

    .gs-variable-items-wrapper > li.variable-item:not(.variable-item--more-text):not(.variable-item--more-arrow) {
        margin-right: 0;
        min-width: 30px;
        min-height: 30px;
    }

    /* Slightly clearer selected state at catalog density */
    .gs-variable-items-wrapper > li.variable-item.selected:not(.gs-not-available) {
        box-shadow: 0 0 0 2px rgba(28, 22, 41, 0.12);
        transform: translateY(-1px);
    }

    .gs-variable-items-wrapper.color-variable-items-wrapper > li.variable-item.selected:not(.gs-not-available),
    .gs-variable-items-wrapper.image-variable-items-wrapper > li.variable-item.selected:not(.gs-not-available) {
        box-shadow: 0 0 0 2px rgba(28, 22, 41, 0.28);
    }

    /* Radio: card-sized text; the classic list sits as one block under the card's alignment */
    .gs-variable-items-wrapper.radio-variable-items-wrapper {
        font-size: var(--gs-wvs--field-font-size, 14px);

        // Rows, not chips: skip the 40px chip touch target (the whole row is tappable).
        > li.variable-item:not(.variable-item--more-text):not(.variable-item--more-arrow) {
            min-width: 0;
            min-height: 0;
            transform: none;
        }

        .variable-item-radio-value-wrapper {
            font-size: var(--gs-wvs--field-font-size, 14px);
        }

        &.gs-field-style-style_one {
            width: auto;
        }

        // Side by side: one centred row (start / end follow the card alignment below).
        &.gs-field-style-style_one.gs-radio-layout-horizontal {
            width: 100%;
            justify-content: center;
        }

        &.gs-field-style-style_two {
            max-width: 100%;
        }

        &.gs-field-style-style_three {
            justify-content: center;
        }
    }

    &.gs-archive-align-start {
        .radio-variable-items-wrapper.gs-radio-layout-horizontal,
        .radio-variable-items-wrapper.gs-field-style-style_three,
        .gs-woo-variation-items-wrapper:has(> .radio-variable-items-wrapper) {
            justify-content: flex-start;
        }
    }

    &.gs-archive-align-end {
        .radio-variable-items-wrapper.gs-radio-layout-horizontal,
        .radio-variable-items-wrapper.gs-field-style-style_three,
        .gs-woo-variation-items-wrapper:has(> .radio-variable-items-wrapper) {
            justify-content: flex-end;
        }
    }

    .gs_archive_reset_variations {
        display: none;
        width: 100%;
        justify-content: center;
        margin: 0;
        min-height: 0;

        &.is-visible {
            display: flex;
            margin-top: 0.05rem;
        }
    }

    .gs_archive_reset_variations_link {
        display: inline-block;
        padding: 0;
        border: 0;
        background: transparent;
        color: rgba(28, 22, 41, 0.48);
        font-size: 12px;
        font-weight: 500;
        line-height: 1.3;
        text-decoration: none;
        transition: color .15s ease;

        &:hover,
        &:focus {
            color: #1C1629;
            text-decoration: underline;
            background: transparent;
        }

        &:focus {
            outline: none;
        }

        &:focus-visible {
            outline: 2px solid rgba(28, 22, 41, 0.3);
            outline-offset: 2px;
            border-radius: 2px;
        }
    }

    .gs-archive-information {
        display: none;
        min-height: 0;
        margin-top: 0.3rem;
        font-size: 12px;
        line-height: 1.35;
        text-align: center;
        color: rgba(28, 22, 41, 0.65);

        &.is-visible:not(:empty) {
            display: block;
        }

        &:empty {
            display: none;
            margin: 0;
        }

        .gs-embed-added {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 0.2rem 0.55rem;
            border-radius: 999px;
            background: rgba(10, 122, 47, 0.1);
            color: #0a7a2f;
            font-size: 12px;
            font-weight: 600;
            animation: gs-archive-fade-in .2s ease;

            &:before {
                content: "";
                width: 7px;
                height: 7px;
                border-radius: 50%;
                background: currentColor;
                flex: 0 0 auto;
            }
        }
    }

    .gs-variable-items-wrapper li.variable-item {
        cursor: pointer;
        position: relative;
        z-index: 1;
    }

    /* +N more / expand control */
    .variable-item--more-text {
        list-style: none;
        margin: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 30px;
        padding: 0 0.55rem;
        border-radius: 999px;
        border: 1px solid rgba(28, 22, 41, 0.14);
        background: rgba(28, 22, 41, 0.03);
        color: rgba(28, 22, 41, 0.7);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.01em;
        cursor: pointer;
        user-select: none;
        transition: background .15s ease, border-color .15s ease, color .15s ease;

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

        &:hover,
        &:focus-visible {
            color: #1C1629;
            border-color: rgba(28, 22, 41, 0.28);
            background: rgba(28, 22, 41, 0.06);
            outline: none;
        }
    }



    @media (max-width: 600px) {
        --gs-archive-gap: 0.4rem;
        --gs-archive-row-gap: 0.45rem;
        margin: 0.45rem 0 0.55rem;

        .gs-variable-items-wrapper {
            --gs-wvs--field-width: 40px;
            --gs-wvs--field-height: 40px;
        }

        .gs-variable-items-wrapper > li.variable-item:not(.variable-item--more-text):not(.variable-item--more-arrow) {
            min-width: 40px;
            min-height: 40px;
        }

        .variable-item--more-text {
            min-height: 40px;
            font-size: 12px;
        }

    }

    /* Alignment — mirrors Shop & Catalog setting; matches typical ATC placement */
    &.gs-archive-align-start {
        .variations {
            place-items: start;
        }

        .gs-variable-items-wrapper {
            justify-content: flex-start;
        }

        .gs_archive_reset_variations,
        .gs-archive-information {
            justify-content: flex-start;
            text-align: left;
        }
    }

    &.gs-archive-align-center {
        .variations {
            place-items: center;
        }

        .gs-variable-items-wrapper {
            justify-content: center;
        }

        .gs_archive_reset_variations,
        .gs-archive-information {
            justify-content: center;
            text-align: center;
        }
    }

    &.gs-archive-align-end {
        .variations {
            place-items: end;
        }

        .gs-variable-items-wrapper {
            justify-content: flex-end;
        }

        .gs_archive_reset_variations,
        .gs-archive-information {
            justify-content: flex-end;
            text-align: right;
        }
    }
}


@keyframes gs-archive-fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Softly nudge sibling ATC to match swatch alignment without rewriting the card */
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-center) > .button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-center) > a.button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-center) > .gswvs-add-to-cart-btn,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-center) > .button,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-center) > a.button {
    margin-left: auto;
    margin-right: auto;
}

.product:has(> .gs-archive-variations-wrapper.gs-archive-align-end) > .button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-end) > a.button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-end) > .gswvs-add-to-cart-btn,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-end) > .button,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-end) > a.button {
    margin-left: auto;
    margin-right: 0;
}

.product:has(> .gs-archive-variations-wrapper.gs-archive-align-start) > .button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-start) > a.button,
.product:has(> .gs-archive-variations-wrapper.gs-archive-align-start) > .gswvs-add-to-cart-btn,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-start) > .button,
.wc-block-grid__product:has(> .gs-archive-variations-wrapper.gs-archive-align-start) > a.button {
    margin-left: 0;
    margin-right: auto;
}
/* Colors and plain images: keep the swatch centred in its box. Cards / catalogs give the box a
   minimum (touch) size bigger than the swatch, and the tick is centred on the box. */
.gs-variable-items-wrapper.color-variable-items-wrapper > li:not(.variable-item--more-text):not(.variable-item--more-arrow),
.gs-variable-items-wrapper.image-variable-items-wrapper:not(.gs-field-style-style_two):not(.gs-field-style-style_pill) > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Buttons: keep the label centred in the box (catalog boxes are taller than the label). */
.gs-variable-items-wrapper.button-variable-items-wrapper > li:not(.variable-item--more-text):not(.variable-item--more-arrow) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Round buttons: the label box is never narrower than tall (same var as its height),
   so short labels (6, M) are circles; long ones stay pills. */
.gs-variable-items-wrapper.button-variable-items-wrapper.gs-shape-style-rounded_shape .variable-item-span {
    box-sizing: border-box;
    min-width: var(--gs-wvs--field-height);
    padding-left: 8px;
    padding-right: 8px;
}


/* Radio, classic list side by side (Look & feel → Radio layout). */
.gs-variable-items-wrapper.radio-variable-items-wrapper.gs-field-style-style_one.gs-radio-layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 18px;
    row-gap: 8px;
}


/* Light colors (white, cream...): dark tick and no glow, so the check stays crisp. */
.gs-variable-items-wrapper > li:has(.is-light-color) {
    --gs-wvs--tick-color: #1C1629;

    .gswps--icon.gswps--tick {
        filter: none !important;
    }
}


/* ==========================================================
   Product card (Shop & Catalog "Plugin card"; Pro embeds use it too)
   and catalog page chrome. Shared by Lite and Pro.
   ========================================================== */
.gs-embed-product {
    --gs-card-title-size: 1.1rem;
    --gs-card-btn-radius: 8px;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(28, 22, 41, 0.08);
    border-radius: 8px;
    background: #fff;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;

    &.gs-embed-align-start .gs-archive-variations-wrapper .variations {
        place-items: start;
    }
    &.gs-embed-align-center .gs-archive-variations-wrapper .variations {
        place-items: center;
    }
    &.gs-embed-align-end .gs-archive-variations-wrapper .variations {
        place-items: end;
    }


    /* Title alignment / size */
    &.gs-card-title-center {
        .gs-embed-product__category,
        .gs-embed-product__rating,
        .gs-embed-product__title,
        .gs-embed-product__price,
        .gs-embed-product__cart,
        .gs-archive-information {
            text-align: center;
        }
    }

    &.gs-card-title-size-md {
        --gs-card-title-size: 1.1rem;
    }

    /* Button skins */

    &.gs-card-btn-r-md {
        --gs-card-btn-radius: 8px;
    }



    // Shared button feel for every skin: compact, firm label, soft lift on hover.
    .gs-embed-product__cart .gswvs-add-to-cart-btn {
        min-height: 40px;
        padding: 0.55rem 1.3rem;
        font-size: 14px;
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: 0.01em;

        &:hover {
            transform: translateY(-1px);
        }

        &:active {
            transform: translateY(0);
        }

        &:focus-visible {
            outline: 2px solid rgba(28, 22, 41, 0.35);
            outline-offset: 2px;
        }
    }

    // Default skin: a quiet neutral chip that turns dark on hover (the theme's gray
    // .button looked unfinished in the card).
    &.gs-card-btn-theme .gs-embed-product__cart .gswvs-add-to-cart-btn {
        border-radius: var(--gs-card-btn-radius);
        background: rgba(28, 22, 41, 0.06);
        color: #1c1629;
        border: 1px solid rgba(28, 22, 41, 0.1);

        &:hover,
        &:focus {
            background: #1c1629;
            border-color: #1c1629;
            color: #fff;
        }
    }

    // Square photo area, whole photo inside (portrait / landscape shots are never cut),
    // so every card in a row lines up.
    .gs-embed-product__image {
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        text-align: center;

        > a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        // !important: WooCommerce / themes set `li.product a img { height: auto; margin-bottom: 1em }`.
        img {
            width: 100%;
            max-width: 100%;
            height: 100% !important;
            margin: 0 auto !important;
            object-fit: contain;
            transition: opacity 0.2s ease;
        }
    }

    .gs-embed-product__title {
        margin: 0;
        font-size: var(--gs-card-title-size);
        line-height: 1.35;
        text-align: center;

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

    .gs-embed-product__price {
        text-align: center;
        margin: 0;
    }

    .gs-embed-product__cart {
        text-align: center;
        margin-top: 0.25rem;

        // Size and type: see "Shared button feel" below.
        .gswvs-add-to-cart-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            text-transform: capitalize;
            border-radius: var(--gs-card-btn-radius);
            text-decoration: none !important;
            box-shadow: none;
            transition: opacity 0.2s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;

            &:hover,
            &:focus {
                text-decoration: none !important;
            }

            &.loading {
                opacity: 0.6;
                pointer-events: none;
            }

            &.gswvs-variation-ready:not(.loading) {
                transform: translateY(0);
            }
        }
    }

    .gs-archive-information {
        min-height: 1.25em;
        text-align: center;
        font-size: 0.9rem;

        .gs-embed-added {
            color: #0a7a2f;
            font-weight: 600;
        }
    }

    .gs-archive-variations-wrapper {
        width: 100%;
    }

    .gs-variable-items-wrapper > li.variable-item {
        min-width: 32px;
        min-height: 32px;
    }

    // One rhythm inside the card: the card's gap is the only space between title,
    // price, swatches and button. !important: WooCommerce / themes add their own
    // margins to loop titles, prices and buttons (li.product h3 / .price / .button).
    .gs-embed-product__title,
    .gs-embed-product__price,
    .gs-embed-product__cart .gswvs-add-to-cart-btn {
        margin: 0 !important;
    }

    .gs-embed-product__title {
        padding: 0 !important;
    }

    > .gs-archive-variations-wrapper,
    .gs-woo-variation-items-wrapper {
        margin: 0;
    }

    // Buttons line up along the bottom of a row of cards.
    .gs-embed-product__cart {
        margin-top: auto;
        padding-top: 0.25rem;
    }
}

/* Plugin-mode cards inside theme li.product — avoid double padding from theme */
li.product .gs-loop-plugin-card.gs-embed-product {
    margin: 0;
}

/* ==========================================================
   Catalog page chrome (breadcrumb / title / results / sort / pagination)
   Opt-in via catalog_chrome_mode = plugin — theme HTML kept
   ========================================================== */
body.gs-woo-catalog-chrome {
    --gs-chrome-ink: #1c1629;
    --gs-chrome-muted: rgba(28, 22, 41, 0.62);
    --gs-chrome-line: rgba(28, 22, 41, 0.12);
    --gs-chrome-fill: rgba(28, 22, 41, 0.04);
    --gs-chrome-radius: 8px;

    .woocommerce-breadcrumb,
    .wp-block-woocommerce-breadcrumbs {
        margin: 0 0 0.75rem;
        font-size: 0.875rem;
        line-height: 1.5;
        color: var(--gs-chrome-muted);
        letter-spacing: 0.01em;

        a {
            color: var(--gs-chrome-muted);
            text-decoration: none;
            transition: color 0.15s ease;

            &:hover,
            &:focus {
                color: var(--gs-chrome-ink);
            }
        }
    }

    .wp-block-query-title,
    .woocommerce-products-header__title,
    h1.page-title,
    .entry-title {
        margin: 0 0 1.25rem;
        color: var(--gs-chrome-ink);
        font-weight: 700;
        letter-spacing: -0.02em;
        line-height: 1.2;
    }

    /* Results + sorting toolbar */
    .woocommerce-result-count,
    .wp-block-woocommerce-product-results-count,
    .wc-block-product-results-count {
        margin: 0;
        font-size: 0.875rem;
        color: var(--gs-chrome-muted);
        line-height: 1.4;
    }

    form.woocommerce-ordering,
    .woocommerce-ordering,
    .wp-block-woocommerce-catalog-sorting,
    .wp-block-woocommerce-product-sorting {
        margin: 0;

        select,
        .wc-blocks-components-select__select,
        .orderby {
            min-height: 40px;
            padding: 0.45rem 2rem 0.45rem 0.85rem;
            border: 1px solid var(--gs-chrome-line);
            border-radius: var(--gs-chrome-radius);
            background-color: #fff;
            color: var(--gs-chrome-ink);
            font-size: 0.875rem;
            line-height: 1.3;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;

            &:hover {
                border-color: rgba(28, 22, 41, 0.28);
            }

            &:focus {
                outline: none;
                border-color: var(--gs-chrome-ink);
                box-shadow: 0 0 0 3px rgba(28, 22, 41, 0.08);
            }
        }
    }

    /* Classic WC puts count + ordering as siblings before the loop */
    .woocommerce-result-count + .woocommerce-ordering,
    .woocommerce-ordering {
        margin-bottom: 1.25rem;
    }

    .woocommerce-result-count {
        margin-bottom: 0.75rem;
    }

    @media (min-width: 782px) {
        .woocommerce-notices-wrapper + .woocommerce-result-count,
        .woocommerce-products-header + .woocommerce-result-count {
            float: left;
            margin-bottom: 1.25rem;
        }

        .woocommerce-result-count + form.woocommerce-ordering,
        form.woocommerce-ordering {
            float: right;
            margin-bottom: 1.25rem;
        }

        ul.products,
        .wp-block-woocommerce-product-collection {
            clear: both;
        }
    }

    /* No pagination (one page of results): same space below the grid. */
    ul.products:last-child {
        margin-bottom: 3.5rem;
    }

    /* Pagination — bottom margin keeps the last row off the footer. */
    .woocommerce-pagination,
    .wp-block-query-pagination,
    nav.woocommerce-pagination {
        margin: 2rem 0 3.5rem;
        clear: both;

        ul.page-numbers,
        .page-numbers {
            display: inline-flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            align-items: center;
            justify-content: center;
            margin: 0;
            padding: 0;
            list-style: none;
            border: 0;
        }

        li {
            margin: 0;
            border: 0;
            float: none;
        }

        a.page-numbers,
        span.page-numbers,
        .wp-block-query-pagination-numbers a,
        .wp-block-query-pagination-numbers span,
        .wp-block-query-pagination-previous,
        .wp-block-query-pagination-next {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 2.25rem;
            min-height: 2.25rem;
            padding: 0.35rem 0.7rem;
            border: 1px solid var(--gs-chrome-line);
            border-radius: 999px;
            background: #fff;
            color: var(--gs-chrome-ink);
            font-size: 0.875rem;
            font-weight: 500;
            text-decoration: none;
            line-height: 1;
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;

            &:hover,
            &:focus {
                background: var(--gs-chrome-fill);
                border-color: rgba(28, 22, 41, 0.28);
                color: var(--gs-chrome-ink);
                text-decoration: none;
            }
        }

        span.page-numbers.current,
        .wp-block-query-pagination-numbers .current {
            background: var(--gs-chrome-ink);
            border-color: var(--gs-chrome-ink);
            color: #fff;
            cursor: default;
        }

        span.page-numbers.dots {
            border: 0;
            background: transparent;
            min-width: auto;
            padding: 0 0.25rem;
            color: var(--gs-chrome-muted);
        }
    }
}

/* Plugin card catalog grid — desktop / tablet / mobile columns */
body.gs-woo-plugin-cards {
    --gs-shop-cols-desktop: 3;
    --gs-shop-cols-tablet: 2;
    --gs-shop-cols-mobile: 1;

    .wp-block-woocommerce-product-template,
    .wc-block-product-template,
    ul.products {
        display: grid !important;
        grid-template-columns: repeat(var(--gs-shop-cols-desktop), minmax(0, 1fr)) !important;
        gap: 1.5rem !important;
        list-style: none;
        padding-left: 0;
        margin-left: 0;
        margin-right: 0;

        &::before,
        &::after {
            display: none !important;
            content: none !important;
        }

        > li.product,
        > li.wc-block-product,
        > .product {
            width: 100% !important;
            max-width: none !important;
            margin: 0 !important;
            float: none !important;
            clear: none !important;
        }
    }

    @media (max-width: 781px) {
        .wp-block-woocommerce-product-template,
        .wc-block-product-template,
        ul.products {
            grid-template-columns: repeat(var(--gs-shop-cols-tablet), minmax(0, 1fr)) !important;
            gap: 1.15rem !important;
        }
    }

    @media (max-width: 480px) {
        .wp-block-woocommerce-product-template,
        .wc-block-product-template,
        ul.products {
            grid-template-columns: repeat(var(--gs-shop-cols-mobile), minmax(0, 1fr)) !important;
            gap: 1rem !important;
        }
    }
}
