/**
 * Mix and Match Products - Custom Styling
 * Sport Drink inspired clean black and white design
 * Matches quantity selector and shipping info box aesthetic
 */

/* ==========================================================================
   Main Container
   ========================================================================== */

.mnm_form {
    border: 3px solid #000000;
    background: #ffffff;
    padding: 0;
    margin: 20px 0;
    box-shadow: 8px 8px 0 #000000;
}

/* ==========================================================================
   Product List/Table
   ========================================================================== */

.mnm_child_products {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mnm_child_products .child-item {
    display: flex;
    align-items: center;
    padding: 24px;
    border: 3px solid #000000;
    gap: 20px;
    position: relative;
    background: #ffffff;
    box-shadow: 6px 6px 0 #000000;
}

.mnm_child_products .child-item:last-child {
    border-bottom: 3px solid #000000;
}

/* Out of stock styling */
.mnm_child_products .child-item.outofstock {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* ==========================================================================
   Product Image
   ========================================================================== */

.mnm_child_product_images {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border: 3px solid #000000;
    background: #ffffff;
}

.mnm_child_product_images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mnm_child_product_images figure {
    margin: 0;
}

/* ==========================================================================
   Product Details
   ========================================================================== */

.mnm_child_product_details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mnm_child_product_details .product-title,
.mnm_child_product_details .product_title {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    color: #000000;
    letter-spacing: -0.02em;
}

.mnm_child_product_details .product-title a,
.mnm_child_product_details .product_title a {
    color: #000000;
    text-decoration: none;
}

.mnm_child_product_details .product-title a:hover,
.mnm_child_product_details .product_title a:hover {
    text-decoration: underline;
}

/* Variation details */
.mnm_child_product_details .product-variations {
    font-size: 14px;
    color: #666666;
    margin: 0;
}

.mnm_child_product_details dl {
    margin: 0;
    font-size: 14px;
}

.mnm_child_product_details dt {
    font-weight: 600;
    display: inline;
}

.mnm_child_product_details dd {
    display: inline;
    margin: 0;
}

.mnm_child_product_details dt:after {
    content: ": ";
}

.mnm_child_product_details dd:after {
    content: "";
    display: block;
}

/* ==========================================================================
   Product Price
   ========================================================================== */

.mnm_child_product_details .price,
.product-price {
    font-size: 18px;
    font-weight: 800;
    color: #000000;
    margin: 0;
}

.mnm_child_product_details .price del,
.product-price del {
    opacity: 0.6;
    font-weight: 400;
}

.mnm_child_product_details .price ins,
.product-price ins {
    text-decoration: none;
}

/* ==========================================================================
   Quantity Selector
   ========================================================================== */

.product-quantity {
    flex-shrink: 0;
    margin-left: auto;
}

/* Hide default number input arrows */
.product-quantity input[type="number"]::-webkit-outer-spin-button,
.product-quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-quantity input[type="number"] {
    -moz-appearance: textfield;
}

/* Plus/Minus buttons style */
.mnm_form .product-quantity .quantity {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    width: auto !important;
}

.mnm_form .product-quantity .button,
.mnm_form .product-quantity .btn,
.product-quantity .minus,
.product-quantity .plus {
    background: transparent !important;
    border: 3px solid #000000 !important;
    border-radius: 3px;
    color: #000000 !important;
    cursor: pointer;
    font-size: 20px !important;
    font-weight: 800 !important;
    height: 48px !important;
    width: 48px !important;
    line-height: 1;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mnm_form .product-quantity .button:hover,
.mnm_form .product-quantity .btn:hover,
.product-quantity .minus:hover,
.product-quantity .plus:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

.mnm_form .product-quantity .button:disabled,
.mnm_form .product-quantity .btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
    background: transparent !important;
    color: #000000 !important;
}

.mnm_form .product-quantity .qty,
.product-quantity input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    border: 3px solid #000000 !important;
    border-radius: 3px;
    flex: 0 0 auto;
    font-size: 18px !important;
    font-weight: 800 !important;
    height: 48px !important;
    line-height: 1;
    margin: 0 !important;
    padding: 2px 8px !important;
    text-align: center;
    width: 80px !important;
    color: #000000 !important;
    background: #ffffff !important;
}

.mnm_form .product-quantity .qty:hover,
.product-quantity input[type="number"]:hover {
    border-color: #777 !important;
}

.mnm_form .product-quantity .qty:focus,
.product-quantity input[type="number"]:focus {
    outline: none;
    border-color: #000000 !important;
}

/* Force quantity to display */
.mnm_child_products .product-quantity,
.mnm_child_products .product-quantity .quantity,
.mnm_child_products .product-quantity input,
.mnm_child_products .product-quantity .button,
.mnm_child_products .product-quantity .btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ==========================================================================
   Status Messages
   ========================================================================== */

.mnm_status {
    padding: 20px 24px;
    border-bottom: 3px solid #000000;
    background: #f9f9f9;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.01em;
}

.mnm_status.passes_validation {
    background: #e8f5e9;
    color: #2e7d32;
}

.mnm_status.fails_validation {
    background: #ffebee;
    color: #c62828;
}

/* ==========================================================================
   Add to Cart Section
   ========================================================================== */

.summary-add-to-cart-form-mnm {
    clear: both;
    margin-bottom: 2em;
}

.summary-add-to-cart-form-mnm .woocommerce-variation-add-to-cart,
.summary-add-to-cart-form-mnm .mnm_button {
    padding: 24px;
    border-top: 3px solid #000000;
}

/* ==========================================================================
   Bundle Quantity Selector (Main Add to Cart)
   ========================================================================== */

.mnm_button_wrap .quantity,
.woocommerce-mix-and-match-add-to-cart .quantity {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 16px;
}

.mnm_button_wrap .quantity input[type="number"],
.woocommerce-mix-and-match-add-to-cart .quantity input[type="number"] {
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
    border: 3px solid #000000 !important;
    border-radius: 3px;
    font-size: 20px !important;
    font-weight: 800 !important;
    height: 56px !important;
    line-height: 1;
    margin: 0 !important;
    padding: 4px 12px !important;
    text-align: center;
    width: 200px !important;
    color: #000000 !important;
    background: #ffffff !important;
    flex: 1 1 auto;
    max-width: 300px;
}

.mnm_button_wrap .quantity input[type="number"]:hover,
.woocommerce-mix-and-match-add-to-cart .quantity input[type="number"]:hover {
    border-color: #777 !important;
}

.mnm_button_wrap .quantity input[type="number"]:focus,
.woocommerce-mix-and-match-add-to-cart .quantity input[type="number"]:focus {
    outline: none;
    border-color: #000000 !important;
}

.mnm_button_wrap .quantity input[type="number"]::-webkit-outer-spin-button,
.mnm_button_wrap .quantity input[type="number"]::-webkit-inner-spin-button,
.woocommerce-mix-and-match-add-to-cart .quantity input[type="number"]::-webkit-outer-spin-button,
.woocommerce-mix-and-match-add-to-cart .quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mnm_button_wrap .quantity .button,
.mnm_button_wrap .quantity .btn,
.mnm_button_wrap .quantity .minus,
.mnm_button_wrap .quantity .plus,
.woocommerce-mix-and-match-add-to-cart .quantity .button,
.woocommerce-mix-and-match-add-to-cart .quantity .btn,
.woocommerce-mix-and-match-add-to-cart .quantity .minus,
.woocommerce-mix-and-match-add-to-cart .quantity .plus {
    background: transparent !important;
    border: 3px solid #000000 !important;
    border-radius: 3px;
    color: #000000 !important;
    cursor: pointer;
    font-size: 24px !important;
    font-weight: 800 !important;
    height: 56px !important;
    width: 56px !important;
    line-height: 1;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mnm_button_wrap .quantity .button:hover,
.mnm_button_wrap .quantity .btn:hover,
.mnm_button_wrap .quantity .minus:hover,
.mnm_button_wrap .quantity .plus:hover,
.woocommerce-mix-and-match-add-to-cart .quantity .button:hover,
.woocommerce-mix-and-match-add-to-cart .quantity .btn:hover,
.woocommerce-mix-and-match-add-to-cart .quantity .minus:hover,
.woocommerce-mix-and-match-add-to-cart .quantity .plus:hover {
    background: #333333 !important;
    color: #ffffff !important;
}

.mnm_button_wrap .quantity .button:disabled,
.mnm_button_wrap .quantity .btn:disabled,
.woocommerce-mix-and-match-add-to-cart .quantity .button:disabled,
.woocommerce-mix-and-match-add-to-cart .quantity .btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
    background: transparent !important;
    color: #000000 !important;
}

/* Reset messages */
.mnm_reset {
    margin: 16px 0;
    text-align: center;
}

.mnm_reset a {
    font-size: 14px;
    color: #000000;
    text-decoration: underline;
}

.mnm_reset a:hover {
    text-decoration: none;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .mnm_child_products {
        gap: 16px;
    }
    
    .mnm_child_products .child-item {
        flex-wrap: wrap;
        padding: 20px;
        gap: 16px;
        box-shadow: 4px 4px 0 #000000;
    }
    
    .mnm_child_product_images {
        width: 70px;
        height: 70px;
    }
    
    .mnm_child_product_details {
        flex: 1;
        min-width: 0;
    }
    
    .mnm_child_product_details .product-title,
    .mnm_child_product_details .product_title {
        font-size: 16px;
    }
    
    .mnm_child_product_details .product-variations,
    .mnm_child_product_details dl {
        font-size: 13px;
    }
    
    .product-quantity {
        flex-basis: 100%;
        margin-left: 0;
        display: flex;
        justify-content: center;
    }
    
    .mnm_status {
        padding: 16px 20px;
        font-size: 14px;
    }
}

@media screen and (max-width: 480px) {
    .mnm_child_products {
        gap: 12px;
    }
    
    .mnm_child_products .child-item {
        padding: 16px;
        box-shadow: 3px 3px 0 #000000;
    }
    
    .mnm_child_product_images {
        width: 60px;
        height: 60px;
    }
    
    .mnm_child_product_details .product-title,
    .mnm_child_product_details .product_title {
        font-size: 14px;
    }
    
    .mnm_form.has-plus-minus-buttons .product-quantity .qty {
        width: 60px;
        font-size: 16px;
    }
    
    .mnm_form.has-plus-minus-buttons .product-quantity .button {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}

/* ==========================================================================
   Grid Layout (if using grid mode)
   ========================================================================== */

.mnm_form.layout-grid .mnm_child_products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0;
}

.mnm_form.layout-grid .mnm_child_products .child-item {
    flex-direction: column;
    text-align: center;
    border-right: 3px solid #000000;
    border-bottom: 3px solid #000000;
    box-shadow: 4px 4px 0 #000000;
}

.mnm_form.layout-grid .mnm_child_products .child-item:last-child {
    border-bottom: 3px solid #000000;
}

.mnm_form.layout-grid .mnm_child_product_images {
    width: 120px;
    height: 120px;
}

.mnm_form.layout-grid .product-quantity {
    margin-left: 0;
}

/* ==========================================================================
   Compatibility & Cleanup
   ========================================================================== */

/* Remove default WooCommerce styles that conflict */
.mnm_child_products .child-item::before,
.mnm_child_products .child-item::after {
    display: none;
}

/* Ensure buttons inherit correct styling */
.mnm_form button:focus,
.mnm_form input:focus {
    outline: none;
    box-shadow: none;
}

/* Clean up any theme-specific overrides */
.mnm_form * {
    box-sizing: border-box;
}
