:root {
  --primary: #1c2e5a;
  --primary-dark: #0f172a;
  --accent: #cc2229;
  --accent-hover: #a81b21;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-hover: 0 12px 30px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
header { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; position: relative; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo-img { height: 50px; width: auto; object-fit: contain; border-radius: 8px; }
.logo-text { display: flex; flex-direction: column; }
.logo-title { font-weight: 900; font-size: 1.5rem; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.1; }
.logo-title span { color: var(--accent); }
.logo-subtitle { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav ul { display: flex; gap: 24px; list-style: none; }
.nav a:not(.logo) { text-decoration: none; color: var(--text); font-weight: 500; transition: color .2s; }
.nav a:not(.logo):hover, .nav a.active { color: var(--accent); }

.mobile-menu-btn { display: none; } 

a[href="favorites.html"] {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  color: var(--accent) !important;
  font-weight: 600 !important;
}
a[href="favorites.html"] svg { width: 16px !important; height: 16px !important; fill: currentColor; }

/* Соцсети */
.social-icons { display: flex; gap: 12px; align-items: center; }
.social-icons a { display: block; width: 36px; height: 36px; border-radius: 8px; transition: transform 0.2s; background-size: cover; background-position: center; }
.social-icons a:hover { transform: translateY(-3px); }
.social-tg { background-image: url('../images/tg-logo.png'); background-color: #0088cc; }
.social-vk { background-image: url('../images/vk-logo.png'); background-color: #0077FF; }
.social-max { background-image: url('../images/max-logo.png'); background-color: #7B68EE; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 16px 32px; border-radius: 12px; background: var(--primary); color: #fff; text-decoration: none; font-weight: 600; font-size: 1rem; border: none; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(28, 46, 90, 0.15); }
.btn:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(28, 46, 90, 0.25); }
.btn-accent { background: linear-gradient(135deg, #cc2229 0%, #a81b21 100%); box-shadow: 0 4px 15px rgba(204, 34, 41, 0.3); }
.btn-accent:hover { background: linear-gradient(135deg, #a81b21 0%, #8a151b 100%); box-shadow: 0 8px 25px rgba(204, 34, 41, 0.4); }
.btn-outline { background: transparent; border: 2px solid rgba(255, 255, 255, 0.3); backdrop-filter: blur(10px); box-shadow: none; }
.btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.8); }

/* Hero */
.hero { background: linear-gradient(135deg, #1c2e5a 0%, #0f172a 100%); color: #fff; padding: 120px 0; text-align: center; position: relative; overflow: hidden; }
.hero .container { position: relative; z-index: 10; }
.hero h1 { font-size: 3.5rem; margin-bottom: 20px; font-weight: 900; line-height: 1.2; letter-spacing: -1px; }
.hero p { font-size: 1.25rem; opacity: .85; margin-bottom: 40px; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; }

/* Блоки */
.trust-section { background: var(--surface); padding: 40px 0; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; text-align: center; }
.trust-item h3 { font-size: 2.5rem; color: var(--primary); font-weight: 900; margin-bottom: 5px; }
.trust-item p { color: var(--muted); font-size: 1rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 40px; margin-bottom: 80px; }
.step-card { background: var(--surface); padding: 32px 24px; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); transition: transform 0.3s; }
.step-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.step-num { width: 48px; height: 48px; background: rgba(204, 34, 41, 0.1); color: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 900; margin-bottom: 20px; }
.step-title { font-size: 1.15rem; font-weight: 800; color: var(--primary); margin-bottom: 12px; }
.step-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.6; }

/* Сетка и карточки */
.objects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; margin: 40px 0; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; display: flex; flex-direction: column; border: 1px solid var(--border); }
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.card-img-wrapper { position: relative; height: 240px; overflow: hidden; background: #e5e7eb; border-radius: var(--radius) var(--radius) 0 0; margin: 8px 8px 0 8px; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; display: block; border-radius: var(--radius) var(--radius) 0 0; }
.card:hover .card-img { transform: scale(1.05); }
.card-badge { position: absolute; top: 16px; left: 16px; background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; z-index: 5; }
.card-badge.new { background: #10b981; }
.favorite-btn { position: absolute; top: 16px; right: 16px; background: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #9ca3af; z-index: 11; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.favorite-btn svg { width: 20px; height: 20px; fill: currentColor; }
.favorite-btn.active { color: var(--accent); }
.card-slider-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.9); color: var(--text); border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; font-size: 1rem; opacity: 0; transition: opacity 0.2s; }
.card-img-wrapper:hover .card-slider-btn { opacity: 1; }
.card-slider-btn.prev { left: 12px; }
.card-slider-btn.next { right: 12px; }
.card-body { padding: 20px 24px 24px; flex: 1; display: flex; flex-direction: column; }
.card-price { font-size: 1.6rem; font-weight: 900; color: var(--primary); margin-bottom: 8px; }
.card-title { font-weight: 700; margin-bottom: 8px; font-size: 1.1rem; color: var(--text); }
.card-meta { color: var(--muted); font-size: .95rem; margin-bottom: 20px; display: flex; align-items: center; gap: 6px; }

/* Фильтры */
.filters-bar { display: flex; gap: 12px; margin: 30px 0; flex-wrap: wrap; position: relative; z-index: 150; }
.filter-dropdown { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 20px; cursor: pointer; user-select: none; display: flex; align-items: center; box-shadow: var(--shadow); }
.filter-dropdown.active { z-index: 999; border-color: var(--primary); }
.filter-dropdown.disabled { opacity: 0.45; pointer-events: none; cursor: not-allowed; }
.filter-title { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; color: var(--text); }
.filter-title svg { width: 16px; height: 16px; fill: var(--muted); }
.filter-content { display: flex; flex-direction: column; gap: 12px; position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: var(--surface); border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.15); padding: 20px; z-index: 1000; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s; border: 1px solid var(--border); }
.filter-dropdown.active .filter-content { opacity: 1; visibility: visible; transform: translateY(0); }
.filter-content label { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; cursor: pointer; }
.filter-content input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* =========================================
   ОДИНОЧНЫЙ СЛАЙДЕР ЦЕНЫ (ОДНА ЛИНИЯ)
   ========================================= */
.price-filter-content {
  width: 300px;
  min-width: 300px;
  padding: 24px 20px;
}

.price-values {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary);
}

.single-range-slider {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.range-track-bg {
  position: absolute;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  z-index: 1;
}

.range-track-fill {
  position: absolute;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  left: 0;
  z-index: 2;
}

/* Сам инпут */
.single-range-slider input[type="range"] {
  position: absolute;
  width: 100%;
  height: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: none;
  pointer-events: none; 
  margin: 0;
  z-index: 3;
}

/* Кружок (thumb) */
.single-range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto; 
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  position: relative;
  z-index: 4;
  transition: transform 0.1s;
}

.single-range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  position: relative;
  z-index: 4;
}

.single-range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}
/* ========================================= */

/* Footer */
footer { background: var(--primary-dark); color: #9ca3af; padding: 60px 0 30px; margin-top: 80px; }
footer a { color: #9ca3af; text-decoration: none; }
footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { color: #fff; margin-bottom: 20px; font-size: 1.1rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 12px; }
.copyright { text-align: center; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); font-size: .9rem; }

/* Утилиты */
.section-title { font-size: 2.2rem; margin: 60px 0 20px; color: var(--primary); font-weight: 900; }
.section-sub { color: var(--muted); margin-bottom: 30px; font-size: 1.1rem; }

/* АДАПТИВ (МОБИЛКА) */
@media (max-width: 768px) {
  .hero { padding: 60px 0 80px; }
  .hero h1 { font-size: 2rem; line-height: 1.3; margin-bottom: 15px; }
  .hero p { font-size: 1rem; margin-bottom: 30px; padding: 0 10px; opacity: 0.9; }
  .hero-buttons { flex-direction: column; gap: 12px; padding: 0 10px; }
  .hero-buttons .btn { width: 100%; padding: 14px; font-size: 1rem; }
  .trust-grid { grid-template-columns: 1fr; gap: 20px; }
  .steps-grid { grid-template-columns: 1fr; }
  
  .nav { height: 75px; padding: 0 15px; }
  .nav-right { gap: 10px; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
  .social-icons { display: none !important; }
  
  .logo { gap: 8px !important; display: flex; align-items: center; margin-right: auto; flex-shrink: 0; }
  .logo-img { height: 45px !important; width: auto !important; object-fit: contain; border-radius: 8px; } 
  
  .logo-text { display: flex !important; flex-direction: column; justify-content: center; white-space: nowrap; }
  .logo-title { font-size: 1.4rem !important; line-height: 1; margin-bottom: 2px; } 
  .logo-subtitle { display: block !important; font-size: 0.6rem !important; letter-spacing: 0.5px; } 
  
  .mobile-menu-btn { display: flex !important; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 0; z-index: 300; flex-shrink: 0; }
  .mobile-menu-btn span { width: 28px; height: 2px; background: var(--text); transition: 0.3s; border-radius: 2px; }
  
  .nav ul { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; flex-direction: column; padding: 20px; box-shadow: 0 10px 20px rgba(0,0,0,0.1); border-radius: 0 0 16px 16px; z-index: 250; }
  .nav ul.show { display: flex; }
  .nav ul li { width: 100%; text-align: center; margin-bottom: 15px; }
  .nav ul a { font-size: 1.1rem !important; display: block; padding: 10px; }

  .objects-grid { grid-template-columns: 1fr; }
  .object-layout { grid-template-columns: 1fr; }
  .object-sidebar-right { position: static; }
  .specs-grid { grid-template-columns: 1fr; }

  /* ФИКС ВЕРСТКИ ФИЛЬТРОВ НА МОБИЛКЕ (Сетка 2x2) */
  .filters-bar { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 10px; 
    margin: 20px 0; 
  }
  .filter-dropdown { 
    padding: 12px 15px; 
    justify-content: space-between; 
    width: 100%;
  }
  .filter-title { 
    width: 100%; 
    justify-content: space-between; 
    font-size: 0.95rem;
  }
  .filter-content {
    left: 0;
    right: auto;
    width: max-content;
    min-width: 100%;
    max-width: calc(100vw - 40px);
  }
  /* Прижимаем выпадашки правой колонки вправо, чтобы не вылезали за экран */
  .filter-dropdown:nth-child(even) .filter-content {
    left: auto;
    right: 0;
  }
  
  /* Специально для цены (она 4-я, прижмется вправо) */
  .price-filter-content {
    width: 280px !important;
    max-width: calc(100vw - 40px) !important;
    padding: 20px 15px;
  }
  .price-values { font-size: 0.85rem; }
}
