/* ===========================================
   THERMOKIL LTD - RESPONSIVE STYLES
   Mobile-First Breakpoints
   =========================================== */

/* ===== DESKTOP LARGE (≤1440px) ===== */
@media (max-width: 1440px) {
    .container {
        max-width: 1140px;
    }

    .hero-title {
        font-size: var(--font-size-5xl);
    }
}

/* ===== DESKTOP (≤1024px) ===== */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .section-title {
        font-size: var(--font-size-3xl);
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .newspaper-layout {
        grid-template-columns: 350px 1fr;
        gap: var(--spacing-xl);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== TABLET (≤768px) ===== */
@media (max-width: 768px) {
    :root {
        --navbar-height: 70px;
        --section-padding-desktop: 60px 0;
    }

    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }

    /* Navbar Mobile */
    .navbar {
        padding: var(--spacing-sm) 0;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: var(--navbar-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--navbar-height));
        background: rgba(10, 10, 10, 0.98);
        flex-direction: column;
        padding: var(--spacing-xl);
        gap: var(--spacing-md);
        transition: left var(--transition-base);
        border-top: 1px solid var(--border-fire);
    }

    .navbar-menu.active {
        left: 0;
    }

    .navbar-link {
        font-size: var(--font-size-lg);
        padding: var(--spacing-sm) 0;
        width: 100%;
        text-align: center;
    }

    /* Hero */
    .hero {
        min-height: 90vh;
    }

    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-cta-group {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta-group .btn {
        width: 100%;
    }

    /* Moving Banner */
    .banner-item {
        font-size: var(--font-size-base);
    }

    /* Service Cards */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: var(--spacing-lg);
    }

    /* CRITICAL: Override inline styles for Services Section */
    #services > div > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-lg) !important;
    }

    /* Remove excessive padding-top on service text sections */
    #services div[style*="padding-top: 100px"] {
        padding-top: var(--spacing-md) !important;
    }

    /* Services banner title responsiveness */
    #services > div[style*="padding: 1.5rem"] h2 {
        font-size: 1.75rem !important;
    }

    #services > div[style*="padding: 1.5rem"] p {
        font-size: 0.95rem !important;
    }

    /* Service section headings on mobile */
    #services h3[style*="font-size: 1.8rem"] {
        font-size: 1.3rem !important;
    }

    /* Icon boxes in services */
    #services div[style*="width: 60px"] {
        width: 50px !important;
        height: 50px !important;
    }

    #services div[style*="width: 60px"] i {
        font-size: 22px !important;
    }

    /* Contact section grid fix */
    #contact .row[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-lg) !important;
    }

    /* Trust badges wrapping */
    #about div[style*="display: flex"] {
        justify-content: center !important;
    }

    /* New responsive classes for mobile */
    .services-banner {
        padding: 1rem 0;
        margin-bottom: var(--spacing-lg);
    }

    .service-banner-title {
        font-size: 1.75rem;
    }

    .service-banner-subtitle {
        font-size: 0.95rem;
    }

    .service-layout,
    .service-layout-reverse {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .service-text-content {
        padding-top: var(--spacing-md);
    }

    .service-heading-box {
        width: 50px;
        height: 50px;
    }

    .service-heading-box i {
        font-size: 24px;
    }

    .service-section-title {
        font-size: 1.3rem;
    }

    .service-image-card {
        aspect-ratio: 16 / 9;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    /* Contact form - ultra compact for mobile NO SCROLL */
    .contact-form-modal {
        width: 95%;
        max-height: 95vh;
    }

    .contact-form-modal .modal-body {
        padding: 16px;
    }

    .contact-form-header {
        margin-bottom: 12px;
    }

    .contact-form-icon {
        display: none;
    }

    .modal-title {
        font-size: 1.25rem;
        margin-bottom: 4px;
        padding-right: 50px; /* Extra padding on mobile to prevent X button overlap */
    }

    .modal-description {
        display: none;
    }

    .contact-form {
        gap: 12px;
    }

    .form-group {
        gap: 0px;
    }

    .form-group label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }

    .form-group label i {
        display: none;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .contact-form .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
        margin-top: 4px;
    }

    .form-privacy-note {
        margin-top: 6px;
        font-size: 0.6rem;
    }

    /* Redesign studies carousel for mobile - vertical layout */
    .studies-carousel {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }

    .carousel-arrow {
        width: 100%;
        max-width: 200px;
        height: 40px;
        margin: 0 auto;
    }

    .carousel-arrow-left {
        order: -1;
    }

    .carousel-arrow-right {
        order: 1;
    }

    .studies-track {
        order: 0;
        width: 100%;
    }

    .study-card {
        padding: var(--spacing-lg);
        padding-bottom: calc(var(--spacing-lg) + 40px);
        min-height: auto;
        position: relative;
        transition: max-height 0.3s ease;
    }

    .study-card-excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.6;
        transition: all 0.3s ease;
    }

    .study-card.expanded .study-card-excerpt {
        display: block;
        -webkit-line-clamp: unset;
    }

    /* Expand/collapse chevron - show on mobile */
    .study-card-expand {
        display: flex;
        position: absolute;
        bottom: var(--spacing-md);
        right: var(--spacing-md);
        width: 32px;
        height: 32px;
        background: rgba(255, 59, 48, 0.2);
        border: 1px solid var(--border-fire);
        border-radius: var(--border-radius-full);
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        color: var(--fire-red);
        font-size: 14px;
        z-index: 10;
    }

    .study-card-expand:hover {
        transform: scale(1.1);
    }

    .study-card-expand i {
        transition: transform 0.3s ease;
    }

    .study-card.expanded .study-card-expand i {
        transform: rotate(180deg);
    }

    /* Modal */
    .modal-overlay {
        padding: var(--spacing-md);
    }

    .modal-slideshow {
        height: 250px;
    }

    .modal-body {
        padding: var(--spacing-lg);
    }

    .modal-title {
        font-size: var(--font-size-2xl);
    }

    .modal-cta-group {
        flex-direction: column;
    }

    .modal-cta-group .btn {
        width: 100%;
    }

    /* Accordion */
    .accordion-header {
        padding: var(--spacing-md);
    }

    .accordion-icon {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }

    .accordion-title {
        font-size: var(--font-size-lg);
    }

    .accordion-body {
        padding: 0 var(--spacing-md) var(--spacing-md) var(--spacing-md);
    }

    /* Before/After Slider */
    .before-after-container {
        max-width: 100%;
    }

    .slider-button {
        width: 40px;
        height: 40px;
    }

    /* Newspaper Layout */
    .newspaper-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }

    .newspaper-image img {
        max-height: 300px;
    }

    /* Studies Carousel */
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }

    .studies-title {
        font-size: var(--font-size-xl);
    }

    .study-card {
        padding: var(--spacing-lg);
    }

    .study-card-title {
        font-size: var(--font-size-lg);
    }

    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Quick Testimonials Carousel */
    .quick-testimonials-section {
        padding: var(--spacing-md) 0;
    }

    .quick-testimonials-carousel {
        gap: var(--spacing-sm);
    }

    .testimonial-nav {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-base);
    }

    .quick-testimonials-track {
        min-height: 140px;
    }

    .quick-testimonial-content {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .quick-testimonial-text {
        font-size: var(--font-size-sm);
    }

    /* CTA Banner */
    .cta-banner {
        padding: var(--spacing-2xl) var(--spacing-md);
    }

    .cta-banner-title {
        font-size: var(--font-size-3xl);
    }

    .cta-banner-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-banner-buttons .btn {
        width: 100%;
    }

    /* Footer */
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-md);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    /* Back to Top */
    .back-to-top {
        bottom: var(--spacing-md);
        right: var(--spacing-md);
    }
}

/* ===== MOBILE (≤480px) ===== */
@media (max-width: 480px) {
    :root {
        --spacing-xl: 32px;
        --spacing-2xl: 48px;
        --spacing-3xl: 60px;
        --spacing-4xl: 80px;
    }

    /* Typography */
    h1 {
        font-size: var(--font-size-3xl);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .section-subtitle {
        font-size: var(--font-size-base);
    }

    /* Hero */
    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .hero-badge {
        font-size: 0.7rem;
        padding: 6px 12px;
    }

    /* Buttons */
    .btn {
        padding: 12px 24px;
        font-size: var(--font-size-sm);
    }

    .btn-lg {
        padding: 14px 30px;
        font-size: var(--font-size-base);
    }

    /* Service Cards */
    .service-title {
        font-size: var(--font-size-xl);
    }

    .service-benefits li {
        font-size: var(--font-size-sm);
    }

    /* Modal */
    .modal-overlay {
        padding: var(--spacing-sm);
    }

    .modal-slideshow {
        height: 200px;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-title {
        font-size: var(--font-size-xl);
    }

    /* Stats */
    .stat-number {
        font-size: var(--font-size-3xl);
    }

    .stat-label {
        font-size: var(--font-size-base);
    }

    /* CTA Banner */
    .cta-banner-title {
        font-size: var(--font-size-2xl);
    }

    .cta-banner-subtitle {
        font-size: var(--font-size-base);
    }

    /* New responsive classes for mobile */
    .service-banner-title {
        font-size: 1.5rem;
    }

    .service-banner-subtitle {
        font-size: 0.875rem;
    }

    .service-section-title {
        font-size: 1.1rem;
    }

    .service-heading-box {
        width: 45px;
        height: 45px;
    }

    .service-heading-box i {
        font-size: 20px;
    }

    .service-cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    /* Carousel mobile refinements */
    .studies-carousel {
        gap: var(--spacing-sm);
    }

    .carousel-arrow {
        height: 36px;
        font-size: var(--font-size-base);
    }

    .study-card {
        padding: var(--spacing-md);
    }

    .study-card-title {
        font-size: var(--font-size-lg);
    }

    .study-card-excerpt {
        font-size: var(--font-size-sm);
        -webkit-line-clamp: 3;
    }

    /* Footer */
    .social-links {
        justify-content: center;
    }
}

/* ===== MOBILE MEDIUM (≤390px) - iPhone 13/14 ===== */
@media (max-width: 390px) {
    .service-banner-title {
        font-size: 1.35rem;
    }

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

    .container {
        padding: 0 var(--spacing-sm);
    }

    .service-section-title {
        font-size: 1.05rem;
    }
}

/* ===== MOBILE SMALL (≤375px) - iPhone SE/11/12 mini ===== */
@media (max-width: 375px) {
    .service-banner-title {
        font-size: 1.25rem;
    }

    .service-section-title {
        font-size: 1rem;
    }

    .navbar-logo span {
        font-size: 1rem;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }

    .service-heading-box {
        width: 40px;
        height: 40px;
    }

    .service-heading-box i {
        font-size: 18px;
    }

    /* Carousel refinements for very small screens */
    .carousel-arrow {
        max-width: 150px;
        font-size: var(--font-size-sm);
    }

    .study-card-title {
        font-size: var(--font-size-base);
    }
}

/* ===== LANDSCAPE MODE (MOBILE/TABLET) ===== */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-4xl) 0;
    }

    .modal-overlay {
        padding: var(--spacing-sm);
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-slideshow {
        height: 200px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .hover-lift:hover {
        transform: none;
    }

    .service-card:hover::before {
        opacity: 0;
    }

    /* Increase touch target sizes */
    .btn {
        min-height: 48px;
    }

    .navbar-link {
        padding: var(--spacing-md) 0;
    }

    .accordion-header {
        padding: var(--spacing-lg);
    }

    .modal-close {
        width: 48px;
        height: 48px;
        font-size: var(--font-size-2xl);
    }

    /* Remove hover-dependent interactions */
    .service-card:active {
        transform: scale(0.98);
    }

    .testimonial-card:active {
        transform: scale(0.98);
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .hero-video-bg {
        display: none;
    }

    .moving-banner .banner-track {
        animation: none;
    }

    .btn-pulse {
        animation: none;
    }

    #fire-particles {
        display: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .border-fire {
        border-color: var(--fire-red);
    }

    .service-card {
        border-width: 2px;
    }

    .btn-fire {
        border: 2px solid var(--fire-red);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-video-bg,
    .fire-particles,
    .modal-overlay,
    .back-to-top,
    .cta-banner,
    .no-print {
        display: none !important;
    }

    .hero {
        min-height: auto;
        page-break-after: always;
    }

    .section-padding {
        padding: 30px 0;
    }

    .service-card,
    .testimonial-card,
    .stat-card {
        page-break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }

    .footer {
        border-top: 2px solid #000;
    }
}

/* ===== EXTRA SMALL DEVICES (≤360px) ===== */
@media (max-width: 360px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .hero-title {
        font-size: var(--font-size-xl);
    }

    .service-card {
        padding: var(--spacing-md);
    }

    .modal-body {
        padding: var(--spacing-sm);
    }

    .footer-contact-item {
        font-size: var(--font-size-sm);
    }
}

