﻿/* ==================== قواعد عامة ==================== */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ==================== Sidebar ==================== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 220px;
    height: 100vh;
    background: linear-gradient(180deg, #673ab7, #512da8);
    padding-top: 20px;
    box-shadow: -2px 0 10px rgba(0,0,0,0.3);
    transform: translateX(140px); /* مخفي على الجوال افتراضيًا */
    transition: transform 0.3s ease;
    will-change: transform;
    overflow-y: auto;
    overscroll-behavior: contain;
    user-select: none;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 9999;
}

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .sidebar ul li a {
            display: flex;
            align-items: center;
            padding: 15px;
            gap: 12px;
            color: white;
            font-size: 18px;
            text-decoration: none;
            transition: 0.3s;
        }

            .sidebar ul li a i {
                font-size: 22px;
                min-width: 30px;
            }

            .sidebar ul li a:hover {
                background: rgba(255,255,255,0.25);
                border-radius: 10px 0 0 10px;
            }

            .sidebar ul li a span {
                opacity: 0;
                white-space: nowrap;
                transition: 0.3s;
            }

    .sidebar:hover ul li a span,
    .sidebar.open ul li a span {
        opacity: 1;
    }

/* زر فتح/إغلاق Sidebar */
.sidebar-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    background: #512da8;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 20px;
    cursor: pointer;
    z-index: 10000;
}

/* ==================== Sidebar Behavior Desktop & Mobile ==================== */
/* Desktop ≥ 992px */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0); /* ظاهر دائمًا */
    }

    .sidebar-toggle {
        display: none; /* إخفاء زر الفتح */
    }

    body {
        margin-right: 220px; /* إزاحة المحتوى للجانب */
    }
}

/* Mobile & Tablet < 992px */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(100%); /* مخفي بالكامل */
    }

        .sidebar.open {
            transform: translateX(0); /* يظهر عند الفتح */
        }

    body {
        margin-right: 0;
    }
}

/* ==================== Featured Slider & Ads ==================== */
.featured-slider-container {
    width: 100%;
    height: 50px;
    overflow: hidden;
    position: relative;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.featured-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease-in-out;
}

.featured-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
}

    .featured-slide img {
        width: 100%;
        height: 50%;
        object-fit: cover;
        will-change: transform;
    }

.ad-overlay {
    position: absolute;
    inset: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
    color: #fff;
}

.ad-title, .ad-price, .ad-btn {
    opacity: 0;
    transform: translateY(30px);
}

.swiper-slide-active .ad-title,
.swiper-slide-active .ad-price,
.swiper-slide-active .ad-btn {
    animation: textIn 0.8s ease forwards;
}

.ad-btn {
    margin-top: 10px;
    display: inline-block;
    background: #ffd700;
    color: #000;
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: bold;
    width: fit-content;
}

.ad-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomSlow 6s ease-in-out infinite alternate;
    transition: transform 0.5s ease;
}

.ad-card:hover .ad-image {
    transform: scale(1.05);
}

@keyframes zoomSlow {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

@keyframes textIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Categories ==================== */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.category {
    width: 180px;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .category img {
        width: 100%;
        height: 140px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .category h4 {
        margin: 10px 0;
        font-size: 1rem;
        color: #333;
        font-weight: bold;
    }

    .category:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    }

        .category:hover img {
            transform: scale(1.05);
        }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .category {
        width: 45%;
    }

    .ad-title {
        font-size: 1.4rem;
    }

    .ad-price {
        font-size: 1rem;
    }

    .counter-card {
        margin-bottom: 15px;
    }

    .counter-icon {
        font-size: 24px;
    }

    .counter-value {
        font-size: 1.2rem;
    }

    .product-card img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .category {
        width: 90%;
    }

    .slider-card {
        padding-top: 100%;
    }

    .product-card img {
        height: 100px;
    }

    /* قسم المورد */
    .supplier-header {
        background-color: #343a40;
        border-radius: 15px;
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 20px;
        color: white;
    }

    .supplier-bg-circle img {
        width: 140px;
        height: 140px;
        border-radius: 50%;
        object-fit: contain;
        border: 3px solid #fff;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

        .supplier-bg-circle img:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        }

    .supplier-header h2 {
        text-shadow: 1px 1px 5px rgba(0,0,0,0.7);
        margin-bottom: 10px;
    }

    .supplier-header .rating-text {
        text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    }

    /* Cards المنتجات */
    .card-product {
        position: relative;
        overflow: hidden;
        border-radius: 15px;
        transition: transform 0.3s ease;
    }

        .card-product img {
            height: 180px;
            object-fit: contain;
            padding: 10px;
            transition: transform 0.3s ease;
        }

        .card-product:hover img {
            transform: scale(1.05);
        }

    .card-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: rgba(0,0,0,0.7);
        color: white;
        padding: 10px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .card-product:hover .card-overlay {
        transform: translateY(0);
    }

    .btn-success:hover {
        background-color: #28a745cc;
    }

    /* Responsive للهواتف */
    @media (max-width: 768px) {
        .supplier-header {
            flex-direction: column;
            align-items: center;
            text-align: center;
        }

        .supplier-bg-circle {
            margin-bottom: 15px;
        }
    }
    /* ====== Responsive ====== */
    @media (max-width: 768px) {
        .supplier-header {
            flex-direction: column;
            text-align: center;
        }
    }
    /* Responsive:  المنتجات الرائجهالشاشات الصغيرة */
    @media (max-width: 57px) {
        .ad-footer {
            flex-direction: column;
            gap: 6px;
            align-items: flex-start;
            padding: 10px;
        }

        .add-to-cart-btn {
            align-self: flex-end;
        }

        .product-name {
            font-size: 16px;
        }

        .supplier-link {
            font-size: 12px;
        }

        .price-top {
            font-size: 14px;
            padding: 4px 8px;
        }

        /* Responsive spacing */
        @media (max-width: 768px) {
            .product-card {
                margin: 0 auto;
            }
            /* Responsive */
            @media (max-width: 768px) {
                .table-responsive {
                    overflow-x: auto;
                }

                /* 📱 تحويل التايم لاين إلى عمودي في الموبايل */
                @media (max-width: 768px) {
                    .timeline {
                        flex-direction: column;
                        align-items: flex-start;
                    }

                    /* 📱 تهيئة الموبايل */
                    @media (max-width: 768px) {
                        .product-img {
                            height: 260px;
                        }

                        .product-card:hover {
                            transform: translateY(-3px) scale(1.02);
                        }
                    }

                    @media (max-width: 480px) {
                        .product-img {
                            height: 230px;
                        }
                    }
                    /* Responsive adjustments تسجسل الدخول */
                    @media (max-width: 991px) {
                        .col-lg-6 {
                            text-align: center !important;
                        }

                        .logo-img {
                            width: 120px;
                            height: 120px;
                            margin: 0 auto 20px auto;
                        }

                        .bg-glass {
                            padding: 20px;
                        }

                        #radius-shape-1, #radius-shape-2 {
                            display: none;
                        }
                    }

                    @media (max-width: 575px) {
                        .logo-img {
                            width: 100px;
                            height: 100px;
                        }

                        .custom-input {
                            font-size: 14px;
                            padding-left: 35px;
                        }

                        .btn-login {
                            font-size: 14px;
                            padding: 10px;
                        }

                        
                            }

                    /* Media Queries لتصغير الشاشات */
                    @media (max-width: 76px) {
                        .category {
                            max-width: 50%; /* نصف الشاشة لكل بطاقة 45*/
                        }
                    }

                    @media (max-width: 48px) {
                        .category {
                            max-width: 90%; /* تقريبًا شاشة كاملة للبطاقة */
                        }
                    }
                        }
                }
            }
        }
    }

    
