/* Navbar BEM styles */
@media (max-width: 639px) {
    :root {
        --site-header-height: 48px;
    }
}

.navbar {
    min-height: var(--site-header-height);
    height: var(--site-header-height);
    max-height: var(--site-header-height);
    border-bottom: 1px solid #D7DFE0;
    background-color: #ffffff;
    box-shadow: 0 8px 18px rgba(5, 46, 49, 0.06);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    margin: 0 !important;
    overflow: visible;
}

@media (max-width: 1023px) {
    .navbar {
        border-radius: 0 0 1rem 1rem;
    }
}

.navbar__container {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 640px) {
    .navbar__container {
        padding: 0 1.5rem;
    }
}

@media (min-width: 768px) {
    .navbar__container {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .navbar__container {
        padding: 0 2.5rem;
    }
}

/* Left section */
.navbar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 640px) {
    .navbar__left {
        gap: 1.5rem;
    }
}

.navbar__logo {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
}

.navbar__logo-image {
    width: 40px;
    height: 40px;
    display: block;
    object-fit: contain;
}

/* City button */
.navbar__city-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__city-button {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
}

.navbar__city-button:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__city-icon {
    width: 1rem;
    height: 1rem;
    color: #0CAF60;
}

@media (min-width: 640px) {
    .navbar__city-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.navbar__city-name {
    font-size: 0.75rem;
    color: #374151;
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .navbar__city-name {
        font-size: 0.875rem;
    }
}

@media (max-width: 639px) {
    .navbar__city-name {
        display: none;
    }

    .navbar__favorites-button {
        display: none;
    }
}

/* Menu */
.navbar__menu {
    display: none;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 1024px) {
    .navbar__menu {
        display: flex;
        gap: 2rem;
    }
}

.navbar__menu-item {
    font-size: 0.75rem;
    color: #374151;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .navbar__menu-item {
        font-size: 0.875rem;
    }
}

.navbar__menu-item:hover {
    color: #0CAF60;
}

.navbar__menu-item--active {
    color: #0CAF60;
    font-weight: 500;
}

/* Right section */
.navbar__right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .navbar__right {
        gap: 0.75rem;
    }
}


/* Icon buttons */
.navbar__icon-button {
    position: relative;
    padding: 0.375rem;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__icon-button {
        padding: 0.5rem;
    }
}

.navbar__icon-button:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__icon-button svg {
    width: 1rem;
    height: 1rem;
    color: #374151;
    transition: color 0.2s ease;
}

.navbar__icon-button i {
    display: block;
    font-size: 0.875rem;
    line-height: 1;
    color: #374151;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__icon-button svg {
        width: 1.25rem;
        height: 1.25rem;
    }

    .navbar__icon-button i {
        font-size: 1.125rem;
    }
}

.navbar__icon-button:hover svg {
    color: #0CAF60;
}

.navbar__icon-button:hover i {
    color: #0CAF60;
}

.navbar__icon-button--active {
    background-color: rgba(12, 175, 96, 0.12);
}

.navbar__icon-button--active svg {
    color: #0CAF60;
}

.navbar__icon-button--active i {
    color: #0CAF60;
}

/* Badge */
.navbar__badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 0.95rem;
    height: 0.875rem;
    padding: 0 0.2rem;
    transform: translate(32%, -32%);
    background-color: #0CAF60;
    border-radius: 9999px;
    font-size: 0.5rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.navbar__badge--hidden {
    display: none;
}

@media (min-width: 640px) {
    .navbar__badge {
        min-width: 1rem;
        height: 1rem;
        padding: 0 0.22rem;
        font-size: 0.625rem;
    }
}

/* Profile button */
.navbar__profile-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__profile-button {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
}

.navbar__profile-button:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__profile-icon {
    width: 1rem;
    height: 1rem;
    color: #374151;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__profile-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.navbar__profile-button:hover .navbar__profile-icon {
    color: #0CAF60;
}

.navbar__profile-name {
    display: none;
    font-size: 0.75rem;
    color: #374151;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__profile-name {
        display: inline;
        font-size: 0.875rem;
    }
}

.navbar__profile-button:hover .navbar__profile-name {
    color: #0CAF60;
}

.navbar__profile-arrow {
    display: none;
    width: 0.75rem;
    height: 0.75rem;
    color: #374151;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__profile-arrow {
        display: block;
    }
}

@media (min-width: 1024px) {
    .navbar__profile-arrow {
        width: 1rem;
        height: 1rem;
    }
}

.navbar__profile-button:hover .navbar__profile-arrow {
    color: #0CAF60;
}

@media (min-width: 1024px) and (max-width: 1180px) {
    .navbar__city-button {
        max-width: 140px;
    }

    .navbar__city-name {
        max-width: 92px;
    }

    .navbar__profile-button {
        max-width: 180px;
    }

    .navbar__profile-name {
        max-width: 118px;
    }

    .navbar__notifications-button {
        display: none;
    }
}

/* Login button */
.navbar__login-button {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__login-button {
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }
}

.navbar__login-button:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__login-icon {
    width: 1rem;
    height: 1rem;
    color: #374151;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__login-icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.navbar__login-button:hover .navbar__login-icon {
    color: #0CAF60;
}

.navbar__login-text {
    display: none;
    font-size: 0.75rem;
    color: #374151;
    transition: color 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__login-text {
        display: inline;
        font-size: 0.875rem;
    }
}

.navbar__login-button:hover .navbar__login-text {
    color: #0CAF60;
}

/* Profile dropdown */
.navbar__profile-dropdown {
    position: relative;
}

.navbar__dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.35rem;
    width: 12rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 14px 28px rgba(5, 46, 49, 0.12);
    border: 1px solid #D7DFE0;
    padding: 0.5rem 0;
    z-index: 50;
    display: none;
    overflow: hidden;
}

.navbar__dropdown-menu--open {
    display: block !important;
    animation: navbar-dropdown-in 0.22s ease;
}

.navbar__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.navbar__dropdown-item:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__dropdown-item--danger {
    color: #FB2C36;
}

.navbar__dropdown-item--danger:hover {
    background-color: rgba(251, 44, 54, 0.1);
}

.navbar__dropdown-item svg {
    width: 1rem;
    height: 1rem;
    color: currentColor;
}

.navbar__dropdown-divider {
    border-top: 1px solid #D7DFE0;
    margin: 0.5rem 0;
}

/* Burger menu */
.navbar__burger {
    display: block;
    padding: 0.375rem;
    border-radius: 0.5rem;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 640px) {
    .navbar__burger {
        padding: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .navbar__burger {
        display: none;
    }
}

.navbar__burger:hover {
    background-color: rgba(12, 175, 96, 0.1);
}

.navbar__burger svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #374151;
}

@media (min-width: 640px) {
    .navbar__burger svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

.navbar__burger:hover svg {
    color: #0CAF60;
}

/* Mobile menu */
.navbar__mobile-menu {
    display: none;
    position: absolute;
    top: calc(var(--site-header-height) + 0.35rem);
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    background-color: #ffffff;
    border: 1px solid #D7DFE0;
    border-radius: 1rem;
    box-shadow: 0 14px 28px rgba(5, 46, 49, 0.12);
    padding: 1rem;
    z-index: 40;
    overflow: hidden;
}

@media (min-width: 640px) {
    .navbar__mobile-menu {
        left: 0.75rem;
        right: 0.75rem;
        padding: 1rem 1.5rem;
    }
}

@media (min-width: 768px) {
    .navbar__mobile-menu {
        left: 1rem;
        right: 1rem;
        padding: 1rem 2rem;
    }
}

.navbar__mobile-menu--open {
    display: block !important;
    animation: navbar-dropdown-in 0.22s ease;
}

@keyframes navbar-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-0.35rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar__mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.navbar__mobile-menu-item {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
}

.navbar__mobile-menu-item:hover {
    color: #0CAF60;
}

.navbar__mobile-menu-item--active {
    color: #0CAF60;
    font-weight: 500;
}

/* Utilities */
.navbar__hidden {
    display: none;
}

/* City modal */
body.navbar-city-modal-open {
    overflow: hidden;
}

.navbar-city-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    align-items: flex-start;
    justify-content: center;
    padding: 5rem 1rem 1rem;
}

.navbar-city-modal--open {
    display: flex;
}

.navbar-city-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.navbar-city-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 32rem;
    max-height: calc(100vh - 7rem);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

.navbar-city-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #D7DFE0;
}

.navbar-city-modal__title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    font-weight: 600;
    color: #052E31;
}

.navbar-city-modal__close {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.navbar-city-modal__close:hover {
    background: rgba(12, 175, 96, 0.1);
}

.navbar-city-modal__close-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #5F777B;
}

.navbar-city-modal__search-wrap {
    padding: 1rem;
}

.navbar-city-modal__search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.navbar-city-modal__search-box {
    position: relative;
}

.navbar-city-modal__search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    color: #5F777B;
}

.navbar-city-modal__search-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem 0 3rem;
    border-radius: 0.5rem;
    border: 1px solid #D7DFE0;
    color: #5F777B;
    outline: 0;
    font-size: 0.9375rem;
}

.navbar-city-modal__search-input::placeholder {
    color: rgba(95, 119, 123, 0.6);
}

.navbar-city-modal__search-input:focus {
    border-color: #0CAF60;
    box-shadow: 0 0 0 4px rgba(12, 175, 96, 0.2);
}

.navbar-city-modal__location {
    padding: 0 1rem 0.5rem;
}

.navbar-city-modal__location-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.navbar-city-modal__location-btn:hover {
    background: rgba(12, 175, 96, 0.1);
}

.navbar-city-modal__location-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.navbar-city-modal__location-icon-wrap {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(12, 175, 96, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.navbar-city-modal__location-btn:hover .navbar-city-modal__location-icon-wrap {
    background: rgba(12, 175, 96, 0.2);
}

.navbar-city-modal__location-icon {
    width: 1rem;
    height: 1rem;
    color: #0CAF60;
}

.navbar-city-modal__location-text {
    color: #052E31;
    font-weight: 500;
}

.navbar-city-modal__location-status {
    min-height: 1.25rem;
    margin: 0.25rem 0 0 2.75rem;
    font-size: 0.6875rem;
    line-height: 1.3;
    color: #5F777B;
}

.navbar-city-modal__results,
.navbar-city-modal__popular {
    padding: 0.5rem 1rem 1rem;
    overflow-y: auto;
}

.navbar-city-modal__results {
    max-height: 15rem;
}

.navbar-city-modal__results--hidden,
.navbar-city-modal__popular--hidden {
    display: none;
}

.navbar-city-modal__popular-title {
    margin: 0 0 0.75rem;
    color: #052E31;
    font-size: 1rem;
    font-weight: 500;
}

.navbar-city-modal__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.navbar-city-modal__city-item {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.navbar-city-modal__city-item:hover {
    background: rgba(12, 175, 96, 0.1);
}

.navbar-city-modal__city-item--active {
    background: rgba(12, 175, 96, 0.12);
}

.navbar-city-modal__city-icon {
    width: 1rem;
    height: 1rem;
    margin-top: 0.125rem;
    color: #5F777B;
    flex-shrink: 0;
}

.navbar-city-modal__city-item:hover .navbar-city-modal__city-icon,
.navbar-city-modal__city-item--active .navbar-city-modal__city-icon {
    color: #0CAF60;
}

.navbar-city-modal__city-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.navbar-city-modal__city-name {
    color: #052E31;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.35;
}

.navbar-city-modal__city-region {
    color: #5F777B;
    font-size: 0.75rem;
    line-height: 1.35;
}

.navbar-city-modal__empty {
    margin: 0;
    padding: 0.75rem;
    color: #5F777B;
    font-size: 0.875rem;
}
