/* Category Slider Component Styles */
.category-slider-section {
    background: white;
    position: relative;
}

.category-slider-container {
    position: relative;
    overflow: visible;
}

/* Native Scroll Slider (Mobile) */
.category-slider-native-scroll {
    width: 100%;
    padding: 0;
}

.native-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 8px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
}

.native-scroll-slide {
    flex-shrink: 0;
    width: calc((100% - 12px) / 1.7); /* 1.7 slides visible */
}

@media (min-width: 640px) {
    .native-scroll-slide {
        width: calc((100% - 24px) / 2);
    }
}

/* Swiper Lazy Loading Preloader Styles */
.swiper-lazy-preloader {
    width: 42px;
    height: 42px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -21px;
    margin-top: -21px;
    z-index: 10;
    transform-origin: 50%;
    animation: swiper-preloader-spin 1s infinite linear;
    box-sizing: border-box;
    border: 4px solid #f97316;
    border-radius: 50%;
    border-top-color: transparent;
}

.swiper-lazy-preloader-black {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: transparent;
}

@keyframes swiper-preloader-spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Lazy yüklenen resimlere placeholder arka plan */
.swiper-lazy {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Resim yüklendiğinde animasyonu kaldır */
.swiper-lazy-loaded {
    animation: none;
    background: transparent;
}

/* Custom navigation buttons - Product slider ile aynı stiller */
.category-slider-container .custom-swiper-button-prev,
.category-slider-container .custom-swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

/* Hover efektleri sadece hover destekleyen cihazlarda (desktop/laptop) */
@media (hover: hover) and (pointer: fine) {
    .category-slider-container .custom-swiper-button-prev:hover,
    .category-slider-container .custom-swiper-button-next:hover {
        background-color: rgba(0, 0, 0, 0.9);
    }
}

.category-slider-container .custom-swiper-button-prev:disabled,
.category-slider-container .custom-swiper-button-next:disabled {
    cursor: not-allowed;
}

.category-slider-container .custom-swiper-button-prev {
    left: -25px;
}

.category-slider-container .custom-swiper-button-next {
    right: -25px;
}

.category-product-card {
    /* Ürün kartları için özel stiller */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Equal height slides için güçlü CSS çözümü */
.equal-height-slides {
    --swiper-slide-height: 100%;
}

.equal-height-slides .swiper-wrapper {
    display: flex !important;
    align-items: stretch !important;
}

.equal-height-slides swiper-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.equal-height-slides .category-product-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Tüm slide'ları eşit yükseklikte yap */
.category-slider-container swiper-slide.equal-height-slide {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.category-slider-container swiper-slide.equal-height-slide > * {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.category-slider-container swiper-slide.equal-height-slide .prod-card-container {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 380px !important;
}

/* Kategori kartı içeriğini eşit dağıt */
.category-slider-container swiper-slide.equal-height-slide .prod-card-container > div {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}


.category-card {
    display: block;
    text-decoration: none;
    transition: all 0.3s ease;
    height: 100%; /* Tam yükseklik */
}

/* Hover efektleri sadece hover destekleyen cihazlarda */
@media (hover: hover) and (pointer: fine) {
    .category-card:hover {
        transform: translateY(-2px);
    }
}

/* Equal height categories için CSS */
.equal-height-categories {
    display: grid;
    grid-auto-rows: 1fr; /* Tüm satırlar eşit yükseklik */
}

.equal-height-categories .category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.equal-height-categories .category-card > div {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 200px; /* Minimum yükseklik garantisi */
}

.equal-height-categories .category-card .aspect-square {
    flex-shrink: 0; /* Görsel alanı sabit tut */
}

.equal-height-categories .category-card .p-3 {
    flex: 1; /* Metin alanı kalan yeri kaplasın */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* İçeriği üst ve alta yay */
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Kategori isimlerini büyüt */
.category-slider .category-card h4 {
    font-size: 1rem !important; /* 16px - text-sm'den text-base'e */
    font-weight: 600 !important; /* font-medium'dan font-semibold'a */
    line-height: 1.4 !important;
    color: #374151 !important; /* gray-700 - daha nötr */
}

/* Hover'da turuncu yap - sadece hover destekleyen cihazlarda */
@media (hover: hover) and (pointer: fine) {
    .category-slider .category-card:hover h4 {
        color: #ea580c !important; /* hover'da orange-600 */
    }
}

@media (min-width: 768px) {
    .category-slider .category-card h4 {
        font-size: 1.125rem !important; /* 18px - text-lg */
    }
}

/* Kategori kartlarında hover efektini sabit yap */
.category-slider .category-card {
    transform: translateY(-2px) !important; /* Hover efektini sabit yap */
}

.category-slider .category-card .bg-white {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; /* hover shadow'u sabit yap */
    transition: box-shadow 0.3s ease, transform 0.3s ease !important; /* Smooth transitions */
}

.category-slider .category-card img {
    transform: scale(1.05) !important; /* Görsel scale efektini sabit yap */
    transition: transform 0.3s ease !important; /* Smooth transition */
}

/* Hover'da görsel animasyonu ve gölge artırma - sadece hover destekleyen cihazlarda */
@media (hover: hover) and (pointer: fine) {
    .category-slider .category-card:hover img {
        transform: scale(1.1) !important; /* Hover'da biraz daha büyüt */
    }

    .category-slider .category-card:hover .bg-white {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.15) !important; /* Hover'da dört taraftan eşit gölge */
        transform: translateY(-4px) !important; /* Hover'da biraz daha yukarı kaldır */
    }
}

/* Mobilde Tailwind group-hover efektlerini devre dışı bırak */
@media (hover: none) and (pointer: coarse) {
    .category-card.group:hover img,
    .category-card.group img {
        transform: scale(1) !important; /* Mobilde scale efektini kapat */
    }
    
    .category-card.group:hover h4,
    .category-card.group h4 {
        color: inherit !important; /* Mobilde renk değişimini kapat */
    }
    
    .category-card.group:hover .bg-white,
    .category-card.group .bg-white {
        transform: translateY(0) !important; /* Mobilde yukarı kalkma efektini kapat */
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important; /* Normal shadow */
    }
}

/* Mobile Navigation Buttons - Hidden */
@media (max-width: 640px) {
    .category-slider-container .custom-swiper-button-prev,
    .category-slider-container .custom-swiper-button-next {
        display: none !important; /* Mobile'da okları gizle */
    }
}

/* Tablet Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .category-slider-section {
        padding: 2rem 0;
    }
}
