/* Responsive adjustments for 600px and below (Mobile) */
@media screen and (max-width: 600px) {
    /* Stack flex containers vertically */
    .e-con.e-flex, 
    .e-con-inner {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Make all columns 100% width */
    .elementor-column,
    .elementor-col-50,
    .elementor-col-33,
    .elementor-col-66 {
        width: 100% !important;
    }
    
    /* Scale down typography */
    h1, .elementor-heading-title.elementor-size-default, .elementor-widget-heading h2.elementor-heading-title {
        font-size: 32px !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }
    h2 {
        font-size: 26px !important;
        line-height: 1.3 !important;
        text-align: center !important;
    }
    h3 {
        font-size: 22px !important;
        text-align: center !important;
    }
    p, .elementor-text-editor {
        font-size: 16px !important;
        text-align: center !important;
    }
    
    /* Center align buttons and widgets */
    .elementor-widget-button .elementor-button-wrapper {
        text-align: center !important;
        display: flex;
        justify-content: center;
    }
    
    /* Reduce container padding */
    .e-con {
        padding: 30px 20px !important;
    }
    
    /* Images responsive */
    img {
        max-width: 100% !important;
        height: auto !important;
        margin: 0 auto;
        display: block;
    }

    /* Special rule: keep the header horizontal on mobile */
    .elementor-location-header {
        position: relative !important;
        background-color: #ffffff !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }
    
    .elementor-location-header .e-con {
        padding: 0 !important;
    }
    
    .elementor-location-header .e-con-inner {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 15px !important;
        width: 100% !important;
    }
    
    .elementor-location-header .elementor-widget {
        margin-bottom: 0 !important;
    }
    
    /* Hide the Contact Us button in header for mobile */
    .elementor-location-header .elementor-hidden-mobile,
    .elementor-location-header .elementor-element-8df97f6 {
        display: none !important;
    }
    
    .elementor-location-header .elementor-widget-theme-site-logo {
        width: auto !important;
    }
    
    .elementor-widget-theme-site-logo img {
        max-height: 45px !important;
        width: auto !important;
        margin: 0;
        display: block;
    }
    
    /* Mobile Menu Logic */
    .elementor-nav-menu--layout-horizontal {
        display: none !important; /* Hide desktop menu */
    }
    
    .elementor-location-header .elementor-widget-nav-menu {
        width: auto !important;
    }
    
    .elementor-menu-toggle {
        display: flex !important;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        background-color: transparent !important;
        border: none;
        padding: 5px;
        margin: 0;
    }
    
    .elementor-menu-toggle svg {
        width: 30px !important;
        height: 30px !important;
        fill: #333 !important;
    }
    
    .elementor-menu-toggle__icon--close { 
        display: none !important; 
    }
    
    .elementor-menu-toggle.menu-open .elementor-menu-toggle__icon--open { 
        display: none !important; 
    }
    
    .elementor-menu-toggle.menu-open .elementor-menu-toggle__icon--close { 
        display: block !important; 
    }
    
    /* Dropdown mobile menu */
    .elementor-nav-menu--dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100vw;
        background-color: #ffffff;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
        z-index: 1000;
        text-align: left;
    }
    
    .elementor-nav-menu--dropdown.active {
        display: block !important;
    }
    
    /* Override Elementor's scaleY(0)/max-height:0 hiding */
    .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        transform: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .elementor-nav-menu--dropdown ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .elementor-nav-menu--dropdown ul li {
        border-bottom: 1px solid #eee;
    }
    
    .elementor-nav-menu--dropdown ul li a {
        display: block;
        padding: 15px 20px;
        color: #333;
        font-size: 16px;
        text-decoration: none;
        font-weight: 500;
    }
    
    /* Form fields mobile widths */
    .elementor-field-group {
        flex-basis: 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }
}

/* Tablet Adjustments (601px to 1024px) */
@media screen and (min-width: 601px) and (max-width: 1024px) {
    /* Prevent header from overlapping hero section */
    .elementor-location-header {
        position: relative !important;
        background-color: #ffffff !important;
        z-index: 9999 !important;
        overflow: visible !important;
    }
    
    .elementor-location-header .e-con {
        padding: 0 !important;
    }
    
    .elementor-location-header .e-con-inner {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 5px 20px !important;
        width: 100% !important;
    }
    
    /* Hide Contact Us button in header to prevent squishing with burger menu */
    .elementor-location-header .elementor-hidden-tablet,
    .elementor-location-header .elementor-element-8df97f6 {
        display: none !important;
    }
    
    .elementor-location-header .elementor-widget {
        margin-bottom: 0 !important;
    }
    
    .elementor-widget-theme-site-logo img {
        max-height: 45px !important;
        width: auto !important;
        margin: 0;
        display: block;
    }
    
    /* Fix the broken line-height on headings caused by Elementor's CSS at 1024px */
    h1, h2, .elementor-heading-title.elementor-size-default, .elementor-widget-heading h2.elementor-heading-title {
        font-size: 38px !important;
        line-height: 1.3 !important;
    }
    
    /* Show mobile menu burger and hide standard menu on tablet */
    .elementor-nav-menu--layout-horizontal {
        display: none !important;
    }
    
    .elementor-menu-toggle {
        display: flex !important;
        background-color: transparent !important;
        border: none;
        padding: 5px;
    }
    
    .elementor-menu-toggle svg {
        width: 30px !important;
        height: 30px !important;
        fill: #333 !important;
    }
    
    .elementor-menu-toggle__icon--close { display: none !important; }
    .elementor-menu-toggle.menu-open .elementor-menu-toggle__icon--open { display: none !important; }
    .elementor-menu-toggle.menu-open .elementor-menu-toggle__icon--close { display: block !important; }
}

/* Dropdown Menu Styles (Applies to both Mobile and Tablet) */
@media screen and (max-width: 1024px) {
    /* Ensure containers don't hide the dropdown */
    .elementor-location-header .e-con,
    .elementor-location-header .e-con-inner,
    .elementor-location-header .elementor-widget-nav-menu,
    .elementor-location-header .elementor-widget-container {
        overflow: visible !important;
    }
    
    .elementor-nav-menu--dropdown {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100vw;
        background-color: #ffffff;
        box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
        z-index: 1000;
        text-align: left;
    }
    
    .elementor-nav-menu--dropdown.active {
        display: block !important;
    }
    
    /* Override Elementor's scaleY(0)/max-height:0 hiding */
    .elementor-nav-menu--dropdown.elementor-nav-menu__container {
        transform: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .elementor-nav-menu--dropdown ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }
    
    .elementor-nav-menu--dropdown ul li {
        border-bottom: 1px solid #eee !important;
    }
    
    .elementor-nav-menu--dropdown ul li a {
        display: block !important;
        padding: 15px 20px !important;
        color: #333333 !important;
        font-size: 16px !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        background-color: transparent !important;
    }
}
