/**
 * PickBox WooCommerce Cart Page Enhancements
 * Additional styling for the cart page
 */

/* Cart Page Specific Styles */
.woocommerce-cart .pickbox-cart-wrapper {
    margin: 0;
    padding: 0;
}

/* Override default WooCommerce cart styles */
.woocommerce-cart .woocommerce-cart-form__contents {
    display: none; /* Hide default table */
}

.woocommerce-cart .cart-collaterals {
    display: none; /* Hide default cart collaterals */
}

/* Custom Cart Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cart-summary-container {
    animation: fadeInScale 0.5s ease-out;
}

.cart-items-section {
    animation: fadeInScale 0.4s ease-out;
}

/* Enhanced Mobile Experience */
@media (max-width: 640px) {
    .pickbox-cart-header {
        padding: 25px 0;
    }
    
    .cart-title {
        font-size: 1.6em;
        margin-bottom: 8px;
    }
    
    .cart-subtitle {
        font-size: 1em;
    }
    
    .pickbox-cart-content {
        padding: 30px 0;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .product-name {
        font-size: 1em;
    }
    
    .quantity-controls {
        margin: 10px 0;
    }
    
    .cart-actions {
        padding: 20px 15px;
    }
    
    .cart-totals {
        padding: 15px;
    }
    
    .summary-title {
        padding: 15px;
        font-size: 1.1em;
    }
}

/* Touch-friendly controls for mobile */
@media (max-width: 768px) {
    .qty-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1em;
    }
    
    .remove-item {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
    }
    
    .quantity-controls input[type="number"] {
        width: 60px;
        height: 40px;
        font-size: 1em;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .pickbox-cart-wrapper {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    
    .cart-items-section,
    .cart-summary-container {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .cart-items-header {
        background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
        color: #e0e0e0;
    }
    
    .cart-item {
        border-bottom-color: #404040;
    }
    
    .cart-item:hover {
        background-color: #3a3a3a;
    }
    
    .product-name,
    .total-label,
    .total-amount {
        color: #e0e0e0;
    }
    
    .product-meta,
    .price-label,
    .subtotal-label {
        color: #b0b0b0;
    }
    
    .cart-actions {
        background: #3a3a3a;
        border-top-color: #404040;
    }
    
    .coupon-form input {
        background: #3a3a3a;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .quantity-controls {
        border-color: #555;
    }
    
    .quantity-controls input[type="number"] {
        background: #3a3a3a;
        color: #e0e0e0;
    }
    
    .qty-btn {
        background: #4a4a4a;
        color: #b0b0b0;
    }
    
    .order-total {
        background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
    }
}

/* Print styles */
@media print {
    .pickbox-cart-header,
    .cart-actions,
    .wc-proceed-to-checkout,
    .payment-methods-preview,
    .security-badge,
    .coupon-section {
        display: none;
    }
    
    .pickbox-cart-layout {
        display: block;
    }
    
    .cart-summary-section {
        margin-top: 30px;
    }
    
    .cart-item {
        break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cart-item {
        border: 2px solid #000;
    }
    
    .qty-btn,
    .remove-item {
        border: 2px solid #000;
    }
    
    .btn-start-shopping,
    .apply-coupon,
    .cart-actions button,
    .wc-proceed-to-checkout a {
        border: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cart-item,
    .cart-summary-container,
    .cart-items-section {
        animation: none;
    }
    
    .qty-btn:hover,
    .remove-item:hover,
    .btn-start-shopping:hover,
    .apply-coupon:hover,
    .cart-actions button:hover,
    .wc-proceed-to-checkout a:hover {
        transform: none;
    }
    
    .cart-item-image img {
        transition: none;
    }
    
    .cart-item:hover .cart-item-image img {
        transform: none;
    }
}

/* Focus states for accessibility */
.qty-btn:focus,
.remove-item:focus,
.btn-start-shopping:focus,
.apply-coupon:focus,
.cart-actions button:focus,
.wc-proceed-to-checkout a:focus {
    outline: 3px solid #007A70;
    outline-offset: 2px;
}

.quantity-controls input[type="number"]:focus,
.coupon-form input:focus {
    box-shadow: 0 0 0 3px rgba(0, 122, 112, 0.3);
}

/* Loading spinner for AJAX updates */
.cart-loading {
    position: relative;
}

.cart-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(0, 122, 112, 0.3);
    border-radius: 50%;
    border-top-color: #007A70;
    animation: spin 1s linear infinite;
    z-index: 10;
}

/* Success message styling */
.woocommerce-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 1px solid #c3e6cb;
    border-left: 5px solid #28a745;
    color: #155724;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
}

.woocommerce-message::before {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #28a745;
}

/* Error message styling */
.woocommerce-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border: 1px solid #f5c6cb;
    border-left: 5px solid #dc3545;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
}

.woocommerce-error::before {
    content: '\f071';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #dc3545;
}

/* Info message styling */
.woocommerce-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    border: 1px solid #bee5eb;
    border-left: 5px solid #17a2b8;
    color: #0c5460;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 600;
}

.woocommerce-info::before {
    content: '\f05a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-right: 10px;
    color: #17a2b8;
}

/* RTL support */
[dir="rtl"] .cart-breadcrumb {
    direction: rtl;
}

[dir="rtl"] .cart-title i {
    margin-left: 15px;
    margin-right: 0;
}

[dir="rtl"] .cart-item {
    direction: rtl;
}

[dir="rtl"] .quantity-controls {
    direction: ltr; /* Keep controls in LTR */
}

[dir="rtl"] .payment-icons {
    direction: ltr; /* Keep payment icons in LTR */
}

/* Custom scrollbar for cart items */
.cart-items-container {
    max-height: 70vh;
    overflow-y: auto;
}

.cart-items-container::-webkit-scrollbar {
    width: 8px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #007A70;
    border-radius: 4px;
}

.cart-items-container::-webkit-scrollbar-thumb:hover {
    background: #005952;
}

/* Firefox scrollbar */
.cart-items-container {
    scrollbar-width: thin;
    scrollbar-color: #007A70 #f1f1f1;
}
