/* ===== تصميم صفحة المنتجات الحديثة - Horizontal Scrollable ===== */

/* قسم التصنيفات الرئيسي */
.categories-filter-section {
    margin: 15px 0;
    padding: 0 15px;
}

.categories-filter-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.categories-filter-title i {
    color: var(--primary-color);
}

/* شريط التصنيفات الأفقي */
.categories-horizontal-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 15px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.categories-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.categories-horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.categories-horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.category-filter-chip {
    background: var(--card-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.category-filter-chip:hover {
    transform: translateY(-2px);
    /* تقليل التوهج عند الهوفر - من 12px إلى 6px */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.category-filter-chip.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
    /* تقليل التوهج في الحالة النشطة */
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.3), 0 0 3px rgba(0, 78, 137, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.category-filter-chip .chip-icon {
    font-size: 1.1rem;
}

/* قسم المنتجات */
.products-sections-container {
    padding: 0 15px;
}

/* قسم تصنيف واحد */
.category-section {
    margin-bottom: 30px;
}

.category-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.category-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-section-title .title-icon {
    font-size: 1.3rem;
}

.view-all-btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-all-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

.view-all-btn i {
    font-size: 0.7rem;
}

/* صف المنتجات الأفقي */
.products-horizontal-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.products-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.products-horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.products-horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

/* بطاقة المنتج الصغيرة */
.product-card-compact {
    background: var(--card-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 110px;
    max-width: 110px;
    flex-shrink: 0;
}

.product-card-compact:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card-compact:active {
    transform: translateY(-2px);
}

/* صورة المنتج */
.product-image-compact {
    width: 100%;
    height: 90px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* محتوى البطاقة */
.product-info-compact {
    padding: 8px;
}

.product-name-compact {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px 0;
}

.product-price-compact {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 5px 0;
}

.product-market-compact {
    font-size: 0.6rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-market-compact i {
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* زر الإضافة السريع */
.product-add-btn-compact {
    width: 100%;
    padding: 5px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.product-add-btn-compact:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.product-add-btn-compact:active {
    transform: scale(0.95);
}

.product-add-btn-compact i {
    font-size: 0.75rem;
}

/* شارة العرض */
.product-badge-compact {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 15px;
    font-size: 0.6rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.product-card-compact {
    position: relative;
}

/* حالة فارغة */
.category-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.category-empty i {
    font-size: 2.5rem;
    opacity: 0.5;
    margin-bottom: 10px;
}

.category-empty p {
    font-size: 0.85rem;
}

/* Dark Mode Support */
.dark-mode .category-filter-chip {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(148, 163, 184, 0.3);
}

.dark-mode .product-card-compact {
    background: rgba(30, 41, 59, 0.95);
}

.dark-mode .product-image-compact {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.dark-mode .view-all-btn {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dark-mode .view-all-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Animation */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-card-compact {
    animation: fadeInRight 0.4s ease-out;
}

.category-section {
    animation: fadeInRight 0.3s ease-out;
}

/* تأخير تدريجي */
.product-card-compact:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card-compact:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card-compact:nth-child(3) {
    animation-delay: 0.15s;
}

.category-section:nth-child(1) {
    animation-delay: 0.1s;
}

.category-section:nth-child(2) {
    animation-delay: 0.2s;
}

.category-section:nth-child(3) {
    animation-delay: 0.3s;
}

.category-section:nth-child(4) {
    animation-delay: 0.4s;
}

.category-section:nth-child(5) {
    animation-delay: 0.5s;
}

.category-section:nth-child(6) {
    animation-delay: 0.6s;
}


/* قسم التصنيفات */
.categories-section {
    margin: 20px 0;
    padding: 0 10px;
}

.categories-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-title i {
    color: var(--primary-color);
}

/* شبكة التصنيفات - سطرين × 3 فئات */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 25px;
}

.category-card {
    background: linear-gradient(135deg, var(--card-color) 0%, rgba(255, 255, 255, 0.8) 100%);
    border-radius: 15px;
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.category-card:hover::before {
    opacity: 0.1;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.category-card.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.category-card.active::before {
    opacity: 0;
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.2);
}

.category-card.active .category-icon {
    filter: brightness(1.2);
}

.category-name {
    font-size: 0.85rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-card.active .category-name {
    color: white;
}

/* شبكة المنتجات - 3 في الصف */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 10px;
}

/* بطاقة المنتج الصغيرة */
.product-card {
    background: var(--card-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-card:active {
    transform: translateY(-2px);
}

/* صورة المنتج */
.product-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* محتوى البطاقة */
.product-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.product-market {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0;
}

.product-market i {
    font-size: 0.7rem;
}

/* زر الإضافة السريع */
.product-add-btn {
    width: 100%;
    padding: 6px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: auto;
}

.product-add-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.product-add-btn:active {
    transform: scale(0.95);
}

.product-add-btn i {
    font-size: 0.8rem;
}

/* شارة العرض */
.product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* حالة فارغة */
.products-empty {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.products-empty i {
    font-size: 4rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 20px;
}

.products-empty h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.products-empty p {
    color: var(--text-secondary);
}

/* Dark Mode Support */
.dark-mode .category-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.dark-mode .category-card:hover::before {
    opacity: 0.2;
}

.dark-mode .product-card {
    background: rgba(30, 41, 59, 0.95);
}

.dark-mode .product-image {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Responsive - للشاشات الصغيرة جداً */
@media (max-width: 360px) {
    .categories-grid {
        gap: 8px;
    }

    .category-card {
        padding: 12px 8px;
    }

    .category-icon {
        font-size: 1.6rem;
    }

    .category-name {
        font-size: 0.75rem;
    }

    .products-grid {
        gap: 8px;
    }

    .product-image {
        height: 85px;
    }
}

/* Animation للتحميل */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.4s ease-out;
}

.category-card {
    animation: fadeInUp 0.3s ease-out;
}

/* تأخير تدريجي للبطاقات */
.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}