/**
 * Responsive Design System for Novoshop Theme
 * Mobile-first approach with comprehensive breakpoints
 */

/* ============================================
   MOBILE FIRST BASE STYLES (320px+)
   ============================================ */

/* Base mobile styles are already in style.css */

/* ============================================
   SMALL MOBILE (320px - 479px)
   ============================================ */
@media (max-width: 479px) {
    /* Typography */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Container */
    .container {
        padding: 0 12px;
    }
    
    /* Header Mobile */
    .site-header {
        padding: 8px 0;
    }
    
    .header-logo img {
        max-height: 35px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-search {
        order: 2;
        width: 100%;
        margin: 0;
    }
    
    .header-actions {
        order: 3;
        justify-content: center;
        width: 100%;
    }
    
    .search-wrapper {
        border-radius: 20px;
    }
    
    .search-category {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .search-field {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .search-submit {
        padding: 8px 12px;
    }
    
    .user-link,
    .cart-link {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Navigation Mobile */
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .novoshop-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 10000;
        transition: right 0.3s ease;
        padding: 60px 20px 20px;
        overflow-y: auto;
    }
    
    .novoshop-menu.mobile-menu-open {
        right: 0;
    }
    
    .novoshop-menu ul {
        flex-direction: column;
        gap: 0;
    }
    
    .novoshop-menu li {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .novoshop-menu a {
        padding: 15px 0;
        font-size: 16px;
        border-bottom: none;
    }
    
    /* Product Grid Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 16px 0;
    }
    
    .product-card {
        padding: 10px;
    }
    
    .product-title {
        font-size: 14px;
        min-height: auto;
        margin: 8px 0;
    }
    
    .price {
        font-size: 15px;
    }
    
    /* Single Product Mobile */
    .novoshop-product-single {
        flex-direction: column;
        gap: 20px;
        padding: 16px 0;
    }
    
    .product-left,
    .product-right {
        width: 100%;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    /* Shop Layout Mobile */
    .shop-container {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }
    
    .shop-filters {
        width: 100%;
        margin-bottom: 0;
        padding: 12px;
    }
    
    .shop-products {
        width: 100%;
    }
    
    /* Buttons Mobile */
    .button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Gallery Mobile */
    .product-gallery .gallery-thumbs {
        gap: 6px;
        margin-top: 8px;
    }
    
    .product-gallery .gallery-thumbs img {
        width: 50px;
        height: 50px;
    }
}

/* ============================================
   LARGE MOBILE (480px - 767px)
   ============================================ */
@media (min-width: 480px) and (max-width: 767px) {
    /* Typography */
    body {
        font-size: 15px;
    }
    
    /* Container */
    .container {
        padding: 0 16px;
    }
    
    /* Header */
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-search {
        order: 2;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .header-actions {
        order: 3;
        justify-content: center;
    }
    
    /* Navigation */
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .product-card {
        padding: 12px;
    }
    
    /* Single Product */
    .novoshop-product-single {
        flex-direction: column;
        gap: 24px;
    }
    
    .product-left,
    .product-right {
        width: 100%;
    }
    
    /* Shop Layout */
    .shop-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .shop-filters {
        width: 100%;
    }
}

/* ============================================
   TABLET (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Typography */
    body {
        font-size: 16px;
    }
    
    /* Container */
    .container {
        padding: 0 20px;
    }
    
    /* Header */
    .header-content {
        flex-direction: row;
        gap: 20px;
    }
    
    .header-search {
        order: 2;
        flex: 1;
        max-width: 500px;
    }
    
    .header-actions {
        order: 3;
    }
    
    /* Navigation */
    .main-navigation {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .novoshop-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .novoshop-menu a {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }
    
    /* Single Product */
    .novoshop-product-single {
        flex-direction: row;
        gap: 28px;
    }
    
    .product-left {
        width: 45%;
    }
    
    .product-right {
        width: 55%;
    }
    
    /* Shop Layout */
    .shop-container {
        flex-direction: row;
        gap: 24px;
    }
    
    .shop-filters {
        width: 250px;
        flex: 0 0 250px;
    }
    
    .shop-products {
        flex: 1;
    }
}

/* ============================================
   DESKTOP (1024px - 1199px)
   ============================================ */
@media (min-width: 1024px) and (max-width: 1199px) {
    /* Container */
    .container {
        padding: 0 24px;
    }
    
    /* Header */
    .header-content {
        gap: 30px;
    }
    
    .header-search {
        max-width: 600px;
    }
    
    /* Navigation */
    .novoshop-menu {
        gap: 20px;
    }
    
    .novoshop-menu a {
        padding: 12px 14px;
        font-size: 15px;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
    
    /* Single Product */
    .novoshop-product-single {
        gap: 32px;
    }
    
    .product-left {
        width: 48%;
    }
    
    .product-right {
        width: 52%;
    }
    
    /* Shop Layout */
    .shop-filters {
        width: 280px;
        flex: 0 0 280px;
    }
}

/* ============================================
   LARGE DESKTOP (1200px+)
   ============================================ */
@media (min-width: 1200px) {
    /* Container */
    .container {
        padding: 0 32px;
    }
    
    /* Header */
    .header-content {
        gap: 40px;
    }
    
    .header-search {
        max-width: 700px;
    }
    
    /* Navigation */
    .novoshop-menu {
        gap: 30px;
    }
    
    .novoshop-menu a {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Product Grid */
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
    
    /* Single Product */
    .novoshop-product-single {
        gap: 40px;
    }
    
    /* Shop Layout */
    .shop-filters {
        width: 320px;
        flex: 0 0 320px;
    }
}

/* ============================================
   MOBILE-SPECIFIC ENHANCEMENTS
   ============================================ */

/* Touch-friendly elements */
@media (max-width: 767px) {
    /* Larger touch targets */
    .button,
    .user-link,
    .cart-link,
    .action-icon a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Improved spacing */
    .product-card {
        margin-bottom: 16px;
    }
    
    /* Better form elements */
    .search-field,
    .search-category {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Swipe gestures for mobile */
    .product-gallery {
        touch-action: pan-x;
    }
    
    /* Mobile-specific animations */
    .novoshop-menu {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }
    
    .novoshop-menu.mobile-menu-open {
        transform: translateX(0);
    }
}

/* ============================================
   LANDSCAPE ORIENTATION
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
    /* Header adjustments for landscape */
    .header-content {
        flex-direction: row;
        gap: 15px;
    }
    
    .header-search {
        order: 2;
        flex: 1;
    }
    
    .header-actions {
        order: 3;
    }
    
    /* Navigation for landscape */
    .novoshop-menu {
        width: 100%;
        height: auto;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: translateY(100%);
    }
    
    .novoshop-menu.mobile-menu-open {
        transform: translateY(0);
    }
}

/* ============================================
   HIGH DPI DISPLAYS
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp images on retina displays */
    .product-card img,
    .header-logo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    /* Hide non-essential elements */
    .site-header,
    .mobile-menu-toggle,
    .header-actions-icons,
    .shop-filters {
        display: none !important;
    }
    
    /* Optimize for print */
    .container {
        max-width: none;
        padding: 0;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
    
    /* Ensure text is readable */
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
    }
}

/* ============================================
   DARK MODE RESPONSIVE
   ============================================ */
@media (prefers-color-scheme: dark) and (max-width: 767px) {
    /* Mobile dark mode adjustments */
    .novoshop-menu {
        background: #1a1a1a;
        color: #fff;
    }
    
    .novoshop-menu a {
        color: #fff;
    }
    
    .novoshop-menu a:hover {
        color: var(--primary-color);
    }
    
    .mobile-menu-toggle {
        background: var(--primary-color);
    }
}

/* ============================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
   ============================================ */

/* Hide on mobile */
.hide-mobile {
    display: block;
}

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

/* Show only on mobile */
.show-mobile {
    display: none;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block !important;
    }
}

/* Hide on tablet and below */
.hide-tablet {
    display: block;
}

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

/* Show only on desktop */
.show-desktop {
    display: none;
}

@media (min-width: 1024px) {
    .show-desktop {
        display: block !important;
    }
}

/* Responsive text alignment */
.text-center-mobile {
    text-align: left;
}

@media (max-width: 767px) {
    .text-center-mobile {
        text-align: center;
    }
}

/* Responsive spacing */
.padding-mobile {
    padding: 20px;
}

@media (max-width: 767px) {
    .padding-mobile {
        padding: 12px;
    }
}

/* Responsive grid */
.grid-mobile-1 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 767px) {
    .grid-mobile-1 {
        grid-template-columns: 1fr;
    }
}
