/* ================================
   index.css - Complete & Final CSS
   For Online Pharmacy Homepage
   Fixed 230px Product Cards | Clean Layout | No Gaps
   ================================ */

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    overscroll-behavior-y: contain;
}

/* Swiper Global Fixes */
.swiper {
    width: 100%;
    overflow: hidden !important;
    position: relative;
}

.swiper-wrapper {
    display: flex;
}

/* ===================================
   PRODUCT SLIDERS (Featured, Best Sellers, New Arrivals)
   Fixed 230px Card Width - Perfect Layout
   =================================== */
.swiper.product-slider {
    overflow: hidden !important;
    padding: 0 50px;
    /* Space for navigation arrows */
    position: relative;
}

.swiper.product-slider .swiper-wrapper {
    align-items: stretch;
}

.swiper.product-slider .swiper-slide {
    width: 230px !important;
    max-width: 230px !important;
    flex-shrink: 0 !important;
    height: auto !important;
    display: flex;
    justify-content: center;
}

/* Product Card Styling */
.product-card {
    width: 230px !important;
    max-width: 230px !important;
    margin: 0 auto;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    background: white;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 123, 255, 0.2) !important;
    border-color: #007bff !important;
}

/* Discount Badge Styling */
.badge.bg-success {
    font-size: 0.65rem !important;
    font-weight: 600;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Discount Price Styling */
.text-decoration-line-through {
    color: #6c757d !important;
    font-size: 0.85rem;
    margin-right: 0.25rem;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    padding: 10px;
}

.product-card .card-body {
    padding: 1rem;
}

.product-card .card-title {
    font-size: 0.95rem;
    height: 48px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.5rem;
}

/* Navigation Arrows for Product Sliders */
.swiper.product-slider .swiper-button-next,
.swiper.product-slider .swiper-button-prev {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    top: 50%;
    margin-top: -22px;
    z-index: 10;
    transition: all 0.3s ease;
}

.swiper.product-slider .swiper-button-next:after,
.swiper.product-slider .swiper-button-prev:after {
    font-size: 18px;
    color: #007bff;
    font-weight: bold;
}

.swiper.product-slider .swiper-button-next:hover,
.swiper.product-slider .swiper-button-prev:hover {
    background: #007bff;
}

.swiper.product-slider .swiper-button-next:hover:after,
.swiper.product-slider .swiper-button-prev:hover:after {
    color: white;
}

/* Mobile Adjustments for Product Sliders */
@media (max-width: 767px) {
    .swiper.product-slider {
        padding: 0 40px;
    }

    .swiper.product-slider .swiper-button-next,
    .swiper.product-slider .swiper-button-prev {
        width: 38px;
        height: 38px;
        margin-top: -19px;
    }

    .swiper.product-slider .swiper-button-next:after,
    .swiper.product-slider .swiper-button-prev:after {
        font-size: 16px;
    }
}

/* ===================================
   CATEGORY SLIDER (Shop by Category - Optional Future Use)
   =================================== */
.categorySlider {
    overflow: hidden !important;
    padding: 0 50px;
}

.categorySlider .swiper-slide {
    width: 230px !important;
    max-width: 230px !important;
    flex-shrink: 0 !important;
    display: flex;
    justify-content: center;
}

.hover-lift {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hover-lift:hover {
    transform: translateY(-12px);
    box-shadow: 0 20px 40px rgba(0, 123, 255, 0.15) !important;
}

/* ==========================================
   MANUFACTURERS – SMOOTH INFINITE CAROUSEL
   Bootstrap-friendly version
   ========================================== */

.manufacturers-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
    padding: 2.5rem 0;
    /* ≈ 40px */
}

.manufacturers-track-wrapper {
    overflow: hidden;
    /* contains the moving track */
    margin: 0 -15px;
    /* negative margin to fight .container padding on small screens if needed — optional */
}

.manufacturers-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    /* 24px */
    padding: 1.25rem 0;
    /* 20px top/bottom */

    width: max-content;
    /* ← critical for dynamic content width */
    animation: scroll-left 20s linear infinite;
    will-change: transform;
}

/* Pause on hover / focus */
.manufacturers-track:has(.manufacturer-card:hover) {
    animation-play-state: paused;
}

.manufacturer-card {
    min-width: 160px;
    aspect-ratio: 16 / 10;
    /* helps maintain proportion */
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 1rem;
    transition: all 0.25s ease;
}

.manufacturer-card:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.manufacturer-card a {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.manufacturer-card img {
    max-width: 120px;
    max-height: 70px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ─── Seamless infinite loop ─── */
@keyframes scroll-left {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .manufacturers-track {
        gap: 1.25rem;
        animation-duration: 20s;
    }

    .manufacturer-card {
        min-width: 140px;
    }
}

@media (max-width: 768px) {
    .manufacturers-track {
        gap: 1rem;
        animation-duration: 20s;
    }

    .manufacturer-card {
        min-width: 120px;
        padding: 0.75rem;
    }

    .manufacturer-card img {
        max-width: 100px;
        max-height: 60px;
    }
}

@media (max-width: 576px) {
    .manufacturers-track {
        gap: 0.75rem;
        animation-duration: 20s;
    }

    .manufacturer-card {
        min-width: 100px;
        padding: 0.625rem;
    }

    .manufacturer-card img {
        max-width: 80px;
        max-height: 50px;
    }
}

/* ===================================
   MAIN BANNER CAROUSEL
   =================================== */
#mainBannerCarousel {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

#mainBannerCarousel .carousel-item img {
    object-fit: cover;
    height: 250px;
}

@media (min-width: 768px) {
    #mainBannerCarousel .carousel-item img {
        height: 350px;
    }
}

@media (min-width: 992px) {
    #mainBannerCarousel .carousel-item img {
        height: 550px;
    }
}

/* ===================================
   ANIMATED COUNTER
   =================================== */
.counter {
    font-size: 1.4rem;
    background: linear-gradient(45deg, #0d6efd, #0dcaf0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    display: inline-block;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.counter {
    animation: countUp 1s ease-out forwards;
}

/* ===================================
   GENERAL UTILITIES
   =================================== */
.hover-shadow {
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hover-shadow:hover {
    box-shadow: 0 12px 30px rgba(0, 123, 255, 0.18) !important;
    transform: translateY(-6px);
}

/* Small Promo Banner Hover Zoom */
.position-relative:hover img {
    transform: scale(1.08);
    transition: transform 8s ease;
}