:root {
    --orange: #FF931C;
    --beige: #EEE8E3;
    --brown: #5E4A3C;
    --white: #FFFFFF;
    --dark-overlay: rgba(0, 0, 0, 0.4);

    --font-heading: 'Inter Tight', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #F9F9F9;
    color: var(--brown);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
}


h1, h2, h3 {
    font-family: var(--font-heading);
}


.hero-title {
    font-weight: 700;
    font-size: 60px;
    line-height: 70px;
}


h2 {
    font-weight: 700;
    font-size: 40px;
    line-height: 50px;
}


h3 {
    font-weight: 700;
    font-size: 24px;
    line-height: 30px;
}

button, .cta-btn, .search-btn, .tab {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 24px;
}

.caption, .nav-link, .tag {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    line-height: 24px; 
}


.container {
    max-width: 100%; 
    margin: 0 auto;
    padding: 0 60px;
}

.hero {
    /* меняем прозрачность фотки, чтобы текст был виднее (0.55) */
    background-image: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)), url('../images/mainback.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    min-height: 800px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.hero-title {
    font-weight: 700;
    font-size: 60px;
    line-height: 70px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5); 
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    left: 50%;
    transform: translateX(-50%);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px;
    z-index: 9999;
    
    background-color: transparent; 
    transition: all 0.3s ease-in-out;
}

.navbar.scrolled {
    top: 8px;
    width: 93.8%; 
    background-color: #5E4A3C !important;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    height: 65px;
    padding: 0 30px;
}

.navbar .lang-dropdown{
    right: -15px;
}

.navbar.scrolled .lang-dropdown {
    right: -29px !important;
    top: 44px !important;
}

.navbar.scrolled .lang-dropdown {
    background-color: rgba(94, 74, 60, 0.95); 
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .lang-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar.scrolled .logo {
    margin-top: 0;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    margin-right: 40px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    transition: opacity 0.3s;
}
.nav-link:hover { opacity: 0.8; }

.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0px;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
}

.lang-switch {
    position: relative;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    z-index: 100;
    padding-bottom: 20px;
    margin-bottom: -20px;
}

.selected-lang {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
    transition: opacity 0.3s;
}

.selected-lang:hover {
    opacity: 0.8;
}

.lang-switch img {
    width: 24px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lang-dropdown {
    position: absolute;
    top: 100%; 
    right: -15px;
    width: 200px;
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lang-switch:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: var(--white);
    font-size: 16px;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-option.active {
    background: rgba(255, 255, 255, 0.1);
    font-weight: 700;
}

.hero-content {
    margin-top: auto;
    margin-bottom: 250px; 
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    max-width: 380px;
    text-align: right;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}


.search-block {
    position: absolute;
    bottom: 50px;
    left: 60px;  
    right: 60px; 
    z-index: 1000;
}

.search-tabs {
    display: flex;
}

.tab {
    padding: 12px 35px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    border: 1px solid transparent;
    outline: none;
}

.tab:focus {
    outline: none;
}

.tab.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1.5px;
}

.tab:not(.active) {
    background-color: rgba(0, 0, 0, 0.3); 
    color: rgba(255, 255, 255, 0.836);
}

.tab:not(.active):hover {
    background-color: rgba(87, 87, 87, 0.2);
    color: var(--white);
}

.search-bar {
    background-color: var(--orange);
    border-radius: 0 16px 16px 16px; 
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.search-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: var(--white);
    cursor: pointer;
    flex: 1;
    flex-basis: 0;
    min-width: 0;
    
    padding-right: 40px;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    margin-right: 30px;
    position: relative;
}

.search-field .field-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; 
}

.search-field:nth-last-child(2) {
    border-right: none;
    padding-right: 0;
    margin-right: 30px;
}

.search-field span {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
}

.search-btn {
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    color: var(--white);
    padding: 0 60px;
    height: 64px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.search-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.features {
    padding: 100px 0;
}

.features-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.feature-card {
    background-color: var(--beige);
    border-radius: 12px;
    padding: 40px;
    min-height: 240px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.title-card {
    background-color: #F5F1EE;
    width: calc(33.333% - 14px);
    justify-content: center;
}

.title-card h2 {
    color: var(--brown);
    z-index: 2;
}

.beige-card {
    justify-content: flex-start;
}

.bg-shape {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 220px;
    height: 220px;
    opacity: 0.6;
    z-index: 1;
    pointer-events: none;
}

.feature-card h2,
.feature-card h3,
.feature-card p,
.feature-card .icon-wrap,
.feature-card .card-content {
    position: relative;
    z-index: 50;
}

.title-card.white-bg {
    background-color: transparent;
    border: 1px solid var(--beige);
}

.title-card.white-bg .bg-shape {
    fill: var(--beige) !important;
    transform: translateX(24px);
}

.feature-card.beige-card.wide-card.with-bg .bg-shape {
    fill: var(--white) !important;
    transform: translateX(24px);
}

.features-grid > :nth-child(2) { width: calc(33.333% - 14px); }
.features-grid > :nth-child(3) { width: calc(33.333% - 14px); flex-grow: 1; }

.features-grid > :nth-child(4) { width: 40%; } 
.features-grid > :nth-child(5) { width: calc(60% - 20px); }

.icon-wrap {
    font-size: 28px;
    margin-bottom: 24px;
    color: var(--brown);
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    opacity: 0.8;
}

.listings {
    padding-bottom: 100px;
}

.listings-wrapper {
    display: flex;
    gap: 20px;
}

a.listing-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

a.listing-card:hover {
    transform: scale(1.02);
}

.listing-card {
    width: 50%;
    position: relative;
}

.listing-image {
    height: 480px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.listing-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.tags-top {
    position: absolute;
    top: 25px;
    right: 25px;
    z-index: 2;
}

.listing-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 25px;
}

.listing-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}

.listing-bottom-row .listing-info {
    flex: 1;
    min-width: 0;
}

.listing-bottom-row .price {
    flex-shrink: 0;
}

.tags-bottom {
    z-index: 2;
}

.left-tags {
    display: flex;
    gap: 10px;
}

.tag {
    padding: 6px 12px;
    border-radius: 30px;
    color: var(--white);
    font-weight: 600;
    font-size: 13px;
}

.orange-tag {
    background-color: var(--orange);
}

.dark-tag {
    background-color: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

.price {
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 24px;
    z-index: 2;
    white-space: nowrap;
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(4px);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.slider-arrow:hover { background: rgba(255,255,255,0.4); }
.slider-arrow.left { left: 20px; }
.slider-arrow.right { right: 20px; }

.listing-info {
    z-index: 3;
    color: white;
}

.listing-info h3 {
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    font-size: 18px;
    line-height: 22px;
}


.about {
    padding-bottom: 100px;
}

.about-block {
    background-color: var(--beige);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    min-height: 450px;
}

.about-text {
    flex: 1;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.about-text h2 {
    margin-bottom: 24px;
}

.about-text p {
    margin-bottom: 40px;
    opacity: 0.8;
    max-width: 90%;
}

.cta-btn {
    background-color: var(--orange);
    color: var(--white);
    border: none;
    padding: 0 40px;
    height: 56px;
    border-radius: 8px;
    width: fit-content;
    cursor: pointer;
    transition: background-color 0.3s;

    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.cta-btn:hover { background-color: #e07e10; }

.about-image {
    flex: 1;
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

footer {
    background-color: var(--brown);
    
    width: 93.7%;
    
    margin: 0 auto 20px auto; 
    border-radius: 16px;
    padding: 5px;
    color: var(--white);
}

footer .container {
    max-width: 100%;
    width: 100%;
    padding: 0 30px;
    margin: 0;
}

.footer-content {
    height: 70px;
    padding: 0 60px;
    flex-wrap: wrap;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6); /* Полупрозрачный белый */
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fff; /* При наведении белый */
}

.footer-logo img {
    height: 40px; 
    width: auto;
    opacity: 1;
}

.socials {
    display: flex;
    gap: 15px;
}

.socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background-color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.socials a i {
    color: var(--brown);
    font-size: 22px;
    line-height: 0;
}

.socials a .fa-paper-plane {
    margin-left: -2px;
    margin-top: 0px;
}

.socials a:hover {
    transform: translateY(-4px);
}


.search-field {
    position: relative; 
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 15px;
}

.search-dropdown {
    max-height: 350px; /* Максимальная высота выпадающего списка */
    overflow-y: auto;  /* Вертикальный скролл */
    /* Остальные стили берем из предыдущего шага */
    display: none; 
    position: absolute;
    top: 100%; 
    margin-top: 38px; 
    left: -30px;
    width: calc(100% + 31px);
    background-color: #F5F5F5;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 99999;
    box-sizing: border-box;
}

.search-dropdown::-webkit-scrollbar {
    width: 6px;
}
.search-dropdown::-webkit-scrollbar-track {
    background: transparent; /* ВАЖНО: Делаем фон прозрачным */
    /* Добавляем небольшие отступы сверху и снизу, чтобы ползунок не бился об углы */
    margin-top: 6px;
    margin-bottom: 6px;
}
.search-dropdown::-webkit-scrollbar-thumb {
    /* Используем полупрозрачный черный цвет, чтобы он хорошо смотрелся на бежевом фоне */
    background-color: rgba(0, 0, 0, 0.2); 
    border-radius: 10px; /* Сильное скругление, чтобы был как капсула */
}
.search-dropdown::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3); /* Чуть темнее при наведении */
}

.dropdown-search-wrapper {
    position: relative;
    padding: 5px 8px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

.dropdown-search {
    width: 100%;
    padding: 8px 10px 8px 30px; /* Отступ слева для иконки */
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
}

.dropdown-search:focus {
    border-color: var(--orange);
}

.dropdown-search-wrapper i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 12px;
}

/* Отделяем контейнер с динамическими элементами */
.dynamic-items-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Если список районов пуст или отключен */
.search-field.disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Для последнего поля ("Вид недвижимости") */
/* Здесь черты справа нет, поэтому +50px (как вы сделали) - это хороший вариант, 
   визуально будет сбалансировано. Оставляем ваш вариант. */
.search-field:nth-last-child(2) .search-dropdown {
    width: calc(100% + 60px);
}

.search-field.active .search-dropdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.search-field.active .fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s;
}

/* --- СТИЛИЗАЦИЯ ПУНКТОВ (ОСТАЕТСЯ ПРЕЖНЕЙ) --- */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    user-select: none;
    white-space: nowrap; /* Текст в одну строку */
}

.dropdown-item:hover {
    background-color: #E0E0E0;
}

.dropdown-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #E8E4E1;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s;
}

.dropdown-item input:checked ~ .checkmark {
    background-color: var(--orange);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dropdown-item input:checked ~ .checkmark:after {
    display: block;
}

.item-text {
    color: #4A4A4A;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 15px;
}

.dropdown-item input:checked ~ .item-text {
    color: var(--brown);
    font-weight: 700;
}

/* === БУРГЕР-МЕНЮ (скрыто на десктопе) === */
.burger-menu {
    display: none;
}

.mobile-menu {
    display: none;
}


/* Крестик для очистки - скрыт по умолчанию, показывается через JS */
.clear-btn {
    display: none !important;
    color: var(--white);
    font-size: 14px;
    cursor: pointer;
    margin-left: auto; 
    margin-right: 10px;
    opacity: 0.8;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 10;
}

.clear-btn.visible {
    display: block !important;
}

.clear-btn:hover {
    opacity: 1;
}

.lang-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important; /* Разрешаем кликать по языкам */
    display: flex !important;
}

/* Дополнительно: чтобы стрелочка (если она есть) или активный язык подсвечивался */
.lang-switch.active .selected-lang {
    opacity: 0.8;
}

/* === СТИЛИ ДЛЯ ИЕРАРХИЧЕСКОГО ВЫБОРА ТИПОВ === */

/* ВАЖНО: display: block; отсюда НУЖНО УБРАТЬ, иначе меню не закроется. 
   Оставляем стили только для содержимого */

/* Делаем контейнер внутри на всю ширину */
#type-items-container {
    width: 100%;
}

/* Стили для радио кнопок (кругляшки) */
.dropdown-item input[type="radio"] ~ .checkmark {
    border-radius: 50%;
}

.dropdown-item input[type="radio"]:checked ~ .checkmark:after {
    left: 6px;
    top: 6px;
    width: 8px;
    height: 8px;
    border: none;
    border-radius: 50%;
    background: white;
    transform: none;
}

/* ============================================================
   МОБИЛЬНЫЕ ТАБЫ - ПЕРЕОПРЕДЕЛЯЕМ ДЕСКТОПНЫЕ СТИЛИ
   ============================================================ */
.mobile-search-section .tab {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.mobile-search-section .tab.active {
    background-color: #FFFFFF !important;
    color: #FF931C !important;
    border: none !important;
    text-decoration: none !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

.mobile-search-section .tab:not(.active) {
    background-color: transparent !important;
    color: #FFFFFF !important;
    border: none !important;
    text-decoration: none !important;
}