/* 
 * QR Menu System - Responsive CSS
 * Contains responsive design styles for the QR Menu System
 */

/* Base responsive adjustments */
@media (min-width: 1200px) {
    .product-details {
        flex-direction: row;
        gap: var(--space-xlarge);
    }
    
    .product-image {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .product-info {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 1024px) {
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .container {
        padding: 0 var(--space-medium);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-medium);
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        /*grid-template-columns: 1fr;*/
        gap: var(--space-medium);
    }
    
    .product-item-image {
        width: 40vw;
        height: 50vw;
    }
    
    .product-details {
        gap: var(--space-medium);
    }
    
    .product-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-small);
    }
    
    /* Improved touch targets for mobile */
    .language-btn, 
    .back-btn,
    .category-card,
    .product-item {
        /*min-height: 44px;*/
    }

    .language-btn,
    .back-btn {
        padding: 10px 10px;
        border: solid 1px #f5d6c2;
        color: #f5d6c2;
    }
    
    /* Adjust spacing for mobile */
    .page {
        padding: var(--space-medium) 0;
    }
    
    .header {
        margin-bottom: var(--space-large);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    h3 {
        font-size: 16px;
    }
    
    .language-grid {
        grid-template-columns: 1fr;
    }

    .product-item {
        flex-direction: column;
        background-color: #f5d6c2;
        color: #245b4e;
        border: solid 1px #f5d6c2;
        text-align: center;
    }

    .product-item-image {
        width: 45vw;
        height: 35vw;
    }
    
    .product-item-content {
        padding: 8px;/*var(--space-medium);*/
    }
    
    .allergen-list {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .container {
        padding: 0 var(--space-small);
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .category-card:active {
        transform: translateY(-5px);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    
    .product-item:active {
        background-color: rgba(255, 255, 255, 0.15);
    }
    
    /* Larger touch targets */
    .language-btn, 
    .back-btn {
        /*padding: 14px 18px;*/
    }
    
    .allergen-item {
        padding: 10px 16px;
    }
}

/* Tablet-specific adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .language-grid {
        max-width: 500px;
    }
    
    .category-grid {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .language-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .language-card img {
        width: 60px;
        height: 60px;
    }
    
    .category-card {
        height: 150px;
    }
}

/* High-DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        background-size: contain;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
        font-size: 12pt;
    }
    
    .header, .footer, .language-selector, .back-btn {
        display: none;
    }
    
    .product-details {
        display: block;
    }
    
    .product-image {
        max-width: 50%;
        margin: 0 auto;
    }
    
    .product-price {
        color: black;
        font-weight: bold;
    }
    
    a {
        color: black;
        text-decoration: none;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --deep-forest-green: #0a2a1c;
    }
}

/* Accessibility enhancements */
@media (prefers-contrast: high) {
    :root {
        --deep-forest-green: #0a3d1a;
        --pure-white: #ffffff;
        --accent-gold: #ffcc00;
    }
    
    .product-item-description {
        color: var(--pure-white);
    }
    
    .category-card-content {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .language-card, .product-item, .category-card {
        border: 1px solid var(--pure-white);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    
    .stagger-item {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Larger screens */
@media (min-width: 1400px) {
    .container {
        max-width: 100vw;
    }
    
    body {
        font-size: 18px;
    }
    
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    h3 {
        font-size: 22px;
    }
}
