/**
 * Custom Cart Styles for B2B WooCommerce
 * Professional styling for empty and populated cart states
 */

/* ==========================================================================
   Empty Cart State Styles
   ========================================================================== */

.cart-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 40px 0;
}

.cart-empty-content {
    max-width: 400px;
    margin: 0 auto;
}

.cart-empty-heading {
    font-size: 28px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.3;
}

.cart-empty-actions {
    margin-top: 30px;
}

.btn-back-to-shop {
    background: #3498db;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-back-to-shop:hover {
    background: #2980b9;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ==========================================================================
   Populated Cart State Styles - B2B Professional Layout
   ========================================================================== */

.woocommerce-cart-form-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cart-table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.shop_table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

/*.shop_table thead {
    background: #34495e;
    color: white;
}
*/
.shop_table thead th {
    padding: 18px 15px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    text-align: left;
}

.shop_table tbody tr {
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.2s ease;
}

.shop_table tbody tr:hover {
    background-color: #f8f9fa;
}

.shop_table tbody tr:last-child {
    border-bottom: none;
}

.shop_table tbody td {
    padding: 20px 15px;
    vertical-align: middle;
    border: none;
}

/* Product Thumbnail */
.product-thumbnail {
    width: 80px;
    text-align: center;
}

.product-thumbnail img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

/* Product Name & SKU */
.product-name {
    min-width: 250px;
}

.product-info h3,
.product-info a {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-decoration: none;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.product-info a:hover {
    color: #3498db;
}

.product-sku {
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
}

.product-sku strong {
    color: #34495e;
}

/* Price */
/*.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
    min-width: 100px;
}
*/
/* Quantity Controls */
.product-quantity {
    min-width: 120px;
}

.quantity-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-wrapper .qty {
    width: 60px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

.quantity-controls {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #495057;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.qty-btn:active {
    transform: scale(0.95);
}

/* Subtotal */
/*.product-subtotal {
    font-size: 16px;
    font-weight: 600;
    color: #27ae60;
    min-width: 100px;
}
*/
/* Remove Button */
.product-remove {
    width: 50px;
    text-align: center;
}

.ajax-remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.ajax-remove-item:hover {
    background: #c0392b;
    color: white;
    transform: scale(1.1);
}

/* Actions Row */
.actions {
    background: #f8f9fa;
    padding: 20px 15px !important;
}

.actions .coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.actions .coupon label {
    font-weight: 600;
    color: #495057;
}

.actions .coupon input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.actions .button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.actions .button:hover {
    background: #2980b9;
}

/* Cart Totals */
.cart-collaterals {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

.cart_totals {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.cart_totals h2 {
 /*   font-size: 20px;
    font-weight: 600;
    color: #2c3e50;*/
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.cart_totals table {
    width: 100%;
    margin-bottom: 20px;
}

.cart_totals th,
.cart_totals td {
    padding: 12px 0;
    border-bottom: 1px solid #ecf0f1;
}

.cart_totals th {
    font-weight: 600;
    color: #495057;
    text-align: left;
}

.cart_totals td {
    text-align: right;
 /*   font-weight: 600;
    color: #27ae60;*/
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    font-size: 18px;
    font-weight: 700;
 /*   color: #2c3e50;*/
    border-bottom: none;
    padding-top: 15px;
}

.wc-proceed-to-checkout {
    text-align: center;
}

.checkout-button {
    background: #27ae60;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkout-button:hover {
    background: #229954;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* Color of the "Place an order" button */
a.checkout-button.button.alt.wc-forward {
    background-color: #e9e6ed !important;
    border-color: #e9e6ed !important;
    color: #555 !important; /* you can change it to #fff, for example, if you need white text */
}

/* Button color on hover */
a.checkout-button.button.alt.wc-forward:hover {
    background-color: #dcd8e0 !important; /* a little darker for effect */
    border-color: #dcd8e0 !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.cart-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Quantity updating state */
.quantity-updating {
    opacity: 0.6;
    pointer-events: none;
}

/* Item removing state */
.item-removing {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .woocommerce-cart-form-wrapper {
        padding: 10px;
    }
    
    .cart-table-wrapper {
        overflow-x: auto;
    }
    
    .shop_table {
        min-width: 600px;
    }
    
    .shop_table thead th {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .shop_table tbody td {
        padding: 15px 8px;
    }
    
    .product-thumbnail {
        width: 60px;
    }
    
    .product-thumbnail img {
        width: 45px;
        height: 45px;
    }
    
    .product-name {
        min-width: 200px;
    }
    
    .quantity-wrapper {
        flex-direction: column;
        gap: 5px;
    }
    
    .quantity-controls {
        flex-direction: row;
        gap: 5px;
    }
    
    .cart-collaterals {
        justify-content: center;
    }
    
    .cart_totals {
        max-width: 100%;
    }
    
    .actions .coupon {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .cart-empty-heading {
        font-size: 24px;
    }
    
    .cart-empty-state {
        padding: 40px 15px;
    }
}

@media (max-width: 480px) {
    .shop_table {
        min-width: 500px;
    }
    
    .product-name {
        min-width: 150px;
    }
    
    .product-info h3,
    .product-info a {
        font-size: 14px;
    }
    
    .product-sku {
        font-size: 12px;
    }
}

/* ==========================================================================
   WooCommerce Notices Integration
   ========================================================================== */

.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 5px;
    border-left: 4px solid;
}

.woocommerce-message {
    background: #d4edda;
    border-left-color: #27ae60;
    color: #155724;
}

.woocommerce-error {
    background: #f8d7da;
    border-left-color: #e74c3c;
    color: #721c24;
}

.woocommerce-info {
    background: #d1ecf1;
    border-left-color: #3498db;
    color: #0c5460;
}
