/*
 Theme Name:   Homey Child
 Theme URI:    https://brokenbow.com
 Description:  Child theme for Homey — all brokenbow.com custom code lives here, safe from theme updates.
 Author:       brokenbow.com
 Author URI:   https://brokenbow.com
 Template:     homey
 Version:      1.0.0
*/

/* ── Mobile Nav Menu Fix ─────────────────────────────────────────────────
   Force menu wrapper visible when toggle is open.
   Elementor's own CSS variable approach gets overridden somewhere upstream.
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .e-n-menu[data-layout="dropdown"] .e-n-menu-wrapper {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #fff !important;
        z-index: 99999 !important;
        padding: 10px 0 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    }
}

/* Force hide the Homey main search bar on all devices — search handled by Elementor */
#homey-main-search {
    display: none !important;
}

/* Prevent horizontal overflow / sideways scroll on mobile
   NOTE: overflow-x on <html> breaks position:absolute menus on iOS — body only */
body {
    overflow-x: hidden !important;
}

/* ── Mobile Search Modal Fix ─────────────────────────────────────────────
   Make #myModal scrollable on mobile; keep "Search now" button always visible.
   Structure: #myModal > .modal-dialog > .modal-content > .modal-header + .modal-body
   The "Search now" button lives in .modal-body > .search-filter > .search-filter-wrap > .search-filter-footer
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
    #myModal .modal-dialog {
        margin: 10px !important;
        max-height: calc(100vh - 20px) !important;
        display: flex !important;
        flex-direction: column !important;
    }
    #myModal .modal-content {
        max-height: calc(100vh - 20px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    #myModal .modal-header {
        flex-shrink: 0 !important;
    }
    #myModal .modal-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    #myModal .search-filter-footer {
        position: sticky !important;
        bottom: 0 !important;
        background: #fff !important;
        padding: 12px 15px !important;
        border-top: 1px solid #ddd !important;
        z-index: 10 !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
        margin-bottom: -15px !important;
    }
    #myModal .search-filter-footer .search-apply-filters {
        width: 100% !important;
        margin-top: 8px !important;
    }
    /* Shrink calendar on mobile */
    .search-calendar-module table { font-size: 13px !important; }
    .search-calendar-module td,
    .search-calendar-module th { padding: 6px 2px !important; }
}


/* ── Hide menu items when closed on mobile ───────────────────────────────
   Prevents nav item titles (e.g. "Book Now") bleeding into the header bar
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .e-n-menu:not([data-layout="dropdown"]) .e-n-menu-wrapper {
        display: none !important;
    }
}
