/**
 * Unified Cart Styles
 * All cart-related CSS in one organized file
 * Includes: Base layout, Black theme, RTL support, responsive design, animations
 */

/* ========================================
   BASE LAYOUT & STRUCTURE
   ======================================== */

/* Modern Cart Page Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa;
}

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

/* Ensure normal text direction */
.item-name, .item-category, .item-total {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr;
}

[dir="rtl"] .item-name,
[dir="rtl"] .item-category,
[dir="rtl"] .item-total {
    direction: rtl;
}

/* Main Container */
.cart-main-container {
    background: white;
    padding: 40px;
    box-shadow: none;
    margin: 150px auto 30px; /* Desktop/Large screens - 190px minus 40px main padding */
}

/* Cart Header */
.cart-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.cart-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

/* Alerts */
.alert {
    margin-bottom: 20px;
    padding: 15px 20px;
    border: none;
    display: flex;
    align-items: center;
    gap: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert i {
    font-size: 20px;
}

/* Cart Layout */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    margin-bottom: 40px;
}

/* Cart Items Section */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cart Item */
.cart-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-item:hover {
    box-shadow: none;
    border-color: #212529;
}

/* Item Image */
.item-image {
    width: 120px;
    height: 120px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sale-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff6b6b;
    color: white;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

/* Item Details */
.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin: 0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item-name:hover {
    color: #212529;
    text-decoration: underline;
}

.remove-item-btn {
    background: transparent;
    border: none;
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.remove-item-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

.item-category {
    font-size: 14px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Price and Quantity */
.item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    gap: 20px;
}

.price-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.original-price {
    font-size: 16px;
    color: #6c757d;
    text-decoration: line-through;
}

.sale-price {
    font-size: 20px;
    color: #212529;
    font-weight: 600;
}

.regular-price {
    font-size: 20px;
    color: #212529;
    font-weight: 600;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: white;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #f8f9fa;
    color: #212529;
    border-color: #212529;
}

.quantity-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.item-total {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Cart Summary */
.cart-summary {
    background: #f8f9fa;
    padding: 30px;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.summary-title {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 25px;
}

.summary-details {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid #dee2e6;
}

.summary-label {
    color: #6c757d;
}

.summary-value {
    color: #212529;
    font-weight: 500;
}

.discount-value {
    color: #28a745;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.total-label {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.total-value {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
}

/* Checkout Button */
.checkout-btn {
    display: block;
    width: 100%;
    background: #000000;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 25px;
    text-align: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: none;
}

.checkout-btn:hover::before {
    animation: shine 0.6s ease;
}

.checkout-btn:hover {
    background: #333333;
    color: white;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

.checkout-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.continue-shopping-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 15px;
}

.continue-shopping {
    display: inline-block;
    color: #000000;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    color: #333333;
    text-decoration: underline;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.empty-title {
    font-size: 28px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 10px;
}

.empty-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
}

.start-shopping-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #000000;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s ease;
}

.start-shopping-btn:hover {
    background: #333333;
    transform: none;
    color: white;
    text-decoration: none;
}

/* Secure Payment Box */
.secure-payment-box {
    background: #f8f9fa;
    padding: 20px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e9ecef;
}

.secure-icon {
    width: 50px;
    height: 50px;
    background: #212529;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.secure-icon i {
    font-size: 24px;
    color: white;
}

.secure-content {
    flex: 1;
}

.secure-title {
    font-size: 16px;
    font-weight: 600;
    color: #212529;
    margin: 0 0 5px 0;
}

.secure-text {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

/* Animations */
@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -100%); opacity: 0; }
}

/* Fix Bootstrap Modal z-index issues */
.modal-backdrop {
    z-index: 9998 !important;
}

#deleteConfirmModal {
    z-index: 9999 !important;
}

.modal-dialog {
    z-index: 9999 !important;
}

.modal-content {
    z-index: 9999 !important;
    position: relative;
}

/* Force modal backdrop to be below the modal */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal.show {
    z-index: 1050 !important;
}

#deleteConfirmModal {
    z-index: 1055 !important;
}

/* Make sure header/nav don't interfere */
header, nav, .cart-main-container {
    position: relative;
    z-index: 1;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet and below */
@media (max-width: 991px) {
    /* Reduce top spacing for tablet - 90px minus 40px main padding */
    .cart-main-container {
        margin: 50px auto 30px;
    }

    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Container adjustments - 90px minus 30px main padding */
    .cart-main-container {
        padding: 16px;
        margin: 60px auto 15px;
    }

    /* Header adjustments */
    .cart-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .cart-title {
        font-size: 20px;
    }

    /* Layout adjustments */
    .cart-content {
        gap: 20px;
    }

    /* Cart item mobile layout */
    .cart-item {
        padding: 15px;
        gap: 15px;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        position: relative;
        overflow: visible;
    }

    /* Product image - smaller on mobile */
    .item-image {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .sale-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    /* Product details - FIX LAYOUT */
    .item-details {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .item-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        width: 100%;
    }

    .item-header > div {
        flex: 1;
        margin-right: 10px;
    }

    .item-name {
        font-size: 14px;
        line-height: 1.4;
        display: inline;
        word-break: normal;
        overflow-wrap: normal;
        white-space: normal;
    }

    .item-category {
        font-size: 12px;
        margin-top: 4px;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .remove-item-btn {
        flex-shrink: 0;
        padding: 5px;
    }

    /* Price and quantity section */
    .item-bottom {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        flex-wrap: wrap;
    }

    .price-info {
        font-size: 14px;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .original-price {
        font-size: 13px;
    }

    .sale-price,
    .regular-price {
        font-size: 16px;
    }

    .item-total {
        font-size: 15px;
        font-weight: 600;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Quantity controls - ensure visible */
    .quantity-controls {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .qty-btn {
        width: 32px;
        height: 32px;
    }

    .quantity-input {
        width: 40px;
        height: 32px;
        font-size: 14px;
    }

    /* Cart summary */
    .cart-summary {
        padding: 20px;
    }

    .summary-title {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .summary-row {
        padding: 8px 0;
        font-size: 14px;
    }

    .total-label {
        font-size: 16px;
    }

    .total-value {
        font-size: 20px;
    }

    /* Buttons */
    .checkout-btn {
        padding: 14px;
        font-size: 15px;
        margin-top: 20px;
    }

    .continue-shopping {
        font-size: 13px;
        margin-top: 12px;
    }

    /* Secure payment box */
    .secure-payment-box {
        padding: 15px;
        margin-top: 15px;
        gap: 10px;
    }

    .secure-icon {
        width: 40px;
        height: 40px;
    }

    .secure-icon i {
        font-size: 20px;
    }

    .secure-title {
        font-size: 14px;
    }

    .secure-text {
        font-size: 12px;
    }

    /* Empty cart */
    .empty-cart {
        padding: 40px 20px;
    }

    .empty-icon {
        font-size: 60px;
    }

    .empty-title {
        font-size: 22px;
    }

    .empty-text {
        font-size: 14px;
    }

    .start-shopping-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Simple mobile styles - Very small screens */
@media (max-width: 480px) {
    /* 90px minus 20px main padding for very small screens */
    .cart-main-container {
        padding: 10px;
        margin: 70px auto 15px;
    }

    .cart-item {
        display: block;
        padding: 15px;
    }

    /* Image as separate block first - full width */
    .item-image {
        display: block;
        width: 100%;
        max-width: none;
        height: 250px;
        margin: 0 0 20px 0;
        position: relative;
    }

    .item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Sale badge position - match delete icon size */
    .sale-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 1;
        font-size: 12px;
        padding: 6px 12px;
    }

    /* Details as separate block */
    .item-details {
        display: block;
        width: 100%;
    }

    /* Move delete button over image on mobile - opposite corner from badge */
    .remove-item-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 2;
        background: white;
        border: 1px solid #dee2e6;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .item-header {
        display: block;
        margin-bottom: 15px;
    }

    .item-header > div {
        display: block;
    }

    .item-name {
        display: block;
        font-size: 16px;
        margin-bottom: 8px;
    }

    .item-category {
        display: block;
        margin-bottom: 15px;
    }

    /* Quantity and price in same row */
    .item-bottom {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    /* Remove border from quantity controls */
    .quantity-controls {
        border: none !important;
        display: flex;
        align-items: center;
    }

    .item-total {
        font-size: 20px;
        font-weight: 600;
        white-space: nowrap;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .cart-item {
        padding: 12px;
    }

    .item-image {
        height: 200px;
    }

    .item-name {
        font-size: 14px;
    }

    .item-category {
        font-size: 11px;
    }

    .qty-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .quantity-input {
        width: 36px;
        height: 30px;
        font-size: 13px;
    }

    .item-total {
        font-size: 16px;
    }
}

/* ========================================
   RTL SUPPORT
   ======================================== */

/* Fix quantity controls in RTL */
[dir="rtl"] .quantity-controls {
    direction: ltr !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
}

/* Fix quantity input alignment */
[dir="rtl"] .quantity-input {
    text-align: center !important;
    direction: ltr !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 60px !important;
    display: inline-block !important;
}

/* Ensure buttons maintain proper order */
[dir="rtl"] .quantity-btn {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Override any inherited RTL text alignment */
[dir="rtl"] .quantity-section {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

[dir="rtl"] .quantity-section .quantity-controls {
    margin: 0 !important;
}

/* Additional specificity to override any conflicting styles */
[dir="rtl"] .cart-item .quantity-controls {
    text-align: center !important;
    direction: ltr !important;
}

[dir="rtl"] .cart-item .quantity-input {
    text-align: center !important;
    direction: ltr !important;
}

/* Continue Shopping button stays centered in Arabic */
[dir="rtl"] .continue-shopping-wrapper {
    text-align: center !important;
}

[dir="rtl"] .continue-shopping {
    display: inline-block !important;
    text-align: center !important;
}

/* Fix for mobile views */
@media (max-width: 768px) {
    [dir="rtl"] .quantity-controls {
        direction: ltr !important;
        text-align: center !important;
    }

    [dir="rtl"] .quantity-input {
        text-align: center !important;
        direction: ltr !important;
    }

    /* Keep Continue Shopping button centered on mobile in Arabic */
    [dir="rtl"] .continue-shopping-wrapper {
        text-align: center !important;
    }

    [dir="rtl"] .continue-shopping {
        display: inline-block !important;
        text-align: center !important;
    }
}

/* Override any parent RTL styles */
[dir="rtl"] .item-price-quantity .quantity-controls {
    direction: ltr !important;
}

[dir="rtl"] .item-price-quantity .quantity-input {
    text-align: center !important;
    direction: ltr !important;
}

/* Ensure the entire quantity control area doesn't inherit RTL */
[dir="rtl"] .quantity-controls * {
    direction: ltr !important;
}

/* Fix any float or position issues */
[dir="rtl"] .quantity-controls {
    float: none !important;
    position: relative !important;
}

[dir="rtl"] .quantity-input {
    float: none !important;
    position: relative !important;
}

/* Additional fix for input field */
[dir="rtl"] input.quantity-input[type="number"] {
    text-align: center !important;
    direction: ltr !important;
    unicode-bidi: embed !important;
}

/* Fix arrows for checkout and continue shopping buttons */
[dir="rtl"] .checkout-btn .fa-arrow-right {
    transform: rotate(180deg);
}

[dir="rtl"] .continue-shopping-btn .fa-arrow-left {
    transform: rotate(180deg);
}

/* Fix arrow in empty cart start shopping button */
[dir="rtl"] .start-shopping-btn .fa-arrow-right {
    transform: rotate(180deg);
}

/* Ensure proper spacing after arrow flip */
[dir="rtl"] .checkout-btn .btn-icon {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .continue-shopping-btn i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .start-shopping-btn i {
    margin-left: 0;
    margin-right: 10px;
}

/* Fix button content alignment */
[dir="rtl"] .checkout-btn,
[dir="rtl"] .continue-shopping-btn,
[dir="rtl"] .start-shopping-btn {
    flex-direction: row-reverse;
}

/* Additional mobile fixes for RTL */
@media (max-width: 768px) {
    /* Fix sale badge position in RTL */
    [dir="rtl"] .sale-badge {
        right: auto;
        left: 8px;
    }

    /* Fix item header in RTL */
    [dir="rtl"] .item-header {
        text-align: right;
    }

    /* Center align text on very small screens */
    @media (max-width: 480px) {
        [dir="rtl"] .cart-item {
            text-align: center;
        }

        [dir="rtl"] .item-header {
            text-align: center;
        }
    }
}

/* Cart Page Black Theme - Override All Blue Colors and Remove Shadows */

/* Override ALL color variables including cart-specific ones */
:root {
    --primary-color: #212529 !important;
    --primary-hover: #000000 !important;
    --primary-light: #f8f9fa !important;
    --primary-dark: #000000 !important;
    --cart-primary: #212529 !important;
    --cart-secondary: #6c757d !important;
    --cart-accent: #212529 !important;
    --cart-hover: #000000 !important;
    --cart-gradient-start: #212529 !important;
    --cart-gradient-end: #212529 !important;
}

/* Remove all shadows and rounded corners */
* {
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ===== EXCEPTION: Keep badges circular (override universal rule) ===== */
/* Cart badge - keep circular shape */
.cart-count-badge,
.mobile-cart-badge,
.cart-count,
.mobile-header-icons .cart-count,
.sidenav-icon-links .cart-count-badge,
/* Wishlist badge - keep circular shape */
.wishlist-count-badge {
    border-radius: 50% !important;
}

/* Main Container */
.cart-main-container {
    background: white !important;
    border-radius: 0 !important;
    padding: 40px !important;
    box-shadow: none !important;
    margin: 30px auto !important;
}

/* Cart Items */
.cart-item {
    border: 1px solid #e9ecef !important;
    border-radius: 0 !important;
    margin-bottom: 15px !important;
    padding: 20px !important;
    transition: none !important;
    box-shadow: none !important;
}

.cart-item:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #212529 !important;
}

/* Links and Interactive Elements */
.item-name a {
    color: #212529 !important;
    text-decoration: none !important;
}

.item-name a:hover {
    color: #212529 !important;
    text-decoration: underline !important;
}

/* Prices */
.sale-price {
    color: #212529 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}

.original-price {
    color: #6c757d !important;
}

/* Quantity Controls */
.qty-btn {
    background: white !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
    border-radius: 0 !important;
}

.qty-btn:hover {
    background: #f8f9fa !important;
    color: #212529 !important;
    border-color: #212529 !important;
}

/* Remove Button */
.remove-btn {
    color: #dc3545 !important;
    border-radius: 0 !important;
}

.remove-btn:hover {
    background: #dc3545 !important;
    color: white !important;
}

/* Total Section */
.total-value {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #212529 !important;
}

/* Checkout Button */
.checkout-btn {
    background: #212529 !important;
    color: white !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 15px 30px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    transition: background 0.3s ease !important;
    box-shadow: none !important;
}

.checkout-btn:hover {
    background: #000000 !important;
    transform: none !important;
    box-shadow: none !important;
}

.checkout-btn:disabled {
    background: #6c757d !important;
    cursor: not-allowed !important;
}

/* Continue Shopping Link */
.continue-shopping {
    color: #212529 !important;
    text-decoration: none !important;
    border-bottom: 2px solid transparent !important;
    transition: border-color 0.3s ease !important;
}

.continue-shopping:hover {
    color: #000000 !important;
    border-bottom-color: #000000 !important;
}

/* Empty Cart */
.empty-cart {
    text-align: center !important;
    padding: 80px 20px !important;
}

.empty-cart-icon {
    font-size: 80px !important;
    color: #dee2e6 !important;
    margin-bottom: 30px !important;
}

.start-shopping-btn {
    background: #212529 !important;
    color: white !important;
    border: none !important;
    padding: 12px 30px !important;
    border-radius: 0 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: background 0.3s ease !important;
}

.start-shopping-btn:hover {
    background: #000000 !important;
    transform: none !important;
    color: white !important;
}

/* Benefits Section */
.benefits-section {
    background: #f8f9fa !important;
    border-radius: 0 !important;
    padding: 30px !important;
    margin-top: 40px !important;
    box-shadow: none !important;
}

.benefit-icon {
    background: rgba(33, 37, 41, 0.1) !important;
    border-radius: 0 !important;
}

.benefit-icon i {
    color: #212529 !important;
}

/* Mobile Responsive Font Sizes */
@media (max-width: 768px) {
    /* Reduce container padding */
    .cart-main-container {
        padding: 20px !important;
        margin: 15px auto !important;
    }
    
    /* Cart title */
    .cart-title {
        font-size: 24px !important;
    }
    
    .cart-count {
        font-size: 16px !important;
    }
    
    /* Cart items */
    .cart-item {
        padding: 15px !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    /* Item image */
    .item-image {
        width: 100% !important;
        height: 200px !important;
    }
    
    /* Item details */
    .item-details {
        width: 100% !important;
    }
    
    .item-name {
        font-size: 16px !important;
        margin-bottom: 10px !important;
    }
    
    .item-description {
        font-size: 14px !important;
    }
    
    /* Price section */
    .price-section {
        margin-top: 15px !important;
    }
    
    .sale-price {
        font-size: 18px !important;
    }
    
    .original-price {
        font-size: 14px !important;
    }
    
    /* Quantity controls */
    .quantity-controls {
        margin: 15px 0 !important;
    }
    
    .qty-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    #quantity {
        width: 50px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
    
    /* Actions */
    .item-actions {
        margin-top: 15px !important;
        gap: 10px !important;
    }
    
    .price-total {
        font-size: 16px !important;
    }
    
    .remove-btn {
        padding: 8px 15px !important;
        font-size: 14px !important;
    }
    
    /* Total section */
    .total-section {
        padding: 20px !important;
        margin-top: 20px !important;
    }
    
    .total-label {
        font-size: 16px !important;
    }
    
    .total-value {
        font-size: 22px !important;
    }
    
    /* Checkout button */
    .checkout-btn {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* Continue shopping */
    .continue-shopping {
        font-size: 14px !important;
        margin-top: 15px !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* Benefits section */
    .benefits-section {
        padding: 20px !important;
        margin-top: 30px !important;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .benefit-item {
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
        text-align: left !important;
    }
    
    .benefit-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .benefit-text h4 {
        font-size: 16px !important;
        margin-bottom: 5px !important;
    }
    
    .benefit-text p {
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .cart-title {
        font-size: 20px !important;
    }
    
    .cart-count {
        font-size: 14px !important;
    }
    
    .item-name {
        font-size: 15px !important;
    }
    
    .sale-price {
        font-size: 16px !important;
    }
    
    .total-value {
        font-size: 20px !important;
    }
    
    .checkout-btn {
        font-size: 14px !important;
        padding: 10px 15px !important;
    }
}

/* RTL Support */
[dir="rtl"] .cart-item {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .item-details {
    text-align: right !important;
}

[dir="rtl"] .item-actions {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .benefit-item {
    flex-direction: row-reverse !important;
}

/* Override cart-modern.css purple theme */
.cart-page-container,
.cart-container {
    background: #f8f9fa !important;
}

.cart-header-modern {
    background: transparent !important;
}

.cart-title-modern {
    background: none !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: #212529 !important;
    color: #212529 !important;
}

/* Ensure all buttons use black theme */
button, .btn {
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Override any gradient backgrounds */
*[class*="gradient"],
*[style*="gradient"] {
    background: #212529 !important;
}
/* ===== Success Toast Animations (moved from cart-success-handler.blade.php) ===== */
@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideUp {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, -100%); opacity: 0; }
}
/* Cart Page RTL Fixes */

/* Fix quantity controls in RTL */
[dir="rtl"] .quantity-controls {
    direction: ltr !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
}

/* Fix quantity input alignment */
[dir="rtl"] .quantity-input {
    text-align: center !important;
    direction: ltr !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 60px !important;
    display: inline-block !important;
}

/* Ensure buttons maintain proper order */
[dir="rtl"] .quantity-btn {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Override any inherited RTL text alignment */
[dir="rtl"] .quantity-section {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

[dir="rtl"] .quantity-section .quantity-controls {
    margin: 0 !important;
}

/* Additional specificity to override any conflicting styles */
[dir="rtl"] .cart-item .quantity-controls {
    text-align: center !important;
    direction: ltr !important;
}

[dir="rtl"] .cart-item .quantity-input {
    text-align: center !important;
    direction: ltr !important;
}

/* Fix Continue Shopping button - align right in Arabic */
[dir="rtl"] .continue-shopping {
    text-align: right !important;
    display: block !important;
    margin: 15px 0 !important;
    width: auto !important;
}

/* Fix for mobile views */
@media (max-width: 768px) {
    [dir="rtl"] .quantity-controls {
        direction: ltr !important;
        text-align: center !important;
    }
    
    [dir="rtl"] .quantity-input {
        text-align: center !important;
        direction: ltr !important;
    }
    
    /* Keep Continue Shopping button aligned right on mobile in Arabic */
    [dir="rtl"] .continue-shopping {
        text-align: right !important;
        margin: 15px 0 !important;
        display: block !important;
    }
}

/* Override any parent RTL styles */
[dir="rtl"] .item-price-quantity .quantity-controls {
    direction: ltr !important;
}

[dir="rtl"] .item-price-quantity .quantity-input {
    text-align: center !important;
    direction: ltr !important;
}

/* Ensure the entire quantity control area doesn't inherit RTL */
[dir="rtl"] .quantity-controls * {
    direction: ltr !important;
}

/* Fix any float or position issues */
[dir="rtl"] .quantity-controls {
    float: none !important;
    position: relative !important;
}

[dir="rtl"] .quantity-input {
    float: none !important;
    position: relative !important;
}

/* Additional fix for input field */
[dir="rtl"] input.quantity-input[type="number"] {
    text-align: center !important;
    direction: ltr !important;
    unicode-bidi: embed !important;
}

/* Fix arrows for checkout and continue shopping buttons */
[dir="rtl"] .checkout-btn .fa-arrow-right {
    transform: rotate(180deg);
}

[dir="rtl"] .continue-shopping-btn .fa-arrow-left {
    transform: rotate(180deg);
}

/* Fix arrow in empty cart start shopping button */
[dir="rtl"] .start-shopping-btn .fa-arrow-right {
    transform: rotate(180deg);
}

/* Ensure proper spacing after arrow flip */
[dir="rtl"] .checkout-btn .btn-icon {
    margin-left: 0;
    margin-right: 10px;
}

[dir="rtl"] .continue-shopping-btn i {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .start-shopping-btn i {
    margin-left: 0;
    margin-right: 10px;
}

/* Fix button content alignment */
[dir="rtl"] .checkout-btn,
[dir="rtl"] .continue-shopping-btn,
[dir="rtl"] .start-shopping-btn {
    flex-direction: row-reverse;
}

/* Additional mobile fixes for RTL */
@media (max-width: 768px) {
    /* Fix sale badge position in RTL */
    [dir="rtl"] .sale-badge {
        right: auto;
        left: 8px;
    }
    
    /* Fix item header in RTL */
    [dir="rtl"] .item-header {
        text-align: right;
    }
    
    /* Center align text on very small screens */
    @media (max-width: 480px) {
        [dir="rtl"] .cart-item {
            text-align: center;
        }
        
        [dir="rtl"] .item-header {
            text-align: center;
        }
    }
}