/**
 * WooCommerce Split Order by Stock - Styles
 * Version 1.1.0
 */

/* ==========================================================================
   Common Styles
   ========================================================================== */

.wc-split-order-wrapper {
    padding: 10px 0;
}

.wc-split-order-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.wc-split-order-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.wc-split-order-details {
    margin-top: 15px;
    padding: 15px;
    background: #f8f8f8;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.wc-split-shipment {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.wc-split-shipment:last-of-type {
    margin-bottom: 10px;
}

.wc-split-shipment-instock {
    border-left: 3px solid #46b450;
}

.wc-split-shipment-backorder {
    border-left: 3px solid #ffb900;
}

.wc-split-shipment strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
}

.wc-split-shipment ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wc-split-shipment ul li {
    padding: 4px 0;
    color: #666;
    font-size: 0.9em;
}

.wc-split-order-note {
    margin: 10px 0 0;
    padding: 8px;
    background: #fff8e5;
    border-radius: 3px;
    font-size: 0.85em;
    color: #6d5200;
}

/* ==========================================================================
   Cart Page Styles
   ========================================================================== */

.wc-split-order-cart-wrapper {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.wc-split-order-toggle {
    margin-bottom: 15px;
}

.wc-split-order-toggle .wc-split-order-checkbox {
    margin-bottom: 8px;
}

.wc-split-order-description {
    margin: 0;
    padding: 0;
    color: #666;
    font-size: 0.9em;
}

.wc-split-order-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .wc-split-order-preview {
        grid-template-columns: 1fr;
    }
}

.wc-split-cart {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wc-split-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.wc-split-cart-header h3 {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.wc-split-cart-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.wc-split-badge-instock {
    background: #d4edda;
    color: #155724;
}

.wc-split-badge-backorder {
    background: #fff3cd;
    color: #856404;
}

.wc-split-cart-instock {
    border: 2px solid #46b450;
}

.wc-split-cart-backorder {
    border: 2px solid #ffb900;
}

.wc-split-cart-table {
    width: 100%;
    border-collapse: collapse;
}

.wc-split-cart-table th,
.wc-split-cart-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.wc-split-cart-table th {
    background: #fafafa;
    font-size: 0.85em;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.wc-split-cart-table tbody tr:last-child td {
    border-bottom: none;
}

.wc-split-cart-table .product-thumbnail {
    width: 60px;
}

.wc-split-cart-table .product-thumbnail img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.wc-split-cart-table .product-quantity,
.wc-split-cart-table .product-subtotal {
    text-align: center;
    width: 80px;
}

.wc-split-cart-table tfoot td {
    padding: 12px 10px;
    background: #fafafa;
}

.wc-split-cart-table tfoot .text-right {
    text-align: right;
}

.wc-split-shipping-note {
    text-align: center !important;
    color: #888;
    font-size: 0.85em;
}

.wc-split-order-summary {
    grid-column: 1 / -1;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    text-align: center;
    border: 1px solid #e0e0e0;
}

.wc-split-order-summary p {
    margin: 0 0 10px;
}

.wc-split-order-summary .wc-split-order-note {
    margin: 10px 0 0;
    display: inline-block;
}

/* ==========================================================================
   Checkout Page Styles (Standard WooCommerce)
   ========================================================================== */

.wc-split-order-option {
    padding: 15px;
    margin: 15px 0;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

/* ==========================================================================
   CheckoutWC Compatibility Styles
   ========================================================================== */

.wc-split-order-option-cfw {
    padding: 20px;
    margin: 0 0 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.wc-split-order-option-cfw .wc-split-order-wrapper {
    padding: 0;
}

.wc-split-order-option-cfw .wc-split-order-checkbox {
    font-size: 1em;
}

.wc-split-order-option-cfw .wc-split-order-details {
    margin-top: 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 3px solid #0073aa;
}

.wc-split-order-option-cfw .wc-split-shipment {
    background: #fafafa;
}

/* Shipping method labels for split packages */
.woocommerce-shipping-methods .shipping-package-name,
#cfw-shipping-method .cfw-shipping-package-title {
    font-weight: 600;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

/* Package titles in checkout */
.woocommerce-shipping-totals th,
.cfw-shipping-method-heading {
    font-weight: 600;
}

/* Multiple shipping packages display */
.woocommerce-checkout-review-order-table .shipping,
#cfw-cart .cfw-cart-totals .cfw-shipping-row {
    background: #f9f9f9;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 480px) {
    .wc-split-cart-table .product-thumbnail {
        display: none;
    }
    
    .wc-split-cart-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .wc-split-cart-header h3 {
        font-size: 0.9em;
    }
    
    .wc-split-order-checkbox {
        flex-direction: column;
        align-items: flex-start;
    }
}
