/**
 * Clean Mobile Styles for Two Time Heating & Cooling LLC
 * Target: Phones only (320px-768px)
 * Clean, fast, functional - no bloat
 * Version: 2.0 - Complete Rewrite
 */

 /* ======= ENSURE NAVIGATION LINKS ARE CLICKABLE =======
@media screen and (max-width: 768px) {
    nav ul li a {
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 1003;
    }
    
    nav ul li a:active {
        background-color: rgba(20, 154, 158, 0.1);
    }
} */

/* ======= MOBILE ONLY STYLES ======= */
@media screen and (max-width: 768px) {
    
    /* ======= BASE MOBILE SETUP ======= */
    * {
        -webkit-tap-highlight-color: rgba(20, 154, 158, 0.3);
        -webkit-overflow-scrolling: touch;
    }
    
    html {
        scroll-padding-top: 80px;
    }
    
    body {
        padding-bottom: 70px;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    section {
        padding: 3rem 0;
    }
    
    /* Prevent iOS zoom on form inputs */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="search"],
    textarea,
    select {
        font-size: 16px;
        -webkit-appearance: none;
        border-radius: 6px;
    }
    
    /* ======= TYPOGRAPHY ======= */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.8rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* ======= HEADER & NAVIGATION ======= */
    header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        min-height: 80px;
    }
    
    .logo {
        max-width: 70%;
        flex-shrink: 0;
    }
    
    .logo-image {
        height: 60px;
        max-width: 270px;
        width: auto;
    }
    
    .header-cta {
        display: none;
    }
    
    /* Mobile Toggle Button */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1003;
        position: relative;
    }
    
    .hamburger-line {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--primary-dark);
        margin: 2px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    /* Hamburger Animation */
    .mobile-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .mobile-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* CRITICAL FIX: Remove ALL potential click blockers */
    
    /* 1. Ensure overlay doesn't block nav clicks */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.2);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        /* CRITICAL: Don't block nav area */
        pointer-events: none;
    }
    
    .overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* 2. Ensure nav is above overlay and clickable */
    nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100vh;
        background-color: var(--white);
        padding: 2rem;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
        transition: right 0.3s ease;
        z-index: 1002; /* Above overlay */
        overflow-y: auto;
        display: block;
        pointer-events: auto;
    }
    
    nav.active {
        right: 0;
    }
    
    /* 3. CRITICAL: Ensure navigation links are completely clickable */
    nav ul {
        display: flex;
        flex-direction: column;
        padding: 3rem 0 0 0;
        margin: 0;
        list-style: none;
        pointer-events: auto;
        position: relative;
        z-index: 1003;
    }
    
    nav ul li {
        margin: 0 0 1.5rem 0;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--light-gray);
        display: block;
        pointer-events: auto;
        position: relative;
        z-index: 1003;
    }
    
    nav ul li:last-child {
        border-bottom: none;
    }
    
    /* 4. MOST CRITICAL: Navigation links must work */
    nav ul li a {
        display: block;
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 1004; /* Highest z-index */
        padding: 0.75rem 0;
        font-size: 1.1rem;
        color: var(--dark);
        text-decoration: none;
        font-weight: 600;
        font-family: var(--heading-font);
        text-transform: uppercase;
        letter-spacing: 0.025em;
        transition: color 0.3s ease;
        
        /* Remove any potential blockers */
        background: none;
        border: none;
        outline: none;
        box-shadow: none;
        transform: none;
        
        /* Ensure touch targets are large enough */
        min-height: 44px;
        min-width: 44px;
        
        /* Debug background to see if links are there */
        /* background-color: rgba(255, 0, 0, 0.1); */
    }
    
    /* Visual feedback */
    nav ul li a:active {
        background-color: rgba(20, 154, 158, 0.2);
        border-radius: 4px;
    }
    
    nav ul li a:hover,
    nav ul li a.active {
        color: var(--primary);
    }
    
    /* 5. Ensure hamburger toggle is properly positioned */
    .mobile-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
        z-index: 1005; /* Above everything */
        position: relative;
        pointer-events: auto;
    }
    
    /* 6. Remove any conflicting transforms or animations */
    nav *, nav ul *, nav ul li *, nav ul li a * {
        transform: none;
        animation: none;
    }
    
    /* Mobile Menu Contact Section */
    .mobile-menu-contact {
        display: block;
        padding: 2rem 0 1rem;
        border-top: 1px solid var(--light-gray);
        margin-top: 2rem;
    }
    
    .mobile-call-btn,
    .mobile-email-btn {
        display: block;
        width: 100%;
        padding: 1rem;
        margin-bottom: 1rem;
        background-color: var(--primary);
        color: var(--white);
        text-decoration: none;
        border-radius: 8px;
        text-align: center;
        font-weight: 600;
        transition: all 0.3s ease;
        box-sizing: border-box;
    }
    
    .mobile-call-btn {
        background-color: var(--secondary);
    }
    
    .mobile-call-btn:hover,
    .mobile-email-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        color: var(--white);
    }
    
    /* ======= HERO SECTION ======= */
    .hero {
        padding: 6rem 0 4rem;
        text-align: center;
        background-attachment: scroll;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero h1 {
        margin-bottom: 1.5rem;
    }
    
    .hero p {
        margin-bottom: 2rem;
        max-width: 100%;
    }
    
    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-cta .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        margin: 0;
    }
    
    .hero-image {
        display: none;
    }
    
    .hero-badges {
        display: none;
    }
    
    /* ======= PAGE HEADER ======= */
    .page-header {
        padding: 6rem 0 3rem;
        text-align: center;
    }
    
    .breadcrumbs {
        justify-content: center;
        font-size: 0.9rem;
    }
    
    /* ======= BUTTONS ======= */
    .btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        display: block;
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* ======= SERVICES SECTION ======= */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    .service-icon {
        width: 70px;
        height: 70px;
        font-size: 1.8rem;
    }
    
    /* ======= ABOUT SECTION ======= */
    .about-flex {
        flex-direction: column;
    }
    
    .about-image {
        margin-right: 0;
        margin-bottom: 2rem;
        max-width: 100%;
    }
    
    .about-badges {
        justify-content: center;
        text-align: center;
    }
    
    /* ======= FORMS ======= */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        min-width: 100%;
        flex: none;
    }
    
    .form-control {
        width: 100%;
        padding: 1rem;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    .form-label {
        font-size: 0.9rem;
    }
    
    /* ======= CONTACT PAGE ======= */
    .map-contact-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .map-container {
        min-width: unset;
        height: auto;
    }
    
    .map-frame {
        height: auto;
        padding: 6px;
        border-radius: 15px;
    }
    
    .map-frame iframe {
        height: 300px;
        border-radius: 12px;
    }
    
    .contact-info-section {
        min-width: unset;
        height: auto;
    }
    
    .contact-info-box {
        width: 100%;
        height: auto;
        min-height: 300px;
        padding: 2rem 1.5rem;
    }
    
    .contact-info-grid {
        gap: 2rem;
    }
    
    .contact-info-item {
        min-height: 70px;
    }
    
    .contact-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* ======= REVIEWS PAGE ======= */
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .review-form-container {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }
    
    .star-rating {
        gap: 0.25rem;
        justify-content: center;
    }
    
    .star {
        font-size: 1.75rem;
    }
    
    .service-checkboxes {
        grid-template-columns: 1fr;
    }
    
    /* ======= SERVICES PAGE ======= */
    .service-details {
        flex-direction: column;
        gap: 2rem;
    }
    
    .service-details-image,
    .service-details-content {
        min-width: unset;
        flex: none;
    }
    
    .services-nav {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    /* ======= PROJECTS PAGE ======= */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-info {
        flex-direction: column;
        gap: 2rem;
    }
    
    .project-gallery,
    .project-content {
        min-width: unset;
        flex: none;
    }
    
    /* ======= CERTIFICATIONS ======= */
    .certifications-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .certification-card {
        padding: 1.5rem 1rem;
        height: auto;
    }
    
    .certification-logo {
        height: 60px;
    }
    
    /* ======= CTA SECTION ======= */
    .cta-steps {
        flex-direction: column;
        gap: 2rem;
    }
    
    .cta-step {
        min-width: unset;
        flex: none;
    }
    
    .cta-step:not(:last-child):after {
        display: none;
    }
    
    .cta-inner {
        padding: 2rem;
    }
    
    /* ======= FOOTER ======= */
    .footer-logo-section {
        text-align: center;
        margin-bottom: 2rem;
        padding: 1rem 0;
    }
    
    .footer-logo {
        display: flex;
        flex-direction: column; /* ← KEY: Change to vertical layout */
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1.3rem;
        color: var(--white);
        gap: 1rem; /* ← KEY: Space between logo and text */
        margin-bottom: 1rem;
    }
    
    .footer-logo img {
        height: 80px; /* ← KEY: Bigger logo for mobile */
        width: auto;
        max-width: 120px;
        margin: 0; /* ← KEY: Remove right margin for vertical layout */
        object-fit: contain;
    }
    
    .footer-logo div {
        text-align: center;
        line-height: 1.2;
        margin: 0;
    }
    
    .footer-logo span {
        color: var(--secondary);
        display: block; /* ← KEY: Put on separate line */
        margin-top: 0.25rem;
    }
    
    /* Rest of existing footer mobile styles... */
    .footer-top {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        justify-content: center;
    }
    
    .footer-col {
        min-width: unset;
        max-width: unset;
        text-align: center;
        flex: none;
    }
    
    /* ======= MOBILE ACTION BAR ======= */
    .mobile-action-bar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: var(--white) !important;
        border-top: 1px solid var(--light-gray) !important;
        display: flex !important;
        z-index: 1000 !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
        padding: 0.5rem !important;
        
        /* Animation properties */
        transform: translateY(0) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* Hidden state when nav is open */
    .mobile-action-bar.nav-open {
        transform: translateY(100%) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                    visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    /* Enhanced action button animations */
    .action-btn {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 0.75rem 0.5rem !important;
        text-decoration: none !important;
        color: var(--primary-dark) !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        min-height: 60px !important;
        
        /* Enhanced transitions */
        transition: all 0.2s ease !important;
        transform: scale(1) !important;
    }
    
    /* Better touch feedback */
    .action-btn:active {
        transform: scale(0.95) !important;
        background-color: var(--light-gray) !important;
    }
    
    .action-btn:hover {
        background-color: var(--light-gray) !important;
        color: var(--primary) !important;
        transform: translateY(-2px) !important;
    }
    
    .action-btn i {
        font-size: 1.5rem !important;
        margin-bottom: 0.25rem !important;
        color: var(--primary) !important;
        transition: color 0.2s ease, transform 0.2s ease !important;
    }
    
    .action-btn.call-action i {
        color: var(--secondary) !important;
    }
    
    /* Icon animation on hover */
    .action-btn:hover i {
        transform: scale(1.1) !important;
    }
    
    /* ======= TEAM SECTION ======= */
    .team-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .team-member {
        text-align: center;
    }
    
    .team-social {
        justify-content: center;
    }
    
    /* ======= VALUES SECTION ======= */
    .values-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* ======= STATS SECTION ======= */
    .reviews-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

/* ======= HIDE MOBILE ELEMENTS ON DESKTOP ======= */
@media (min-width: 769px) {
    .mobile-toggle,
    .mobile-action-bar,
    .mobile-contact-buttons,
    .mobile-menu-contact {
        display: none;
    }
    
    body {
        padding-bottom: 0;
    }
}

@media (max-width: 576px) {
    .footer-logo img {
        height: 90px;
        max-width: 140px;
    }
    
    .footer-logo {
        font-size: 1.4rem;
        gap: 1.2rem;
    }
}