/* ===============================================
   GLOBAL RESPONSIVE ENHANCEMENTS
   Mobile-first responsive design for all pages
   =============================================== */

/* ======================
   BASE RESPONSIVE SETUP
   ====================== */

/* Improve touch interactions on mobile */
@media (hover: none) and (pointer: coarse) {
    button, a, .clickable {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth transitions for all interactive elements */
button, a, input, select, textarea {
    transition: all 0.3s ease;
}

/* Prevent layout shift from scrollbar */
html {
    scrollbar-gutter: stable;
}

/* ======================
   HEADER RESPONSIVE
   ====================== */

@media (max-width: 1024px) {
    .header {
        padding: 1rem 0;
    }

    .header-content {
        gap: 1.5rem;
    }

    .site-logo {
        max-height: 45px;
    }

    .nav .nav-link {
        font-size: 0.9375rem;
        padding: 0.625rem 0.875rem;
    }

    .currency-selector {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: white;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .header-content {
        gap: 1rem;
    }

    .site-logo {
        max-height: 40px;
    }

    .mobile-menu-toggle {
        display: flex;
        padding: 0.5rem;
    }

    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        transition: right 0.3s ease;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        z-index: 10000;
    }

    .nav.active {
        right: 0;
    }

    .nav-container {
        flex-direction: column;
        padding: 1rem;
    }

    .nav .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem;
        border-radius: 8px;
    }

    .nav .nav-link:hover {
        background: #f8fafc;
    }

    .cart-badge {
        width: 36px;
        height: 36px;
    }

    .cart-badge svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 540px) {
    .header-content {
        padding: 0 0.75rem;
    }

    .site-logo {
        max-height: 36px;
    }

    .cart-badge {
        width: 32px;
        height: 32px;
    }
}

/* ======================
   HERO SECTION RESPONSIVE
   ====================== */

@media (max-width: 1024px) {
    .hero {
        padding: 4rem 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.125rem;
    }

    .hero-images {
        margin-top: 3rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 3rem 0;
    }

    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

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

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 540px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-content h1 {
        font-size: 1.75rem;
    }

    .hero-content p {
        font-size: 0.9375rem;
    }
}

/* ======================
   PRODUCTS GRID RESPONSIVE
   ====================== */

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-card {
        max-width: 100%;
    }
}

@media (max-width: 540px) {
    .product-card {
        padding: 1.25rem;
    }

    .product-card-image {
        height: 200px;
    }

    .product-card-title {
        font-size: 1.125rem;
    }

    .product-card-price {
        font-size: 1.25rem;
    }
}

/* ======================
   FORMS RESPONSIVE
   ====================== */

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem;
    }

    .form-group label {
        font-size: 0.9375rem;
    }
}

@media (max-width: 540px) {
    .form-group {
        margin-bottom: 1.25rem;
    }
}

/* ======================
   MODALS RESPONSIVE
   ====================== */

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 1rem;
        border-radius: 12px;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1.25rem;
    }
}

@media (max-width: 540px) {
    .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
}

/* ======================
   TABLES RESPONSIVE
   ====================== */

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
}

/* ======================
   CONTAINERS RESPONSIVE
   ====================== */

@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
        padding: 0 2rem;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 1024px;
        padding: 0 1.5rem;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 768px;
        padding: 0 1.25rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 0 0.875rem;
    }
}

/* ======================
   SECTIONS RESPONSIVE
   ====================== */

@media (max-width: 1024px) {
    section {
        padding: 4rem 0;
    }
}

@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }

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

    .section-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 540px) {
    section {
        padding: 2rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 0.9375rem;
    }
}

/* ======================
   UTILITIES RESPONSIVE
   ====================== */

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ======================
   PERFORMANCE OPTIMIZATIONS
   ====================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Can be extended for dark mode support */
}

/* High contrast mode */
@media (prefers-contrast: high) {
    button, a {
        border: 2px solid currentColor;
    }
}

/* ======================
   LANDSCAPE ORIENTATION
   ====================== */

@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 0.5rem 0;
    }

    .hero {
        padding: 2rem 0;
    }

    section {
        padding: 2rem 0;
    }
}
