/* Composite Products Manager - Frontend Styles */
/* Version: 2.3.9 - WordPress 6.8+ and WooCommerce 9.x compatibility */

/* ============================================
   PRODUCT PAGE - Composite Options
   ============================================ */
.cpm-composite-wrapper {
    margin: 20px 0;
}

.cpm-addon-group {
    margin-bottom: 20px;
}

.cpm-addons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.cpm-addon-item {
    display: flex;
    flex-direction: column;
}

.cpm-addon-image img {
    max-width: 100%;
    height: auto;
}

.cpm-addon-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cpm-addon-price-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.cpm-addon-quantity {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cpm-qty-input {
    width: 50px;
    text-align: center;
}

.cpm-total-wrapper,
.cpm-grand-total-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
}

/* ============================================
   CART/CHECKOUT/ORDER - Composite Display Table
   Minimal structure - themes style this
   ============================================ */
.cpm-cart-addons-wrapper,
.cpm-checkout-addons-wrapper,
.cpm-order-addons-wrapper,
.cpm-order-item-meta {
    display: block;
}

.cpm-cart-addons-table {
    width: 100%;
    border-collapse: collapse;
}

.cpm-cart-addons-table tr {
    height: auto !important;
}

.cpm-cart-addons-table td {
    padding: 4px 8px;
    vertical-align: middle;
    height: auto !important;
}

.cpm-cart-addons-table .cpm-addon-qty {
    width: 40px;
    white-space: nowrap;
}

.cpm-cart-addons-table .cpm-addon-name {
    /* Flexible width */
}

.cpm-cart-addons-table .cpm-addon-unit-price,
.cpm-cart-addons-table .cpm-addon-subtotal {
    width: 80px;
    text-align: right;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .cpm-addons-grid {
        grid-template-columns: 1fr;
    }
    
    .cpm-total-wrapper,
    .cpm-grand-total-wrapper {
        flex-direction: column;
        gap: 10px;
    }
    
    .cpm-cart-addons-table .cpm-addon-unit-price,
    .cpm-cart-addons-table .cpm-addon-subtotal {
        width: 60px;
    }
}
