/* ==========================================================================
   PHONE EXPERIENCE (Deann 10/7: mobile simpler but "super cool and innovative")
   Menu redesign (all sizes, full screen on phones), swipe rails for long stacks,
   quick-action bar, and a phone flight path down the left edge. js/mobile.js.
   ========================================================================== */

/* ---------- Menu ---------- */
.menu-panel {
    overflow-y: auto;
}
#nav-pri {
    position: relative;
    padding-left: 26px;
}
#nav-pri ul {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: mx-nav;
}
#nav-pri li {
    counter-increment: mx-nav;
}
#nav-pri a {
    position: relative;
    display: block;
    padding: 8px 0;
    font-size: clamp(1.75rem, 7.5vw, 2.25rem);
    font-weight: 600;
    line-height: 1.15;
    color: #ffffff;
    transition: color 0.25s ease, translate 0.25s ease;
}
#nav-pri a:hover,
#nav-pri a:focus-visible {
    color: #d4af37;
    translate: 6px 0;
}
/* Gold flight line with a waypoint at each link */
#nav-pri::before {
    content: "";
    position: absolute;
    left: 9px; /* centred on the 12px waypoints */
    top: 14px;
    bottom: 14px;
    width: 2px;
    background: repeating-linear-gradient(to bottom, #d4af37 0 5px, transparent 5px 10px);
    transform-origin: 50% 0;
    scale: 1 0;
}
#nav-pri a::before {
    content: counter(mx-nav, decimal-leading-zero);
    position: absolute;
    right: 100%;
    top: 50%;
    margin-right: 10px;
    translate: 0 -50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #001227;
    border: 2px solid #d4af37;
    font-size: 0;
}
#nav-pri a:hover::before {
    background: #d4af37;
}
.menu-overlay.opacity-100 #nav-pri::before {
    scale: 1 1;
    transition: scale 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}
@media (prefers-reduced-motion: no-preference) {
    #nav-pri li {
        opacity: 0;
        translate: 0 18px;
    }
    .menu-overlay.opacity-100 #nav-pri li {
        animation: mx-menu-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
        animation-delay: calc(0.12s + var(--mx-i, 0) * 0.07s);
    }
    .menu-overlay.opacity-100 .mx-menu-extras {
        animation: mx-menu-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
    }
}
@keyframes mx-menu-in {
    from { opacity: 0; translate: 0 18px; }
    to { opacity: 1; translate: 0 0; }
}

/* Latest tour + quick actions */
.mx-menu-extras {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.mx-menu-tour {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 16 / 8;
    background: #0f172a;
    color: #ffffff;
}
.mx-menu-tour img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.mx-menu-tour:hover img {
    scale: 1.05;
}
.mx-menu-tour::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 18, 39, 0.85), rgba(0, 18, 39, 0) 60%);
}
.mx-menu-tour__play {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #d4af37 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14' viewBox='0 0 16 18'%3E%3Cpath d='M1 1.7v14.6a1 1 0 001.5.87l12.5-7.3a1 1 0 000-1.74L2.5.83A1 1 0 001 1.7z' fill='%2302225a'/%3E%3C/svg%3E") 56% 50% no-repeat;
}
.mx-menu-tour__text {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mx-menu-tour__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #e2c36d;
}
.mx-menu-tour__name {
    font-size: 18px;
    font-weight: 600;
}
.mx-menu-actions {
    display: flex;
    gap: 10px;
}
.mx-menu-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff;
    font-weight: 600;
    transition: background 0.25s ease, border-color 0.25s ease;
}
.mx-menu-action:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #d4af37;
}

@media (max-width: 767px) {
    .menu-panel {
        width: 100% !important;
        max-width: none !important;
    }
    .menu-panel > div:first-child {
        padding-left: 20px;
        padding-right: 20px;
    }
    .menu-panel nav.px-8,
    .mx-menu-extras,
    .menu-panel > .px-8 {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* ---------- Quick-action bar (phones) ---------- */
.mx-quickbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 58;
    display: flex;
    gap: 8px;
    padding: 7px;
    border-radius: 999px;
    background: rgba(0, 18, 39, 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    translate: 0 160%;
    transition: translate 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mx-quickbar[hidden] {
    display: none;
}
.mx-quickbar.is-on {
    translate: 0 0;
}
.mx-quickbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
}
.mx-quickbar__call {
    flex: 0 0 auto;
    padding: 0 18px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.mx-quickbar__quote {
    flex: 1;
    background: #d4af37;
    color: #02225a;
}
@media (min-width: 768px) {
    .mx-quickbar {
        display: none !important;
    }
}

/* ---------- Phone flight path (left edge) ---------- */
.mx-pfp {
    position: fixed;
    left: 3px;
    top: 104px;
    bottom: 110px;
    z-index: 40;
    width: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.mx-pfp.is-on {
    opacity: 1;
}
.mx-pfp__track,
.mx-pfp__fill {
    position: absolute;
    left: 7px;
    top: 0;
    width: 2px;
    height: 100%;
}
.mx-pfp__track {
    background: repeating-linear-gradient(to bottom, rgba(2, 34, 90, 0.16) 0 4px, transparent 4px 8px);
}
.mx-pfp__fill {
    background: linear-gradient(to bottom, #e2c36d, #be9141);
    transform-origin: 50% 0;
    scale: 1 0;
    border-radius: 2px;
}
.mx-pfp__dot {
    position: absolute;
    left: 4px;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(2, 34, 90, 0.28);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.mx-pfp__dot.is-reached {
    background: #d4af37;
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.8);
}
.mx-pfp__drone {
    position: absolute;
    left: -3px;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    filter: drop-shadow(0 2px 3px rgba(2, 34, 90, 0.3));
}
.mx-pfp__drone .mx-rotor {
    transform-box: fill-box;
    transform-origin: center;
}
@media (prefers-reduced-motion: no-preference) {
    .mx-pfp.is-on .mx-pfp__drone .mx-rotor {
        animation: mx-rotor 0.18s linear infinite;
    }
}
@media (min-width: 768px) {
    .mx-pfp {
        display: none !important;
    }
}

/* ---------- Swipe rails (phones) ---------- */
@media (max-width: 767px) {
    .mx-rail {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        align-items: stretch !important;
        justify-content: flex-start !important; /* centred overflow can't scroll back to the first card */
        gap: 14px !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        margin-left: -16px !important;
        margin-right: -16px !important;
        padding: 6px 16px 14px !important;
        height: auto !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mx-rail::-webkit-scrollbar {
        display: none;
    }
    .mx-rail > .mx-rail__item {
        flex: 0 0 84% !important;
        width: auto !important;
        max-width: 84% !important;
        margin: 0 !important;
        scroll-snap-align: center;
        transition: scale 0.35s ease, opacity 0.35s ease;
    }
    .mx-rail > .mx-rail__item:not(.is-active) {
        scale: 0.95;
        opacity: 0.72;
    }
    .mx-rail .comelife-card,
    .mx-rail .customize-card,
    .mx-rail .process-step {
        transform: none !important;
    }
    .mx-rail-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 2px;
    }
    .mx-rail-dots span {
        width: 6px;
        height: 6px;
        border-radius: 999px;
        background: #d5dce8;
        transition: width 0.3s ease, background 0.3s ease;
    }
    .mx-rail-dots span.is-on {
        width: 20px;
        background: #be9141;
    }
}
@media (min-width: 768px) {
    .mx-rail-dots {
        display: none;
    }
}
