.site-header .mobile-menu-toggle {
    display: none;
}

@media (max-width: 800px) {
    .site-header .mobile-menu-toggle {
        display: inline-flex;
        flex: 0 0 44px;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 10px;
        border: 1px solid #dce5df;
        border-radius: 10px;
        background: #fff;
        color: #173f35;
        cursor: pointer;
    }

    .site-header .mobile-menu-toggle svg {
        width: 22px;
        height: 22px;
    }

    .site-header .mobile-menu-toggle[aria-expanded="true"] {
        background: #edf4ef;
        border-color: #a5bfb1;
    }

    .site-header .mobile-menu-toggle:focus-visible,
    .site-header .desktop-nav a:focus-visible {
        outline: 2px solid #276f57;
        outline-offset: 3px;
    }

    .site-header .desktop-nav.is-mobile-open {
        display: flex !important;
        position: absolute;
        top: 100%;
        inset-inline: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        max-height: calc(100vh - 160px);
        max-height: calc(100dvh - 160px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 12px;
        border: 1px solid #dce5df;
        border-radius: 0 0 14px 14px;
        background: #fff;
        box-shadow: 0 14px 28px #173f351a;
    }

    .site-header .desktop-nav.is-mobile-open a {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
    }

    .site-header .desktop-nav.is-mobile-open a:hover,
    .site-header .desktop-nav.is-mobile-open a[aria-current="page"] {
        background: #edf4ef;
        color: #173f35;
    }

    .site-header .desktop-nav.is-mobile-open a.active::after {
        display: none;
    }

    /* Mobile handling for grouped properties nav-dropdown */
    .site-header .desktop-nav.is-mobile-open .nav-dropdown {
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .site-header .desktop-nav.is-mobile-open .nav-dropdown-trigger {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        background: #f7faf8;
        border: 1px solid #e2ebe5;
        color: #173f35;
        cursor: pointer;
    }

    .site-header .desktop-nav.is-mobile-open .nav-dropdown-menu {
        position: static;
        display: flex;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 4px 8px 4px 0;
        gap: 3px;
        margin-top: 4px;
    }

    .site-header .desktop-nav.is-mobile-open .nav-dropdown-item {
        padding: 8px 12px;
        background: #fff;
        border: 1px solid #edf2ee;
        border-radius: 8px;
    }
}

@media (max-width: 560px) {
    .site-header .header-actions {
        gap: 6px;
    }

    .site-header .account-link span {
        display: none;
    }

    .site-header .user-menu-name {
        display: none;
    }

    .site-header .user-menu-trigger {
        padding: 4px 6px;
    }
}

/* ==========================================================================
   Desktop Navigation Grouped Dropdown (املاک)
   ========================================================================== */
.nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-dropdown-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--ink);
    padding: 6px 2px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
    position: relative;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.active,
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:focus-within .nav-dropdown-trigger,
.nav-dropdown.is-open .nav-dropdown-trigger {
    color: var(--jade);
    font-weight: 600;
}

.nav-dropdown-trigger.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--jade);
    border-radius: 2px;
}

.dropdown-chevron {
    transition: transform 0.2s ease;
    opacity: 0.75;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown:focus-within .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron,
.user-menu-dropdown:hover .dropdown-chevron,
.user-menu-dropdown.is-open .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background: #fff;
    border: 1px solid #dce5df;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(23, 63, 53, 0.14);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 100;
    margin-top: 6px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    transition: background 0.12s ease, color 0.12s ease;
}

.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    background: #edf4ef;
    color: var(--deep);
}

.nav-dropdown-item .item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.nav-dropdown-item .item-desc {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.3;
}

.nav-dropdown-divider {
    height: 1px;
    background: #edf2ee;
    margin: 4px 6px;
}

.nav-dropdown-item-all .item-title {
    color: var(--jade);
}

/* ==========================================================================
   User Profile Dropdown in Header Actions
   ========================================================================== */
.user-menu-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid #dce5df;
    border-radius: 20px;
    background: #fff;
    color: var(--deep);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.user-menu-trigger:hover,
.user-menu-dropdown.is-open .user-menu-trigger {
    background: #edf4ef;
    border-color: #a5bfb1;
}

.user-avatar-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #173f35;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.user-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #dce5df;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(23, 63, 53, 0.14);
    display: none;
    flex-direction: column;
    z-index: 105;
    overflow: hidden;
}

.user-menu-dropdown:hover .user-menu-popover,
.user-menu-dropdown.is-open .user-menu-popover,
.user-menu-dropdown:focus-within .user-menu-popover {
    display: flex;
}

.user-menu-header {
    padding: 12px 14px;
    background: #fbfdfb;
    border-bottom: 1px solid #edf2ee;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name-text {
    font-size: 13.5px;
    color: var(--deep);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-badge {
    font-size: 11px;
    color: var(--jade);
    font-weight: 600;
}

.user-menu-items {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
    font-size: 13px;
    transition: background 0.12s ease;
}

.user-menu-item:hover {
    background: #edf4ef;
    color: var(--deep);
}

.user-menu-footer {
    padding: 6px;
    border-top: 1px solid #edf2ee;
    background: #fafbfa;
}

.dropdown-logout-form {
    margin: 0;
}

.dropdown-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #b91c1c;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.12s ease;
}

.dropdown-logout-btn:hover {
    background: #fee2e2;
}

/* ==========================================================================
   PWA Install Mobile Banner & iOS Modal
   ========================================================================== */
.pwa-install-banner {
    position: fixed;
    bottom: 74px; /* Right above bottom-nav (64px) + margin */
    left: 12px;
    right: 12px;
    max-width: 480px;
    margin-inline: auto;
    background: #fff;
    border: 1px solid #c8dcd0;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(23, 63, 53, 0.18);
    padding: 11px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 99;
    animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.pwa-install-banner[hidden],
.pwa-ios-modal[hidden],
[hidden].pwa-install-banner,
[hidden].pwa-ios-modal {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (min-width: 801px) {
    .pwa-install-banner,
    .pwa-ios-modal {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pwa-banner-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    flex-shrink: 0;
    background: #edf4ef;
    padding: 2px;
    object-fit: cover;
}

.pwa-banner-text {
    min-width: 0;
}

.pwa-banner-text strong {
    display: block;
    font-size: 13px;
    color: var(--deep);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-text p {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: #173f35 !important;
    color: #fff !important;
    border-radius: 8px !important;
    padding: 7px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(23, 63, 53, 0.25);
}

.pwa-dismiss-btn {
    background: transparent;
    border: none;
    color: #8fa398;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.pwa-dismiss-btn:hover {
    background: #f1f5f2;
    color: #173f35;
}

/* Modal for iOS Safari PWA guidance - MOBILE ONLY */
.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

@media (max-width: 800px) {
    .pwa-ios-modal:not([hidden]) {
        display: flex;
    }
}

@media (min-width: 801px) {
    .pwa-ios-modal,
    .pwa-ios-modal:not([hidden]),
    #pwa-ios-modal {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

.pwa-ios-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.pwa-ios-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 22px 20px 30px;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1;
    animation: pwaSheetUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pwaSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.pwa-ios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2ee;
}

.pwa-ios-close {
    background: #f1f5f2;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    color: #555;
}

.pwa-ios-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-ios-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--ink);
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #edf4ef;
    color: #173f35;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

