﻿/* Basket.css - استایل کامل صفحه سبد خرید */

/* استایل‌های پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    direction: rtl;
}

/* کانتینر اصلی */
.basket-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

/* هدر صفحه */
.basket-header {
    background: linear-gradient(135deg, #2c3e50, #4a6491);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

    .basket-header::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
        background-size: 20px 20px;
        animation: float 20s linear infinite;
    }

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    100% {
        transform: translate(-20px, -20px) rotate(360deg);
    }
}

.basket-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}

.basket-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* استایل جدول */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
}

    .table thead {
        background: linear-gradient(135deg, #3498db, #2980b9);
        color: white;
    }

        .table thead td {
            padding: 20px 15px;
            font-weight: 600;
            font-size: 1.1rem;
            text-align: center;
            border: none;
            position: relative;
        }

            .table thead td::after {
                content: '';
                position: absolute;
                bottom: 0;
                right: 50%;
                transform: translateX(50%);
                width: 0;
                height: 3px;
                background: #e74c3c;
                transition: width 0.3s ease;
            }

            .table thead td:hover::after {
                width: 80%;
            }

    .table tbody tr {
        transition: all 0.3s ease;
        border-bottom: 1px solid #ecf0f1;
    }

        .table tbody tr:hover {
            background: linear-gradient(135deg, #f8f9fa, #e9ecef);
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

    .table tbody td {
        padding: 18px 15px;
        text-align: center;
        font-size: 1rem;
        color: #2c3e50;
        border: none;
        position: relative;
    }

/* استایل دکمه‌ها */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

    .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: left 0.5s;
    }

    .btn:hover::before {
        left: 100%;
    }

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

    .btn-danger:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    }

.btn-success {
    background: linear-gradient(135deg, #27ae60, #219a52);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

    .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
    }

/* استایل فوتر جدول */
.table tfoot {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

    .table tfoot tr {
        transition: all 0.3s ease;
    }

        .table tfoot tr:hover {
            background: linear-gradient(135deg, #3d566e, #34495e);
        }

    .table tfoot td {
        padding: 20px 15px;
        text-align: center;
        font-weight: 600;
        font-size: 1.1rem;
        border: none;
    }

/* استایل‌های رسپانسیو */
@media (max-width: 768px) {
    .basket-header {
        padding: 20px;
    }

        .basket-header h1 {
            font-size: 2rem;
        }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 2px solid #bdc3c7;
        border-radius: 15px;
        padding: 15px;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 10px;
        text-align: left;
        border-bottom: 1px solid #ecf0f1;
    }

        .table tbody td:last-child {
            border-bottom: none;
        }

        .table tbody td::before {
            content: attr(data-label);
            font-weight: 700;
            color: #3498db;
            font-size: 0.9rem;
            min-width: 100px;
        }

    .table tfoot td {
        padding: 15px 10px;
        font-size: 1rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .basket-container {
        border-radius: 15px;
    }

    .basket-header {
        padding: 15px;
    }

        .basket-header h1 {
            font-size: 1.7rem;
        }

    .table tbody tr {
        padding: 10px;
        margin-bottom: 15px;
    }

    .table tbody td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .table tfoot td {
        padding: 12px 8px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 7px 14px;
        font-size: 0.8rem;
    }
}

/* انیمیشن‌های ویژه */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table tbody tr {
    animation: fadeInUp 0.6s ease forwards;
}

    .table tbody tr:nth-child(1) {
        animation-delay: 0.1s;
    }

    .table tbody tr:nth-child(2) {
        animation-delay: 0.2s;
    }

    .table tbody tr:nth-child(3) {
        animation-delay: 0.3s;
    }

    .table tbody tr:nth-child(4) {
        animation-delay: 0.4s;
    }

    .table tbody tr:nth-child(5) {
        animation-delay: 0.5s;
    }

/* استایل برای سبد خرید خالی */
.empty-basket {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

    .empty-basket i {
        font-size: 4rem;
        margin-bottom: 20px;
        color: #bdc3c7;
    }

    .empty-basket h3 {
        font-size: 1.8rem;
        margin-bottom: 15px;
        color: #2c3e50;
    }

    .empty-basket p {
        font-size: 1.1rem;
        margin-bottom: 30px;
    }

/* استایل برای تخفیف */
.discount-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    margin-right: 10px;
}

/* استایل برای قیمت‌ها */
.price-original {
    text-decoration: line-through;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-left: 10px;
}

.price-final {
    color: #27ae60;
    font-weight: 700;
    font-size: 1.1rem;
}

/* استایل برای تعداد محصول */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 50%;
    background: #3498db;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .quantity-btn:hover {
        background: #2980b9;
        transform: scale(1.1);
    }

.quantity-input {
    width: 50px;
    text-align: center;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    padding: 5px;
    font-weight: 600;
}


@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .btn-warning:hover:not(:disabled) {
        background: linear-gradient(135deg, #e67e22, #d35400);
        transform: translateY(-2px);
    }

    .btn-warning:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }