/**
 * 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;
}

/* 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;
}

/* 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;
}

/* 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;
    }
}

/* 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;
}
