/* Additional CSS fixes for cart alignment */

/* Table styling improvements */
.cart-modern .cart-items {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.cart-modern .cart-items thead th {
    padding: 15px;
    font-weight: 600;
    color: #333;
    background-color: #f9f9f9;
    border-bottom: 2px solid #eee;
    text-align: left;
}

.cart-modern .cart-items thead th:first-child { width: 40%; } /* Product */
.cart-modern .cart-items thead th:nth-child(2) { width: 15%; } /* Price */
.cart-modern .cart-items thead th:nth-child(3) { width: 15%; } /* Quantity */
.cart-modern .cart-items thead th:nth-child(4) { width: 15%; } /* Total */
.cart-modern .cart-items thead th:last-child { width: 10%; } /* Delete */

.cart-modern .cart-items tbody td {
    padding: 20px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.cart-modern .cart-items tbody td:first-child {
    text-align: left;
}

/* Product cell styling */
.cart-modern .cart-item-details {
    display: flex;
    align-items: center;
}

.cart-modern .cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.cart-modern .cart-item-info {
    flex: 1;
}

.cart-modern .product-name {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    margin-bottom: 5px;
}

.cart-modern .product-name:hover {
    color: var(--primary-color);
}

/* Price styling */
.cart-modern .price-amount {
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.cart-modern .currency-symbol {
    margin-right: 2px;
    display: inline-flex;
    align-items: center;
}

.cart-modern .currency-symbol img {
    height: 1em;
    width: auto;
    vertical-align: middle;
}


/* Delete button styling */
.cart-modern .btn-delete {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-color: #ff5252;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin: 0 auto;
}

.cart-modern .btn-delete:hover {
    background-color: #e04545;
    color: white;
}

/* Loading indicator for cart updates */
.cart-modern .cart-item.updating {
    position: relative;
    pointer-events: none;
}

.cart-modern .cart-item.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.cart-modern .cart-item.updating::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -15px;
    margin-left: -15px;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    z-index: 2;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart message alerts */
.cart-modern .cart-message {
    margin: 10px 0 20px;
    padding: 12px 15px;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

.cart-modern .alert-success {
    background-color: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.cart-modern .alert-danger {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid #f44336;
    color: #f44336;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Quantity controls styling */
.cart-modern .quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 120px;
    margin: 0 auto;
}

.cart-modern .quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-modern .quantity-btn:hover {
    background-color: #e0e0e0;
}

.cart-modern .quantity-btn.minus {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.cart-modern .quantity-btn.plus {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.cart-modern .quantity-input {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #333;
    background-color: #fff;
    padding: 0 5px;
    margin: 0;
    display: inline-block;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Hide number input arrows */
.cart-modern .quantity-input::-webkit-outer-spin-button,
.cart-modern .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Coupon form styling */
.coupon-section {
    margin-bottom: 20px;
}

.coupon-form {
    display: flex;
    margin-bottom: 10px;
}

.coupon-input {
    flex: 1;
    height: 40px;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.coupon-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.coupon-button {
    height: 40px;
    padding: 0 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.coupon-button:hover {
    background-color: #0069d9;
}

.coupon-button:active {
    background-color: #0062cc;
}

/* Applied coupon styling */
.applied-coupon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    border-radius: 4px;
    margin-bottom: 10px;
}

.coupon-info {
    display: flex;
    flex-direction: column;
}

.coupon-code {
    font-weight: 600;
    color: #007bff;
    font-size: 15px;
    margin-bottom: 3px;
}

.coupon-discount {
    color: #28a745;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.coupon-discount .currency-symbol img {
    height: 1em;
    margin-right: 2px;
}

.remove-coupon-button {
    background-color: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-coupon-button:hover {
    background-color: #dc3545;
    color: white;
}

/* Highlight effect for price changes */
@keyframes highlight-price {
    0% { background-color: transparent; }
    30% { background-color: rgba(255, 193, 7, 0.3); }
    100% { background-color: transparent; }
}

.highlight {
    animation: highlight-price 1.5s ease;
    border-radius: 3px;
}

/* Coupon message styling */
.coupon-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    transition: all 0.3s ease;
}

.coupon-message.text-success {
    color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

.coupon-message.text-danger {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
}

.coupon-message.text-info {
    color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
    border-left: 3px solid #17a2b8;
}

/* Fix for mobile view */
@media (max-width: 767px) {
    .cart-modern .cart-items tbody td {
        padding: 15px 10px;
    }
    
    .cart-modern .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    /* Mobile coupon styles */
    .coupon-form {
        flex-direction: column;
    }
    
    .coupon-input {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 10px;
    }
    
    .coupon-button {
        width: 100%;
        border-radius: 4px;
    }
    
    .coupon-message {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .applied-coupon {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .remove-coupon-button {
        align-self: stretch;
        text-align: center;
    }
    
    .cart-modern .quantity-controls {
        max-width: 100px;
    }
    
    .cart-modern .quantity-btn {
        width: 28px;
        height: 28px;
    }
    
    .cart-modern .quantity-input {
        width: 35px;
        height: 28px;
    }
    
    /* Hide column headers on mobile */
    .cart-modern .checkout-cart-header {
        display: none;
    }
    
    /* Responsive checkout cart item grid */
    .cart-modern .checkout-cart-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px 0;
        gap: 15px;
    }
    
    .cart-modern .checkout-item-col {
        width: 100%;
        padding: 5px 0;
    }
    
    .cart-modern .product-col {
        order: 1;
    }
    
    .cart-modern .price-col {
        order: 2;
        justify-content: flex-start;
        text-align: left;
    }
    
    .cart-modern .quantity-col {
        order: 3;
        justify-content: flex-start;
        text-align: left;
    }
    
    .cart-modern .total-col {
        order: 4;
        justify-content: flex-start;
        width: 100%;
    }
}
