/* Pacific Innovation E-commerce - Responsive Styles */

/* ===== SMALL DEVICES (Mobile) ===== */
@media (max-width: 640px) {
    /* Base Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    h4 { font-size: 1.125rem; }
    
    /* Header */
    .header-top .container {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .contact-info span {
        display: block;
        margin-right: 0;
        margin-bottom: var(--spacing-xs);
    }
    
    .user-links a {
        margin: 0 var(--spacing-sm);
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: var(--spacing-md);
    }
    
    .cart-icon span,
    .account-icon span {
        display: none;
    }
    
    /* Navigation */
    .nav-menu {
        flex-direction: column;
        gap: 0;
        overflow-x: auto;
        white-space: nowrap;
        padding: var(--spacing-sm) 0;
    }
    
    .nav-menu li {
        display: inline-block;
    }
    
    .nav-menu a {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* Hero Section */
    .hero {
        padding: var(--spacing-xl) 0;
        margin-bottom: var(--spacing-xl);
        border-radius: var(--radius-lg);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .product-card {
        margin-bottom: var(--spacing-md);
    }
    
    /* Features */
    .feature-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .feature-item {
        padding: var(--spacing-md);
    }
    
    /* Cart Table */
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    
    .cart-table th,
    .cart-table td {
        padding: var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    /* Product Details */
    .product-detail {
        gap: var(--spacing-lg);
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .product-actions .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .footer-section {
        text-align: center;
    }
    
    .contact-details li {
        justify-content: center;
    }
    
    /* Utility Classes */
    .hidden-sm { display: none !important; }
    
    /* Buttons */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    /* Forms */
    .form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
    
    /* Container Padding */
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Spacing Adjustments */
    .main-content {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        margin-bottom: var(--spacing-xl);
    }
    
    .mt-5 { margin-top: var(--spacing-xl); }
    .mb-5 { margin-bottom: var(--spacing-xl); }
    .p-5 { padding: var(--spacing-xl); }
}

/* ===== MEDIUM DEVICES (Tablets) ===== */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Header */
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-bar {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: var(--spacing-md);
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Features */
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    /* Cart & Checkout */
    .cart-summary {
        margin-top: var(--spacing-xl);
    }
    
    /* Product Details */
    .product-detail {
        gap: var(--spacing-xl);
    }
    
    .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Utility Classes */
    .hidden-md { display: none !important; }
}

/* ===== LARGE DEVICES (Desktop) ===== */
@media (min-width: 1025px) {
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Features */
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Navigation Enhancements */
    .nav-menu {
        gap: var(--spacing-2xl);
    }
    
    /* Product Details Layout */
    .product-detail {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Cart Layout */
    .cart-container {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: var(--spacing-2xl);
    }
    
    /* Utility Classes */
    .hidden-lg { display: none !important; }
}

/* ===== EXTRA LARGE DEVICES ===== */
@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: var(--spacing-xl);
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 3.5rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .site-header,
    .site-footer,
    .btn,
    .product-actions,
    .search-bar,
    .header-actions {
        display: none !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
        font-size: 12pt !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .product-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-color: #f9fafb;
        --text-color: #e5e7eb;
        --text-light: #9ca3af;
        --border-color: #374151;
        --light-color: #111827;
        --white: #1f2937;
    }
    
    body {
        background-color: #111827;
        color: #e5e7eb;
    }
    
    .product-card,
    .cart-summary,
    .site-header,
    .form-control,
    .alert {
        background-color: var(--white);
    }
    
    .product-title a,
    .cart-table th,
    .form-label {
        color: var(--dark-color);
    }
    
    .cart-table th {
        background-color: #374151;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --primary-dark: #0000cc;
        --border-color: #000000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control {
        border: 2px solid var(--border-color);
    }
    
    .alert {
        border: 2px solid currentColor;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .product-card:hover {
        transform: none;
    }
    
    .product-card:hover .product-image img {
        transform: none;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .nav-menu a {
        padding: var(--spacing-md);
    }
    
    .product-actions .btn {
        min-height: 44px;
    }
    
    /* Increase touch targets */
    .thumbnail,
    .cart-item-remove,
    .search-form button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects for touch */
    .product-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .btn:hover {
        transform: none;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-height: 500px) and (orientation: landscape) {
    .site-header {
        position: static;
    }
    
    .hero {
        padding: var(--spacing-lg) 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== FOLDABLE DEVICES ===== */
@media (max-width: 320px) {
    .container {
        padding: 0 var(--spacing-xs);
    }
    
    .logo img {
        height: 40px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .cart-count {
        font-size: 0.625rem;
        min-width: 16px;
        padding: 0.0625rem 0.25rem;
    }
    
    .product-grid {
        gap: var(--spacing-md);
    }
    
    .product-info {
        padding: var(--spacing-md);
    }
    
    .product-title {
        font-size: 1rem;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
}

/* ===== 4K AND HIGH RESOLUTION SCREENS ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    body {
        font-size: 18px;
    }
    
    h1 { font-size: 4rem; }
    h2 { font-size: 3rem; }
    h3 { font-size: 2rem; }
    h4 { font-size: 1.5rem; }
    
    .product-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: var(--spacing-2xl);
    }
    
    .product-image {
        height: 300px;
    }
    
    .btn {
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
}