/* Single, predictable mobile simulator.
   The phone shell never scrolls; only the website inside it scrolls. */

.wd-phone-statusbar,
.wd-mobile-nav-toggle,
.wd-mobile-menu,
.wd-mobile-actionbar,
.wd-mobile-toast {
    display: none;
}

/* iPhone 17 Pro Max-inspired outer proportions: 78 x 163.4 mm. */
[data-website-demo]:not(.wd-real-mobile) .wd-device-frame.mobile {
    position: relative !important;
    display: block !important;
    width: min(420px, 100%) !important;
    height: auto !important;
    aspect-ratio: 78 / 163.4;
    margin-inline: auto;
    overflow: hidden !important;
    border: 10px solid #15171a !important;
    border-radius: 48px !important;
    background: #101216 !important;
    box-shadow: 0 34px 80px rgba(10,14,20,.28), 0 0 0 1px rgba(255,255,255,.07) inset !important;
    isolation: isolate;
}

.wd-device-frame.mobile > .wd-phone-statusbar {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 130;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 34px;
    padding: 0 15px;
    color: rgba(255,255,255,.92);
    background: #101216;
    font-size: .61rem;
    font-weight: 800;
    letter-spacing: .01em;
}

.wd-phone-time { justify-self: start; }

.wd-phone-island {
    width: 92px;
    height: 20px;
    border-radius: 999px;
    background: #020304;
    box-shadow: 0 0 0 1px rgba(255,255,255,.035) inset;
}

.wd-phone-status-icons {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: .92;
    white-space: nowrap;
}

.wd-phone-signal {
    display: inline-flex;
    align-items: end;
    gap: 1px;
    height: 9px;
}

.wd-phone-signal i {
    display: block;
    width: 2px;
    border-radius: 1px;
    background: currentColor;
}

.wd-phone-signal i:nth-child(1) { height: 3px; }
.wd-phone-signal i:nth-child(2) { height: 5px; }
.wd-phone-signal i:nth-child(3) { height: 7px; }
.wd-phone-signal i:nth-child(4) { height: 9px; }

.wd-phone-battery {
    position: relative;
    width: 18px;
    height: 9px;
    border: 1px solid currentColor;
    border-radius: 2px;
}

.wd-phone-battery::before {
    content: '';
    position: absolute;
    inset: 1px auto 1px 1px;
    width: 12px;
    border-radius: 1px;
    background: currentColor;
}

.wd-phone-battery::after {
    content: '';
    position: absolute;
    top: 2px;
    right: -3px;
    width: 2px;
    height: 4px;
    border-radius: 0 1px 1px 0;
    background: currentColor;
    opacity: .7;
}

/* ONE scroll container. */
.wd-device-frame.mobile .wd-site {
    position: absolute !important;
    top: 34px;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: auto !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 0 96px !important;
    border-radius: 0 0 35px 35px;
    background: var(--wds-bg, #fff);
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(120,126,134,.42) transparent;
    scroll-behavior: smooth;
    clip-path: inset(0 round 0 0 35px 35px);
}

.wd-device-frame.mobile .wd-site::-webkit-scrollbar { width: 4px; }
.wd-device-frame.mobile .wd-site::-webkit-scrollbar-track { background: transparent; }
.wd-device-frame.mobile .wd-site::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(120,126,134,.38);
}

.wd-device-frame.mobile .wds-nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 90 !important;
    flex: 0 0 auto !important;
    min-height: 60px;
    margin: 0 !important;
    padding: .68rem .86rem !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 20px rgba(0,0,0,.12) !important;
}

.wd-device-frame.mobile .wds-brand {
    max-width: calc(100% - 54px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wd-device-frame.mobile .wds-nav-links,
.wd-device-frame.mobile .wds-nav-cta {
    display: none !important;
}

.wd-device-frame.mobile .wd-mobile-nav-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 11px;
    padding: 0;
    color: #fff;
    background: rgba(255,255,255,.07);
    cursor: pointer;
}

.wd-mobile-nav-toggle span,
.wd-mobile-nav-toggle::before,
.wd-mobile-nav-toggle::after {
    content: '';
    position: absolute;
    display: block;
    width: 17px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
}

.wd-mobile-nav-toggle::before { transform: translateY(-5px); }
.wd-mobile-nav-toggle::after { transform: translateY(5px); }
.wds-nav.is-mobile-menu-open .wd-mobile-nav-toggle span { opacity: 0; }
.wds-nav.is-mobile-menu-open .wd-mobile-nav-toggle::before { transform: rotate(45deg); }
.wds-nav.is-mobile-menu-open .wd-mobile-nav-toggle::after { transform: rotate(-45deg); }

.wd-device-frame.mobile .wd-mobile-menu {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    right: 0;
    z-index: 89;
    display: grid;
    grid-template-columns: 1fr;
    padding: .45rem .68rem .72rem;
    border-top: 1px solid rgba(255,255,255,.08);
    background: color-mix(in srgb, var(--wds-dark) 96%, #000);
    box-shadow: 0 18px 28px rgba(0,0,0,.22);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.wd-device-frame.mobile .wds-nav.is-mobile-menu-open .wd-mobile-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wd-mobile-menu button {
    width: 100%;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    padding: .74rem .56rem;
    color: rgba(255,255,255,.84);
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: .73rem;
    font-weight: 800;
}

.wd-mobile-menu button:last-child { border-bottom: 0; }
.wd-mobile-menu button[hidden] { display: none !important; }

/* Mobile layout must stay one column and every section must keep its natural height. */
.wd-device-frame.mobile .wds-hero,
.wd-device-frame.mobile .wds-service-grid,
.wd-device-frame.mobile .wds-value-layout,
.wd-device-frame.mobile .wds-gallery,
.wd-device-frame.mobile .wds-review-grid,
.wd-device-frame.mobile .wds-conversion-section,
.wd-device-frame.mobile .wds-location-section {
    grid-template-columns: minmax(0,1fr) !important;
}

.wd-device-frame.mobile .wds-section,
.wd-device-frame.mobile .wds-review-section,
.wd-device-frame.mobile .wds-conversion-section,
.wd-device-frame.mobile .wds-location-section,
.wd-device-frame.mobile .wds-hero,
.wd-device-frame.mobile .wds-proof {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    scroll-margin-top: 72px;
}

.wd-device-frame.mobile .wds-hero-copy {
    min-width: 0 !important;
    padding: 2.4rem 1.2rem !important;
}

.wd-device-frame.mobile .wds-hero h2 {
    max-width: 100% !important;
    font-size: clamp(2rem, 8vw, 2.55rem) !important;
    line-height: 1.02 !important;
    overflow-wrap: anywhere;
}

.wd-device-frame.mobile .wds-hero-copy p { max-width: 100% !important; }

.wd-device-frame.mobile .wds-hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
}

.wd-device-frame.mobile .wds-btn-primary,
.wd-device-frame.mobile .wds-btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: normal !important;
}

/* Keep all generated media visible. */
.wd-device-frame.mobile .wds-visual.wds-visual-photo {
    display: block !important;
    width: 100% !important;
    min-height: 245px !important;
    height: 245px !important;
    margin: 0 !important;
    background-position: center !important;
    background-size: cover !important;
}

.wd-device-frame.mobile .wds-service-card.wds-service-card-photo {
    overflow: hidden !important;
}

.wd-device-frame.mobile .wds-service-card.wds-service-card-photo .wds-service-thumb {
    display: block !important;
    min-height: 155px !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
}

.wd-device-frame.mobile .wds-service-thumb img,
.wd-device-frame.mobile .wds-gallery-item.wds-gallery-photo img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.wd-device-frame.mobile .wds-gallery-item.wds-gallery-photo {
    min-height: 165px !important;
    overflow: hidden !important;
}

/* Fixed actions live outside the scroll container. */
.wd-device-frame.mobile > .wd-mobile-actionbar {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 140;
    display: grid;
    grid-template-columns: 1.35fr .85fr;
    gap: .5rem;
    padding: .52rem;
    border: 1px solid rgba(18,24,30,.10);
    border-radius: 17px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 -10px 28px rgba(13,18,24,.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.wd-device-frame.mobile.is-before-preview > .wd-mobile-actionbar { display: none !important; }

.wd-mobile-action {
    display: inline-flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid rgba(18,24,30,.12);
    border-radius: 13px;
    padding: .62rem .76rem;
    color: #30363d;
    background: #fff;
    font-size: .72rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.wd-mobile-action.is-primary {
    border-color: var(--wds-primary, #ff6b00);
    color: #fff;
    background: var(--wds-primary, #ff6b00);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--wds-primary, #ff6b00) 26%, transparent);
}

.wd-mobile-action-icon { font-size: .92rem; line-height: 1; }

.wd-device-frame.mobile > .wd-mobile-toast {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 86px;
    z-index: 145;
    display: block;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    padding: .72rem .82rem;
    color: #fff;
    background: rgba(17,20,24,.95);
    box-shadow: 0 14px 34px rgba(0,0,0,.24);
    font-size: .68rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.wd-device-frame.mobile > .wd-mobile-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Before uses the same phone and the same full-range scroll, but without the
   conversion-oriented mobile controls/images. */
.wd-device-frame.mobile.is-before-preview .wds-nav {
    position: relative !important;
    top: auto !important;
    box-shadow: none !important;
}

.wd-device-frame.mobile.is-before-preview .wd-mobile-nav-toggle,
.wd-device-frame.mobile.is-before-preview .wd-mobile-menu {
    display: none !important;
}

.wd-device-frame.mobile.is-before-preview .wds-nav-cta {
    display: inline-flex !important;
    font-size: .62rem;
    padding: .48rem .62rem;
}

.wd-device-frame.mobile.is-before-preview .wd-site { padding-bottom: 24px !important; }

.wd-device-frame.mobile.is-before-preview .wds-visual,
.wd-device-frame.mobile.is-before-preview .wds-service-thumb {
    display: none !important;
}

/* Real phone: contained preview; the OS already supplies the outer device. */
.wd-real-mobile .wd-device-frame.mobile {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 76svh !important;
    min-height: 560px !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    border: 1px solid rgba(19,25,32,.12) !important;
    border-radius: 24px !important;
    background: #101216 !important;
    box-shadow: 0 16px 38px rgba(19,25,32,.11) !important;
}

.wd-real-mobile .wd-device-frame.mobile > .wd-phone-statusbar { display: none !important; }

.wd-real-mobile .wd-device-frame.mobile .wd-site {
    top: 0 !important;
    border-radius: 22px !important;
    clip-path: inset(0 round 22px) !important;
}

@media (max-width: 420px) {
    .wd-real-mobile .wd-device-frame.mobile {
        height: 74svh !important;
        min-height: 520px !important;
    }

    .wd-device-frame.mobile > .wd-mobile-actionbar {
        grid-template-columns: 1.25fr .85fr;
        gap: .4rem;
        left: 6px;
        right: 6px;
        bottom: 6px;
    }

    .wd-mobile-action {
        min-height: 46px;
        padding-left: .55rem;
        padding-right: .55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wd-mobile-menu,
    .wd-mobile-nav-toggle span,
    .wd-mobile-nav-toggle::before,
    .wd-mobile-nav-toggle::after,
    .wd-mobile-toast {
        transition: none !important;
    }
}
