/* Category Slider Styles */

.category-slider-section {
    margin: 3rem 0;
    padding: 2rem 0;
}

.category-slider-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 20px;
    position: relative;
}

.category-slider-header.ltr {
    flex-direction: row;
}

.category-slider-header.rtl {
    flex-direction: row-reverse;
}

.category-slider-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
}

.category-slider-title a {
    color: #000000;
    text-decoration: none;
    transition: color 0.3s;
}

/* English: Montserrat bold */
html[lang="en"] .category-slider-title a,
html[dir="ltr"] .category-slider-title a {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Arabic: IBM Plex Sans Arabic bold */
html[lang="ar"] .category-slider-title a,
html[dir="rtl"] .category-slider-title a {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 700;
}

.category-slider-title a:hover {
    color: #2563eb;
}

html.dark .category-slider-title a {
    color: #ffffff;
}

.category-slider-more {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: absolute;
}

.category-slider-header.ltr .category-slider-more {
    right: 20px;
}

.category-slider-header.rtl .category-slider-more {
    left: 20px;
}

.category-slider-more:hover {
    color: #1d4ed8;
}

.category-slider-wrapper {
    position: relative;
    padding: 0 60px;
}

.category-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 1rem;
}

.category-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.category-slide {
    flex: 0 0 auto;
    width: 280px;
}

.category-slide .product-card {
    width: 100%;
    margin: 0;
    max-width: 100%;
    border-radius: 12px;
}

.category-slide .product-image-container {
    width: 326px;
    height: 326px;
    padding: 3px;
    margin: 0;
}

.category-slide .product-image {
    width: 320px;
    height: 320px;
    object-fit: cover;
}

@media (max-width: 767px) {
    .category-slide .product-image-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        max-width: 326px;
        margin: 0 auto;
        padding: 3px;
    }
    
    .category-slide .product-image {
        width: calc(100% - 6px);
        height: calc(100% - 6px);
        max-width: 320px;
        max-height: 320px;
        object-fit: cover;
    }
    
    .category-slide .product-image-placeholder {
        width: calc(100% - 6px) !important;
        height: calc(100% - 6px) !important;
        max-width: 320px;
        max-height: 320px;
        margin: 0 auto;
    }
}

/* Desktop: Show multiple slides */
@media (min-width: 768px) {
    .category-slide {
        width: 326px;
    }
}

@media (min-width: 1024px) {
    .category-slide {
        width: 326px;
    }
}

/* Mobile: Show 1.5 slides at a time */
@media (max-width: 767px) {
    .category-slide {
        width: calc(66.666% - 1rem);
    }
    
    .category-slider-header {
        padding: 0 15px;
    }
    
    .category-slider-header.ltr .category-slider-more {
        right: 15px;
    }
    
    .category-slider-header.rtl .category-slider-more {
        left: 15px;
    }
    
    .category-slider-wrapper {
        padding: 0 15px;
    }
    
    .category-slider-title {
        font-size: 1.5rem;
    }
}

/* Slider Arrows */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
    user-select: none;
}

.slider-arrow:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.slider-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

[dir="rtl"] .slider-arrow:active {
    transform: translateY(-50%) scaleX(-1) scale(0.95);
}

.slider-arrow svg {
    width: 20px;
    height: 20px;
    color: #1e293b;
}

.slider-arrow:hover svg {
    color: #2563eb;
}

.slider-arrow-prev {
    left: 10px;
}

.slider-arrow-next {
    right: 10px;
}

[dir="rtl"] .slider-arrow-prev {
    left: auto;
    right: 10px;
    /* Flip the arrow icon for RTL */
    transform: translateY(-50%) scaleX(-1);
}

[dir="rtl"] .slider-arrow-next {
    right: auto;
    left: 10px;
    /* Flip the arrow icon for RTL */
    transform: translateY(-50%) scaleX(-1);
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .category-slider-wrapper {
        padding: 0 50px;
    }
    
    .slider-arrow {
        width: 35px;
        height: 35px;
    }
    
    .slider-arrow-prev {
        left: 5px;
    }
    
    .slider-arrow-next {
        right: 5px;
    }
}

/* RTL Support */
[dir="rtl"] .category-slider {
    direction: rtl;
}

