/*
 * Variable product buy-box — single product page. Added 2026-08-19.
 *
 * The theme had NO styling for WooCommerce's variation markup at all, so a
 * variable product rendered as an unstyled table with two tiny native selects
 * and a bare "Sign up now" text link.
 *
 * This styles the attribute dropdowns and hides WooCommerce's native quantity
 * box and submit button in favour of the theme's own "− 1 +" widget and green
 * cta_btn — the same approach add-to-cart/simple.php already uses.
 *
 * Only loaded on single product pages for variable / variable-subscription
 * products. See inc/product-variations.php.
 *
 * Brand: green #315B42, dark #1F3933, font inherited (Montserrat).
 *
 * To revert: delete this file, inc/product-variations.php, the require in
 * functions.php, and woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php.
 */

/* ---- attribute dropdowns ---- */

.product_section article.product table.variations {
    width: 100%;
    /* The bottom margin also reserves room for the "Clear" link, which is
       positioned out of flow (see .reset_variations below) and would otherwise
       collide with the price underneath. */
    margin: 0 0 38px;
    border: 0;
    border-collapse: collapse;
}

.product_section article.product table.variations tbody {
    display: block;
    width: 100%;
}

/* Label sits to the LEFT of the swatches rather than above them — stacking it
   cost a whole line of vertical space for one short word. */
.product_section article.product table.variations tr {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 14px;
    width: 100%;
    margin-bottom: 10px;
}

.product_section article.product table.variations td {
    display: block;
    padding: 0;
    border: 0;
    background: none;
}

.product_section article.product table.variations td.label {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    margin-bottom: 0;
}

.product_section article.product table.variations td.value {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 auto;
        -ms-flex: 1 1 auto;
            flex: 1 1 auto;
    min-width: 0;
}

/* Narrow screens: go back to stacking, there is not room for both. */
@media screen and (max-width: 480px) {
    .product_section article.product table.variations tr {
        display: block;
    }

    .product_section article.product table.variations td.label {
        margin-bottom: 6px;
    }
}

.product_section article.product table.variations td.label label {
    display: block;
    margin: 0;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
    color: #1F3933;
}

/* ---- swatches ----------------------------------------------------------
 * The native <select> stays in the DOM as the source of truth — WooCommerce's
 * variation JS reads and writes it, and enables/disables its <option>s to show
 * which combinations exist. It is visually hidden and mirrored by buttons.
 * Modelled on the Black Note product pages.
 */

.product_section article.product table.variations tr.mv-has-swatches select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.product_section article.product .mv-swatches {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
    gap: 10px;
}

.product_section article.product .mv-swatch {
    -webkit-appearance: none;
            appearance: none;
    padding: 14px 18px;
    background-color: #fff;
    border: 1px solid #cfd4d0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 700;
    color: #1F3933;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.product_section article.product .mv-swatch:hover {
    border-color: #315B42;
}

.product_section article.product .mv-swatch:focus-visible {
    outline: 2px solid #315B42;
    outline-offset: 2px;
}

/* Selected: filled, with the double-ring the reference design uses. */
.product_section article.product .mv-swatch.is-selected {
    background-color: #315B42;
    border-color: #315B42;
    color: #fff;
    box-shadow: 0 0 0 2px #fff inset, 0 0 0 3px #315B42;
}

/* No variation exists for this combination — hidden outright rather than shown
   greyed out, so the customer only ever sees choices they can actually make.
   (e.g. picking Powder removes 90 Day Supply from the list entirely.) */
.product_section article.product .mv-swatch.is-unavailable {
    display: none;
}

/* Progressive disclosure: later attribute rows stay hidden until the ones
   before them have a value. */
.product_section article.product table.variations tr.mv-locked {
    display: none;
}

/* ---- choice guidance ---------------------------------------------------
 * A greyed-out Add to cart is a weak hint that a choice is still needed, so
 * an unanswered row asks for it directly: tinted panel, green rule down the
 * side and a short prompt. The Type row keeps its compact heading after a
 * choice so the Chews-versus-Powder help remains available while switching.
 */
.product_section article.product table.variations tr.mv-needs-choice {
    -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
    /* Flush with the description, quantity box and Add to cart. A negative
       margin here let the tint bleed wider, but it left the panel hanging out
       past everything else in the column. */
    margin-left: 0;
    margin-right: 0;
    padding: 12px 14px;
    background-color: #eef3ef;
    border-left: 4px solid #315B42;
    border-radius: 6px;
}

/* No standing label on swatch rows at all. Unanswered, the "Choose type"
   prompt already names it; answered, the chosen swatch speaks for itself.
   The element stays in the DOM (not removed) because the prompt reads its text
   to build "Choose <attribute>". */
.product_section article.product table.variations tr.mv-has-swatches td.label {
    display: none;
}

/* The prompt is its own flex line above the swatches. */
.product_section article.product .mv-choose-hint {
    -webkit-box-ordinal-group: 0;
    -webkit-order: -1;
        -ms-flex-order: -1;
            order: -1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 6px;
    width: 100%;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #315B42;
    text-transform: uppercase;
}

.product_section article.product .mv-choose-hint__icon {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    width: 17px;
    height: 17px;
}

.product_section article.product .mv-choose-hint__label {
    text-transform: uppercase;
}

.product_section article.product .mv-product-help {
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    color: #315B42;
    text-transform: none;
}

@media screen and (max-width: 420px) {
    .product_section article.product .mv-choose-hint--with-help {
        -webkit-flex-wrap: wrap;
            -ms-flex-wrap: wrap;
                flex-wrap: wrap;
    }

    .product_section article.product .mv-product-help {
        margin-left: 23px;
    }
}

/* Unpicked swatches read as buttons, not as static chips. */
.product_section article.product tr.mv-needs-choice .mv-swatch {
    border-width: 2px;
    border-color: #315B42;
    color: #1F3933;
}

.product_section article.product tr.mv-needs-choice .mv-swatch:hover {
    background-color: #315B42;
    color: #fff;
}

/* The select itself, when NOT rendered as swatches. Native appearance stripped
   and a chevron drawn in, so it matches the .qty and .cta_btn controls. */
.product_section article.product table.variations select {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 15px 42px 15px 16px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%231F3933' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px auto;
    border: 1px solid #000;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    line-height: 17px;
    color: #1F3933;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

.product_section article.product table.variations select:focus-visible {
    outline: 2px solid #315B42;
    outline-offset: 2px;
}

/* Options with no matching variation are greyed rather than silently absent. */
.product_section article.product table.variations select option:disabled {
    color: #9b9b9b;
}

/* "Clear" is taken out of the flow. In flow it added its own height to the
   cell, so the label — vertically centred against the whole cell — sat above
   the middle of the swatches rather than level with them. */
.product_section article.product table.variations td.value {
    position: relative;
}

.product_section article.product .reset_variations {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.2;
    color: #315B42;
    text-decoration: underline;
}

/* Hidden until a full combination is chosen — WooCommerce toggles this. */
.product_section article.product .reset_variations[style*="visibility: hidden"] {
    display: none;
}

/* ---- price / availability readout ---- */

.product_section article.product .single_variation_wrap {
    width: 100%;
}

.product_section article.product .woocommerce-variation-price {
    margin-bottom: 14px;
    font-size: 1.313em;
    font-weight: 500;
    letter-spacing: 0.015em;
    color: #1F3933;
}

.product_section article.product .woocommerce-variation-description p:last-child,
.product_section article.product .woocommerce-variation-availability p:last-child {
    margin-bottom: 0;
}

/* ---- buy box ---- */

/* Hide WooCommerce's native controls; the theme's own drive them.
   Same pattern as add-to-cart/simple.php. */
.product_section article.product .woocommerce-variation-add-to-cart .quantity,
.product_section article.product .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    display: none !important;
}

.product_section article.product .mv-var-buybox {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    /* Group quantity, button and stock together on the left rather than
       spreading them across the row. */
    -webkit-box-pack: start;
    -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
            justify-content: flex-start;
    gap: 14px;
}

/* The button sizes to its content rather than filling the row — full width it
   was far wider than it needed to be, and it leaves room for the stock line
   alongside. */
.product_section article.product .mv-var-buybox .col2:last-of-type {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
}

.product_section article.product button.cta_btn.mv-var-add {
    width: auto;
    min-width: 250px;
    margin-bottom: 0;
}

/* "In stock", relocated onto this row by script. */
.product_section article.product .mv-var-buybox .mv-buybox-stock {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    margin: 0;
}

@media screen and (max-width: 560px) {
    /* Not enough room for all three across — let the stock line drop under. */
    .product_section article.product .mv-var-buybox {
        -webkit-flex-wrap: wrap;
            -ms-flex-wrap: wrap;
                flex-wrap: wrap;
    }

    .product_section article.product button.cta_btn.mv-var-add {
        min-width: 0;
        width: 100%;
    }

    .product_section article.product .mv-var-buybox .col2:last-of-type {
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 auto;
            -ms-flex: 1 1 auto;
                flex: 1 1 auto;
    }
}

/* Before a full combination is chosen there is no price and nothing to add. */
.product_section article.product button.cta_btn.mv-var-add[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.product_section article.product button.cta_btn.mv-var-add[disabled]:hover {
    background-color: #315B42;
}

/* ---- one-time vs subscribe (All Products for Subscriptions) -------------
 * APFS ships its own markup with no styling that suits this theme. It renders
 * a radio pair (one-time / subscribe) plus a delivery-frequency dropdown that
 * it reveals by removing .closed from the wrapper.
 */

.product_section article.product .wcsatt-options-wrapper {
    /* 10px of air between the price and this card — APFS renders inside the
       price node, so the price's own margin does not separate them. */
    margin: 10px 0 20px;
    /* Even padding all round: the gap under the frequency dropdown should
       match the gap above "One-time purchase". */
    padding: 18px;
    background-color: #f7f6f2;
    border: 1px solid #e4e3dd;
    border-radius: 10px;
}

.product_section article.product .wcsatt-options-prompt-fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.product_section article.product ul.wcsatt-options-prompt-radios {
    margin: 0;
    padding: 0;
    list-style: none;
}

.product_section article.product li.wcsatt-options-prompt-radio {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.product_section article.product li.wcsatt-options-prompt-radio:last-child {
    margin-bottom: 0;
}

.product_section article.product .wcsatt-options-prompt-label {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    color: #1F3933;
    cursor: pointer;
}

.product_section article.product .wcsatt-options-prompt-action-input {
    -webkit-appearance: radio;
            appearance: radio;
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #315B42;
    cursor: pointer;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
}

.product_section article.product .wcsatt-sub-discount {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 8px;
    background-color: #315B42;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

/* Delivery frequency.
   NOTE: do not key visibility off `.closed` on the wrapper — that class is
   present at all times regardless of which radio is chosen, so hiding on it
   hides the frequency dropdown permanently. APFS manages this itself. */
.product_section article.product .wcsatt-options-product-wrapper {
    margin-top: 14px;
    margin-bottom: 0;
}

/* Nothing inside the card may add trailing space — the card's own padding is
   what sets the gap under the dropdown. reset.css gives form controls their
   own bottom margin, which is what made this gap roughly double the top one. */
.product_section article.product .wcsatt-options-wrapper > *:last-child,
.product_section article.product .wcsatt-options-product-wrapper > *:last-child,
.product_section article.product select.wcsatt-options-product-dropdown {
    margin-bottom: 0;
}

.product_section article.product .wcsatt-options-product-dropdown-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #1F3933;
}

.product_section article.product select.wcsatt-options-product-dropdown {
    display: block;
    width: 100%;
    padding: 13px 42px 13px 16px;
    background-color: #fff;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='M1 1l7 7 7-7' fill='none' stroke='%231F3933' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px auto;
    border: 1px solid #cfd4d0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    line-height: 17px;
    color: #1F3933;
    cursor: pointer;
    -webkit-appearance: none;
       -moz-appearance: none;
            appearance: none;
}

/* The APFS price line sits above the options; the theme already styles
   .woocommerce-variation-price, this keeps the small print tidy. */
/* Inline, so "— or subscribe to save 15%" continues on the same line as the
   price rather than dropping below it. */
.product_section article.product small.wcsatt-sub-options {
    display: inline;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
}

.product_section article.product .wcsatt-sub-discount {
    vertical-align: middle;
}

/* The compact benefit summary beside the product's price is intentionally one
   pill so "Free shipping" cannot be mistaken for a product-wide offer. */
.product_section article.product .mv-top-sub-benefit {
    letter-spacing: 0.01em;
}

/* Keep the decision-point treatment explicit: discount + shipping benefit. */
.product_section article.product .mv-sub-benefit-plus {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    color: #315B42;
}

/* Put the subscription's free-shipping benefit beside the discount at the
   exact point where shoppers choose between one-time and Subscribe to save. */
.product_section article.product .mv-free-shipping-pill {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
        -ms-flex-align: center;
            align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #b7c7bc;
    border-radius: 999px;
    background-color: #eef3ef;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #315B42;
    white-space: nowrap;
}

.product_section article.product .mv-free-shipping-pill svg {
    display: block;
    width: 14px;
    height: 12px;
    margin: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: translateY(-1px);
}

/* ---- per-form delivery guidance ----------------------------------------
 * Sits directly under the purchase box. Deliberately high-contrast: it exists
 * because the weight-to-supply relationship is genuinely counter-intuitive, so
 * quiet grey small print would defeat the point.
 */

.product_section article.product .mv-delivery-note {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
        -ms-flex-align: start;
            align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 13px 15px;
    background-color: #eef3ef;
    border-left: 4px solid #315B42;
    border-radius: 6px;
    font-size: 13.5px;
    line-height: 1.5;
    color: #1F3933;
}

.product_section article.product .mv-delivery-note[hidden] {
    display: none;
}

.product_section article.product .mv-delivery-note__icon {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 auto;
        -ms-flex: 0 0 auto;
            flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    background-color: #315B42;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    line-height: 18px;
    color: #fff;
    text-align: center;
}

.product_section article.product .mv-delivery-note strong {
    font-weight: 700;
}

.product_section article.product .mv-delivery-note__read-more {
    display: inline;
    margin: 0 0 0 4px;
    padding: 0;
    background: none;
    border: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    font-weight: 700;
    color: #315B42;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    -webkit-appearance: none;
            appearance: none;
}

.product_section article.product .mv-delivery-note__read-more:hover {
    color: #1F3933;
}

.product_section article.product .mv-delivery-note__read-more:focus-visible {
    outline: 2px solid #315B42;
    outline-offset: 3px;
}

/* Long subscription price strings ("$43.35 every 45 days") overflow the fixed
   84px price chip the theme uses for simple products. Let them wrap. */
.product_section article.product button.cta_btn.mv-var-add {
    padding-right: 110px;
}

.product_section article.product button.cta_btn.mv-var-add .btn_price {
    width: 104px;
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
}

@media screen and (max-width: 820px) {
    /* Keep the price range clean on line one, then group the subscription
       message and its combined benefit pill on their own line. */
    .product_section article.product small.wcsatt-sub-options {
        display: block;
        margin-top: 3px;
    }

    .product_section article.product small.wcsatt-sub-options .wcsatt-dash {
        display: none;
    }

    /* Centre the three-line summary beneath the centred mobile title: price
       range, subscription benefit, then stars/review count. Keep the buy box
       and its transactional price left-aligned. */
    .product_section article.product .cols.mv-price-row,
    .product_section article.product .cols.mv-price-row .col2 {
        text-align: center;
    }

    .product_section article.product .mv-var-buybox {
        gap: 10px;
    }

    .product_section article.product .wcsatt-options-prompt-label {
        gap: 5px;
        font-size: 13px;
    }

    .product_section article.product .wcsatt-options-prompt-label-subscription .wcsatt-options-prompt-action {
        white-space: nowrap;
    }

    .product_section article.product .mv-free-shipping-pill {
        gap: 2px;
        padding-right: 5px;
        padding-left: 5px;
        font-size: 12px;
    }

    .product_section article.product .mv-free-shipping-pill svg {
        width: 13px;
        height: 11px;
    }

    .product_section article.product table.variations select {
        padding: 13px 38px 13px 14px;
    }
}

@media screen and (max-width: 479px) {
    /* Fieldsets retain a min-content width in some browsers, so the long
       subscription benefits can make the card wider than the phone. */
    .product_section article.product .wcsatt-options-prompt-fieldset {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    /* Keep the radio and Subscribe label together on row one. Put the plus
       and shipping benefit below them so the complete pill remains visible. */
    .product_section article.product .wcsatt-options-prompt-label-subscription {
        display: grid;
        grid-template-columns: 17px auto minmax(0, 1fr);
        column-gap: 5px;
        row-gap: 6px;
        width: 100%;
        min-width: 0;
    }

    .product_section article.product .wcsatt-options-prompt-label-subscription .wcsatt-options-prompt-action-input {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .product_section article.product .wcsatt-options-prompt-label-subscription .wcsatt-options-prompt-action {
        grid-column: 2 / -1;
        grid-row: 1;
    }

    .product_section article.product .wcsatt-options-prompt-label-subscription .mv-sub-benefit-plus {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
    }

    .product_section article.product .wcsatt-options-prompt-label-subscription .mv-free-shipping-pill {
        grid-column: 3;
        grid-row: 2;
        justify-self: start;
        max-width: 100%;
    }
}
