/**
 * Bee1 Grouped Products - Frontend Styles
 */

.product-type-bee1_grouped form.cart:not(.bee1-grouped-cart) .quantity {
    display: inline-flex;
}

.product-type-bee1_grouped.bee1-grouped-show-atc-each form.cart:not(.bee1-grouped-cart),
.product-type-bee1_grouped.bee1-grouped-show-atc-each .bee1-grouped-total,
.product-type-bee1_grouped.bee1-grouped-show-atc-each .bee1-grouped-alert,
.product-type-bee1_grouped.bee1-grouped-show-atc-no form.cart,
.product-type-bee1_grouped.bee1-grouped-show-atc-no .bee1-grouped-total,
.product-type-bee1_grouped.bee1-grouped-show-atc-no .bee1-grouped-alert {
    display: none !important;
}

.bee1-grouped-wrap.bee1-grouped-show-atc-each+form.cart,
.bee1-grouped-wrap.bee1-grouped-show-atc-no+form.cart {
    display: none !important;
}

/* Wrap */
.bee1-grouped-wrap {
    margin: 0 0 1.5em;
    padding: 0;
    clear: both;
}

/* Products Container */
.bee1-grouped-products {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bee1-grouped-item-text {
    padding: 4px 0 12px;
    color: #171f3b;
}

.bee1-grouped-item-text h1,
.bee1-grouped-item-text h2,
.bee1-grouped-item-text h3,
.bee1-grouped-item-text h4,
.bee1-grouped-item-text h5,
.bee1-grouped-item-text h6,
.bee1-grouped-item-text p {
    margin: 0;
}

.bee1-grouped-pick-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.bee1-grouped-pick-group-counter {
    font-size: 0.75em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #185fa5;
    white-space: nowrap;
}

.bee1-grouped-pick-group-counter.bee1-grouped-pick-group-counter-done {
    background: #e6f7ee;
    color: #1d9e75;
}

/* Layout: Grid */
.bee1-grouped-layout-grid-2 .bee1-grouped-products,
.bee1-grouped-layout-grid-3 .bee1-grouped-products,
.bee1-grouped-layout-grid-4 .bee1-grouped-products {
    display: grid;
    gap: 20px;
}

.bee1-grouped-layout-grid-2 .bee1-grouped-products {
    grid-template-columns: repeat(2, 1fr);
}

.bee1-grouped-layout-grid-3 .bee1-grouped-products {
    grid-template-columns: repeat(3, 1fr);
}

.bee1-grouped-layout-grid-4 .bee1-grouped-products {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Item */
.bee1-grouped-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #fff;
}

.bee1-grouped-product-unpurchasable {
    opacity: 0.6;
}

/* Checkbox */
.bee1-grouped-choose {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.bee1-grouped-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.bee1-grouped-choose .checkmark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bee1-grouped-choose .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bee1-grouped-checkbox:checked+.checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.bee1-grouped-checkbox:checked+.checkmark:after {
    display: block;
}

/* Thumbnail */
.bee1-grouped-thumb {
    flex-shrink: 0;
    width: 60px;
}

.bee1-grouped-thumb img {
    max-width: 100%;
    height: auto;
    display: block;
}

.bee1-grouped-thumb-new {
    display: none;
}

/* Title & Info */
.bee1-grouped-title {
    flex: 1;
    min-width: 150px;
}

.bee1-grouped-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.bee1-grouped-name a {
    text-decoration: none;
    color: inherit;
}

.bee1-grouped-name a:hover {
    color: #0073aa;
}

/* Price */
.bee1-grouped-price {
    font-size: 0.9em;
    color: #666;
}

.bee1-grouped-price-new {
    display: none;
}

/* Availability */
.bee1-grouped-availability {
    font-size: 0.85em;
    margin-top: 5px;
}

/* Quantity */
.bee1-grouped-quantity {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bee1-grouped-quantity-ratio {
    min-width: 52px;
    justify-content: center;
}

.bee1-grouped-quantity-ratio-value,
.bee1-grouped-ratio-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #171f3b;
}

.bee1-grouped-ratio-label {
    margin-inline-start: 8px;
    font-size: 0.92em;
}

.bee1-grouped-atc {
    width: 190px;
    flex: 0 0 190px;
}

.bee1-grouped-atc form.cart {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.bee1-grouped-atc .added_to_cart {
    display: none !important;
}

.bee1-grouped-atc .single_add_to_cart_button {
    width: 100%;
    margin: 0 !important;
}

.bee1-grouped-atc-quantity .quantity,
.bee1-grouped-atc-quantity .qty {
    width: 100%;
}

.bee1-grouped-quantity .qty {
    width: 60px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Quantity stepper (− / + pill), rendered when Quantity Mode = "free" */
.bee1-grouped-quantity-stepper {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #dcdcde;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.bee1-grouped-quantity-stepper .bee1-grouped-quantity-minus,
.bee1-grouped-quantity-stepper .bee1-grouped-quantity-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    color: #171f3b;
    text-decoration: none;
    background: #f6f7f7;
    user-select: none;
    transition: background 0.15s ease;
}

.bee1-grouped-quantity-stepper .bee1-grouped-quantity-minus:hover,
.bee1-grouped-quantity-stepper .bee1-grouped-quantity-plus:hover {
    background: #ececef;
    color: #171f3b;
}

.bee1-grouped-quantity-stepper .qty {
    width: 44px;
    padding: 6px 2px;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bee1-grouped-quantity-stepper .qty::-webkit-outer-spin-button,
.bee1-grouped-quantity-stepper .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bee1-grouped-quantity-stepper .qty:focus {
    outline: none;
    box-shadow: none;
}

/* Main bundle quantity as a − / + pill (free quantity mode). WooCommerce
   renders <div class="quantity"><label…/><input class="qty"></div>; the
   minus/plus anchors are injected around the input by frontend.js's
   enhanceMainQuantity(). */
.product-type-bee1_grouped form.cart:not(.bee1-grouped-cart) .quantity.bee1-grouped-main-quantity {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #dcdcde;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.bee1-grouped-main-quantity .bee1-grouped-main-qty-minus,
.bee1-grouped-main-quantity .bee1-grouped-main-qty-plus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    color: #171f3b;
    text-decoration: none;
    background: #f6f7f7;
    user-select: none;
    transition: background 0.15s ease;
}

.bee1-grouped-main-quantity .bee1-grouped-main-qty-minus:hover,
.bee1-grouped-main-quantity .bee1-grouped-main-qty-plus:hover {
    background: #ececef;
    color: #171f3b;
}

.bee1-grouped-main-quantity .qty {
    width: 52px;
    padding: 8px 2px;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bee1-grouped-main-quantity .qty::-webkit-outer-spin-button,
.bee1-grouped-main-quantity .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bee1-grouped-main-quantity .qty:focus {
    outline: none;
    box-shadow: none;
}

/* Variations Form */
.bee1-grouped-variations-form {
    margin-top: 10px;
    width: 100%;
}

.bee1-grouped-variations-form .variations {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bee1-grouped-variations-form .variation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bee1-grouped-variations-form .label {
    font-size: 0.9em;
    color: #666;
}

.bee1-grouped-variations-form select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.bee1-grouped-variations-form .reset {
    margin-top: 5px;
}

.bee1-grouped-variations-form .reset_variations {
    font-size: 0.85em;
    color: #999;
    text-decoration: none;
}

.bee1-grouped-variations-form .reset_variations:hover {
    color: #0073aa;
}

/* Total */
.bee1-grouped-total {
    margin-top: 15px;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 4px;
    font-weight: 600;
    display: none;
}

/* Alert */
.bee1-grouped-alert {
    margin-top: 15px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
}

/* Mix & Match container status */
.bee1-grouped-mix-match-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 13px 15px;
    background: #f7f8fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #171f3b;
}

.bee1-grouped-mix-match-counter {
    font-weight: 600;
}

.bee1-grouped-mix-match-counter-done {
    color: #287a4d;
}

.bee1-grouped-clear-selections {
    padding: 0;
    background: transparent;
    border: 0;
    color: #64748b;
    font: inherit;
    font-size: 0.88em;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.bee1-grouped-clear-selections:hover,
.bee1-grouped-clear-selections:focus-visible {
    color: #171f3b;
}

.bee1-grouped-quantity-limit-reached {
    opacity: 0.35;
    cursor: not-allowed !important;
}

/* ============================================================
   Item Style: Card (bee1_grouped_settings[item_style] = card)
   Opt-in modern look modeled on Mix & Match style package pages.
   Everything scoped under .bee1-grouped-style-card so the
   default (classic) output is untouched.
   ============================================================ */
.bee1-grouped-style-card .bee1-grouped-products {
    gap: 10px;
}

.bee1-grouped-style-card .bee1-grouped-item {
    border: 1px solid #ececef;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 1px 3px rgba(23, 31, 59, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bee1-grouped-style-card .bee1-grouped-item:hover {
    border-color: #d4d6dd;
    box-shadow: 0 3px 10px rgba(23, 31, 59, 0.1);
}

.bee1-grouped-style-card .bee1-grouped-thumb {
    width: 64px;
}

.bee1-grouped-style-card .bee1-grouped-thumb img {
    border-radius: 8px;
}

.bee1-grouped-style-card .bee1-grouped-name {
    font-size: 1em;
    margin-bottom: 2px;
}

.bee1-grouped-style-card .bee1-grouped-price {
    font-size: 0.85em;
}

.bee1-grouped-style-card .bee1-grouped-item-text {
    padding: 8px 2px 4px;
}

.bee1-grouped-style-card .bee1-grouped-choose .checkmark {
    border-radius: 999px;
    height: 22px;
    width: 22px;
}

.bee1-grouped-style-card .bee1-grouped-choose .checkmark:after {
    left: 8px;
    top: 4px;
}

.bee1-grouped-style-card .bee1-grouped-total {
    margin-top: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #ececef;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(23, 31, 59, 0.06);
    font-size: 1.05em;
}

.bee1-grouped-style-card .bee1-grouped-alert {
    border-radius: 12px;
}

@media (max-width: 768px) {
    .bee1-grouped-style-card .bee1-grouped-item {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .bee1-grouped-style-card .bee1-grouped-thumb {
        width: 56px;
    }

    .bee1-grouped-style-card .bee1-grouped-quantity {
        width: auto;
        margin-inline-start: auto;
    }
}

/* Best-seller boosters */
.bee1-grouped-savings-badge {
    display: inline-block;
    margin-inline-start: 8px;
    padding: 2px 10px;
    background: #e6f7ee;
    color: #1d9e75;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 600;
    vertical-align: middle;
}

.bee1-grouped-social-proof {
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

.bee1-grouped-free-shipping-nudge {
    margin-top: 8px;
    padding: 8px 12px;
    background: #eef6ff;
    border-radius: 4px;
    font-size: 0.85em;
    color: #185fa5;
}

.bee1-grouped-low-stock-urgency {
    display: inline-block;
    margin-inline-start: 6px;
    font-size: 0.85em;
    font-weight: 600;
    color: #e24b4a;
}

.bee1-grouped-shop-badge {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 10px;
    background: #171f3b;
    color: #fbc109;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {

    .bee1-grouped-layout-grid-2 .bee1-grouped-products,
    .bee1-grouped-layout-grid-3 .bee1-grouped-products,
    .bee1-grouped-layout-grid-4 .bee1-grouped-products {
        grid-template-columns: 1fr;
    }

    .bee1-grouped-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .bee1-grouped-thumb {
        width: 80px;
    }

    .bee1-grouped-quantity {
        width: 100%;
        justify-content: flex-start;
    }

    .bee1-grouped-mix-match-status {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Show ATC variations */
.bee1-grouped-show-atc-each .bee1-grouped-quantity,
.bee1-grouped-show-atc-no .bee1-grouped-quantity {
    display: none;
}

.bee1-grouped-show-atc-each .bee1-grouped-choose,
.bee1-grouped-show-atc-no .bee1-grouped-choose {
    display: none;
}

.bee1-grouped-show-atc-no .bee1-grouped-atc {
    display: none;
}
