/* ========================================
   Responsive Styles for iOPEN Mall Clone
   ======================================== */

/* Mobile First Approach */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Hide desktop elements */
    .top-utility-bar,
    .main-header,
    .category-nav {
        display: none !important;
    }

    /* Show mobile header */
    .mobile-header {
        display: block !important;
    }

    /* Banner adjustments */
    .banner-section {
        margin-top: 50px;
    }

    .banner-slide img {
        height: 200px;
        object-fit: cover;
    }

    /* Quick links grid */
    .it720_downbox ul {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }

    .it720_downbox li a {
        padding: 8px;
    }

    .it720_downbox li img {
        width: 40px;
        height: 40px;
    }

    .it720_downbox li p span {
        font-size: 11px;
    }

    /* Flash sale */
    .it902-item-title h3 {
        font-size: 18px;
    }

    .it902-time-box {
        font-size: 12px;
    }

    .it902-time-box span {
        padding: 3px 6px;
        font-size: 14px;
    }

    /* Product cards */
    .product-card {
        width: 48%;
        margin-bottom: 10px;
    }

    .product-card img {
        height: 150px;
    }

    .product-card h3 {
        font-size: 13px;
        line-height: 1.3;
    }

    .product-card .price {
        font-size: 16px;
    }

    /* Section titles */
    .section-title {
        font-size: 18px;
        padding: 10px 0;
    }

    /* Products grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Brand grid */
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .brand-item img {
        height: 60px;
    }

    /* Slider navigation */
    .slider-nav {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }

    /* Hide desktop elements */
    .top-utility-bar,
    .main-header,
    .category-nav {
        display: none !important;
    }

    /* Show mobile header */
    .mobile-header {
        display: block !important;
    }

    .banner-slide img {
        height: 250px;
    }

    .it720_downbox ul {
        grid-template-columns: repeat(5, 1fr);
    }

    .product-card {
        width: 32%;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .brand-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }

    /* Show desktop header, hide mobile */
    .mobile-header {
        display: none !important;
    }

    .top-utility-bar,
    .main-header,
    .category-nav {
        display: block !important;
    }

    .banner-slide img {
        height: 300px;
    }

    .it720_downbox ul {
        grid-template-columns: repeat(10, 1fr);
    }

    .product-card {
        width: 23%;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .brand-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Search box adjustments */
    .search-wrapper {
        flex: 1;
        max-width: 500px;
    }

    /* Category nav */
    .category-list {
        flex-wrap: wrap;
    }

    .category-list li {
        font-size: 13px;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .mobile-header {
        display: none !important;
    }

    .banner-slide img {
        height: 350px;
    }

    .product-card {
        width: 19%;
    }

    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .brand-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }

    .mobile-header {
        display: none !important;
    }

    .banner-slide img {
        height: 400px;
    }

    .product-card {
        width: 19%;
    }

    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .brand-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* Print Styles */
@media print {
    .mobile-header,
    .top-utility-bar,
    .category-nav,
    .banner-nav,
    .slider-nav,
    .quick-links,
    .flash-sale {
        display: none !important;
    }

    .product-card {
        page-break-inside: avoid;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-card img,
    .brand-item img,
    .banner-slide img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-width: 767.98px) {
    .banner-slide img {
        height: 200px;
    }

    .mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: white;
    }

    .banner-section {
        margin-top: 60px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .banner-slider {
        scroll-behavior: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if needed */
    /* Currently not implemented */
}
