/* ==========================================================================
   Wholesale product page bar (storefront/product/_wholesale-buy-bar, js/storefront/wholesale-buy.js)
   Colours: teal #0F6E8C (picked chip, Add button), border #C7DDE8, ink #10243A,
   in the cart: green #15803D on #ECFDF3
   ========================================================================== */

.wbuy {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.wbuy [hidden] {
    display: none !important;
}

/* ✓ In your cart: 6 pcs · View cart · Remove */
/* In the cart: the line on top, then three clear buttons  [View cart] [Back] [Remove] */
.wbuy__status {
    margin: 0;
    padding: 10px 12px 12px;
    border: 1.5px solid #16A34A;
    border-radius: 12px;
    background: #ECFDF3;
    color: #14532D;
    font-size: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wbuy__status-icon {
    flex: none;
    width: 20px;
    height: 20px;
    color: #15803D;
}

.wbuy__status-text {
    flex: 1 1 calc(100% - 28px);
    min-width: 0;
    font-weight: 700;
}

.wbuy__status-text strong {
    font-size: 18px;
    font-weight: 800;
}

.wbuy__link {
    flex: 1 1 0;
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    border: 1.5px solid #0F6E8C;
    border-radius: 10px;
    background: #FFFFFF;
    color: #0F6E8C;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
}

/* View cart: the main next step */
.wbuy__link--cart {
    background: #0F6E8C;
    color: #FFFFFF;
}

.wbuy__link--remove {
    border-color: #B42318;
    color: #B42318;
}

/* How many?  3 6 12 24 48 Other */
.wbuy__pick {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wbuy__pick-label {
    color: #4B6478;
    font-size: 12px;
    font-weight: 700;
}

.wbuy__chips {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.wbuy__chip {
    min-width: 0;
    height: 42px;
    padding: 0 2px;
    border: 1.5px solid #C7DDE8;
    border-radius: 10px;
    background: #FFFFFF;
    color: #10243A;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.wbuy__chip--other {
    font-size: 14px;
}

.wbuy__chip.is-selected {
    border-color: #0F6E8C;
    background: #0F6E8C;
    color: #FFFFFF;
}

.wbuy__chip:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 1 pack · Rate on request          [ Add to cart · 6 ] */
.wbuy__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wbuy__add {
    flex: none;
    min-width: 170px;
    height: 50px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    background: #0F6E8C;
    color: #FFFFFF;
    font: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.wbuy__add:disabled {
    background: #C9D6DE;
    color: #4B6478;
    cursor: default;
}

.wbuy__add.is-done:disabled {
    background: #ECFDF3;
    color: #15803D;
    box-shadow: inset 0 0 0 1.5px #ABEFC6;
}

/* The bar is taller: the page ends above it, and the floating cart pill is not needed (View cart is in the bar) */
.store--product:has(.wbuy) .store__main {
    padding-bottom: calc(250px + env(safe-area-inset-bottom));
}

.store--product:has(.wbuy) .cart-pill {
    display: none;
}

@media (max-width: 360px) {
    .wbuy__add {
        min-width: 150px;
        font-size: 15px;
    }
}

/* Narrow phones: "Other" fits its chip with room around the word */
@media (max-width: 380px) {
    .wbuy__chip--other {
        font-size: 14px;
    }
}

@media (max-width: 340px) {
    .wbuy__chip--other {
        font-size: 13px;
    }
}
