﻿/* =================================
   Responsive Design
   ================================= */

/* Large Tablets & Small Desktops (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    :root {
        --container-width: 960px;
    }

    .section-header h2 {
        font-size: 32px;
    }

    .section-header p {
        font-size: 16px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 500px;
    }

    .hero-slide-content {
        right: 5%;
        max-width: 450px;
    }

        .hero-slide-content h2 {
            font-size: 40px;
        }

        .hero-slide-content p {
            font-size: 18px;
        }

    /* Products Grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* Banner Grid */
    .banner-grid {
        grid-template-columns: 1fr;
    }

    .banner-item {
        height: 350px;
    }

    /* Quick View Modal */
    .quick-view-modal .modal {
        max-width: 700px;
    }
}

/* Tablets (max-width: 768px) */
@media screen and (max-width: 768px) {
    :root {
        --container-width: 720px;
        --spacing-3xl: 48px;
        --spacing-2xl: 32px;
    }

    /* Typography */
    .section-header h2 {
        font-size: 28px;
    }

    .section-header p {
        font-size: 15px;
    }

    /* Top Bar - Hide on tablet */
    .top-bar {
        display: none;
    }

    /* Header */
    .header-content {
        padding: 12px 0;
    }

    .logo h1 {
        font-size: 24px;
    }

    .logo-subtitle {
        font-size: 11px;
    }

    /* Navigation - Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
        order: -1;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--bg-white);
        box-shadow: var(--shadow-xl);
        padding: var(--spacing-2xl);
        transition: var(--transition-normal);
        overflow-y: auto;
        z-index: 2001;
    }

        .main-nav.active {
            right: 0;
        }

    .nav-menu {
        flex-direction: column;
        gap: 0;
    }

        .nav-menu > li {
            border-bottom: 1px solid var(--border-color);
        }

            .nav-menu > li > a {
                padding: 15px 0;
                font-size: 16px;
            }

                .nav-menu > li > a::after {
                    display: none;
                }

    /* Dropdown in mobile */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        padding: 0 var(--spacing-md);
        margin-top: var(--spacing-sm);
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
    }

    .has-dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown-menu a {
        padding: 10px 0;
    }

    /* Mobile menu backdrop */
    .nav-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transition: var(--transition-normal);
    }

        .nav-backdrop.active {
            opacity: 1;
            visibility: visible;
        }

    /* Header Actions */
    .header-actions {
        gap: var(--spacing-sm);
    }

    .search-btn,
    .wishlist-btn,
    .cart-btn {
        width: 36px;
        height: 36px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 400px;
    }

    .hero-slide-content {
        right: 5%;
        left: 5%;
        max-width: 100%;
        text-align: center;
    }

        .hero-slide-content h2 {
            font-size: 32px;
        }

        .hero-slide-content p {
            font-size: 16px;
        }

    .slider-controls {
        padding: 0 10px;
    }

    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }

    .feature-item {
        padding: var(--spacing-lg);
    }

    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .feature-item h3 {
        font-size: 18px;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-lg);
    }

    .category-card {
        height: 300px;
    }

    .category-overlay h3 {
        font-size: 20px;
    }

    /* Products Section */
    .products-filter {
        gap: var(--spacing-sm);
    }

    .filter-btn {
        padding: 8px 20px;
        font-size: 14px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--spacing-lg);
    }

    /* Product Card */
    .product-info {
        padding: var(--spacing-md);
    }

    .product-title {
        font-size: 15px;
    }

    .current-price {
        font-size: 18px;
    }

    /* Banner Section */
    .banner-item {
        height: 300px;
    }

    .banner-content {
        right: var(--spacing-lg);
    }

        .banner-content h3 {
            font-size: 26px;
        }

        .banner-content p {
            font-size: 16px;
        }

    /* Newsletter Section */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }

    .newsletter-text h2 {
        font-size: 28px;
    }

    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-xl);
    }

    /* Shop Page */
    .shop-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: var(--spacing-xl);
    }

    .content-area {
        width: 100%;
    }

    /* Product Detail */
    .product-detail-container {
        flex-direction: column;
    }

    .product-gallery {
        width: 100%;
        margin-bottom: var(--spacing-xl);
    }

    .product-main-info {
        width: 100%;
    }

    /* Quick View Modal */
    .quick-view-content {
        grid-template-columns: 1fr;
    }

    /* Cart */
    .cart-container {
        flex-direction: column;
    }

    .cart-items {
        width: 100%;
        margin-bottom: var(--spacing-xl);
    }

    .cart-summary {
        width: 100%;
    }

    /* Checkout */
    .checkout-container {
        flex-direction: column;
    }

    .checkout-form {
        width: 100%;
        margin-bottom: var(--spacing-xl);
    }

    .order-summary {
        width: 100%;
    }
}

/* Mobile Phones (max-width: 576px) */
@media screen and (max-width: 576px) {
    :root {
        --container-width: 100%;
        --spacing-3xl: 32px;
        --spacing-2xl: 24px;
    }

    .container {
        padding: 0 15px;
    }

    /* Typography */
    .section-header h2 {
        font-size: 24px;
    }

    .section-header p {
        font-size: 14px;
    }

    /* Header */
    .logo h1 {
        font-size: 20px;
    }

    .logo-subtitle {
        display: none;
    }

    .main-nav {
        width: 100%;
        right: -100%;
    }

    .header-actions {
        gap: 5px;
    }

    .search-btn,
    .wishlist-btn,
    .cart-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    /* Hero Slider */
    .hero-slider {
        height: 300px;
    }

    .hero-slide-content h2 {
        font-size: 24px;
        margin-bottom: var(--spacing-sm);
    }

    .hero-slide-content p {
        font-size: 14px;
        margin-bottom: var(--spacing-lg);
    }

    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .slider-dots {
        bottom: 15px;
    }

    .slider-dot {
        width: 8px;
        height: 8px;
    }

        .slider-dot.active {
            width: 20px;
        }

    /* Buttons */
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .btn-large {
        padding: 12px 30px;
        font-size: 16px;
    }

    .btn-small {
        padding: 6px 15px;
        font-size: 13px;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .feature-item {
        padding: var(--spacing-md);
    }

    .feature-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .feature-item h3 {
        font-size: 16px;
    }

    .feature-item p {
        font-size: 13px;
    }

    /* Categories Grid */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .category-card {
        height: 250px;
    }

    .category-overlay {
        padding: var(--spacing-lg);
    }

        .category-overlay h3 {
            font-size: 18px;
        }

    /* Products Section */
    .products-filter {
        flex-direction: column;
        width: 100%;
    }

    .filter-btn {
        width: 100%;
        padding: 10px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }

    /* Product Card */
    .product-image-container {
        aspect-ratio: 1 / 1;
    }

    .product-info {
        padding: var(--spacing-sm);
    }

    .product-category {
        font-size: 11px;
    }

    .product-title {
        font-size: 13px;
        min-height: 40px;
    }

    .product-rating {
        font-size: 12px;
    }

    .current-price {
        font-size: 16px;
    }

    .original-price {
        font-size: 13px;
    }

    .discount-percentage {
        font-size: 11px;
    }

    .add-to-cart-btn {
        padding: 8px;
        font-size: 13px;
    }

    .product-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    /* Banner Section */
    .banner-grid {
        gap: var(--spacing-md);
    }

    .banner-item {
        height: 200px;
    }

    .banner-content {
        right: var(--spacing-md);
    }

        .banner-content h3 {
            font-size: 20px;
        }

        .banner-content p {
            font-size: 14px;
        }

    /* Testimonials */
    .testimonial-item {
        padding: var(--spacing-lg);
    }

    .testimonial-avatar {
        width: 60px;
        height: 60px;
    }

    .testimonial-text {
        font-size: 15px;
    }

    .testimonial-author {
        font-size: 14px;
    }

    /* Newsletter Section */
    .newsletter-section {
        padding: var(--spacing-2xl) 0;
    }

    .newsletter-text h2 {
        font-size: 22px;
    }

    .newsletter-text p {
        font-size: 14px;
    }

    .newsletter-form input {
        padding: 12px 15px;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .footer-col h3 {
        font-size: 18px;
    }

    /* Scroll to Top */
    .scroll-to-top {
        width: 40px;
        height: 40px;
        bottom: 20px;
        left: 20px;
        font-size: 18px;
    }

    /* Breadcrumb */
    .breadcrumb {
        padding: var(--spacing-md) 0;
    }

        .breadcrumb li {
            font-size: 12px;
        }

    /* Shop Page - Sidebar */
    .sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-white);
        z-index: 2001;
        overflow-y: auto;
        transition: var(--transition-normal);
        padding: var(--spacing-lg);
    }

        .sidebar.active {
            right: 0;
        }

    .sidebar-close {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-md);
    }

    .filter-toggle {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-md);
    }

    /* Shop Header */
    .shop-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .results-count {
        font-size: 13px;
    }

    .shop-actions {
        width: 100%;
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .sort-by,
    .view-toggle {
        width: 100%;
    }

    #sortBy {
        width: 100%;
    }

    /* Product List View */
    .product-card.list-view {
        flex-direction: column;
    }

        .product-card.list-view .product-image-container {
            width: 100%;
        }

        .product-card.list-view .product-info {
            width: 100%;
        }

    /* Product Detail */
    .product-detail-info h1 {
        font-size: 22px;
    }

    .product-price .current-price {
        font-size: 24px;
    }

    .product-price .original-price {
        font-size: 18px;
    }

    .product-meta {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .product-actions-row {
        flex-direction: column;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }

    .product-action-buttons {
        width: 100%;
        flex-direction: column;
    }

    /* Tabs */
    .tabs-header {
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* Reviews */
    .review-item {
        padding: var(--spacing-md);
    }

    .review-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    /* Cart Page */
    .cart-item {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .cart-item-image {
        width: 100%;
        height: 200px;
    }

    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
    }

    .cart-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .coupon-form {
        flex-direction: column;
    }

    .summary-row {
        font-size: 14px;
    }

    .summary-total {
        font-size: 18px;
    }

    /* Checkout Page */
    .form-row {
        grid-template-columns: 1fr;
    }

    .order-item {
        gap: var(--spacing-sm);
    }

    .order-item-image {
        width: 60px;
        height: 60px;
    }

    /* Modal */
    .modal {
        width: 95%;
        padding: var(--spacing-lg);
        max-height: 85vh;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

        .modal-footer .btn {
            width: 100%;
        }

    /* Toast Notifications */
    .toast-container {
        top: 70px;
        left: 10px;
        right: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .toast-icon {
        font-size: 20px;
    }

    .toast-title {
        font-size: 14px;
    }

    .toast-message {
        font-size: 13px;
    }

    /* Pagination */
    .pagination {
        gap: 5px;
    }

    .page-btn {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }

    /* Search Overlay */
    .search-container input {
        padding: 15px 50px 15px 15px;
        font-size: 16px;
    }

    .search-result-item {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }

    .search-result-image {
        width: 50px;
        height: 50px;
    }

    .search-result-title {
        font-size: 13px;
    }

    .search-result-price {
        font-size: 14px;
    }
}

/* Extra Small Devices (max-width: 400px) */
@media screen and (max-width: 400px) {
    .hero-slider {
        height: 250px;
    }

    .hero-slide-content h2 {
        font-size: 20px;
    }

    .hero-slide-content p {
        font-size: 13px;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        max-width: 100%;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .banner-item {
        height: 180px;
    }

    .banner-content h3 {
        font-size: 18px;
    }

    .banner-content p {
        font-size: 13px;
    }
}

/* Landscape Mode for Mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 350px;
    }

    .sidebar,
    .main-nav {
        height: 100vh;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .breadcrumb,
    .scroll-to-top,
    .mobile-menu-toggle,
    .search-overlay,
    .toast-container,
    .product-actions,
    .sidebar {
        display: none !important;
    }

    body {
        background-color: white;
        color: black;
    }

    .container {
        max-width: 100%;
    }
}
