/* Subscribe & Save toggle UI.
   All rules are scoped under `.sfz-sas-wrap` to win specificity against
   Kadence Pro's WooTemplate CSS (which targets `.kwt-add-to-cart-single .cart .button.single_add_to_cart_button`
   with high specificity). Where the Kadence selector is still stronger,
   we use !important on the visual property — flagged inline. */

.sfz-sas-wrap {
    margin: 20px 0 24px;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}
.sfz-sas-wrap *,
.sfz-sas-wrap *::before,
.sfz-sas-wrap *::after {
    box-sizing: border-box;
}

.sfz-sas-wrap .sfz-sas-form {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
}

/* ── Tile group ───────────────────────────────────────────────────── */
.sfz-sas-wrap .sfz-sas-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sfz-sas-wrap .sfz-sas-option {
    position: relative;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    margin: 0;
    line-height: 1.3;
}
.sfz-sas-wrap .sfz-sas-option:hover { border-color: #CBD5E1; }

.sfz-sas-wrap .sfz-sas-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    margin: 0;
}

.sfz-sas-wrap .sfz-sas-option__radio {
    width: 20px;
    height: 20px;
    border: 2px solid #CBD5E1;
    border-radius: 999px;
    background: #fff;
    box-sizing: border-box;
    flex-shrink: 0;
    display: inline-block;
}

.sfz-sas-wrap .sfz-sas-option.is-selected {
    border-color: #F22F8B;
    background: #FFF0F7;
    box-shadow: 0 0 0 1px #F22F8B inset;
}
.sfz-sas-wrap .sfz-sas-option.is-selected .sfz-sas-option__radio {
    border-color: #F22F8B;
    background:
        radial-gradient(circle, #F22F8B 0 5px, transparent 6px);
}

/* Title cell */
.sfz-sas-wrap .sfz-sas-option__title {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .04em;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sfz-sas-wrap .sfz-sas-badge {
    background: #F22F8B;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Price cell */
.sfz-sas-wrap .sfz-sas-option__price {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    text-align: right;
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}
.sfz-sas-wrap .sfz-sas-option__price .woocommerce-Price-amount {
    color: inherit;
}
.sfz-sas-wrap .sfz-sas-price-was .woocommerce-Price-amount {
    color: #9CA3AF;
    font-weight: 500;
    text-decoration: line-through;
}

/* Frequency block — second row inside the subscribe tile */
.sfz-sas-wrap .sfz-sas-freq {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.sfz-sas-wrap .sfz-sas-freq[hidden] {
    display: none;
}
.sfz-sas-wrap .sfz-sas-freq__select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #111827;
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #6B7280 50%),
                      linear-gradient(135deg, #6B7280 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    cursor: pointer;
    height: auto;
    box-shadow: none;
}

.sfz-sas-wrap .sfz-sas-perks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #F22F8B;
    font-weight: 500;
}
.sfz-sas-wrap .sfz-sas-perks li::before {
    content: "✓";
    margin-right: 8px;
    font-weight: 700;
}

/* ── Variations (size selector) — label above the tiles ─────────────── */
.sfz-sas-wrap .sfz-sas-variations {
    margin: 0 0 14px;
}
.sfz-sas-wrap .sfz-sas-variations table.variations {
    width: 100%;
    border: 0;
    background: transparent;
    margin: 0;
}
.sfz-sas-wrap .sfz-sas-variations table.variations,
.sfz-sas-wrap .sfz-sas-variations table.variations tbody,
.sfz-sas-wrap .sfz-sas-variations table.variations tr,
.sfz-sas-wrap .sfz-sas-variations table.variations td,
.sfz-sas-wrap .sfz-sas-variations table.variations th {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
}
.sfz-sas-wrap .sfz-sas-variations table.variations th.label {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0;
    text-align: left !important;   /* override <th> default center */
    padding-left: 0 !important;
}
.sfz-sas-wrap .sfz-sas-variations table.variations th.label label {
    color: inherit;
    font-weight: inherit;
    font-size: inherit;
    margin: 0;
    text-align: left !important;
    display: block;
}
/* Kadence's add-to-cart block also wraps the swatch container with its own
   "kt-variation-label" — duplicate of the table th. Hide that to avoid
   showing "Size" twice. */
.sfz-sas-wrap .sfz-sas-variations .kt-variation-label {
    display: none !important;
}
/* Hide the stray "In stock" availability paragraph that WC injects right
   below the size tiles for variable products — the toggle UI shows price
   and the cart drawer surfaces stock when needed. */
.sfz-sas-wrap .single_variation_wrap .stock,
.sfz-sas-wrap p.stock.in-stock,
.sfz-sas-wrap p.stock {
    display: none !important;
}

/* ── Action row (qty + button, side-by-side) ─────────────────────────── */
.sfz-sas-wrap .sfz-sas-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

/* ── Quantity ─────────────────────────────────────────────────────────
   Compact pill containing − N + inline. Sits left of the Add to cart
   button. Kadence styles `.kwt-add-to-cart-single form.cart div.quantity`
   with high specificity (5 classes), so we wrap the WC quantity input in
   our .sfz-sas-qty box and use a chained selector to win where possible. */
.sfz-sas-wrap .sfz-sas-qty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    border: 1.5px solid #1A202C;
    border-radius: 999px;
    background: #fff;
    flex: 0 0 auto;
    min-width: 110px;
    height: 48px;
    box-sizing: border-box;
}
.sfz-sas-wrap .sfz-sas-qty .quantity,
.sfz-sas-wrap .sfz-sas-qty div.quantity.kadence-qty-added,
.single-product.woocommerce .wp-block-kadence-wootemplate-blocks-add-to-cart .sfz-sas-wrap div.quantity.kadence-qty-added {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 none transparent !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 100%;
}
.sfz-sas-wrap .sfz-sas-qty input.qty,
.sfz-sas-wrap .sfz-sas-qty input[type="number"] {
    border: 0 !important;          /* Kadence sets a border here */
    background: transparent !important;
    width: 36px !important;
    min-width: 0 !important;
    height: 38px !important;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: #111827;
    padding: 0 !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}
/* Kadence's + / - buttons inside `.spinners-added .quantity` — make them flat circles. */
.sfz-sas-wrap .sfz-sas-qty .quantity-button,
.sfz-sas-wrap .sfz-sas-qty .qty-button,
.sfz-sas-wrap .sfz-sas-qty button[class*="quantity"] {
    background: transparent !important;
    border: 0 !important;
    color: #111827 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    line-height: 1 !important;
    cursor: pointer;
    box-shadow: none !important;
}
.sfz-sas-wrap .sfz-sas-qty .quantity-button:hover,
.sfz-sas-wrap .sfz-sas-qty .qty-button:hover {
    color: #F22F8B !important;
}
.sfz-sas-wrap .sfz-sas-qty input.qty::-webkit-outer-spin-button,
.sfz-sas-wrap .sfz-sas-qty input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Submit button ────────────────────────────────────────────────────
   Our button no longer carries the `single_add_to_cart_button` class
   (that class is hijacked by WPC Ajax Add-to-Cart's delegated click handler).
   Kadence Pro's competing selector targets `.button.single_add_to_cart_button`
   so without that class it doesn't apply to us — but Kadence/Woo generic
   `.button` styling still tries to take over. !important kept on the visual
   properties to be safe. */
.sfz-sas-wrap button.sfz-sas-submit,
.sfz-sas-wrap .sfz-sas-form button.sfz-sas-submit,
.sfz-sas-wrap .sfz-sas-action-row button.sfz-sas-submit {
    background: #F22F8B !important;
    background-color: #F22F8B !important;
    background-image: none !important;   /* kill any theme gradient overlay */
    background-clip: padding-box !important;
    color: #fff !important;
    /* Kadence's base .button rule sets `border-style: solid` and Woo sets a
       border-color via theme palette → produces a 1px dark outline on top.
       Force the border to fully transparent + 0 width with multiple props. */
    border: 0 none transparent !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: 0 none transparent !important;
    border-radius: 999px !important;
    padding: 12px 28px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none;
    cursor: pointer;
    flex: 1 1 auto;
    width: auto !important;
    margin: 0 !important;
    transition: background .15s, transform .05s;
    line-height: 1.2 !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    /* Reset any global button CSS variables Kadence Pro defines */
    --button-color: #F22F8B;
    --button-color-hover: #D91D77;
    --button-border-color: transparent;
    --button-shadow: none;
    --button-shadow-hover: none;
    --button-text-color: #fff;
    --button-text-color-hover: #fff;
}
/* Kadence sometimes wraps the rendered button with ::before / ::after for
   hover overlay or focus halo — neutralize those. */
.sfz-sas-wrap button.sfz-sas-submit::before,
.sfz-sas-wrap button.sfz-sas-submit::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
}
.sfz-sas-wrap button.sfz-sas-submit:focus,
.sfz-sas-wrap button.sfz-sas-submit:focus-visible {
    outline: 2px solid #FFB7D9 !important;
    outline-offset: 2px;
    box-shadow: none !important;
}
.sfz-sas-wrap button.sfz-sas-submit:hover,
.sfz-sas-wrap .sfz-sas-form button.sfz-sas-submit:hover {
    background: #D91D77 !important;
    color: #fff !important;
}
.sfz-sas-wrap button.sfz-sas-submit:active {
    transform: translateY(1px);
}
.sfz-sas-wrap .sfz-sas-submit__price {
    font-weight: 700;
    color: inherit;
}
.sfz-sas-wrap .sfz-sas-submit__price .woocommerce-Price-amount {
    color: inherit;
}


/* ── Mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .sfz-sas-wrap .sfz-sas-option { padding: 12px 14px; }
    .sfz-sas-wrap .sfz-sas-option__title { font-size: 13px; }
    .sfz-sas-wrap .sfz-sas-option__price { font-size: 14px; }
    .sfz-sas-wrap button.sfz-sas-submit { padding: 14px 18px !important; }
}
