/* Mobile-First Responsive Fixes for Winter Property Theme */
/* ========================================================= */

/* Base Mobile Styles (320px - 767px) */
@media (max-width: 767px) {
    
    /* === GLOBAL FIXES === */
    body {
        font-size: 14px;
        line-height: 1.5;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    /* Prevent horizontal scroll */
    *, *::before, *::after {
        max-width: 100vw;
    }
    
    /* === HEADER & NAVIGATION FIXES === */
    
    /* Contact Info Bar */
    .contact-info-bar {
        display: none; /* Hide on mobile - too cluttered */
    }
    
    /* Site Header */
    .site-header {
        padding: 10px 0;
        position: sticky;
        top: 0;
        z-index: 9999;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
    }
    
    .site-branding {
        flex: 1;
    }
    
    .site-title {
        font-size: 1.3rem !important;
        margin: 0;
    }
    
    .site-description {
        display: none; /* Hide tagline on mobile */
    }
    
    /* Mobile Navigation - Hamburger Menu */
    .menu-toggle {
        display: block !important;
        background: #3b4331;
        color: white;
        border: none;
        padding: 8px 12px;
        border-radius: 4px;
        font-size: 24px;
        cursor: pointer;
        position: relative;
        z-index: 10001;
    }
    
    .menu-toggle .screen-reader-text {
        display: none;
    }
    
    .main-navigation {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 60px);
        background: white;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
        z-index: 10000;
        overflow-y: auto;
    }
    
    .main-navigation.toggled {
        left: 0;
    }
    
    .main-navigation ul {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #e0e0e0;
    }
    
    .main-navigation a {
        display: block;
        padding: 15px 20px;
        color: #3b4331;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
    }
    
    .main-navigation a:active,
    .main-navigation a:focus {
        background: #f0f4ec;
    }
    
    /* Overlay when menu is open */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    /* === HERO SECTION MOBILE === */
    .hero-section {
        padding: 20px 0 !important;
    }
    
    .hero-section > div {
        grid-template-columns: 1fr !important;
        padding: 0 15px !important;
        gap: 1rem !important;
    }
    
    .hero-section img {
        width: 200px !important;
        max-width: 200px !important;
        height: auto !important;
        margin: 0 auto 1rem !important;
        display: block !important;
        float: none !important;
    }
    
    .hero-content {
        text-align: center !important;
        padding: 0 !important;
    }
    
    .hero-content h1 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-content p {
        font-size: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-content .btn {
        display: block !important;
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 12px 20px !important;
        font-size: 16px !important;
    }
    
    /* === CONTENT SECTIONS === */
    .content-section {
        padding: 2rem 0;
        margin: 0;
    }
    
    .content-card {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem;
    }
    
    h3 {
        font-size: 1.25rem !important;
        margin-bottom: 0.75rem;
    }
    
    p {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    /* === SERVICE CARDS MOBILE === */
    .services-grid {
        display: block !important;
    }
    
    .service-card,
    .service-item {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border-left: 3px solid #3b4331 !important;
    }
    
    .service-card h3,
    .service-item h3 {
        font-size: 1.1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .service-card ul,
    .service-item ul {
        padding-left: 1.25rem !important;
        font-size: 14px;
    }
    
    .service-icon {
        font-size: 1.5rem !important;
    }
    
    /* === CONTACT PAGE MOBILE === */
    .contact-info-grid {
        display: block !important;
        padding: 0;
    }
    
    .contact-info-item {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
        background: #f8f9fa;
        border-radius: 8px;
        border-left: 3px solid #3b4331;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .contact-info-item h4 {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .contact-info-item p {
        margin-bottom: 0.25rem;
    }
    
    .contact-info-item a {
        font-size: 14px !important;
        word-break: break-all;
        display: inline-block;
    }
    
    .contact-info-item small {
        font-size: 12px;
        color: #666;
    }
    
    /* === CONTACT FORM MOBILE === */
    .contact-form {
        padding: 1.25rem !important;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .form-row {
        display: block !important;
        margin-bottom: 0;
    }
    
    .form-group {
        margin-bottom: 1rem !important;
        width: 100% !important;
    }
    
    .form-group label {
        font-size: 14px !important;
        font-weight: 600;
        margin-bottom: 5px !important;
        display: block;
    }
    
    .contact-form input[type="text"],
    .contact-form input[type="email"],
    .contact-form input[type="tel"],
    .contact-form select,
    .contact-form textarea {
        width: 100% !important;
        padding: 12px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        border: 1px solid #ddd !important;
        border-radius: 6px !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background: white;
    }
    
    /* Fix dropdown arrow */
    .contact-form select {
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 20px;
        padding-right: 40px !important;
    }
    
    .contact-form textarea {
        min-height: 100px;
        resize: vertical;
    }
    
    .contact-form .btn {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        font-weight: 600;
        background: #3b4331;
        color: white;
        border: none;
        border-radius: 6px;
        cursor: pointer;
    }
    
    /* === BUTTONS === */
    .btn {
        display: inline-block !important;
        padding: 12px 24px !important;
        font-size: 16px !important;
        border-radius: 6px !important;
        text-decoration: none !important;
        text-align: center !important;
        transition: all 0.3s ease !important;
        cursor: pointer;
    }
    
    .btn-primary {
        background: #3b4331 !important;
        color: white !important;
    }
    
    /* === TESTIMONIALS PAGE MOBILE === */
    .testimonial-card,
    .content-card {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 12px !important;
    }

    /* === MOBILE STACK CLASS - FORCE SINGLE COLUMN === */
    .mobile-stack {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    .mobile-stack > div,
    .mobile-stack > section,
    .mobile-stack > article {
        margin-bottom: 1.5rem !important;
        width: 100% !important;
    }

    /* Process steps on services page */
    .process-steps {
        display: block !important;
    }

    .process-steps > div {
        margin-bottom: 2rem !important;
    }

    /* Hide connecting line on mobile */
    .process-steps > div[style*="position: absolute"] {
        display: none !important;
    }

    /* Mobile button stack */
    .mobile-stack-buttons {
        flex-direction: column !important;
        width: 100% !important;
    }

    .mobile-stack-buttons a {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
    }

    /* Service areas grid on contact page */
    [style*="grid-template-columns: repeat(4"] {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    /* FAQ page styles */
    .faq-item,
    [style*="border-left: 4px solid"] {
        margin-bottom: 1rem !important;
    }

    /* === FOOTER MOBILE === */
    .site-footer {
        padding: 2rem 0 !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    .footer-column h3 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .footer-contact {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .footer-contact-item {
        text-align: center;
    }
    
    /* === MODAL FIXES === */
    .contact-modal .modal-content {
        width: 95% !important;
        max-width: 350px !important;
        padding: 20px !important;
    }
    
    /* === UTILITY OVERRIDES === */
    .text-center {
        text-align: center !important;
    }
    
    .mb-2 {
        margin-bottom: 1rem !important;
    }
    
    .mt-2 {
        margin-top: 1rem !important;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .site-title {
        font-size: 1.2rem !important;
    }
    
    .hero-content h1 {
        font-size: 1.3rem !important;
    }
    
    .hero-section img {
        width: 150px !important;
        max-width: 150px !important;
    }
    
    h1 {
        font-size: 1.5rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    .content-card {
        padding: 1rem !important;
    }
    
    .service-card,
    .service-item {
        padding: 1rem !important;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 750px;
        padding: 0 20px;
    }
    
    .hero-section > div {
        grid-template-columns: 300px 1fr !important;
    }
    
    .hero-section img {
        width: 280px !important;
    }
    
    .hero-content h1 {
        font-size: 2rem !important;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .contact-info-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* === JAVASCRIPT MENU TOGGLE === */
/* Add this to theme.js */
/*
document.addEventListener('DOMContentLoaded', function() {
    const menuToggle = document.querySelector('.menu-toggle');
    const mainNav = document.querySelector('.main-navigation');
    const body = document.body;
    
    if (menuToggle) {
        menuToggle.addEventListener('click', function() {
            mainNav.classList.toggle('toggled');
            
            // Create overlay if it doesn't exist
            let overlay = document.querySelector('.menu-overlay');
            if (!overlay) {
                overlay = document.createElement('div');
                overlay.className = 'menu-overlay';
                document.body.appendChild(overlay);
            }
            
            overlay.classList.toggle('active');
            
            // Close menu when overlay is clicked
            overlay.addEventListener('click', function() {
                mainNav.classList.remove('toggled');
                overlay.classList.remove('active');
            });
        });
    }
});
*/
