/*
 * Pivad mobile layout (phones only).
 * Everything here sits inside one media query, so desktop and tablet rendering is unchanged.
 * Plain CSS on purpose: shipped as-is from the theme's public/ folder, no build step.
 */

/* Elements that only exist for phones stay hidden above the breakpoint. */
.mobile-tab-bar,
.mobile-action-bar {
    display: none;
}

@media (max-width: 767.98px) {
    :root {
        --m-tab-h: 64px;
        --m-action-h: 64px;
        --m-safe-bottom: env(safe-area-inset-bottom, 0px);
        --m-ink: #1b2733;
        --m-muted: #5b6b78;
        --m-line: #e3e8ec;
        --m-accent: #07728a;
        --m-gutter: 16px;
    }

    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        padding-bottom: calc(var(--m-tab-h) + var(--m-safe-bottom)) !important;
    }

    body:has(.mobile-action-bar) {
        padding-bottom: calc(var(--m-tab-h) + var(--m-action-h) + var(--m-safe-bottom)) !important;
    }

    /* ---------- Page frame: one 16px-gutter column on every page ---------- */
    .container-fluid.w90,
    .w90 {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: var(--m-gutter) !important;
        padding-right: var(--m-gutter) !important;
    }

    h1,
    .titlehouse {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }

    .box_shadow h2,
    .projecthome h2,
    .homehouse h2,
    .discover h2,
    .padtop70 h2 {
        font-size: 22px !important;
        line-height: 1.25 !important;
        margin-bottom: 4px !important;
    }

    .padtop70 {
        padding-top: 24px !important;
    }

    .box_shadow {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 16px !important;
    }

    .breadcrumb {
        flex-wrap: nowrap !important;
        overflow: hidden;
        white-space: nowrap;
        font-size: 13px;
    }

    .breadcrumb-item:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ---------- Announcement bar: one readable line ---------- */
    .bravo_topbar {
        background: var(--primary-color-hover, #063a5d) !important;
        min-height: 0 !important;
        padding: 0 !important;
    }

    .bravo_topbar .content {
        height: 34px;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .bravo_topbar .topbar-left {
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .bravo_topbar .topbar-right,
    .bravo_topbar .ae-anno-announcement__controls,
    .bravo_topbar .ae-anno-announcement__dismiss-button {
        display: none !important;
    }

    .bravo_topbar,
    .bravo_topbar a,
    .bravo_topbar .ae-anno-announcement__text,
    .bravo_topbar .ae-anno-announcement__content {
        color: #ffffff !important;
        font-size: 13px !important;
        font-weight: 600;
    }

    .bravo_topbar .ae-anno-announcement__content,
    .bravo_topbar .ae-anno-announcement__text {
        display: block;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 !important;
        margin: 0 !important;
        text-align: center;
    }

    .bravo_topbar .ae-anno-announcement__button {
        display: none !important;
    }

    /* ---------- Header: logo only; the menu lives in the tab bar ---------- */
    .main-header .navbar {
        min-height: 56px;
        padding-top: 6px !important;
        padding-bottom: 6px !important;
    }

    .main-header .navbar-brand .logo {
        height: 34px !important;
        width: auto;
    }

    .main-header .navbar-toggler {
        display: none !important;
    }

    /* ---------- Bottom icon menu (every page) ---------- */
    .mobile-tab-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9990;
        display: flex;
        height: calc(var(--m-tab-h) + var(--m-safe-bottom));
        padding-bottom: var(--m-safe-bottom);
        background: #ffffff;
        border-top: 1px solid var(--m-line);
        box-shadow: 0 -2px 12px rgba(16, 24, 40, 0.06);
    }

    .mobile-tab-bar__item {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--m-muted) !important;
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
        text-decoration: none !important;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tab-bar__item:focus-visible {
        outline: 2px solid var(--m-accent);
        outline-offset: -4px;
    }

    .mobile-tab-bar__item.is-active {
        color: var(--m-accent) !important;
        font-weight: 800;
    }

    .mobile-tab-bar__icon {
        position: relative;
        display: flex;
        font-size: 20px;
        line-height: 1;
    }

    .mobile-tab-bar__badge {
        position: absolute;
        top: -6px;
        right: -12px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 9px;
        background: #c2410c;
        color: #ffffff;
        font-size: 10px;
        font-weight: 800;
        line-height: 17px;
        text-align: center;
    }

    .mobile-tab-bar__label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* ---------- Sticky Price / Call / WhatsApp bar (property & project pages) ---------- */
    .mobile-action-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--m-tab-h) + var(--m-safe-bottom));
        z-index: 9989;
        display: flex;
        align-items: center;
        gap: 10px;
        height: var(--m-action-h);
        padding: 8px var(--m-gutter);
        background: #ffffff;
        border-top: 1px solid var(--m-line);
        box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
    }

    .mobile-action-bar__price {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        line-height: 1.2;
    }

    .mobile-action-bar__label {
        font-size: 11px;
        font-weight: 700;
        color: var(--m-muted);
    }

    .mobile-action-bar__price strong {
        font-size: 15px;
        letter-spacing: -0.2px;
        font-weight: 800;
        color: var(--m-ink);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-action-bar__call,
    .mobile-action-bar__whatsapp {
        flex: none;
        height: 46px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        text-decoration: none !important;
        font-weight: 800;
    }

    .mobile-action-bar__call {
        width: 46px;
        border: 1px solid #cfd8de;
        color: var(--m-ink) !important;
        font-size: 18px;
    }

    .mobile-action-bar__whatsapp {
        gap: 6px;
        padding: 0 12px;
        background: #1a8d4a;
        color: #ffffff !important;
        font-size: 15px;
    }

    .mobile-action-bar__whatsapp i {
        font-size: 20px;
    }

    /* ---------- Floating controls ---------- */
    .cd-top,
    .action_footer {
        display: none !important;
    }

    .whatsapp-float-btn {
        bottom: calc(var(--m-tab-h) + var(--m-safe-bottom) + 16px) !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
    }

    body:has(.mobile-action-bar) .whatsapp-float-btn {
        display: none !important;
    }

    body:has(.site-notice--visible) .whatsapp-float-btn {
        bottom: calc(var(--m-tab-h) + var(--m-safe-bottom) + 96px) !important;
    }

    /* Cookie notice: a compact dark pill floating above the tab bar. */
    .site-notice {
        left: 8px !important;
        right: 8px !important;
        width: auto !important;
        bottom: calc(var(--m-tab-h) + var(--m-safe-bottom) + 8px) !important;
        border-radius: 12px !important;
        overflow: hidden;
        z-index: 9991 !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    body:has(.mobile-action-bar) .site-notice {
        bottom: calc(var(--m-tab-h) + var(--m-action-h) + var(--m-safe-bottom) + 8px) !important;
    }

    .site-notice .site-notice-body {
        padding: 10px 12px !important;
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .site-notice .site-notice__inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px;
        text-align: left !important;
    }

    .site-notice button,
    .site-notice .btn {
        flex: none;
        min-height: 36px;
        margin: 0 !important;
        white-space: nowrap;
    }

    /* Off-canvas menu opens above the tab bar. */
    #navbarSupportedContent {
        z-index: 9995 !important;
    }

    /* ---------- Hero search: compact ---------- */
    .home_banner {
        height: auto !important;
        min-height: 0 !important;
        padding: 28px 0 20px !important;
    }

    .home_banner .topsearch {
        position: relative !important;
        top: auto !important;
        transform: none !important;
        width: 100% !important;
        padding-left: var(--m-gutter) !important;
        padding-right: var(--m-gutter) !important;
    }

    .home_banner h1,
    .home_banner .banner-text-description {
        font-size: 22px !important;
        line-height: 1.25 !important;
        margin-bottom: 14px !important;
    }

    .home_banner .typesearch {
        display: flex !important;
        width: 100%;
    }

    .home_banner .typesearch a {
        flex: 1 1 0;
        text-align: center;
        padding: 10px 4px !important;
        font-size: 14px !important;
    }

    .home_banner .input-group-lg > .form-control,
    .home_banner .input-group-lg .input-group-text {
        height: 48px !important;
        font-size: 15px !important;
    }

    /* ---------- Swipe strips (home sections, related listings) ---------- */
    .m-strip {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 12px;
        margin-left: calc(-1 * var(--m-gutter)) !important;
        margin-right: calc(-1 * var(--m-gutter)) !important;
        padding: 8px var(--m-gutter) 12px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: var(--m-gutter);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .m-strip::-webkit-scrollbar {
        display: none;
    }

    .m-strip > .m-strip__item {
        flex: 0 0 80% !important;
        max-width: 80% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
        scroll-snap-align: start;
    }

    .m-strip > .m-strip__item--narrow {
        flex-basis: 64% !important;
        max-width: 64% !important;
    }

    .m-strip .item,
    .m-strip .grid-in {
        height: 100%;
        margin-bottom: 0 !important;
    }

    .m-strip .item h3,
    .m-strip .item h5,
    .m-strip .blog-title h2 {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        font-size: 15px !important;
        line-height: 1.3 !important;
    }

    .m-strip .blog-excerpt {
        display: none;
    }

    /* ---------- Property / project detail: content order ---------- */
    .detail-main-row {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .detail-main-row > .detail-main-col {
        display: contents;
    }

    .detail-main-row > .detail-main-col > * {
        order: 0;
        max-width: 100%;
    }

    .detail-main-row > .detail-side-col {
        order: 1;
        flex: 0 0 auto;
        max-width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .detail-main-row > .detail-main-col > .detail-reviews {
        order: 2;
        margin-top: 16px;
    }

    .pricehouse {
        font-size: 22px !important;
        font-weight: 800;
    }

    /* ---------- Footer: collapsible link groups ---------- */
    footer .menufooter h4 {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        margin: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        cursor: pointer;
    }

    footer .menufooter h4::after {
        content: '+';
        font-size: 20px;
        font-weight: 400;
    }

    footer .menufooter.is-open h4::after {
        content: '\2212';
    }

    footer .menufooter.is-collapsible > :not(h4) {
        display: none;
    }

    footer .menufooter.is-collapsible.is-open > :not(h4) {
        display: block;
    }

    /* ---------- Install chip + alerts (PWA) ---------- */
    .push-bell {
        margin-left: auto;
        margin-right: 4px;
    }

    .push-alerts-card__inner {
        flex-wrap: wrap;
    }

    .push-alerts-card__button {
        width: 100%;
    }
}

/* ---------- PWA pieces (all screen sizes) ---------- */
[data-push-card][hidden],
[data-push-toggle][hidden] {
    display: none !important;
}

.push-alerts-card {
    padding: 24px 0;
    background: #f4f6f8;
}

.push-alerts-card__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

.push-alerts-card__icon {
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #e3f3f7;
    color: #07728a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.push-alerts-card__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    line-height: 1.4;
    color: #33424f;
}

.push-alerts-card__text strong {
    color: #1b2733;
    font-size: 15px;
}

.push-alerts-card__button {
    flex: none;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: #07728a;
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
}

.push-alerts-card__button[data-push-state='on'] {
    background: #ffffff;
    color: #1b2733;
    border: 1px solid #cfd8de;
}

.push-alerts-card__button[data-push-state='blocked'],
.push-alerts-card__button:disabled {
    opacity: 0.7;
    cursor: default;
}

.push-bell {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1b2733;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.push-bell[data-push-state='on']::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a8d4a;
}

.pwa-chip {
    position: fixed;
    z-index: 9992;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    width: auto;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 12px 12px;
    background: #1b2733;
    color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    font-size: 13px;
    line-height: 1.35;
}

.pwa-chip__icon {
    flex: none;
    border-radius: 10px;
    background: #ffffff;
}

.pwa-chip__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pwa-chip__text strong {
    font-size: 14px;
}

.pwa-chip__action {
    flex: none;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #1b2733;
    font-weight: 800;
    cursor: pointer;
}

.pwa-chip__close {
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: #cfd8de;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Phone overrides for the PWA pieces above (must come after them). */
@media (max-width: 767.98px) {
    .pwa-chip {
        left: 8px;
        right: 8px;
        bottom: calc(var(--m-tab-h) + var(--m-safe-bottom) + 12px);
        max-width: none;
        transform: none;
    }

    .push-alerts-card {
        padding: 16px 0;
    }

    .push-alerts-card__text {
        flex: 1 1 calc(100% - 60px);
    }
}
