/* ============================================
   LECHI Furniture - Responsive Stylesheet
   Version: 1.0.0
   WordPress Ready
============================================ */

/* ============================================
   Extra Large Screens (1400px and up)
============================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1360px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
}

/* ============================================
   Large Screens (1200px - 1399px)
============================================ */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
        gap: var(--spacing-xl);
    }
}

/* ============================================
   Medium-Large Screens (992px - 1199px)
============================================ */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    /* Header */
    .nav-menu {
        gap: var(--spacing-lg);
    }
    
    .nav-menu > li > a {
        font-size: var(--font-size-sm);
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }
    
    .category-icon {
        width: 100px;
        height: 100px;
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-rows: repeat(2, 200px);
    }
    
    /* About */
    .about-grid {
        gap: var(--spacing-3xl);
    }
    
    .about-img-main img {
        height: 400px;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-2xl);
    }
}

/* ============================================
   Tablet Screens (768px - 991px)
============================================ */
@media (max-width: 991px) {
    :root {
        --spacing-4xl: 4rem;
    }
    
    .container {
        width: 100%;
        max-width: 720px;
        padding-right: 16px;
        padding-left: 16px;
        box-sizing: border-box;
    }
    
    /* Header */
    .header-top {
        display: none;
    }
    
    .main-nav {
        padding: var(--spacing-md) 0;
        background-color: var(--color-white);
    }
    
    .logo-main {
        color: var(--color-primary);
        font-size: var(--font-size-2xl);
    }
    
    .nav-menu {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle span {
        background-color: var(--color-primary);
    }
    
    .nav-actions button,
    .nav-actions a {
        color: var(--color-primary);
    }
    
    /* Hero */
    .hero-section {
        min-height: 600px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-desc {
        font-size: var(--font-size-base);
    }
    
    .hero-nav {
        display: none;
    }
    
    .hero-floating-icons {
        display: none;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-card a {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-filter {
        gap: var(--spacing-sm);
    }
    
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    /* About */
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-3xl);
    }
    
    .about-images {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .about-content {
        text-align: center;
    }
    
    .about-content .section-subtitle,
    .about-content .section-title {
        text-align: center;
    }
    
    .about-features {
        justify-content: center;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
    }
    
    .gallery-item.large,
    .gallery-item.tall {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    /* Instagram */
    .instagram-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        width: 100%;
        max-width: 100%;
    }
    
    /* Promo Banner */
    .promo-banner {
        height: 400px;
    }
    
    .promo-content h2 {
        font-size: var(--font-size-4xl);
    }
}

/* ============================================
   Small Tablet / Large Phone (576px - 767px)
============================================ */
@media (max-width: 767px) {
    :root {
        --spacing-4xl: 3rem;
        --spacing-3xl: 2.5rem;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding-right: 16px;
        padding-left: 16px;
        box-sizing: border-box;
    }
    
    /* Typography */
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-desc {
        font-size: var(--font-size-base);
    }
    
    /* Hero */
    .hero-section {
        min-height: 550px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xs);
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .category-card a {
        display: flex;
        align-items: center;
        padding: var(--spacing-lg);
        text-align: right;
    }
    
    .category-icon {
        width: 80px;
        height: 80px;
        margin: 0 0 0 var(--spacing-lg);
    }
    
    .category-content h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Products */
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .products-filter {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* About */
    .about-img-main img {
        height: 300px;
    }
    
    .about-img-secondary {
        position: relative;
        bottom: auto;
        left: auto;
        width: 100%;
        margin-top: var(--spacing-lg);
    }
    
    .about-img-secondary img {
        height: 200px;
    }
    
    .about-experience {
        position: relative;
        top: auto;
        right: auto;
        display: inline-block;
        margin-top: var(--spacing-lg);
    }
    
    .about-features {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .feature-item {
        justify-content: center;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: var(--spacing-xl);
    }
    
    /* Gallery */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        aspect-ratio: 16/9;
    }
    
    /* Testimonials */
    .testimonial-card {
        padding: var(--spacing-xl);
    }
    
    .testimonial-text {
        font-size: var(--font-size-base);
    }
    
    /* Instagram */
    .instagram-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-text h2 {
        font-size: var(--font-size-2xl);
    }
    
    /* Promo Banner */
    .promo-banner {
        height: 350px;
    }
    
    .promo-content h2 {
        font-size: var(--font-size-3xl);
    }
    
    .promo-content p {
        font-size: var(--font-size-base);
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-col h3::after {
        right: 50%;
        transform: translateX(50%);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .contact-list li {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}

/* ============================================
   Mobile Phones (max-width: 575px)
============================================ */
@media (max-width: 575px) {
    :root {
        --spacing-4xl: 2.5rem;
        --spacing-3xl: 2rem;
        --container-padding: 15px;
    }
    
    body {
        font-size: 14px;
    }
    
    /* Header */
    .main-nav {
        padding: var(--spacing-sm) 0;
    }
    
    .logo-main {
        font-size: var(--font-size-xl);
    }
    
    .logo-sub {
        font-size: 8px;
        letter-spacing: 4px;
    }
    
    .nav-actions {
        gap: var(--spacing-sm);
    }
    
    .nav-actions button,
    .nav-actions a {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
    
    .nav-actions .count {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    /* Hero */
    .hero-section {
        min-height: 500px;
    }
    
    .hero-content {
        padding: 0 var(--spacing-md);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-desc {
        font-size: var(--font-size-sm);
    }
    
    /* Section Headers */
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-xs);
        letter-spacing: 2px;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-sm);
    }
    
    .btn-lg {
        padding: var(--spacing-md) var(--spacing-xl);
    }
    
    /* Category Cards */
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-content h3 {
        font-size: var(--font-size-base);
    }
    
    .category-count {
        font-size: var(--font-size-xs);
    }
    
    /* Product Cards */
    .product-info {
        padding: var(--spacing-md);
    }
    
    .product-title {
        font-size: var(--font-size-base);
    }
    
    .current-price {
        font-size: var(--font-size-lg);
    }
    
    .btn-add-cart {
        padding: var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    /* About */
    .about-img-main img {
        height: 250px;
    }
    
    /* Services */
    .service-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-xl);
    }
    
    .service-card h3 {
        font-size: var(--font-size-lg);
    }
    
    /* Promo */
    .promo-banner {
        height: 300px;
    }
    
    .promo-content h2 {
        font-size: var(--font-size-2xl);
    }
    
    /* Testimonials */
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    
    /* Newsletter */
    .newsletter-section {
        padding: var(--spacing-2xl) 0;
    }
    
    .newsletter-text h2 {
        font-size: var(--font-size-xl);
    }
    
    .newsletter-text p {
        font-size: var(--font-size-sm);
    }
    
    /* Footer */
    .footer-top {
        padding: var(--spacing-2xl) 0;
    }
    
    .footer-logo .logo-main {
        font-size: var(--font-size-2xl);
    }
    
    .footer-col h3 {
        font-size: var(--font-size-base);
    }
    
    /* Back to Top */
    .back-to-top {
        width: 40px;
        height: 40px;
        bottom: var(--spacing-md);
        left: var(--spacing-md);
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-body {
        padding: var(--spacing-lg);
    }
}

/* ============================================
   Extra Small Phones (max-width: 375px)
============================================ */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .promo-content h2 {
        font-size: var(--font-size-xl);
    }
    
    .instagram-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Landscape Orientation
============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-desc {
        display: none;
    }
}

/* ============================================
   High DPI Screens
============================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* High resolution image adjustments if needed */
}

/* ============================================
   Print Styles
============================================ */
@media print {
    .header,
    .footer,
    .back-to-top,
    .nav-actions,
    .hero-nav,
    .scroll-indicator,
    .hero-floating-icons {
        display: none !important;
    }
    
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-overlay {
        display: none;
    }
    
    .hero-content {
        color: #000;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
}

/* ============================================
   Reduced Motion
============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-slide {
        animation: none;
    }
    
    .scroll-dot {
        animation: none;
    }
    
    .preloader-progress .progress-bar {
        animation: none;
        width: 100%;
    }
}

/* ============================================
   Dark Mode Support (Optional)
============================================ */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* ============================================
   Touch Devices
============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects for touch devices */
    .product-actions {
        opacity: 1;
        transform: none;
    }
    
    .category-overlay {
        opacity: 1;
        transform: none;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    }
    
    .gallery-overlay {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    .gallery-zoom {
        transform: scale(1);
    }
    
    .instagram-overlay {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.3);
    }
    
    /* Disable custom cursor on touch */
    .custom-cursor {
        display: none !important;
    }
}

/* ============================================
   RTL Specific Adjustments
============================================ */
[dir="rtl"] .btn:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .hero-buttons .btn i {
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

[dir="rtl"] .dropdown-menu li a:hover {
    padding-right: var(--spacing-lg);
    padding-left: var(--spacing-xl);
}

[dir="rtl"] .footer-links ul a:hover,
[dir="rtl"] .footer-categories ul a:hover {
    padding-right: 0;
    padding-left: var(--spacing-sm);
}

/* ============================================
   MOBILE PERFORMANCE & LAYOUT FIXES
   v8 — Critical fixes for mobile rendering
============================================ */

/* ── Global mobile reset ── */
@media (max-width: 991px) {

    /* Fix overflow on body/html */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Fix container to full width */
    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    /* Disable AOS animations immediately on mobile */
    [data-aos] {
        opacity: 1 !important;
        transform: translateY(0) !important;
        transition: none !important;
        animation: none !important;
    }

    /* No custom cursor on mobile */
    .custom-cursor { display: none !important; }

    /* Disable parallax on mobile */
    [data-parallax] { transform: none !important; }

    /* Fix images overflow */
    img { max-width: 100%; height: auto; }

    /* Fix sections padding */
    section, .section {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ── Small phones (<576px) ── */
@media (max-width: 575px) {

    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Prevent any element from overflowing */
    * {
        max-width: 100vw;
        word-break: break-word;
    }

    /* Hero fix on small screens */
    .hero-section {
        min-height: 480px;
        height: auto;
    }

    .hero-slide {
        min-height: 480px;
    }

    .hero-content {
        padding: 20px 16px;
    }

    .hero-title {
        font-size: clamp(1.4rem, 7vw, 2rem);
        line-height: 1.3;
    }

    .hero-desc {
        font-size: 14px;
        line-height: 1.6;
    }

    /* Fix product grid on mobile */
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-card {
        max-width: 100%;
        margin: 0;
    }

    /* Fix footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* Fix WooCommerce shop on mobile */
    .woocommerce ul.products {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* Header fix */
    .header { width: 100%; max-width: 100vw; }
    .nav-content { padding: 0 12px; }

    /* Fix section titles */
    .section-title {
        font-size: clamp(1.3rem, 6vw, 1.8rem);
    }
}

/* ── Extra small phones (<400px) ── */
@media (max-width: 400px) {

    .products-grid,
    .woocommerce ul.products {
        grid-template-columns: 1fr !important;
    }

    .hero-title {
        font-size: 1.3rem;
    }

    .hero-buttons {
        gap: 8px;
    }

    .btn {
        font-size: 13px;
        padding: 10px 16px;
    }
}
