/* 
 * Responsive CSS File for mediniainamukai.lt
 * Author: Mediniai Nameliai
 * Version: 1.0.0
 * Copyright 2025
 */

/* ==================== DESKTOP & LARGE DEVICES (≥992px) ==================== */
/* Styles to override mobile defaults for larger screens */
@media (min-width: 992px) {
    .main-nav {
        display: flex; /* Show the main navigation */
    }

    .mobile-menu-toggle {
        display: none; /* Hide the hamburger toggle */
    }

    .header-actions .btn {
        display: inline-block; /* Ensure quote button is visible if hidden on mobile */
    }
}

/* ==================== EXTRA LARGE DEVICES (≥1440px) ==================== */
@media (min-width: 1440px) {
    :root {
        --section-padding: 8rem;
    }

    .hero-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
}

/* ==================== LARGE DEVICES (1200px - 1439px) ==================== */
@media (max-width: 1439px) {
    .hero-title {
        font-size: 3.2rem;
    }

    .section-title {
        font-size: 2.3rem;
    }

    .about-text h3 {
        font-size: 1.8rem;
    }

    .counter-number {
        font-size: 2.2rem;
    }
}

/* ==================== MEDIUM DEVICES (992px - 1199px) ==================== */
@media (max-width: 1199px) {
    :root {
        --section-padding: 5rem;
    }

    .hero {
        height: 80vh;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.15rem;
    }

    .hero-buttons .btn {
        padding: 0.8rem 1.8rem;
    }

    .main-nav li {
        margin: 0 0.7rem;
    }

    .header-phone {
        margin-right: var(--spacing-md);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .experience-badge {
        width: 100px;
        height: 100px;
    }

    .experience-badge .years {
        font-size: 2rem;
    }

    .counter-item {
        min-width: 180px;
        padding: var(--spacing-lg);
    }

    .counter-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* ==================== SMALL DEVICES (768px - 991px) ==================== */
@media (max-width: 991px) {
    :root {
        --section-padding: 4rem;
    }

    .header-phone span {
        display: none;
    }

    .header-phone {
        font-size: 1.3rem;
        margin-right: var(--spacing-sm);
    }

    .hero {
        height: 70vh;
        min-height: 600px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-features {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    .header-actions .btn { /* Hide header button on small screens */
        display: none;
    }

    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
        z-index: 1001;
    }
    
    /* Ensure mobile menu is visible and properly styled */
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-overlay.active .mobile-menu-container {
        right: 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .section-title {
        font-size: 2rem;
    }

    .about-image, .about-text {
        flex: 0 0 100%;
    }

    .about-image {
        margin-bottom: var(--spacing-xl);
    }

    .counter-item {
        flex: 0 0 calc(50% - var(--spacing-lg));
        max-width: none;
    }

    .features-cta {
        flex-direction: column;
        text-align: center;
    }

    .features-cta-buttons {
        justify-content: center;
    }

    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .testimonial-card {
        padding: var(--spacing-lg);
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .footer-col {
        flex: 0 0 calc(50% - var(--spacing-lg));
    }

    .faq-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
        gap: 0;
    }

    .faq-tab {
        flex: 0 0 auto;
        white-space: nowrap;
        margin-right: var(--spacing-sm);
    }

    .modal-body {
        flex-direction: column;
    }

    .modal-image, .modal-details {
        min-width: 100%;
    }
}

/* ==================== EXTRA SMALL DEVICES (576px - 767px) ==================== */
@media (max-width: 767px) {
    :root {
        --section-padding: 3.5rem;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .hero {
        min-height: 500px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        width: 100%;
        margin: 0 0 var(--spacing-sm);
    }
    
    /* Improved mobile menu styling */
    .mobile-menu-container {
        width: 85%;
        padding: var(--spacing-lg);
    }
    
    .mobile-nav a {
        font-size: 1.1rem;
        padding: var(--spacing-xs) 0;
    }
    
    .mobile-menu-toggle span {
        height: 2px;
    }
    
    .mobile-menu-toggle.active span:nth-child(1),
    .mobile-menu-toggle.active span:nth-child(3) {
        background-color: var(--primary-color);
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle::before,
    .section-subtitle::after {
        display: none;
    }

    /* Center Product Card Content */
    .product-content {
        text-align: center;
    }
    .product-features { /* Center features within the card */
        justify-content: center;
    }
    .product-link { /* Center link within the card */
        justify-content: center;
    }

    /* Center Contact Info Cards */
    .contact-card {
        text-align: center;
    }
    .contact-icon { /* Center icon within the card */
        margin: 0 auto var(--spacing-sm);
    }
    .contact-details { /* Ensure details text is centered */
        text-align: center !important; /* Force centering */
    }
    .contact-details h3, /* Also center heading */
    .contact-details p,
    .contact-details a { /* Center text within details */
        text-align: center !important;
    }
    .contact-social { /* Center social section */
        text-align: center;
    }
    .social-links { /* Center social icons */
        justify-content: center;
    }

    .gallery-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
        justify-content: flex-start;
    }

    .gallery-filter {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .gallery-info h3 {
        font-size: 1.1rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        max-width: 350px;
        margin: 0 auto;
    }

    .counter-item {
        flex: 0 0 100%;
        margin-bottom: var(--spacing-md);
    }

    .testimonial-author img {
        width: 50px;
        height: 50px;
    }

    .back-to-top {
        right: 15px;
        bottom: 15px;
        width: 40px;
        height: 40px;
    }

    .accordion-header h3 {
        font-size: 1rem;
    }

    .footer-col {
        flex: 0 0 100%;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
        margin-top: var(--spacing-sm);
    }

    .modal-content {
        padding: var(--spacing-md);
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }
}

/* ==================== VERY SMALL DEVICES (<576px) ==================== */
@media (max-width: 575px) {
    :root {
        --section-padding: 3rem;
    }

    .hero {
        min-height: 450px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    /* Keep the button visible on mobile for better UX */
    .header-actions .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
    }

    .header.scrolled .logo img {
        height: 35px;
    }

    .header.scrolled .logo-text h1 {
        font-size: 1.1rem;
    }
    
    /* Improved header for very small devices */
    .header-content {
        padding: 5px 0;
    }
    
    .logo img {
        height: 40px;
        margin-right: var(--spacing-sm);
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text span {
        font-size: 0.75rem;
    }
    
    /* Ensure mobile menu toggle is easily tappable */
    .mobile-menu-toggle {
        width: 25px;
        height: 20px;
        margin-left: 10px;
    }
    
    .mobile-menu-toggle span:nth-child(1) {
        top: 0;
    }
    
    .mobile-menu-toggle span:nth-child(2) {
        top: 9px;
    }
    
    .mobile-menu-toggle span:nth-child(3) {
        top: 18px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        max-width: 300px;
        margin: 0 auto;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
    }

    .contact-icon {
        margin: 0 auto var(--spacing-sm);
    }
    .contact-details { /* Ensure details text is centered on very small screens too */
        text-align: center !important; /* Force centering */
    }
    .contact-details p,
    .contact-details a { /* Center text within details */
        text-align: center !important;
    }

    .cta-content h2 {
        font-size: 1.5rem;
    }

    .cta-content p {
        font-size: 1rem;
    }

    .cta-buttons .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }

    .modal-container {
        width: 95%;
    }
}

/* ==================== HEIGHT SPECIFIC QUERIES ==================== */
@media (max-height: 700px) {
    .hero {
        min-height: 450px;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: var(--spacing-md);
    }

    .hero-subtitle {
        margin-bottom: var(--spacing-lg);
    }

    .hero-buttons {
        margin-bottom: var(--spacing-lg);
    }
}

/* ==================== PRINT OVERRIDES ==================== */
@media print {
    body {
        font-size: 10pt;
    }

    .container {
        padding: 0;
    }

    .hero, 
    .cta,
    .testimonials,
    .contact-map {
        display: none;
    }

    .section-padding {
        padding: 10pt 0;
    }

    .gallery-grid {
        display: block;
    }

    .gallery-item {
        display: inline-block;
        width: 32%;
        margin: 0 0.5% 10pt;
        page-break-inside: avoid;
    }

    .feature-card {
        width: 48%;
        display: inline-block;
        margin: 0 1% 10pt;
        page-break-inside: avoid;
    }

    .footer {
        padding-top: 10pt;
        border-top: 1pt solid #ddd;
    }

    .footer-top {
        display: none;
    }
}

/* ==================== DEVICE-SPECIFIC FIXES ==================== */

/* Fix for iPhone X notch and newer models */
@supports (padding: max(0px)) {
    .header {
        padding-left: max(var(--container-padding), env(safe-area-inset-left));
        padding-right: max(var(--container-padding), env(safe-area-inset-right));
    }

    .hero-content {
        padding-left: max(var(--container-padding), env(safe-area-inset-left));
        padding-right: max(var(--container-padding), env(safe-area-inset-right));
    }

    .mobile-menu-container {
        padding-left: max(var(--spacing-xl), env(safe-area-inset-left));
        padding-right: max(var(--spacing-xl), env(safe-area-inset-right));
        padding-top: max(var(--spacing-xl), env(safe-area-inset-top));
        padding-bottom: max(var(--spacing-xl), env(safe-area-inset-bottom));
    }
}

/* ==================== SPECIAL RESOLUTIONS ==================== */

/* Ultra wide support */
@media (min-width: 2000px) {
    .container {
        max-width: 1800px;
    }

    .hero {
        height: 80vh;
    }
}

/* Tablet in portrait mode */
@media (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {
    .hero {
        min-height: 500px;
    }

    .hero-content {
        padding: 0 var(--spacing-lg);
    }
}

/* Mobile in landscape mode */
@media (max-width: 767px) and (orientation: landscape) and (max-height: 600px) {
    .hero {
        min-height: 400px;
    }

    .hero-title {
        font-size: 1.8rem;
        margin-bottom: var(--spacing-sm);
    }

    .hero-subtitle {
        margin-bottom: var(--spacing-md);
    }

    .hero-buttons {
        margin-bottom: var(--spacing-md);
    }

    .hero-features {
        flex-direction: row;
    }
}
