/* featured_products_section.css - نسخه نهایی با بهینه‌سازی موبایل */
@import url('colorpalette.css');

#featured-products-section {
    background-color: var(--bg-light);
}

#products-title {
    color: var(--primary-red);
    margin-bottom: 3rem;
}

/* Category Section */
.category-section {
    background-color: var(--bg-white);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.category-header {
    background: linear-gradient(135deg, var(--primary-red), var(--light-red));
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-header::before {
    content: '🎯';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    opacity: 0.8;
}

.category-header h3 {
    margin-right: 2.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: white;
}

.products-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    color: white;
    backdrop-filter: blur(10px);
}

.category-content {
    padding: 1.5rem;
}

/* حالت گرید برای 6 محصول یا کمتر */
.products-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* استایل‌های جدید کاروسل با متد Swiper */
.products-carousel-container {
    position: relative;
    padding: 0;
}

.products-carousel-container.swiper-initialized {
    padding: 0;
}

.products-carousel {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    width: 100%;
}

.products-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.products-carousel .swiper-slide {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
}

.products-carousel .swiper-slide-active {
    transform: scale(1.02);
    z-index: 2;
    position: relative;
}

.products-carousel .swiper-slide:hover .product-card {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(139, 0, 0, 0.15);
}

.products-carousel .swiper-slide-prev,
.products-carousel .swiper-slide-next {
    transform: scale(0.98);
}

.products-carousel .swiper-slide:not(.swiper-slide-active) {
    opacity: 1 !important;
    transform: scale(1) !important;
}

.slider-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
    /* حذف padding از container اصلی */
    padding: 0 20px; /* اضافه کردن padding داخلی کوچک */
}

.slider-nav__item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    width: 48px;
    background: rgba(255, 255, 255, 0.9); /* پس‌زمینه نیمه شفاف */
    border: 2px solid rgba(255, 255, 255, 0.8); /* border نیمه شفاف */
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s ease-out;
    color: var(--text-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 11;
    backdrop-filter: blur(10px); /* افکت blur برای پس‌زمینه */
}

.slider-nav__item.disabled {
    cursor: not-allowed;
    opacity: 0.4;
    transform: none !important;
    background: rgba(255, 255, 255, 0.6);
}

.slider-nav__item svg {
    width: 20px;
    height: 20px;
}

.slider-nav__item.disabled:hover {
    background: var(--white) !important;
    border-color: var(--border-light) !important;
    color: var(--text-dark) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.slider-nav__item path {
    stroke: currentColor;
}

.slider-nav__item:not(.disabled):hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(139, 0, 0, 0.25);
}

/* Pagination - استایل جدید */
.slider-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 40px;
}

.swiper-pagination-lock {
    display: none !important;
}

.slider-pagination__item {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--border-medium);
    transition: all 0.3s ease-out;
    opacity: 0.2;
    cursor: pointer;
    border: none;
}

.slider-pagination__item.active {
    width: 30px;
    opacity: 1;
    background: var(--primary-red);
}

/* Product Card */
.product-card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    height: 100%;
    width: 100%;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.products-carousel .swiper-slide-active .product-card {
    border-color: var(--primary-red);
    box-shadow: 0 8px 25px rgba(139, 0, 0, 0.12);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 0, 0, 0.12);
    border-color: var(--border-dark);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary-red), var(--golden-yellow));
    z-index: 2;
    opacity: 0.8;
}

.products-carousel .swiper-slide-active .product-card::before {
    opacity: 1;
    height: 4px;
}

/* Product Image */
.product-image-container {
    height: 12rem;
    background: linear-gradient(135deg, var(--light-gray), var(--white));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.no-image-placeholder {
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.no-image-placeholder::before {
    content: '🖼️';
    font-size: 2rem;
    opacity: 0.5;
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem;
    flex-shrink: 0;
    opacity: 1 !important;
}

.product-price {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.product-price::before {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Product Action Button */
.product-action {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-red), var(--light-red));
    color: var(--white);
    text-align: center;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: auto;
    opacity: 1 !important;
}

.products-carousel .swiper-slide-active .product-action {
    background: linear-gradient(135deg, var(--light-red), var(--primary-red));
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

.product-action::before {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

.product-action:hover {
    background: linear-gradient(135deg, var(--light-red), var(--primary-red));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

/* استایل‌های ریسپانسیو برای دسکتاپ و تبلت */
@media (max-width: 1024px) {
    .products-carousel-container {
        padding: 0;
    }

    .slider-nav {
        padding: 0 15px; /* کاهش padding داخلی */
    }
    
    .slider-nav__item {
        width: 42px;
        height: 42px;
    }
}

@media (max-width: 768px) {
    .products-carousel-container {
        padding: 0;
    }


    .slider-nav {
        padding: 0 10px; /* کاهش بیشتر padding داخلی */
    }
    
    .slider-nav__item {
        width: 38px;
        height: 38px;
    }
    
    .product-image-container {
        height: 10rem;
    }
    
    .slider-pagination {
        padding-top: 30px;
    }
}

/* استایل‌های مخصوص موبایل (صفحه نمایش کوچک) */
@media (max-width: 767px) {
    /* مخفی کردن دکمه‌های ناوبری در موبایل */
    .slider-nav {
        display: none;
    }
    
    /* تنظیم padding برای موبایل */
    .products-carousel-container {
        padding: 0 15px;
    }
    
    .products-carousel-container.swiper-initialized {
        padding: 0 15px;
    }
    
    /* تنظیم کاروسل برای نمایش یک محصول کامل در موبایل */
    .products-carousel .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px;
    }
    
    /* حذف افکت scale در موبایل برای نمایش واضح همه محصولات */
    .products-carousel .swiper-slide-active {
        transform: scale(1);
    }
    
    .products-carousel .swiper-slide-prev,
    .products-carousel .swiper-slide-next {
        transform: scale(1);
    }
    
    /* تنظیم product-card برای موبایل */
    .product-card {
        max-width: 100%;
        margin: 0 auto;
    }
    
    /* بهبود استایل‌های محتوا برای موبایل */
    .product-info {
        padding: 1rem;
    }
    
    .product-name {
        font-size: 1rem;
        height: auto;
        min-height: 2.8rem;
    }
    
    .product-price {
        font-size: 1.1rem;
    }
    
    /* بهبود pagination برای موبایل */
    .slider-pagination {
        padding-top: 25px;
        gap: 6px;
    }
    
    .slider-pagination__item {
        width: 6px;
        height: 6px;
    }
    
    .slider-pagination__item.active {
        width: 24px;
    }
    
    /* بهبود hover effects برای موبایل */
    .products-carousel .swiper-slide:hover .product-card {
        transform: translateY(-5px);
    }
    
    .product-card:hover {
        transform: translateY(-5px);
    }
}

/* استایل‌های مخصوص موبایل‌های بسیار کوچک */
@media (max-width: 480px) {
    .products-carousel-container {
        padding: 0 10px;
    }
    
    .products-carousel-container.swiper-initialized {
        padding: 0 10px;
    }
    
    .products-carousel .swiper-slide {
        padding: 0 5px;
    }
    
    .product-image-container {
        height: 9rem;
    }
    
    .product-info {
        padding: 0.875rem;
    }
    
    .product-name {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-action {
        padding: 0.675rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .slider-pagination {
        padding-top: 20px;
    }
    
    .slider-pagination__item {
        width: 5px;
        height: 5px;
    }
    
    .slider-pagination__item.active {
        width: 20px;
    }
}

/* استایل‌های مخصوص تبلت در حالت عمودی */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .products-carousel-container {
        padding: 0 50px;
    }
    
    .slider-nav__item {
        width: 44px;
        height: 44px;
    }
    
    .products-carousel .swiper-slide {
        width: 50% !important;
    }
}

/* بقیه استایل‌ها */
.middle-banner-container {
    margin: 3rem 0;
}

.middle-banner {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.no-products {
    text-align: center;
    padding: 3rem 0;
}

.no-products-content {
    background-color: var(--bg-white);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    max-width: 28rem;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-light);
}

.no-products-icon {
    color: var(--border-medium);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.no-products-icon::before {
    content: '📦';
}

.no-products-title {
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.no-products-description {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.reset-products-filter {
    background: linear-gradient(135deg, var(--primary-red), var(--light-red));
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reset-products-filter::before {
    content: '🔄';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

.reset-products-filter:hover {
    background: linear-gradient(135deg, var(--light-red), var(--primary-red));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 0, 0, 0.2);
}

/* Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: slideInUp 0.5s ease-out;
}

.product-card {
    animation: slideInUp 0.6s ease-out;
}

.products-grid .product-card:nth-child(1) { animation-delay: 0.1s; }
.products-grid .product-card:nth-child(2) { animation-delay: 0.2s; }
.products-grid .product-card:nth-child(3) { animation-delay: 0.3s; }
.products-grid .product-card:nth-child(4) { animation-delay: 0.4s; }

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-gray);
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}