/**
 * ModReal - Complete Responsive CSS
 * Version: 2.0
 * Features: Mobile Navigation, Product Grids, Typography, Touch Optimizations
 */

/* ==========================================
   CSS Variables
   ========================================== */
:root {
    --white: #FFFFFF;
    --black: #1A1A1A;
    --gray: #6B7280;
    --light-gray: #F5F5F5;
    --border-gray: #E5E5E5;
    --accent: #4F46E5;
    --accent-hover: #4338ca;
    --success: #10B981;
    --warning: #f59e0b;
    --error: #ef4444;
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ==========================================
   Mobile Navigation - Hamburger Menu
   ========================================== */

/* Hamburger Button - Hidden on Desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1005;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.hamburger:hover {
    background: var(--light-gray);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--black);
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1003;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation Panel */
.nav-links {
    display: flex;
    gap: 36px;
    list-style: none;
    align-items: center;
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */

/* Tablet Landscape (769px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 24px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }
    
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* Mobile & Tablet Portrait (up to 768px) */
@media (max-width: 768px) {
    /* Top Bar */
    .top-bar {
        display: none !important;
    }
    
    /* Navigation */
    .nav {
        top: 0 !important;
        position: fixed;
        height: 60px;
    }
    
    .nav-inner {
        height: 60px;
        padding: 0 16px;
    }
    
    .logo {
        font-size: 1.3rem;
        z-index: 1005;
    }
    
    .nav-actions {
        gap: 8px;
    }
    
    .nav-icon {
        width: 24px;
        height: 24px;
    }
    
    /* Navigation Links - Mobile Panel */
    .nav-links {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        max-width: 80vw;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        padding: 80px 24px 24px;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
        transition: right 0.3s ease;
        z-index: 1004;
        overflow-y: auto;
        margin: 0;
        align-items: stretch;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        border-bottom: 1px solid var(--border-gray);
        width: 100%;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 16px 0;
        font-size: 16px;
        font-weight: 500;
        color: var(--black);
        text-align: left;
        text-decoration: none;
        transition: var(--transition);
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        color: var(--accent);
        padding-left: 8px;
    }
    
    /* Mobile Nav Actions (icons) */
    .nav-actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .nav-actions > a:not(.hamburger),
    .nav-actions > div {
        display: none;
    }
    
    .nav-actions > a:not(.hamburger):last-child {
        display: flex;
    }
    
    .sign-in {
        display: none !important;
    }
    
    /* Hero Section */
    .hero {
        margin-top: 60px;
        padding: 40px 0 60px;
        min-height: auto;
    }
    
    .hero-content {
        text-align: center;
        max-width: 100%;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
        margin-bottom: 16px;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 16px;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        padding: 14px 24px;
    }
    
    /* Sections */
    .section {
        padding: 48px 0;
    }
    
    .section-header {
        margin-bottom: 32px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    /* Product Grid */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }
    
    .product-card {
        border-radius: var(--radius-md);
    }
    
    .product-image {
        aspect-ratio: 1;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-category {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    
    .product-name {
        font-size: 0.9rem;
        margin-bottom: 4px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-price {
        font-size: 0.95rem;
    }
    
    .product-badge {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .blog-card {
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    
    .blog-image {
        aspect-ratio: 16/10;
    }
    
    .blog-content {
        padding: 16px 0;
    }
    
    .blog-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .blog-excerpt {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-item {
        padding: 24px 16px;
    }
    
    .feature-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    .feature-title {
        font-size: 1rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 16px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .btn-secondary,
    .btn-outline {
        width: 100%;
    }
    
    /* Footer */
    .footer {
        padding: 48px 0 24px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }
    
    .footer-brand {
        font-size: 1.3rem;
    }
    
    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    /* Article Pages */
    .article-header {
        padding: 100px 0 40px;
    }
    
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .article-featured-image {
        margin: 0 0 40px;
        border-radius: var(--radius-md);
    }
    
    .article-content {
        padding: 0 0 40px;
    }
    
    .article-content p {
        font-size: 1rem;
    }
    
    .share-section {
        flex-direction: column;
        gap: 16px;
        padding: 20px 0;
    }
    
    .share-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Related Section */
    .related-section {
        padding: 48px 0;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* FAQ */
    .faq-item {
        padding: 16px 0;
    }
    
    .faq-question {
        font-size: 1rem;
        padding-right: 40px;
    }
    
    .faq-answer {
        font-size: 0.95rem;
    }
    
    /* Cart & Checkout */
    .cart-items,
    .checkout-form {
        padding: 16px;
    }
    
    .cart-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .cart-item-image {
        width: 100%;
        height: 150px;
    }
    
    .cart-item-details {
        width: 100%;
    }
    
    .cart-summary {
        padding: 20px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        padding: 24px;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px 8px;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    /* Ensure buttons are touch-friendly */
    .btn {
        min-height: 48px;
        padding: 12px 20px;
    }
    
    /* Form inputs */
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    /* Cards */
    .product-card,
    .blog-card,
    .service-card {
        margin-bottom: 12px;
    }
    
    /* Filters */
    .filters-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-group {
        width: 100%;
        overflow-x: auto;
    }
    
    .filter-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Modal/Dialog */
    .modal-content {
        margin: 10px;
        padding: 20px;
    }
}

/* ==========================================
   Desktop Large Screens (1200px+)
   ========================================== */
@media (min-width: 1200px) {
    .container {
        max-width: 1240px;
    }
}

/* ==========================================
   Ultra Wide Screens (1400px+)
   ========================================== */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ==========================================
   Touch Device Optimizations
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .product-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }
    
    .product-card:hover .product-image img {
        transform: none;
    }
    
    .blog-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    /* Always show product actions on touch */
    .product-actions {
        opacity: 1 !important;
        transform: none !important;
    }
    
    /* Improve touch targets */
    a, button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Disable text selection on UI elements */
    .nav-links, .product-grid, .btn {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ==========================================
   Reduced Motion Preference
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hamburger span {
        transition: none;
    }
    
    .nav-links {
        transition: none;
    }
    
    .mobile-overlay {
        transition: none;
    }
}

/* ==========================================
   High Contrast Mode Support
   ========================================== */
@media (prefers-contrast: high) {
    :root {
        --border-gray: #000000;
        --gray: #000000;
    }
    
    .nav-links a:hover,
    .nav-links a.active {
        text-decoration: underline;
    }
    
    .btn {
        border: 2px solid var(--black);
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .nav,
    .top-bar,
    .hamburger,
    .mobile-overlay,
    .hero-buttons,
    .share-section,
    footer {
        display: none !important;
    }
    
    .hero {
        margin-top: 0;
        padding: 20px 0;
    }
    
    .article-header {
        padding: 20px 0;
    }
}

/* Navigation Menu Font Size Increase */
.nav-links a {
    font-size: 1.1rem !important;
}

/* Logo font also increased */
.logo {
    font-size: 1.8rem !important;
}


/* Global font size unification */
body {
    font-size: 16px !important;
    line-height: 1.6 !important;
}

p, li, span, div {
    font-size: inherit !important;
}


/* Navigation CSS import */

            background: rgba(255,255,255,0.3);
        }

        /* ========== MAIN NAVIGATION ========== */
        .nav {
            position: fixed;
            top: 40px;
            left: 0;
            right: 0;
            width: 100%;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(10px);
            z-index: 1001;
            border-bottom: 1px solid var(--border-gray);
        }

        .nav-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 72px;
        }

        .logo {
            font-size: 1.5rem;
            font-weight: 400;
            text-decoration: none;
            color: var(--black);
            letter-spacing: -0.02em;
        }

        .logo span:first-child {
            font-weight: 700;
        }

        .nav-links {
            display: flex;
            gap: 36px;
            list-style: none;
        }

        .nav-links > li {
            position: relative;
        }

        .nav-links a {
            color: var(--gray);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 500;
            transition: var(--transition);
            position: relative;
            padding: 10px 0;
            display: block;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: var(--black);
            transition: width 0.3s ease;
        }

        .nav-links a:hover {
            color: var(--black);
        }

        .nav-links a:hover::after {
            width: 100%;
        }
        /* ========== NAVIGATION DROPDOWN ========== */
        .nav-dropdown {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(10px);
            min-width: 220px;
            background: #FFFFFF;
            border-radius: 8px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.12);
            padding: 8px 0;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s ease;
            z-index: 100;
        }

        .nav-dropdown::before {
            content: '';
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid #FFFFFF;
        }

        .nav-links > li:hover .nav-dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
        }

        .nav-dropdown a {
            display: block;
            padding: 10px 20px;
            color: #1A1A1A;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .nav-dropdown a:hover {
            background: #4F46E5;
            color: #FFFFFF;
        }


        .nav-actions {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .nav-icon {
            width: 24px;
            height: 24px;
            cursor: pointer;
            color: var(--black);
            transition: var(--transition);
        }

        .nav-icon:hover {
            opacity: 0.7;
        }

        .nav-icon-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border-radius: 50%;
