/**
 * MediPill Child Theme — Mobile Navigation Styles
 * ALL rules are scoped inside @media (max-width: 768px)
 * Desktop styles are completely untouched.
 */

/* ── Default: hide mobile elements on desktop ─────────────────────────── */
#mp-mobile-header,
#mp-overlay,
#mp-mobile-menu,
#mp-bottom-bar {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE ONLY  (≤ 768px)
═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Hide desktop elements ──────────────────────────────────────────── */
    .top-bar,
    .fixed-header,
    .side_phone,
    .side_email {
        display: none !important;
    }

    /* ── Body padding: account for sticky header + sticky bottom bar ─────── */
    body {
        padding-top: 64px !important;
        padding-bottom: 70px !important;
    }

    /* ═══════════════════════════════════════════════════════
       STICKY MOBILE HEADER
    ═══════════════════════════════════════════════════════ */
    #mp-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: #ffffff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        padding: 0 16px;
        z-index: 9990;
        gap: 10px;
    }

    .mp-logo-link {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        text-decoration: none;
    }

    .mp-logo-img {
        height: 42px;
        width: auto;
        max-width: 140px;
        object-fit: contain;
    }

    /* ── "Book Now" button — gradient pill (matches desktop style) ───────── */
    .mp-header-book-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: linear-gradient(90deg, #1e61eb 0%, #61ce70 100%);
        color: #ffffff !important;
        font-size: 13px;
        font-weight: 400;
        padding: 10px 18px;
        border-radius: 15px;
        text-decoration: none !important;
        white-space: nowrap;
        min-height: 38px;
        margin-left: auto;
        transition: opacity 0.2s ease, transform 0.15s ease;
        flex-shrink: 0;
        letter-spacing: 0.2px;
    }

    .mp-header-book-btn:hover,
    .mp-header-book-btn:focus {
        opacity: 0.85;
        color: #ffffff !important;
        text-decoration: none !important;
        transform: scale(1.03);
        outline: none;
    }

    /* Hamburger button */
    .mp-hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        width: 44px;
        height: 44px;
        padding: 10px 8px;
        background: transparent;
        border: none;
        cursor: pointer;
        border-radius: 4px;
        flex-shrink: 0;
        transition: background 0.2s ease;
    }

    .mp-hamburger:hover,
    .mp-hamburger:focus {
        background: rgba(0, 0, 0, 0.06);
        outline: 2px solid rgba(0, 0, 0, 0.2);
        outline-offset: 2px;
    }

    .mp-burger-line {
        display: block;
        width: 100%;
        height: 2px;
        background: #222222;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    /* Animate burger → X when menu is open */
    .mp-hamburger.is-active .mp-burger-line:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mp-hamburger.is-active .mp-burger-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    .mp-hamburger.is-active .mp-burger-line:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* ═══════════════════════════════════════════════════════
       DARK OVERLAY
    ═══════════════════════════════════════════════════════ */
    #mp-overlay {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 9995;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #mp-overlay.is-visible {
        opacity: 1;
        pointer-events: auto;
    }

    /* ═══════════════════════════════════════════════════════
       FULL-SCREEN SLIDE-OUT MENU
    ═══════════════════════════════════════════════════════ */
    #mp-mobile-menu {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 82%;
        max-width: 340px;
        height: 100%;
        height: 100dvh;
        background: #ffffff;
        z-index: 10000;
        padding: 0;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.18);
    }

    #mp-mobile-menu.is-open {
        transform: translateX(0);
    }

    /* Close (✕) button */
    .mp-close-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
        width: 48px;
        height: 48px;
        margin: 16px 16px 8px auto;
        background: transparent;
        border: 2px solid #dddddd;
        border-radius: 50%;
        font-size: 18px;
        color: #333333;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
        flex-shrink: 0;
    }

    .mp-close-btn:hover,
    .mp-close-btn:focus {
        background: #f5f5f5;
        border-color: #aaaaaa;
        outline: 2px solid #aaaaaa;
        outline-offset: 2px;
    }

    /* Nav container */
    .mp-nav-container {
        flex: 1;
        padding: 8px 0 24px;
    }

    /* Nav list */
    .mp-nav-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    /* Nav items */
    .mp-nav-list li {
        border-bottom: 1px solid #f0f0f0;
        margin: 0;
    }

    .mp-nav-list li:first-child {
        border-top: 1px solid #f0f0f0;
    }

    /* Top-level links */
    .mp-nav-list > li > a {
        display: flex !important;
        align-items: center;
        padding: 0 20px;
        min-height: 56px;
        font-size: 17px;
        font-weight: 600;
        color: #1a1a1a !important;
        text-decoration: none !important;
        transition: background 0.15s ease, color 0.15s ease;
        line-height: 1.3;
    }

    .mp-nav-list > li > a:hover,
    .mp-nav-list > li > a:focus {
        background: #f7f7f7;
        color: #31A63B !important;
        outline: none;
    }

    .mp-nav-list > li.current-menu-item > a,
    .mp-nav-list > li.current_page_item > a {
        color: #31A63B !important;
        border-left: 3px solid #31A63B;
        padding-left: 17px;
    }

    /* Sub-menus */
    .mp-nav-list ul {
        list-style: none;
        margin: 0;
        padding: 0;
        background: #fafafa;
        border-top: 1px solid #eeeeee;
    }

    .mp-nav-list ul li {
        border-bottom: 1px solid #eeeeee;
    }

    .mp-nav-list ul li:last-child {
        border-bottom: none;
    }

    .mp-nav-list ul li a {
        display: flex !important;
        align-items: center;
        padding: 0 20px 0 32px;
        min-height: 50px;
        font-size: 15px;
        font-weight: 500;
        color: #444444 !important;
        text-decoration: none !important;
        transition: background 0.15s ease, color 0.15s ease;
    }

    .mp-nav-list ul li a:hover,
    .mp-nav-list ul li a:focus {
        background: #f0f0f0;
        color: #31A63B !important;
        outline: none;
    }

    /* ═══════════════════════════════════════════════════════
       STICKY BOTTOM ACTION BAR
    ═══════════════════════════════════════════════════════ */
    #mp-bottom-bar {
        display: flex !important;
        align-items: stretch;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: #1a1a2e;
        z-index: 9990;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    }

    .mp-bottom-btn {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-height: 60px;
        padding: 6px 4px;
        text-decoration: none !important;
        color: #ffffff !important;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        gap: 2px;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        transition: background 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mp-bottom-btn:last-child {
        border-right: none;
    }

    .mp-bottom-btn:hover,
    .mp-bottom-btn:focus {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff !important;
        text-decoration: none !important;
        outline: none;
    }

    .mp-bottom-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }

    .mp-bottom-icon {
        font-size: 20px;
        line-height: 1;
        display: block;
    }

    .mp-bottom-label {
        display: block;
        line-height: 1;
    }

    /* "Book Now" bottom button — gradient pill style */
    .mp-bottom-book {
        background: linear-gradient(90deg, #1e61eb 0%, #61ce70 100%);
    }

    .mp-bottom-book:hover,
    .mp-bottom-book:focus {
        background: linear-gradient(90deg, #1a55d4 0%, #4eb85c 100%);
        opacity: 0.9;
    }

    /* ── Prevent body scroll when menu is open ──────────────────────────── */
    body.mp-menu-open {
        overflow: hidden !important;
    }

} /* end @media (max-width: 768px) */
