/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
/* ── 1460px: prevent overflow on 1440px Mac screens ── */
@media (max-width: 1460px) {
  :root { --page-pad: 20px; }
}

@media (max-width:1024px) {
  :root { --page-pad: 24px; }
  .directions-grid { grid-template-columns:repeat(3,1fr); }
  .props-grid { grid-template-columns:repeat(2,1fr); }
  .footer-grid { grid-template-columns:1fr 1fr 1fr; }
  .detail-layout { grid-template-columns:1fr; }
  .detail-sidebar { position:static; }
  .prop-desc-grid { grid-template-columns: 1fr; }
  .team-about-cols { grid-template-columns: 1fr; gap: 0; }
  .team-about-stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .team-about-stat { border-right: none; padding: 0; text-align: left; }
  .team-about-stat:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.08); padding-right: 24px; }
  .contacts-grid { grid-template-columns:1fr; }
  .catalog-filter-inner { grid-template-columns:1fr 1fr; }
  .catalog-filter-inner .btn { grid-column:span 2; }
  /* unified filter */
  .filter-form { padding: 16px var(--page-pad); }
  .filter-row-1 { gap: 8px; }
  .filter-row-2 { gap: 8px; }
  .catalog-grid { grid-template-columns:repeat(2,1fr); }
  .about-strip-inner { grid-template-columns:1fr; gap:40px; }
  .team-grid { grid-template-columns:repeat(2,1fr); }
}

@media (max-width:768px) {
  /* ── Global padding reduction ── */
  :root { --page-pad: 16px; }
  .container { padding: 0 var(--page-pad); }
  .header-inner { padding: 0 16px; gap: 12px; }
  .section { padding: 48px 0; }
  .section-sm { padding: 32px 0; }

  /* ── Header ── */
  .header-nav { display:none; }
  .header-nav.open {
    display:flex; flex-direction:column;
    position:fixed; left:0; right:0; top:64px;
    height:calc(100vh - 64px);
    height:calc(100dvh - 64px);
    background:var(--white); padding:0;
    gap:0; z-index:1100; border-top:2px solid var(--red);
    overflow-y:auto;
  }
  .header-nav.open .nav-sep { display:none; }
  .header-nav.open a {
    display:flex; align-items:center; justify-content:center;
    height:68px; padding:0 24px;
    font-size:1.3rem; font-weight:600; color:var(--dark);
    border-bottom:1px solid var(--gray-100);
    transition: background 0.15s, color 0.15s;
  }
  .header-nav.open a:hover,
  .header-nav.open a.active { color:var(--red); }
  .header-nav.open a::after { display:none; }

  /* Mobile footer inside nav */
  .nav-mobile-footer {
    display:flex;
    margin-top:auto; padding: 24px 24px 32px;
    border-top:1px solid var(--gray-100);
    flex-direction:column; align-items:center; gap:16px;
  }
  .nav-mobile-phone {
    font-size:1.1rem; font-weight:700; color:var(--dark);
    text-decoration:none; letter-spacing:0.02em;
    display:flex; align-items:center; gap:8px;
    border-bottom:none !important; height:auto !important;
    padding:0 !important; background:none !important;
  }
  .nav-mobile-phone:hover { color:var(--red) !important; background:none !important; }
  .nav-mobile-socials { display:flex; gap:12px; }
  .nav-mobile-social {
    width:40px; height:40px; border-radius:50%;
    border:1px solid var(--border); background:var(--white);
    display:flex; align-items:center; justify-content:center;
    color:var(--gray-700); text-decoration:none;
    transition:var(--transition);
    border-bottom:none !important; padding:0 !important; height:40px !important;
  }
  .nav-mobile-social:hover { background:var(--red); color:var(--white); border-color:var(--red); }

  .hamburger { display:flex; }
  .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity:0; }
  .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .header-phone { display:none; }
  /* Компактный lang-switch на мобиле */
  .lang-switch { gap:0; }
  .lang-btn { padding:4px 4px; font-size:0.7rem; }
  .lang-sep-char { font-size:0.7rem; }
  .header-right { gap:10px; }

  /* ── Hero ── */
  .hero-content { padding: 0 0 48px; }
  .hero-actions { flex-direction:column; gap:10px; }
  .hero-actions .btn { width:100%; justify-content:center; }

  /* ── Filter bar (unified) ── */
  .filter-tabs { padding: 0 var(--page-pad); }
  .filter-tab { padding: 14px 16px; }
  .filter-form { padding: 12px var(--page-pad); }
  .filter-row-1 { flex-wrap: wrap; gap: 8px; }
  .filter-row-2 { flex-wrap: wrap; gap: 8px; }
  .filter-row-2-actions { margin-left: 0; width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  .filter-btn { flex: 1; }
  .filter-sep-v { display: none; }

  /* ── Directions ── */
  .directions-grid { grid-template-columns:repeat(2,1fr); gap:10px; }

  /* ── About strip ── */
  .about-strip-inner { padding: 0 var(--page-pad); gap:28px; }
  .stats-row { grid-template-columns:1fr 1fr; }
  .stat-item { padding: 20px 12px; }
  .stat-num { font-size:1.5rem; }

  /* ── Props grid ── */
  .props-grid { grid-template-columns:1fr 1fr; gap:14px; }

  /* ── Section header ── */
  .section-header { flex-direction:column; align-items:flex-start; gap:8px; margin-bottom:20px; }

  /* ── Inner page heroes — одинаковая высота ── */
  .catalog-hero, .team-hero, .contacts-hero, .blog-hero { height: 180px; }
  .catalog-hero-content { padding: 0 var(--page-pad) 24px; }
  .team-hero-content { padding: 0 16px 24px; }
  /* catalog filter → handled by .filter-form above */
  .catalog-body { padding: 24px 16px 60px; }
  .catalog-grid { grid-template-columns:1fr; }

  /* List view на мобиле — вертикальная карточка (как плитка, но full-width) */
  .catalog-grid.catalog-list-view .catalog-card {
    grid-template-columns: 1fr;
    min-height: unset;
    height: auto;
  }
  .catalog-grid.catalog-list-view .catalog-card-img-wrap {
    height: 200px;
    min-height: unset;
    width: 100%;
    position: relative;
    overflow: hidden;
  }
  .catalog-grid.catalog-list-view .catalog-img {
    height: 200px;
    min-height: unset;
    width: 100%;
    aspect-ratio: unset;
    object-fit: cover;
  }
  .catalog-grid.catalog-list-view .card-fav-inline {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 4;
  }
  .catalog-grid.catalog-list-view .catalog-card-body {
    padding: 14px 16px;
  }
  .catalog-grid.catalog-list-view .catalog-name {
    font-size: 0.95rem;
  }
  .catalog-grid.catalog-list-view .catalog-specs {
    margin-top: auto;
  }
  .catalog-grid.catalog-list-view .catalog-card-desc { display: none !important; }

  /* ── Team ── */
  .team-about-grid { grid-template-columns:1fr !important; gap:24px !important; }
  .team-section-inner { padding: 32px 16px 60px; }
  .team-grid { grid-template-columns:1fr 1fr; gap:16px; }
  /* Раздел «О компании» внутри team */
  .team-section-inner > div:last-child > div[style*="grid-template-columns"] {
    display:flex !important; flex-direction:column; gap:24px;
  }

  /* ── Detail gallery: mobile slider ── */
  .detail-gallery {
    display: block;
    position: relative;
    height: 280px;
    border-radius: var(--radius);
    overflow: hidden;
  }
  .gallery-main { height: 280px; }
  .gallery-side { display: none; }
  .gallery-all-btn { display: none; }
  .gallery-mob-slider { display: flex !important; }
  .gallery-mob-prev { display: flex !important; }
  .gallery-mob-next { display: flex !important; }
  .gallery-mob-dots { display: flex !important; }
  .gallery-mob-all { display: flex !important; }
  .detail-body { padding: 24px 16px 60px; }
  .detail-layout { gap:24px; }
  .detail-specs-bar { display:grid; grid-template-columns:repeat(3,1fr); }
  .detail-spec { flex:unset; min-width:0; border-right:1px solid var(--border); border-bottom:1px solid var(--border); }
  .detail-spec:nth-child(3n) { border-right:none; }
  .detail-spec:nth-last-child(-n+3) { border-bottom:none; }
  .detail-spec-svg { width:30px; height:30px; }

  /* ── Contacts ── */
  .contacts-hero-content { padding: 0 16px 24px; }
  .contacts-body { padding: 24px 16px 60px; }
  .contacts-grid { grid-template-columns:1fr; gap:24px; }
  .form-row { grid-template-columns:1fr; gap:10px; }
  .form-card { padding: 20px 16px; }

  /* ── Footer ── */
  .footer-inner { padding: 0 16px; }
  .footer-grid { grid-template-columns:1fr 1fr; gap:24px; margin-bottom:32px; }

  /* ── Pagination / catalog count ── */
  div[style*="justify-content:space-between"] { flex-direction:column; align-items:flex-start; }
}

@media (max-width:480px) {
  /* ── Header ── */
  .logo-text-top { font-size:0.72rem; }
  .logo-text-bot { font-size:0.6rem; }

  /* ── Hero ── */
  .hero { min-height:480px; }

  /* ── Filter ── */
  .filter-row-1 > .filter-field { flex: 1 1 calc(50% - 8px); }
  .filter-field--price .filter-range-input,
  .filter-field--area  .filter-range-input { width: 64px; }
  .rooms-btn { padding: 0 8px; }

  /* ── Search ── */
  .search-form { grid-template-columns:1fr; }
  .search-form .btn { grid-column:auto; }

  /* ── Directions ── */
  .directions-grid { grid-template-columns:1fr 1fr; gap:8px; }
  .direction-img { aspect-ratio:2/3; }
  

  /* ── Props ── */
  .props-grid { grid-template-columns:1fr; }

  /* ── Team ── */
  .team-grid { grid-template-columns:1fr; }

  /* ── Stats ── */
  .stat-item { padding: 16px 8px; }
  .stat-num { font-size:1.4rem; }
  .stat-label { font-size:0.65rem; }

  /* ── Detail specs: 1 column on very small ── */
  .detail-spec { flex: 1 1 100%; border-right:none; border-bottom:1px solid var(--border); }
  .detail-spec:last-child { border-bottom:none; }

  /* ── Footer ── */
  .footer-grid { grid-template-columns:1fr; gap:20px; }
  .footer-bottom { flex-direction:column; align-items:flex-start; gap:6px; }
}

/* ── Sort Dropdown responsive ── */
@media (max-width: 640px) {
  .catalog-headline-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .catalog-headline-row > div { flex: none; }
  .catalog-headline-tools { width: 100%; }
  .sort-dropdown { flex: 1; justify-content: flex-start; }
  .sort-dropdown-btn { min-width: 0; width: 100%; }
  .sort-dropdown-menu { width: 100%; min-width: 0; }
}
/* ── Recently viewed + currency responsive ── */
@media (max-width: 900px) {
}
@media (max-width: 640px) {
  .catalog-headline-tools { width: 100%; flex-wrap: wrap; }
  .currency-switch { order: 2; }
}

/* ── Detail map responsive ── */
@media (max-width: 768px) {
  .detail-inline-map { height: 220px; }
}

/* ── New filters responsive ── */
@media (max-width: 768px) {
  .filter-field--price .filter-range-input,
  .filter-field--area  .filter-range-input { width: 70px; }
  .rooms-btn { padding: 0 8px; font-size: 0.75rem; }
}

/* ── Blog responsive ── */
@media (max-width: 768px) {
  .blog-section-inner { padding: 32px 16px 56px; }
  .blog-article-body  { padding: 0 16px; }
}
@media (max-width: 480px) {
  .blog-section-inner { padding: 24px 16px 48px; }
}
