.wp-block-add-to-cart-with-options-quantity-selector {
	max-width: 120px;
	width: 100%;
}

form.wp-block-add-to-cart-with-options .wc-block-components-quantity-selector {
	height: 54px;
	width: 100%;
	justify-content: center;
	align-items: center;
	gap: 2px;
	border-radius: 8px;
	border: 1px solid var(--wp--preset--color--neutral-200);
	background: var(--wp--preset--color--white);
	box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.03);

    @media (max-width:470px) {  
        gap: 0;
    }

    input.input-text {
        font-size: 0.813rem;
        display: flex;
        width: 36px;
        height: 36px;
        padding: 6px 0;
        justify-content: center;
        align-items: center;
        gap: 0; 
        border-right: 0;
        border-radius: 0;
        border-left: 0;

        @media (max-width:470px) {  
            width: 16px;
            height: 16px;
        }
    }

	.wc-block-components-quantity-selector__button--minus,
    .wc-block-components-quantity-selector__button--plus {
        width: 30px;
        height: 30px;
        padding: 10px;
        position: relative;
        background-color: transparent;
        border: none;
        cursor: pointer;
        font-size: 0 !important;
        color: transparent !important;

        @media (max-width: 470px) {  
            padding: 10px;
            width: 16px;
        }
    }

	button.wc-block-components-quantity-selector__button,
	input.input-text {
		outline: none;           
		box-shadow: none;        
	}
}

/* --- 2. STYLE VARIATIONS FOR QUANTITY SELECTOR (Moved Style-3 variations here to fix Stylelint) --- */
.home-single-product form.wp-block-add-to-cart-with-options .wc-block-components-quantity-selector { 
    border-radius: 120px; 
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.03); 
}

form.wp-block-add-to-cart-with-options .wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:focus-within,
form.wp-block-add-to-cart-with-options .wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:checked) {
	background: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--text-primary) !important;
	border-width: 2px !important;
	color: var(--wp--preset--color--text-primary);
}

/* --- 3. MAIN FORM CONTAINER NESTED STYLES --- */
form.wp-block-add-to-cart-with-options {

	.wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-name {
		font-size: 14px;
		font-style: normal;
		font-weight: 500;
		line-height: 22px;
	}

	.wc-block-components-product-stock-indicator--out-of-stock,
	.wp-block-button__link {
		padding: 10px 30px;
        width: 100% !important;
        color: var(--wp--preset--color--white);
        font-size: var(--wp--preset--font-size--sm);
        font-style: normal;
        font-weight: 500;
        line-height: 1;
        border-radius: 8px;
        min-height: 54px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wc-block-components-product-stock-indicator--out-of-stock {
        background-color: transparent;
        border-radius: 8px;
        color: var(--wp--preset--color--text-primary);
        border: 1px solid var(--wp--preset--color--text-primary);
        width: auto;
        text-align: center;
        box-sizing: border-box;
    }

    /* Variation General Options Layout */
    .wp-block-woocommerce-add-to-cart-with-options-grouped-product-selector .wp-block-group.is-layout-flex:not(.is-vertical)>.wc-block-add-to-cart-with-options-grouped-product-item-selector {
        min-width: auto;
    }

    /* Fixed Active Selection Pill Selector Mismatch (With Variable Override) */
    .wc-block-add-to-cart-with-options-variation-selector-attribute-options_pill:has(input[type="radio"]:checked),
    .wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill:has(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pill-input:checked) {
        background: var(--wp--preset--color--white) !important;
        border: 2px solid var(--wp--preset--color--text-primary) !important;
        color: var(--wp--preset--color--text-primary) !important;
        font-weight: 600 !important;
        --pill-color: var(--wp--preset--color--text-primary) !important;
        --pill-background-color: var(--wp--preset--color--white) !important;
    }

    .wp-block-woocommerce-add-to-cart-with-options-variation-description,
    .wp-block-woocommerce-add-to-cart-with-options-variation-selector {
        margin-bottom: var(--wp--preset--spacing--10);
    }

    :where(.wc-block-add-to-cart-with-options-variation-selector-attribute-options__pills) {
        gap: 10px;
    }

    /* Variation Selector Internal Attributes Selector Row */
    .wp-block-woocommerce-add-to-cart-with-options-variation-selector {
        .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute {
            label {
                margin-bottom: 0;
            }

            .wc-block-add-to-cart-with-options-variation-selector-attribute-options__dropdown {
                max-width: 100%;
                min-width: 75%;
                display: inline-block;
                margin-right: 1em;
                appearance: none;
                -webkit-appearance: none;
                -moz-appearance: none;
                padding-right: 3em;
                background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hldnJvbi1kb3duIj48cG9seWxpbmUgcG9pbnRzPSI2IDkgMTIgMTUgMTggOSI+PC9wb2x5bGluZT48L3N2Zz4=) no-repeat;
                background-size: 16px;
                -webkit-background-size: 16px;
                background-position: calc(100% - 12px) 50%;
                -webkit-background-position: calc(100% - 12px) 50%;
            }

            .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-options,
            select {
                width: 100%;    
            }

            .wp-block-woocommerce-add-to-cart-with-options-variation-selector-attribute-options {
                select {
                    font-size: var(--wp--preset--font-size--base);
                    line-height: 26px; 
                    letter-spacing: 0.16px;
                    border-radius: 12px;
                    border: 1px solid var(--wp--preset--color--neutral-200);
                    outline: none;

                    &:focus-within {
                        border-color: var(--wp--preset--color--neutral-200);
                        outline: none;
                    }
                }

                label {
                    font-size: 14px;
                    font-style: normal;
                    font-weight: 500;
                    line-height: 22px;
                    letter-spacing: 0.28px;
                    border-radius: 8px;
                    background: var(--wp--preset--color--white);
                    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.03);
                    padding: 10px 20px;
                    border-color: var(--wp--preset--color--neutral-200);
                    &:focus-within {
                        outline: none;
                    }
                }
            }
        }
    }
    
    /* Buttons Grid Mechanics */
    .wp-block-button {
        flex-grow: 1;
        .wp-block-button__link.product_type_variable {
            width: 100%;
        }
    }

    .wp-block-post-terms__prefix {
        font-weight: 500;
    }

    .wp-block-woocommerce-add-to-cart-with-options-grouped-product-selector {
        margin-top: 30px;
        margin-bottom: 30px;
        padding-bottom: 30px;
        border-bottom: 1px solid var(--wp--preset--color--neutral-200);

        .wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wp-block-woocommerce-add-to-cart-with-options-grouped-product-item-label {
            color: var(--wp--preset--color--text-primary);
            font-size: 13px;
            font-style: normal;
            font-weight: 500 !important;
            line-height: 20px; 
        }

        .wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wc-block-components-quantity-selector {
            width: 90px;
            height: 50px;
            
            input.input-text {
                width: 20px;
                height: 20px;
                min-height: 50px;
            }
        }

        .wp-block-woocommerce-add-to-cart-with-options-grouped-product-item .wp-block-woocommerce-product-price .wc-block-components-product-price.wc-block-grid__product-price ins {
            font-size: 16px;
            font-style: normal;
            font-weight: 600;
            line-height: 28px;
        }

        .product_type_variable {
            padding-left: var(--wp--preset--spacing--4);
            padding-right: var(--wp--preset--spacing--4);
        }

        .wp-block-woocommerce-add-to-cart-with-options-grouped-product-item {
            margin-bottom: 20px;
        }
    }

	.wc-block-components-quantity-selector >.wc-block-components-quantity-selector__button--minus {
		order: 3;
	}

	.wc-block-components-quantity-selector >.wc-block-components-quantity-selector__button--plus {
		order: 1;
	}

    .wc-block-components-quantity-selector__button--minus::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 6px;
        height: 2px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='2' viewBox='0 0 6 2' fill='none'%3E%3Cpath d='M0 1.065V0H5.94V1.065H0Z' fill='%230B1220'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    .wc-block-components-quantity-selector__button--plus::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 7px;
        height: 7px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7' fill='none'%3E%3Cpath d='M0 3.795V2.73H2.865V0H3.99V2.73H6.855V3.795H3.99V6.54H2.865V3.795H0Z' fill='%230B1220'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    .wc-block-components-quantity-selector__button--minus:disabled,
    .wc-block-components-quantity-selector__button--plus:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }
}
