/* =========================================
   Modern Cart Page Styles
   ========================================= */
:root {
    --primary-color: #e67e22;
    --primary-hover: #d35400;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --success-color: #10b981;
}

.cart-page-header {
    margin: 40px 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInDown 0.5s ease-out;
}

.header-icon-wrapper {
    background: linear-gradient(135deg, var(--primary-color) 0%, #f39c12 100%);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(230, 126, 34, 0.3);
}

.cart-page-header h1 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 800;
}

.cart-page-header .subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-page-header .badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Grid Layout */
.cart-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 40px;
    margin-bottom: 80px;
    align-items: start;
}

/* --- Order Summary Sidebar --- */
.summary-box {
    background: #fff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 100px;
}

.summary-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px dashed var(--border-color);
    font-weight: 700;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1rem;
}

.row-label {
    color: var(--text-light);
    font-weight: 500;
}

.row-value {
    color: var(--text-dark);
    font-weight: 600;
}

.row-value small {
    font-size: 0.75rem;
    color: #94a3b8;
}

.highlight-text {
    color: var(--success-color);
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.summary-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 25px 0;
}

.total-payable {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 30px;
    align-items: flex-end;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem;
}

.gradient-text small {
    -webkit-text-fill-color: var(--primary-color);
    font-size: 0.9rem;
}

/* Buttons */
.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}

.btn-checkout {
    background: linear-gradient(135deg, var(--primary-color), #f39c12);
    color: #fff;
    box-shadow: 0 10px 20px rgba(230, 126, 34, 0.25);
}

.btn-checkout:hover:not([disabled]) {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(230, 126, 34, 0.35);
}

.btn-checkout[disabled] {
    background: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-continue {
    background: var(--bg-light);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.btn-continue:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

/* --- Cart Items --- */
.cart-items-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 20px;
    border-radius: 24px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 0.4s ease;
    gap: 25px;
    animation: fadeIn 0.5s ease-out backwards;
}

.cart-item:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    transform: translateY(-4px);
    border-color: rgba(230, 126, 34, 0.3);
}

.cart-item-img {
    width: 110px;
    height: 110px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-light);
    flex-shrink: 0;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cart-item-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-img img {
    transform: scale(1.1);
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-title {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 700;
}

.cart-item-unit-price {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
    background: var(--bg-light);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-flex;
}

.cart-item-unit-price strong {
    color: var(--text-dark);
}

.cart-item-qty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    width: 60px;
    height: 60px;
    border-radius: 14px;
}

.qty-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.qty-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.cart-item-total {
    min-width: 140px;
    text-align: left;
}

.item-final-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
}

.item-final-price small {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: normal;
}

.btn-remove-item {
    background: #fff1f2;
    color: var(--danger-color);
    border: 1px solid #ffe4e6;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-remove-item:hover {
    background: var(--danger-color);
    color: #fff;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.3);
    transform: rotate(9deg) scale(1.05);
}

/* --- Empty Cart Modern UI --- */
.empty-cart-modern {
    background: #fff;
    border-radius: 30px;
    padding: 80px 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.02);
    border: 2px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-illustration {
    width: 150px;
    height: 150px;
    background: #f8fafc;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    color: #cbd5e1;
    position: relative;
}

.empty-illustration svg {
    width: 70px;
    height: 70px;
}

.empty-illustration::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #f1f5f9;
    animation: pulseBorder 2s infinite;
}

.empty-cart-modern h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 800;
}

.empty-cart-modern p {
    color: var(--text-light);
    font-size: 1.1rem;
    max-width: 400px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.empty-cta {
    max-width: 250px;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseBorder {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .cart-container {
        grid-template-columns: 300px 1fr;
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .cart-container {
        grid-template-columns: 1fr;
    }

    .cart-sidebar {
        order: 2;
    }

    .summary-box {
        position: static;
    }

    .cart-items-section {
        order: 1;
    }
}

@media (max-width: 600px) {
    .cart-item {
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        position: relative;
        gap: 15px;
    }

    .cart-item-img {
        width: 100%;
        height: 180px;
    }

    .cart-item-details {
        text-align: center;
    }

    .cart-item-unit-price {
        justify-content: center;
    }

    .cart-item-qty {
        width: 100%;
        flex-direction: row;
        height: 50px;
        gap: 10px;
    }

    .cart-item-total {
        text-align: center;
        margin-top: 10px;
    }

    .btn-remove-item {
        position: absolute;
        top: 20px;
        left: 20px; /* یا right بسته به RTL */
        width: 40px;
        height: 40px;
    }
}
