/* ========================================
   RESPONSIVE DESIGN
   Mobile-First Approach
   ======================================== */

/* ========================================
   MOBILE STYLES (Base - up to 767px)
   ======================================== */

/* Mobile Navigation */
@media (max-width: 767px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-xl);
        gap: var(--spacing-md);
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }

    .nav-menu.active {
        left: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    .nav-link {
        width: 100%;
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    /* Hero Section Mobile */
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Product Grid Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Typography Mobile */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .category-title {
        font-size: 2rem;
    }

    /* Container Mobile */
    .container {
        padding: 0 var(--spacing-md);
    }

    .section {
        padding: var(--spacing-2xl) 0;
    }

    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Product Card Mobile */
    .product-actions {
        flex-direction: column;
    }

    .product-actions .btn {
        width: 100%;
    }

    /* Buttons Mobile */
    .btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    /* Sell Page Steps Mobile */
    .step-container {
        padding: var(--spacing-lg);
    }

    .device-grid,
    .brand-grid,
    .model-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   TABLET STYLES (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {

    /* Product Grid Tablet */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    /* Navigation Tablet */
    .nav-menu {
        gap: var(--spacing-lg);
    }

    /* Hero Tablet */
    .hero h1 {
        font-size: 2.5rem;
    }

    /* Typography Tablet */
    h1 {
        font-size: 2.25rem;
    }

    h2 {
        font-size: 1.875rem;
    }

    .category-title {
        font-size: 2.25rem;
    }

    /* Footer Tablet */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Container Tablet */
    .container {
        padding: 0 var(--spacing-xl);
    }
}

/* ========================================
   DESKTOP STYLES (1024px and up)
   ======================================== */
@media (min-width: 1024px) {

    /* Product Grid Desktop */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Navigation Desktop - Show all items */
    .mobile-menu-toggle {
        display: none;
    }

    /* Hero Desktop */
    .hero {
        padding: 5rem 0;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    /* Product Card Hover Effects */
    .product-card {
        cursor: pointer;
    }

    .product-image-container {
        overflow: hidden;
    }

    /* Footer Desktop */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   LARGE DESKTOP (1280px and up)
   ======================================== */
@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-2xl);
    }

    .hero h1 {
        font-size: 4rem;
    }

    .category-title {
        font-size: 3rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    .header,
    .footer,
    .btn,
    .mobile-menu-toggle {
        display: none;
    }

    .container {
        max-width: 100%;
    }

    .product-card {
        page-break-inside: avoid;
    }
}

/* ========================================
   ACCESSIBILITY & REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Keyboard Navigation */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .product-card {
        border: 2px solid var(--gray-800);
    }

    .btn {
        border-width: 2px;
    }
}