/* ===== CSS Variables (elite-emlak.az design tokens) ===== */
:root {
  --color-primary: #4264fd;
  --color-primary-light: #a5c5fc;
  --color-green: #3db460;
  --color-logo: #946952;
  --color-logo-alt: #ad7a5b;
  --color-text: #2f1f19;
  --color-text-secondary: #333;
  --color-text-muted: #98918a;
  --color-border: #eae5e1;
  --color-bg-light: #f6f4f1;
  --color-bg-gray: #f8f8f8;
  --color-white: #fff;
  --color-premium: #af8329;
  --font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius-sm: 7px;
  --radius-md: 14px;
  --radius-pill: 100px;
  --shadow-card: 0 5px 12px 0 rgba(0, 0, 0, 0.05);
  --header-height: 60px;
  --mobile-nav-height: 60px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.44;
  padding-bottom: var(--mobile-nav-height);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}

.header__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

.header__logo { flex-shrink: 0; }

.logo-svg { height: 28px; width: auto; max-width: 200px; }

.logo-text {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  fill: var(--color-logo-alt);
  letter-spacing: 0.5px;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.header__nav-link {
  padding: 8px 10px;
  font-size: 14px;
  color: var(--color-text-secondary);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.header__nav-link:hover { background: var(--color-bg-gray); }

.header__nav-link--partner {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.partner-icon { color: var(--color-logo-alt); font-size: 12px; }

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header__lang {
  font-size: 14px;
  color: var(--color-text);
  padding: 6px 8px;
}

.header__fav {
  padding: 8px;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
}

.header__new-ad {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--color-green);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: opacity 0.15s;
}

.header__contact {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  white-space: nowrap;
  text-decoration: none;
  transition: opacity 0.15s;
}

.header__contact:hover { opacity: 0.9; }

.header__new-ad:hover { opacity: 0.9; }

.header__login {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-white);
  white-space: nowrap;
}

.header__login:hover { background: var(--color-bg-gray); }

/* ===== Search Section ===== */
.search-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 15px 0;
}

.search-bar {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.search-bar__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.search-bar__select { flex: 0 0 auto; }

.select-btn {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
  height: 100%;
  min-height: 48px;
}

.select-btn:hover { background: var(--color-bg-gray); }

.select-wrapper { position: relative; }

.select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  z-index: 50;
  padding: 4px 0;
}

.select-wrapper--open .select-dropdown { display: block; }

.select-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.select-dropdown button:hover { background: var(--color-bg-gray); }

.category-pill__icon {
  display: flex;
  align-items: center;
  color: var(--color-text-muted);
}

.floating-filter {
  display: none;
  position: fixed;
  right: 15px;
  bottom: calc(var(--mobile-nav-height) + 15px + env(safe-area-inset-bottom));
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--color-primary);
  color: white;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 12px rgba(66, 100, 253, 0.4);
  z-index: 90;
}

.search-bar__location {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  position: relative;
  border-right: 1px solid var(--color-border);
}

.search-bar__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
  min-height: 48px;
}

.search-bar__input::placeholder { color: var(--color-text-muted); }

.search-bar__city {
  padding: 0 16px;
  font-size: 14px;
  color: var(--color-primary);
  white-space: nowrap;
}

.search-bar__filters-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-right: 1px solid var(--color-border);
  white-space: nowrap;
}

.search-bar__filters-btn:hover { background: var(--color-bg-gray); }

.search-bar__submit {
  padding: 12px 32px;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 500;
  min-height: 48px;
  transition: background 0.15s;
}

.search-bar__submit:hover { background: #3450d4; }

/* ===== Categories ===== */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg-gray);
  color: var(--color-text-secondary);
  font-size: 13px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.category-pill:hover { background: #eee; }

.category-pill--active {
  background: rgba(173, 122, 91, 0.14);
  color: #8a4f32;
  border-color: rgba(173, 122, 91, 0.35);
  font-weight: 600;
}

.category-pill__icon { font-size: 16px; display: inline-flex; }

.listings-empty {
  grid-column: 1 / -1;
  padding: 28px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
}

.today-count {
  text-align: right;
  margin-top: 8px;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer__contact-desc {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  max-width: 420px;
  line-height: 1.5;
}

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px 40px;
}

/* ===== Section ===== */
.section { margin-top: 20px; }

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}

.section__title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
}

.section__header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section__more {
  font-size: 14px;
  color: var(--color-primary);
}

.section__more:hover { text-decoration: underline; }

.page-title {
  font-size: 18px;
  font-weight: 500;
  padding: 14px 0;
  color: var(--color-text);
}

/* ===== Slider Controls ===== */
.slider-controls { display: flex; gap: 4px; }

.slider-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: background 0.15s;
}

.slider-btn:hover:not(:disabled) { background: var(--color-bg-gray); }
.slider-btn:disabled { opacity: 0.3; cursor: default; }

.slider-wrapper { overflow: hidden; margin: 0 -5px; }

.slider-track {
  display: flex;
  gap: 10px;
  transition: transform 0.3s ease;
  padding: 5px;
}

/* ===== Complex Cards ===== */
.complexes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.complex-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
}

.complex-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.complex-card__image-wrap {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.complex-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.complex-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

.complex-card__name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.complex-card__body { padding: 10px 12px 14px; }

.complex-card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.complex-card__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.complex-card__developer {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.complex-card__location {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.complex-card__deadline {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== Listing Cards ===== */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.card {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.15s;
  color: inherit;
}

.card:hover { transform: translateY(-1px); }

.card--slider {
  flex: 0 0 270px;
  width: 270px;
}

.card__image-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card--slider .card__image-wrap { height: 160px; }

.card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  color: var(--color-white);
}

.card__badge--agency { background: var(--color-primary); }

.card__badge--type { background: var(--color-green); }

.card__badge--cat {
  left: auto;
  right: 8px;
  bottom: 8px;
  background: rgba(26, 22, 20, 0.72);
}

.card__bookmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.card__bookmark:hover,
.card__bookmark--active { color: #ff3c00; }

.card__body { padding: 10px 12px 14px; position: relative; }

.card__price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.card__price {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.card__verified { display: flex; }

.card__tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.card__tag {
  font-size: 11px;
  color: var(--color-primary);
  background: rgba(66, 100, 253, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.card__location {
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 2px;
}

.card__specs {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.card__date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.card__premium {
  position: absolute;
  bottom: 12px;
  right: 12px;
}

/* ===== Popular Searches ===== */
.section--popular { margin-top: 30px; }

.popular-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--color-text);
}

.popular-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popular-list li a {
  display: inline-block;
  padding: 8px 14px;
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text-secondary);
  transition: background 0.15s;
}

.popular-list li a:hover { background: var(--color-border); }

/* ===== Footer ===== */
.footer {
  background: var(--color-bg-light);
  padding: 30px 15px 20px;
  margin-bottom: var(--mobile-nav-height);
}

.footer__contact {
  max-width: 1200px;
  margin: 0 auto 25px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.footer__contact-title {
  display: block;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--color-text);
}

.footer__contact-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer__contact-links a {
  font-size: 15px;
  color: var(--color-primary);
}

.footer__lead-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__lead-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.footer__lead-form input,
.footer__lead-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.footer__lead-btn {
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.footer__lead-status {
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer__app {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__app-icon {
  width: 45px;
  height: 45px;
  background: #ce312d;
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.footer__app-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

.footer__app-desc {
  font-size: 12px;
  color: var(--color-text-muted);
}

.footer__locations {
  max-width: 1200px;
  margin: 0 auto 25px;
}

.footer__locations-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 10px;
  margin-top: 15px;
}

.footer__locations-title:first-child { margin-top: 0; }

.footer__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footer__tag {
  font-size: 13px;
  color: var(--color-text-secondary);
  padding: 4px 0;
  margin-right: 12px;
}

.footer__tag:hover { color: var(--color-primary); }

.footer__bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 15px;
}

.footer__links a {
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer__links a:hover { color: var(--color-primary); }

.footer__social {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.footer__social a {
  color: var(--color-text-muted);
  display: flex;
}

.footer__lang-btn {
  font-size: 13px;
  color: var(--color-text-muted);
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.footer__copyright {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* ===== Mobile Bottom Nav ===== */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  color: var(--color-text-muted);
  letter-spacing: 0.3px;
  padding: 4px 8px;
}

.mobile-nav__item--active { color: var(--color-primary); }

.mobile-nav__item--new { position: relative; }

.mobile-nav__new-btn {
  width: 48px;
  height: 48px;
  background: var(--color-green);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  margin-top: -20px;
  box-shadow: 0 2px 8px rgba(61, 180, 96, 0.4);
}

/* ===== Side Menu ===== */
.side-menu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  visibility: hidden;
  pointer-events: none;
}

.side-menu--open {
  visibility: visible;
  pointer-events: auto;
}

.side-menu__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
}

.side-menu--open .side-menu__overlay { opacity: 1; }

.side-menu__content {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 80%;
  max-width: 320px;
  background: #2e2e2e;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0, 0.15, 0, 1);
  overflow-y: auto;
}

.side-menu--open .side-menu__content { transform: translateX(0); }

.side-menu__header {
  padding: 15px;
  display: flex;
  justify-content: flex-end;
}

.side-menu__close {
  color: white;
  font-size: 28px;
  padding: 4px 8px;
}

.side-menu__nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #414141;
  border-bottom: 1px solid #414141;
}

.side-menu__nav a {
  padding: 16px 20px;
  color: white;
  font-size: 16px;
  border-bottom: 1px solid #3a3a3a;
}

.side-menu__nav a:hover { background: #3a3a3a; }

.side-menu__footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-menu__footer a {
  color: #ccc;
  font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .complexes-grid,
  .listings-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .header__burger { display: flex; }
  .header__nav { display: none; }
  .header__contact { display: none; }

  .search-bar__filters { flex-direction: column; }
  .search-bar__select,
  .search-bar__location,
  .search-bar__filters-btn { border-right: none; border-bottom: 1px solid var(--color-border); }
  .search-bar__submit { width: 100%; }

  .complexes-grid { grid-template-columns: repeat(2, 1fr); }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }

  .slider-controls { display: none; }
  .section__header-right .section__more { display: none; }

  .footer__contact { flex-direction: column; }
  .mobile-nav { display: flex; }
  .floating-filter { display: flex; }

  body { padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
}

@media (max-width: 480px) {
  .complexes-grid { grid-template-columns: 1fr; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  .card__image-wrap { height: 140px; }
  .card__price { font-size: 14px; }
  .card__location { font-size: 13px; }
  .card__specs { font-size: 12px; }

  .header__lang { display: none; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
  body { padding-bottom: 0; }
  .footer { margin-bottom: 0; }
}
