/* ==========================================
   BESTSELLER SLIDER STYLES
   Plik: assets/css/bestseller-slider.css
   ========================================== */

/* ==========================================
   SEKCJA GŁÓWNA
   ========================================== */
.bestseller-section {
    position: relative;
    padding: 60px 0;
    background-image: url('../images/bestseller-background.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bestseller-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   HEADER
   ========================================== */
.bestseller-header {
    margin-bottom: 40px;
    display:flex;
    flex-direction:row;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.bestseller-title {
    font-family: 'Poppins', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #333333;
    margin: 0 0 24px 0;
    line-height: 1.2;
}

/* ==========================================
   ZAKŁADKI
   ========================================== */
.bestseller-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bestseller-tab {
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.bestseller-tab:hover {
    color: #FDA635;
}

.bestseller-tab.active {
    background: #FDA635;
    color: white;
}

/* ==========================================
   SLIDER WRAPPER
   ========================================== */
.bestseller-slider-wrapper {
    position: relative;
    margin: 0 50px; /* Space for arrows */
    overflow: visible; /* Zapobiega rozszerzaniu strony */
}

/* Loading Spinner */
.bestseller-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.bestseller-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FDA635;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   SWIPER
   ========================================== */
.bestseller-swiper {
    overflow: hidden; /* Zapobiega rozszerzaniu strony */
    width: 100%;
}

.bestseller-swiper .swiper-wrapper {
    align-items: stretch;
    display: flex;
}

.bestseller-swiper .swiper-slide {
    height: auto;
    display: flex;
    flex-shrink: 0;
    width: auto;
}

.bestseller-swiper .swiper-slide .custom-product-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Zapewnia że obrazki produktów nie rozszerzają slidera */
.bestseller-swiper .product-image-container {
    max-width: 100%;
    overflow: hidden;
}

/* ==========================================
   NAVIGATION ARROWS
   ========================================== */
.bestseller-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.bestseller-nav-prev,
.bestseller-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid #E5E5E5;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: auto;
}

.bestseller-nav-prev {
    left: -60px;
}

.bestseller-nav-next {
    right: -60px;
}

.bestseller-nav-prev:hover,
.bestseller-nav-next:hover {
    background: #FDA635;
    border-color: #FDA635;
}

.bestseller-nav-prev:hover svg,
.bestseller-nav-next:hover svg {
    color: white;
}

.bestseller-nav-prev svg,
.bestseller-nav-next svg {
    color: #333333;
    transition: color 0.3s ease;
}

.bestseller-nav-prev.swiper-button-disabled,
.bestseller-nav-next.swiper-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================
   NO PRODUCTS MESSAGE
   ========================================== */
.no-products {
    text-align: center;
    padding: 60px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    color: #666666;
}

/* ==========================================
   RESPONSYWNOŚĆ
   ========================================== */

/* Mobile (do 767px) - 1.5 produktu */
@media screen and (max-width: 767px) {
    .bestseller-section {
        padding: 40px 0;
    }
    .bestseller-header{
        flex-direction: column;
    }

    
    .bestseller-title {
        font-size: 28px;
        margin-bottom: 20px;
        display:flex;
        flex-direction:row;
        align-items:center;
    }
    
    .bestseller-tabs {
        gap: 8px;
    }
    
    .bestseller-tab {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .bestseller-slider-wrapper {
        margin: 0 20px;
    }
    
    /* Ukryj strzałki na mobile */
    .bestseller-nav-prev,
    .bestseller-nav-next {
        display: none;
    }
}

/* Tablet (768px - 1023px) - 2 produkty */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .bestseller-section {
        padding: 50px 0;
    }
    
    .bestseller-title {
        font-size: 32px;
    }
    
    .bestseller-slider-wrapper {
        margin: 0 40px;
    }
    
    .bestseller-nav-prev {
        left: -50px;
    }
    
    .bestseller-nav-next {
        right: -50px;
    }
}

/* Desktop (1024px+) - 4 produkty */
@media screen and (min-width: 1024px) {
    .bestseller-container {
        max-width: 1400px;
    }
}

/* Large Desktop (1400px+) */
@media screen and (min-width: 1400px) {
    .bestseller-slider-wrapper {
        margin: 0 60px;
    }
    
    .bestseller-nav-prev {
        left: -70px;
    }
    
    .bestseller-nav-next {
        right: -70px;
    }
}
