/**
 * Midway Wholesale - Homepage Stylesheet (MOBILE FIRST)
 * 
 * Mobile-first responsive design approach
 * Base styles: Mobile (320px+)
 * Progressive enhancement: Tablet (768px+), Desktop (992px+)
 * 
 * @package MidwayWholesale
 * @version 3.0 - Mobile First
 * @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;
}

html {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hide containers by default */
.container {
    display: none;
}

/* ================================
   BANNER SLIDER SECTION (Mobile First)
   ================================ */

.slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    z-index: 1;
    margin-top: 0;
}

/* Hide desktop slider on mobile, show mobile slider */
.desktop-slider {
    display: none;
}

.mobile-slider {
    display: block;
}

.slide {
    position: relative;
    width: 100%;
    display: none;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: center;
    max-height: 500px;           /* MUCH TALLER - fills most of screen */
    min-height: 400px;           /* Ensure minimum height */
}

/* Hide old navigation arrows */
.prev, .next {
    display: none;
}

/* Dot Navigation - Mobile */
.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1000;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 20px;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    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);
}

.slider-dots .dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-dots .dot.active {
    background-color: #fff;
    width: 20px;
    border-radius: 20px;
}

/* CTA Button Positioning - Hidden on mobile */
.slide-cta {
    display: none;
}

/* ================================
   FEATURES SECTION (Mobile First)
   ================================ */

.features {
    width: 100%;
    padding: 30px 0;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.feature-container {
    width: 100%;
    display: flex;
    flex-direction: column;         /* Stack vertically on mobile */
    align-items: stretch;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 25px 20px;
    border-bottom: 1px solid #d4d8dd;
    min-height: 140px;
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-item i {
    color: #4c5767;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature-item p {
    color: black;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    font-weight: 500;
}

/* ================================
   CATEGORY SLIDER SECTION (Mobile First)
   ================================ */

.category-slider {
    padding: 20px 15px;
    background: white;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
}

.slider-wrapper {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 10px 0;
    scrollbar-width: none;          /* Firefox */
}

/* Hide scrollbar */
.slider-wrapper::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex: 0 0 120px;                /* Smaller on mobile */
    scroll-snap-align: start;
    text-decoration: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-image {
    width: 120px;
    height: 120px;
    overflow: hidden;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    border-radius: 8px;
}

.category-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.category-item span {
    color: black;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}

/* Slider Navigation - Hidden on mobile, shown on larger screens */
.slider-nav {
    display: none;
}

/* ================================
   TOP SELLING PRODUCTS (Mobile First)
   ================================ */

.top-selling {
    padding: 30px 15px;
    background: #fff;
}

.top-selling-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 0 0 20px;
    padding: 0;
}

.top-selling-title {
    font-size: 20px;
    font-weight: 500;
    color: black;
    margin: 0;
    font-family: "Open Sans", sans-serif;
    text-align: center;
}

.view-all {
    background: white;
    border: 1px solid #19427f;
    color: #19427f;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    display: block;
}

.view-all:hover {
    background: #19427f;
    color: white;
}

/* Products Grid - Mobile: Single column */
.products-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-image-container {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.product-brand {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

.rating {
    display: flex;
    gap: 2px;
}

.rating i {
    color: #ffa500;
    font-size: 12px;
}

.product-name {
    color: #333;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-name:hover {
    color: #19427f;
}

.product-price {
    color: #19427f;
    font-size: 16px;
    font-weight: 600;
}

/* ================================
   PROMOTIONAL BANNERS (Mobile First)
   ================================ */

.banner-section {
    padding: 20px 15px;
    background: #f5f5f5;
}

.banner-grid {
    display: grid;
    grid-template-columns: 1fr;     /* Single column on mobile */
    gap: 15px;
}

.product-banner {
    position: relative;
    border-radius: 12px;
    padding: 25px 20px;
    min-height: 180px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* Both banners use blue gradients now */
.Safety-Quality-banner {
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
}

.variety-of-products-banner {
    background: linear-gradient(135deg, #667eea 0%, #4b6cb7 100%);
}

.banner-content {
    position: relative;
    z-index: 2;
    max-width: 70%;
}

.banner-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.banner-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.banner-link {
    display: inline-block;
    background: white;
    color: #19427f;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.banner-link:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.banner-image,
.banner-image-great {
    position: absolute;
    right: 0;
    bottom: 0;
    max-width: 35%;
    height: auto;
    object-fit: contain;
    opacity: 0.4;
    z-index: 1;
}

/* ================================
   DEALS SECTION (Mobile First)
   ================================ */

.deals-section {
    padding: 30px 15px;
    background: white;
}

.deals-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.deals-title {
    font-size: 20px;
    font-weight: 500;
    color: black;
    margin: 0;
}

.deals-grid {
    display: grid;
    grid-template-columns: 1fr;     /* Single column on mobile */
    gap: 15px;
}

.deal-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px 15px;
    text-align: center;
    transition: box-shadow 0.3s ease;
}

.deal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.deal-title {
    color: #333;
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
    line-height: 1.3;
}

.deal-price {
    color: #19427f;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 15px;
}

.deal-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    min-height: 160px;
    background: #f9f9f9;
    border-radius: 8px;
}

.deal-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stock-info {
    color: rgb(210, 63, 87);
    font-size: 12px;
    margin-bottom: 15px;
    font-weight: 500;
}

.view-details {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #333;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    text-align: center;
    background: white;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-details:hover {
    background: #333;
    color: white;
}

/* ================================
   BRAND SLIDER SECTION (Mobile First)
   ================================ */

.brand-slider-section {
    padding: 30px 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 45px;                /* Space for navigation buttons */
}

.brand-slider {
    display: flex;
    align-items: center;
    gap: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 20px 0;
    scrollbar-width: none;
}

.brand-slider::-webkit-scrollbar {
    display: none;
}

.brand-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-width: 100px;
    scroll-snap-align: start;
}

.brand-logo img {
    max-width: 80px;
    height: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.brand-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Brand navigation buttons */
.brand-nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    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: 5px;
}

.brand-nav-next {
    right: 5px;
}

/* ================================
   TABLET BREAKPOINT (576px and up)
   ================================ */

@media (min-width: 576px) {
    /* Banner slider */
    .slide img {
        max-height: 550px;          /* Very tall on larger phones */
        min-height: 450px;
        object-fit: cover;
        object-position: center;
    }
    
    /* Features - 2 per row */
    .feature-container {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .feature-item {
        flex: 1 1 50%;
        border-bottom: 1px solid #d4d8dd;
        border-right: 1px solid #d4d8dd;
    }
    
    .feature-item:nth-child(2n) {
        border-right: none;
    }
    
    .feature-item:nth-last-child(-n+2) {
        border-bottom: none;
    }
    
    /* Category slider */
    .category-item {
        flex: 0 0 140px;
    }
    
    .category-image {
        width: 140px;
        height: 140px;
    }
    
    .category-item span {
        font-size: 13px;
    }
    
    /* Products grid - 2 columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Deals grid - 2 columns */
    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================
   TABLET LANDSCAPE (768px and up)
   ================================ */

@media (min-width: 768px) {
    /* Banner slider - tall on tablet */
    .slide img {
        max-height: 600px;          /* Very tall on tablet */
        min-height: 500px;
        object-fit: cover;
        object-position: center;
    }
    
    .slider-dots {
        bottom: 15px;
        padding: 8px 15px;
        gap: 10px;
    }
    
    .slider-dots .dot {
        width: 10px;
        height: 10px;
    }
    
    .slider-dots .dot.active {
        width: 24px;
    }
    
    /* Category slider */
    .category-slider {
        padding: 30px 30px;
    }
    
    .slider-container {
        max-width: calc((220px * 5) + (30px * 4));
    }
    
    .slider-wrapper {
        gap: 30px;
    }
    
    .category-item {
        flex: 0 0 220px;
    }
    
    .category-image {
        width: 220px;
        height: 220px;
    }
    
    .category-item span {
        font-size: 14px;
    }
    
    /* Show navigation buttons */
    .slider-nav {
        display: flex;
        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);
    }
    
    .slider-nav i {
        font-size: 16px;
        color: #666;
    }
    
    .slider-nav:hover {
        background: #19427f;
    }
    
    .slider-nav:hover i {
        color: white;
    }
    
    .slider-nav.prev {
        left: 0;
    }
    
    .slider-nav.next {
        right: 0;
    }
    
    /* Top selling */
    .top-selling {
        padding: 40px 30px;
    }
    
    .top-selling-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .top-selling-title {
        font-size: 24px;
    }
    
    .view-all {
        padding: 10px 24px;
        display: inline-block;
    }
    
    /* Banners */
    .banner-section {
        padding: 30px 30px;
    }
    
    .banner-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .product-banner {
        padding: 30px 25px;
        min-height: 200px;
    }
    
    .banner-content {
        max-width: 65%;
    }
    
    .banner-title {
        font-size: 20px;
    }
    
    .banner-subtitle {
        font-size: 14px;
    }
     .banner-link {
        font-size: 15px;
        padding: 12px 24px;
    }
    
    /* Deals */
    .deals-section {
        padding: 40px 30px;
    }
    
    .deals-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .deals-title {
        font-size: 24px;
    }
    
    .deals-header .view-all {
        display: inline-block;
    }
    
    /* Brands */
    .brand-slider {
        gap: 40px;
    }
    
    .brand-logo {
        min-width: 120px;
    }
    
    .brand-logo img {
        max-width: 100px;
    }
}

/* ================================
   DESKTOP (992px and up)
   ================================ */

@media (min-width: 992px) {
    /* Show desktop slider, hide mobile slider */
    .desktop-slider {
        display: block;
    }
    
    .mobile-slider {
        display: none;
    }
    
    /* Banner slider - FULL WIDTH on desktop */
    .slide img {
        max-height: none;           /* Remove height restriction */
        object-fit: contain;        /* Show full image, no cropping */
    }
    
    /* Show CTA buttons */
    .slide-cta {
        display: block;
        position: absolute;
    }
    
    .bottom-left {
        left: 10%;
        bottom: 20%;
    }
    
    .right-side {
        right: 10%;
        top: 50%;
        transform: translateY(-50%);
    }
    
    /* Features - horizontal row */
    .feature-container {
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .feature-item {
        flex: 1;
        padding: 20px 40px;
        height: 150px;
        border-bottom: none;
        border-right: 1px solid #d4d8dd;
    }
    
    .feature-item:last-child {
        border-right: none;
    }
    
    .feature-item i {
        font-size: 3.5rem;
        margin-bottom: 20px;
    }
    
    .feature-item p {
        font-size: 15px;
    }
    
    /* Category slider */
    .category-slider {
        padding: 30px 50px;
    }
    
    /* Top selling */
    .top-selling {
        padding: 40px 20px;
    }
    
    .top-selling-title {
        font-size: 28px;
    }
    
    /* Products grid - 4 columns */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .product-card {
        padding: 20px;
    }
    
    .product-image-container {
        height: 200px;
    }
    
    .product-brand {
        font-size: 13px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .rating i {
        font-size: 13px;
    }
    
    /* Banners */
    .banner-section {
        padding: 40px 20px;
    }
    
    .product-banner {
        padding: 40px 30px;
        min-height: 220px;
    }
    
    .banner-title {
        font-size: 22px;
    }
    
    .banner-subtitle {
        font-size: 15px;
    }
    
    .banner-link {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .banner-image,
    .banner-image-great {
        max-width: 40%;
        opacity: 0.5;
    }
    
    /* Deals */
    .deals-section {
        padding: 40px 20px;
    }
    
    .deals-title {
        font-size: 28px;
    }
    
    .deals-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .deal-card {
        padding: 25px 20px;
    }
    
    .deal-title {
        font-size: 15px;
    }
    
    .deal-price {
        font-size: 16px;
    }
    
    .deal-image {
        min-height: 200px;
    }
    
    .stock-info {
        font-size: 13px;
    }
    
    /* Brands */
    .brand-slider-container {
        padding: 0 60px;
    }
    
    .brand-slider {
        gap: 80px;
    }
    
    .brand-logo {
        min-width: 180px;
        padding: 10px 20px;
    }
    
    .brand-logo img {
        max-width: 140px;
    }
    
    .brand-nav-button {
        width: 40px;
        height: 40px;
    }
    
    .brand-nav-prev {
        left: 10px;
    }
    
    .brand-nav-next {
        right: 10px;
    }
}

/* ================================
   LARGE DESKTOP (1200px and up)
   ================================ */

@media (min-width: 1200px) {
    .top-selling-header,
    .products-grid,
    .deals-grid {
        max-width: 1400px;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

/* Smooth scrolling for reduced motion users */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus indicators */
a:focus, button:focus {
    outline: 2px solid #19427f;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .product-card,
    .deal-card {
        border-width: 2px;
    }
}