/* ========================================
   Responsive Styles
   E-Commerce Moderno - Mobile First
*/

/* ========================================
   Base Mobile Styles (320px+)
   ======================================== */

/* Extra small devices */
@media (max-width: 480px) {
    :root {
        --spacing-lg: 1rem;
        --spacing-xl: 1.25rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Hero */
    .hero {
        padding-top: calc(70px + var(--spacing-2xl));
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-stats {
        gap: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    /* Filters */
    .filters {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: var(--spacing-sm);
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
    
    /* Products Grid */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Cart Sidebar */
    .cart-sidebar {
        max-width: 100%;
        right: -100%;
    }
    
    /* Checkout */
    .checkout-container {
        grid-template-columns: 1fr;
    }
    
    .checkout-summary {
        position: static;
        order: -1;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .payment-option {
        min-width: 100%;
    }
    
    /* Admin */
    .admin-container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: var(--spacing-md);
    }
    
    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: var(--spacing-sm);
    }
    
    .admin-nav-btn {
        flex-shrink: 0;
        font-size: 0.85rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .admin-nav-btn span {
        display: none;
    }
    
    .admin-content {
        padding: var(--spacing-md);
    }
    
    .admin-cards {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form button {
        width: 100%;
    }
    
    /* Modal */
    .modal-content {
        padding: var(--spacing-lg);
        margin: var(--spacing-md);
    }
    
    /* Toast */
    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }
    
    .toast {
        min-width: auto;
    }
}

/* ========================================
   Small Devices (481px - 767px)
   ======================================== */
@media (min-width: 481px) and (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   Medium Devices (768px - 1023px)
   ======================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-visual {
        display: flex;
    }
    
    .hero-circle {
        width: 300px;
        height: 300px;
    }
    
    .hero-card {
        width: 150px;
        height: 150px;
        font-size: 3.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkout-container {
        grid-template-columns: 1fr 320px;
    }
    
    .admin-container {
        grid-template-columns: 200px 1fr;
    }
}

/* ========================================
   Large Devices (1024px - 1279px)
   ======================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .hero-title {
        font-size: 3.25rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   Extra Large Devices (1280px+)
   ======================================== */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

/* ========================================
   Navigation Responsive
   ======================================== */
@media (max-width: 767px) {
    .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-actions {
        gap: var(--spacing-sm);
    }
    
    .btn-icon {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    .mobile-menu {
        display: none !important;
    }
}

/* ========================================
   Product Card Responsive
   ======================================== */
@media (max-width: 767px) {
    .product-image {
        height: 200px;
    }
    
    .product-info {
        padding: var(--spacing-md);
    }
    
    .product-name {
        font-size: 1rem;
    }
    
    .product-price {
        font-size: 1.25rem;
    }
    
    .product-actions {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   Table Responsive
   ======================================== */
@media (max-width: 767px) {
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: var(--spacing-sm);
    }
    
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3),
    .admin-table th:nth-child(5),
    .admin-table td:nth-child(5) {
        display: none;
    }
}

/* ========================================
   Landscape Orientation
   ======================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: auto;
        padding: calc(70px + var(--spacing-xl)) 0 var(--spacing-xl);
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-description {
        max-width: 100%;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
}

/* ========================================
   High DPI Displays
   ======================================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Increase border radius and shadows for retina displays */
    .product-card,
    .btn,
    .form-group input {
        border-radius: var(--radius-md);
    }
}

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Dark Mode Override (for light mode if needed)
   ======================================== */
@media (prefers-color-scheme: light) {
    /* Uncomment to enable light mode support
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f8fafc;
        --bg-card: #ffffff;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-muted: #94a3b8;
        --border-color: #e2e8f0;
    }
    */
}

/* ========================================
   Print
   ======================================== */
@media print {
    .header,
    .footer,
    .cart-sidebar,
    .mobile-menu,
    .filters-section,
    .product-actions,
    .add-to-cart-btn {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .product-card,
    .checkout-form,
    .checkout-summary {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .products-grid {
        display: block;
    }
    
    .product-card {
        margin-bottom: 1rem;
    }
}
