/**
 * Midway Wholesale - Homepage Stylesheet
 * Description: Main stylesheet for the Midway Wholesale homepage
 * Contains styles for slider, categories, products, banners, and responsive design
 * author GoneClear Development Team
 */

/* ================================
   FONT IMPORTS
   ================================ */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* ================================
   RESET AND BASE STYLES
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
}

/* Hide containers by default (likely for template system) */
.container {
    display: none;
}

/* ================================
   BANNER SLIDER SECTION
   ================================ */

/**
 * Main banner slider container
 * Houses promotional banners with navigation controls
 */
.slider {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    z-index: 1;
    margin-top: 0px;
}

/**
 * Individual slide styling
 * Default hidden, becomes visible when active
 */
.slide {
    position: relative;
    width: 100%;
    display: none;
    transition: opacity 0.5s ease-in-out;
}

/* Active slide display state */
.slide.active {
    display: block;
    opacity: 1;
}

/* Slide image styling - responsive and contained */
.slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/**
 * Hide Old Navigation Arrows
 * Using modern dot navigation instead
 */
.prev,
.next {
    display: none;
}

/**
 * Modern Dot Navigation for Slider
 * Clean, minimalist indicator dots positioned at bottom center
 */

/* Dots container - centered at bottom of slider */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1000;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 25px;
}

/* Individual dot styling */
.slider-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

/* Hover effect for dots */
.slider-dots .dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

/* Active dot styling - filled and larger */
.slider-dots .dot.active {
    background-color: #fff;
    width: 32px;
    border-radius: 25px;
}

/**
 * Call-to-Action Button Positioning
 * Used for positioning CTA buttons over banner images
 */
.slide-cta {
    position: absolute;
}

.bottom-left {
    left: 10%;
    bottom: 20%;
}

.right-side {
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
}

/* ================================
   FEATURES SECTION
   ================================ */

/**
 * Features section showcasing company benefits
 * Money back guarantee, shipping, etc.
 */
.features {
    width: 100%;
    padding: 40px 0;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
    border-bottom: 0px solid #eee;
}

.feature-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

/**
 * Individual feature item styling
 * Displays icon and text in vertical layout
 */
.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 40px;
    flex: 1;
    min-width: 200px;
    border-right: 1px solid #d4d8dd;
    height: 150px; /* Fixed height for consistency */
}

/* Remove border from last feature item */
.feature-item:last-child {
    border-right: none;
}

/* Feature icons styling */
.feature-item i {
    color: #4c5767;
    font-size: 3.5rem;
    margin-bottom: 20px;
}

/* Feature text styling */
.feature-item p {
    color: BLACK;
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
    width: 100%;
}

/* ================================
   CATEGORY SLIDER SECTION
   ================================ */

/**
 * Category slider showing product categories
 * Horizontal scrolling with category images and names
 */
.category-slider {
    padding: 30px 50px;
    background: rgb(255, 255, 255);
    position: relative;
    width: 100%;
    overflow: hidden;
}

/**
 * Slider container with fixed width
 * Calculated based on item width (220px * 5) + gaps (30px * 4)
 */
.slider-container {
    position: relative;
    width: calc((220px * 5) + (30px * 4));
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

/**
 * Wrapper for category items
 * Flex layout with horizontal scrolling
 */
.slider-wrapper {
    display: flex;
    gap: 30px;
    overflow: hidden;
    scroll-behavior: smooth;
    padding: 10px 0;
}

/**
 * Individual category item
 * Fixed width for consistent layout
 */
.category-item {
    flex: 0 0 220px;
    text-decoration: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/**
 * Category image container
 * Square container for category images
 */
.category-image {
    width: 220px;
    height: 220px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

/* Category image styling - contained within square */
.category-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Category name text styling */
.category-item span {
    color: black;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
}

/**
 * Slider Navigation (Hidden by default)
 * Circular navigation buttons for category slider
 */
.slider-nav {
    display: none; /* Initially hidden */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navigation icon styling */
.slider-nav i {
    font-size: 16px;
    color: #666;
}

/* Navigation hover effects */
.slider-nav:hover {
    background: #19427f;
}

.slider-nav:hover i {
    color: white;
}

/* Navigation positioning */
.slider-nav.prev {
    left: 0;
}

.slider-nav.next {
    right: 0;
}

/* ================================
   TOP SELLING PRODUCTS SECTION
   ================================ */

/**
 * Top selling products section
 * Grid layout showcasing popular products
 */
.top-selling {
    padding: 40px 20px;
    background: #fff;
    margin-top: 20px;
}

/* Top selling header with title and view all button */
.top-selling-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

/* Top selling title styling */
.top-selling-title {
    font-size: 28px;
    font-weight: 500;
    color: black;
    margin: 0;
    font-family: "Open Sans", sans-serif;
}

/* View all link button */
.view-all {
    background: white;
    border: 1px solid #19427f;
    color: #19427f;
    padding: 10px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-all:hover {
    background: #19427f;
    color: white;
}

/* Section title styling (kept for backward compatibility) */
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 500;
    color: black;
    margin-bottom: 30px;
    font-family: "Open Sans", sans-serif;
}

/**
 * Products grid layout
 * Responsive grid with fixed column count at different breakpoints
 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/**
 * Individual product card
 * Vertical flex layout for product information
 */
.product-card {
    background: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/**
 * Product image container
 * Square aspect ratio with border and centered image
 */
.product-image-container {
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid #D5D9D9;
    border-radius: 8px;
    padding: 10px;
}

/* Product image styling - contained within container */
.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product information wrapper */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/**
 * Brand and rating header
 * Flexbox layout with space between brand and rating
 */
.brand-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Product brand text styling */
.product-brand {
    color: #666;
    font-size: 14px;
}

/**
 * Product name link styling
 * Hover effect with brand color
 */
.product-name {
    color: #0F1111;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.4;
}

.product-name:hover {
    color: #19427f;
}

/* Star rating styling */
.rating {
    color: #FFD700;
    font-size: 12px;
    margin-left: auto;
}

/* Product price styling */
.product-price {
    font-size: 18px;
    font-weight: 400;
    color: #19427f;
}

/**
 * Sold out badge
 * Positioned absolutely in top-right corner of image
 */
.sold-out-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
}

/* ================================
   BANNER SECTION
   ================================ */

/**
 * Promotional banner section
 * Two-column grid with product promotion banners
 */
.banner-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.banner-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/**
 * Individual banner styling
 * Horizontal layout with content and image
 */
.product-banner {
    position: relative;
    padding: 30px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    min-height: 240px;
}

/* Banner content area */
.banner-content {
    max-width: 50%;
    z-index: 2;
}

/* Banner text styling */
.banner-title {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 8px;
    color: #333;
}

.banner-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

/**
 * Banner call-to-action link
 * Styled with underline border
 */
.banner-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid #333;
    padding-bottom: 2px;
}

/* Banner image positioning */
.banner-image {
    position: absolute;
    right: 30px;
    max-width: 30%;
    height: auto;
    z-index: 1;
}

.banner-image-great{
    position: absolute;
    right: 30px;
    max-width: 25%;
    height: auto;
    z-index: 1;
}

/**
 * Specific banner background colors
 * Different themes for different banner types
 */
.Safety-Quality-banner {
    background-color: #e8f4ff;
}

.variety-of-products-banner{
    background-color: #f0f0ff;
}

/* ================================
   DEALS SECTION
   ================================ */

/**
 * Special deals section
 * Grid layout for promotional product deals
 */
.deals-section {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Deals section header with title and view all link */
.deals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.deals-title {
    font-size: 24px;
    font-weight: 500;
    color: #333;
}

/* View all deals link styling */
.view-all {
    padding: 6px 12px;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

/* Deals products grid */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/**
 * Individual deal card
 * Vertical layout with product info and image
 */
.deal-card {
    border: 1px solid #eee;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 4px;
    background: white;
}

/* Deal product title */
.deal-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    text-decoration: none;
    font-weight: 500;
}

/* Deal price styling */
.deal-price {
    color: #333;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Deal product image container */
.deal-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    min-height: 200px;
}

.deal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/**
 * Stock information styling
 * Red text with underline accent
 */
.stock-info {
    color: rgb(210, 63, 87);
    font-size: 13px;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

/* Underline accent for stock info */
.stock-info::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgb(210, 63, 87);
}

/**
 * View details button
 * Compact button styling with border
 */
.view-details {
    width: 50%;
    padding: 6px 16px;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    text-align: center;
    background: white;
    display: inline-block;
}

/* ================================
   BRAND SLIDER SECTION
   ================================ */

/**
 * Brand logos slider section
 * Horizontal scrolling showcase of partner brands
 */
.brand-slider-section {
    padding: 40px 0;
    background-color: #ffffff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    position: relative;
    width: 100%;
}

.brand-slider-container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 0 60px; /* Space for navigation buttons */
}

/**
 * Brand logos slider
 * Flex layout with generous spacing between logos
 */
.brand-slider {
    display: flex;
    align-items: center;
    gap: 80px;
    overflow: hidden;
    padding: 20px 0;
}

/**
 * Individual brand logo container
 * Consistent sizing and centering for logos
 */
.brand-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    min-width: 180px;
}

/**
 * Brand logo image styling
 * Grayscale by default, full color on hover
 */
.brand-logo img {
    max-width: 140px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* Brand logo hover effect */
.brand-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/**
 * Brand slider navigation buttons
 * Circular buttons positioned on sides
 */
.brand-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.brand-nav-button:hover {
    background: #f5f5f5;
}

.brand-nav-prev {
    left: 10px;
}

.brand-nav-next {
    right: 10px;
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

/**
 * Tablet and Small Desktop Breakpoints
 * Adjustments for screens 768px to 1200px
 */
@media (max-width: 1200px) {
    /* Feature items padding adjustment */
    .feature-item {
        padding: 20px;
    }
    
    /* Products grid: 4 columns to 3 columns */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Deals grid: 4 columns to 3 columns */
    .deals-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Brand slider spacing reduction */
    .brand-slider {
        gap: 60px;
    }
}

/**
 * Tablet Breakpoint (768px and below)
 * Major layout changes for tablet devices
 */
@media (max-width: 992px) {
    /* Products grid: 3 columns to 2 columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Deals grid: 3 columns to 2 columns */
    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Features: Horizontal to wrapped layout */
    .feature-container {
        flex-wrap: wrap;
    }
    
    .feature-item {
        flex: 1 1 50%; /* Two items per row */
        border-bottom: 1px solid #eee;
    }
    
    /* Remove right border on even items */
    .feature-item:nth-child(2n) {
        border-right: none;
    }
    
    /* Category slider adjustments */
    .slider-container {
        padding: 0 30px;
    }
    
    .circle-image {
        width: 120px;
        height: 120px;
    }
    
    .category-item {
        flex: 0 0 150px;
    }

    /* Top selling section mobile adjustments */
    .top-selling {
        padding: 20px 16px;
    }

    .top-selling-header {
        padding: 0;
        margin-bottom: 20px;
    }

    .top-selling-title {
        font-size: 22px;
    }

    .view-all {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    /* Banner grid: 2 columns to 1 column */
    .banner-grid {
        grid-template-columns: 1fr;
    }
    
    .banner-content {
        max-width: 60%;
    }
    
    .banner-image {
        max-width: 35%;
    }
    
    /* Brand slider container adjustment */
    .brand-slider-container {
        padding: 0 40px;
    }
    
    .brand-slider {
        gap: 40px;
    }
    
    .brand-logo {
        min-width: 140px;
    }
    
    .brand-logo img {
        max-width: 120px;
    }
}

/**
 * Mobile Breakpoint (576px and below)
 * Single column layouts for mobile devices
 */
@media (max-width: 576px) {
    /* Products grid: Single column */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Section title size reduction */
    .section-title {
        font-size: 24px;
    }

    /* Product card padding reduction */
    .product-card {
        padding: 10px;
    }
    
    /* Deals grid: Single column */
    .deals-grid {
        grid-template-columns: 1fr;
    }
}

/**
 * Small Mobile Breakpoint (480px and below)
 * Final mobile optimizations
 */
@media (max-width: 480px) {
    /* Feature items: Full width */
    .feature-item {
        flex: 1 1 100%;
    }

    /* Product image height reduction */
    .product-image {
        height: 150px;
    }

    /* Slider navigation size reduction */
    .prev, .next {
        font-size: 1.5rem;
        padding: 5px;
    }
    
    /* Mobile-optimized dot navigation */
    .slider-dots {
        bottom: 10px;
        padding: 8px 16px;
        gap: 10px;
    }
    
    .slider-dots .dot {
        width: 10px;
        height: 10px;
    }
    
    .slider-dots .dot.active {
        width: 24px;
    }

    /* Banner adjustments */
    .product-banner {
        padding: 20px;
        min-height: 200px;
    }
    
    .banner-title {
        font-size: 20px;
    }
    
    .banner-content {
        max-width: 100%;
    }
    
    /* Banner image as background overlay */
    .banner-image {
        opacity: 0.3;
        right: 0;
        max-width: 50%;
    }
}

/**
 * Touch Device Dropdown Fix
 * Prevents hover-based dropdowns on touch devices
 */
@media (hover: none) {
    .categories-dropdown:hover .dropdown-menu {
        display: none;
    }

    .categories-dropdown.active .dropdown-menu {
        display: block;
    }
}