/* JuniorHaul Quantity Breaks */

.jh-qb-wrap {
    width: 100%;
    max-width: 620px;
    margin: 22px 0;
    font-family: inherit;
}

.jh-qb-title {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 18px;
    color: #222;
    font-size: 20px;
    line-height: 1.2;
}

.jh-qb-title span {
    height: 1px;
    background: #c9c9c9;
    flex: 1;
}

.jh-qb-options {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.jh-qb-card {
    position: relative;
    border: 1.5px solid #b8b8b8;
    border-radius: 14px;
    background: #f6f6f6;
    padding: 20px 28px;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.jh-qb-card.is-selected {
    border-color: #222;
    border-width: 2px;
    background: #fff;
    box-shadow: 0 2px 0 rgba(0,0,0,.05);
}

.jh-qb-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.jh-qb-left {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #111;
    font-size: 18px;
}

.jh-qb-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #aaa;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    background: #fff;
}

.jh-qb-card.is-selected .jh-qb-radio {
    border-color: #222;
}

.jh-qb-card.is-selected .jh-qb-radio::after {
    content: "";
    width: 12px;
    height: 12px;
    background: #222;
    border-radius: 50%;
    position: absolute;
    left: 3px;
    top: 3px;
}

.jh-qb-badge {
    border: 1px solid #aaa;
    border-radius: 4px;
    background: #fff;
    padding: 3px 9px;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
}

.jh-qb-price {
    text-align: right;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.jh-qb-new-price {
    color: #111;
    font-size: 20px;
    font-weight: 800;
}

.jh-qb-old-price {
    color: #777;
    text-decoration: line-through;
    font-size: 14px;
    margin-top: 3px;
}

.jh-qb-best {
    position: absolute;
    right: 18px;
    top: -12px;
    background: #222;
    color: #fff;
    padding: 4px 18px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.1;
}

.jh-qb-best::before,
.jh-qb-best::after {
    content: "";
    position: absolute;
    top: 0;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
}

.jh-qb-best::before {
    left: -10px;
    border-right: 10px solid #222;
}

.jh-qb-best::after {
    right: -10px;
    border-left: 10px solid #222;
}

.jh-qb-variants {
    margin-top: 16px;
    cursor: default;
}

.jh-qb-variant-labels {
    display: grid;
    grid-template-columns: 34px repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
}

.jh-qb-variant-labels::before {
    content: "";
}

.jh-qb-row {
    display: grid;
    grid-template-columns: 34px repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.jh-qb-row-num {
    font-size: 14px;
    color: #111;
}

.jh-qb-attr-select {
    min-height: 36px;
    width: 100%;
    border: 1px solid #aaa;
    border-radius: 5px;
    background: #fff;
    color: #111;
    font-size: 14px;
    padding: 6px 28px 6px 10px;
}

.jh-qb-add,
.jh-qb-buy-now {
    width: 100%;
    border: 0 !important;
    border-radius: 7px !important;
    min-height: 48px;
    margin-top: 18px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .3px;
    text-transform: uppercase;
    cursor: pointer;
}

.jh-qb-add {
    background: #2fb344 !important;
    color: #fff !important;
}

.jh-qb-buy-now {
    background: #168a34 !important;
    color: #fff !important;
    margin-top: 12px !important;
}

.jh-qb-message {
    display: none;
    margin-top: 12px;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 6px;
}

.jh-qb-message.is-error {
    display: block;
    background: #ffecec;
    color: #9f1d1d;
}

.jh-qb-message.is-success {
    display: block;
    background: #edf9ee;
    color: #1e6b26;
}

@media (max-width: 640px) {
    .jh-qb-card {
        padding: 17px 16px;
    }

    .jh-qb-card-head {
        gap: 10px;
    }

    .jh-qb-left {
        gap: 8px;
        font-size: 16px;
        flex-wrap: wrap;
    }

    .jh-qb-new-price {
        font-size: 18px;
    }

    .jh-qb-price {
        min-width: 110px;
    }

    .jh-qb-row,
    .jh-qb-variant-labels {
        grid-template-columns: 30px repeat(auto-fit, minmax(95px, 1fr));
        gap: 8px;
    }
}


/* v1.2: hide the original WooCommerce add-to-cart form only when our quantity box is active. */
body.single-product.jh-qb-active form.cart {
    display: none !important;
}

/* Keep our custom quantity break box visible. */
body.single-product.jh-qb-active .jh-qb-wrap {
    display: block !important;
}


/* v1.3 strict replace mode:
   Hide the original WooCommerce variation/quantity/cart form on enabled product pages.
   This is needed for custom themes/page builders that do not use normal WooCommerce hooks.
*/
body.single-product.jh-qb-product-enabled form.cart:not(.jh-qb-ignore),
body.single-product.jh-qb-product-enabled .summary form.cart,
body.single-product.jh-qb-product-enabled .product-summary form.cart,
body.single-product.jh-qb-product-enabled .single_variation_wrap,
body.single-product.jh-qb-product-enabled table.variations {
    display: none !important;
}

/* Do not hide our custom quantity box */
body.single-product.jh-qb-product-enabled .jh-qb-wrap,
body.single-product.jh-qb-active .jh-qb-wrap {
    display: block !important;
}

/* Better support when product has 3+ attributes */
.jh-qb-variant-labels,
.jh-qb-row {
    grid-template-columns: 38px repeat(auto-fit, minmax(120px, 1fr));
}

.jh-qb-attr-select {
    max-width: 100%;
}

/* When there are many options, keep the card clean */
@media (min-width: 641px) {
    .jh-qb-variants {
        overflow-x: visible;
    }
}

@media (max-width: 640px) {
    .jh-qb-variant-labels,
    .jh-qb-row {
        grid-template-columns: 28px 1fr;
    }

    .jh-qb-variant-labels {
        display: none;
    }

    .jh-qb-row {
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .jh-qb-row .jh-qb-attr-select {
        grid-column: span 1;
    }
}

/* v1.8 mobile spacing refinements */
@media (max-width: 640px){.jh-qb-options{gap:12px!important}.jh-qb-card{padding:14px!important}.jh-qb-row{grid-template-columns:34px 1fr!important;gap:8px 10px!important;align-items:start!important;margin-bottom:12px!important;border-top:1px solid #eee!important;padding-top:12px!important}.jh-qb-row-num{grid-column:1!important;grid-row:1/span 10!important;padding-top:9px!important}.jh-qb-row .jh-qb-attr-select{grid-column:2!important;margin:0!important;min-height:40px!important}}

/* v2.0 row validation + mobile cleanup */
.jh-qb-row.jh-qb-row-error .jh-qb-attr-select,
.jh-qb-attr-select.jh-qb-select-error{border-color:#d11a2a!important;box-shadow:0 0 0 1px #d11a2a!important;background:#fff8f8!important}
.jh-qb-row-error-text{grid-column:2/-1!important;color:#b00020!important;font-size:12px!important;line-height:1.35!important;margin-top:-4px!important}
@media(max-width:640px){.jh-qb-row{grid-template-columns:32px 1fr!important;grid-auto-rows:auto!important;align-items:center!important;margin-bottom:8px!important;padding-top:8px!important;min-height:0!important}.jh-qb-row-num{grid-column:1!important;grid-row:1/3!important;padding-top:0!important;align-self:center!important}.jh-qb-row .jh-qb-attr-select{grid-column:2!important;min-height:38px!important;margin-bottom:4px!important}.jh-qb-row-error-text{grid-column:2!important;margin-top:0!important;margin-bottom:4px!important}.jh-qb-variants{margin-top:8px!important}}

/* v2.2 compact mobile layout */
@media(max-width:640px){.jh-qb-title{font-size:18px!important;margin-bottom:10px!important;gap:8px!important}.jh-qb-options{gap:9px!important}.jh-qb-card{padding:11px 12px!important;border-radius:10px!important}.jh-qb-left{font-size:15px!important;gap:7px!important}.jh-qb-radio{width:18px!important;height:18px!important}.jh-qb-card.is-selected .jh-qb-radio:after{width:10px!important;height:10px!important;left:2px!important;top:2px!important}.jh-qb-badge{font-size:11px!important;padding:2px 7px!important}.jh-qb-price{min-width:86px!important}.jh-qb-new-price{font-size:16px!important}.jh-qb-old-price{font-size:12px!important}.jh-qb-variants{margin-top:8px!important}.jh-qb-row{grid-template-columns:28px 1fr!important;gap:5px 8px!important;margin-bottom:6px!important;padding-top:7px!important;border-top:1px solid #eee!important}.jh-qb-row-num{font-size:12px!important;align-self:center!important}.jh-qb-row .jh-qb-attr-select{min-height:34px!important;height:34px!important;padding:4px 24px 4px 9px!important;font-size:13px!important;margin-bottom:3px!important}.jh-qb-best{font-size:11px!important;padding:3px 12px!important;top:-9px!important;right:16px!important}.jh-qb-add,.jh-qb-buy-now{min-height:40px!important;margin-top:9px!important;font-size:13px!important}}

/* v2.3 desktop lean wider layout */
@media(min-width:769px){.jh-qb-wrap{max-width:760px!important;width:100%!important;margin-top:16px!important;margin-bottom:16px!important}.jh-qb-title{font-size:19px!important;margin-bottom:12px!important;gap:10px!important}.jh-qb-options{gap:12px!important}.jh-qb-card{padding:14px 24px!important;border-radius:12px!important}.jh-qb-card-head{align-items:center!important;min-height:32px!important}.jh-qb-left{font-size:17px!important;gap:10px!important}.jh-qb-radio{width:20px!important;height:20px!important}.jh-qb-card.is-selected .jh-qb-radio:after{width:10px!important;height:10px!important;left:3px!important;top:3px!important}.jh-qb-badge{font-size:12px!important;padding:2px 8px!important}.jh-qb-price{min-width:128px!important}.jh-qb-new-price{font-size:18px!important}.jh-qb-old-price{font-size:13px!important}.jh-qb-variants{margin-top:10px!important}.jh-qb-variant-labels{grid-template-columns:34px repeat(auto-fit,minmax(140px,1fr))!important;gap:8px!important;font-size:12px!important;margin-bottom:5px!important}.jh-qb-row{grid-template-columns:34px repeat(auto-fit,minmax(140px,1fr))!important;gap:8px!important;margin-bottom:7px!important;align-items:center!important}.jh-qb-row-num{font-size:13px!important}.jh-qb-attr-select{min-height:34px!important;height:34px!important;font-size:13px!important;padding:5px 26px 5px 10px!important}.jh-qb-add,.jh-qb-buy-now{min-height:42px!important;margin-top:12px!important;font-size:13px!important}.jh-qb-buy-now{margin-top:10px!important}}

/* v2.4 variation thumbnail support */
.jh-qb-row{grid-template-columns:34px 42px repeat(auto-fit,minmax(140px,1fr))!important}.jh-qb-variant-labels{grid-template-columns:34px 42px repeat(auto-fit,minmax(140px,1fr))!important}.jh-qb-variant-labels:after{content:""!important}.jh-qb-row-thumb{width:38px!important;height:38px!important;border:1px solid #ddd!important;border-radius:6px!important;background:#f7f7f7!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important}.jh-qb-row-thumb img{width:100%!important;height:100%!important;object-fit:cover!important;display:block!important}.jh-qb-row-thumb:empty{display:none!important}@media(max-width:640px){.jh-qb-row{grid-template-columns:28px 36px 1fr!important}.jh-qb-row-num{grid-column:1!important;grid-row:1/3!important}.jh-qb-row-thumb{grid-column:2!important;grid-row:1/3!important;width:32px!important;height:32px!important;align-self:start!important;margin-top:1px!important}.jh-qb-row .jh-qb-attr-select{grid-column:3!important}.jh-qb-row-error-text{grid-column:3!important}}@media(min-width:769px){.jh-qb-row{grid-template-columns:34px 42px repeat(auto-fit,minmax(140px,1fr))!important}.jh-qb-variant-labels{grid-template-columns:34px 42px repeat(auto-fit,minmax(140px,1fr))!important}}

/* v2.9 checkout quantity lock */
.jh-qb-checkout-fixed-qty,.jh-qb-mini-fixed-qty,.jh-qb-cart-fixed-qty{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:48px!important;padding:4px 8px!important;border-radius:5px!important;background:#f2f2f2!important;color:#222!important;font-size:13px!important;font-weight:700!important}
.woocommerce-checkout-review-order .jh-qb-checkout-fixed-qty + .quantity,.woocommerce-checkout-review-order .jh-qb-checkout-fixed-qty ~ .quantity{display:none!important}

/* v2.16 Buy 1 selected-variant regular price */
.jh-qb-card[data-qty="1"] .jh-qb-price{flex-direction:row!important;align-items:center!important;justify-content:flex-end!important;gap:8px!important;min-width:180px!important}
.jh-qb-card[data-qty="1"] .jh-qb-old-price{margin-top:0!important;font-size:15px!important;color:#8c8c8c!important;text-decoration:line-through!important;white-space:nowrap!important}
@media(max-width:640px){.jh-qb-card[data-qty="1"] .jh-qb-price{min-width:120px!important;gap:5px!important}.jh-qb-card[data-qty="1"] .jh-qb-old-price{font-size:12px!important}}
