/* ═══════════════════════════════════
   TOKENS
═══════════════════════════════════ */
:root {
  --red:        #C0392B;
  --red-hover:  #A93226;
  --red-light:  #FDECEA;
  --dark:       #1A1A1A;
  --dark-2:     #2C2C2C;
  --gray-700:   #4A4A4A;
  --gray-500:   #7A7A7A;
  --gray-300:   #C8C8C8;
  --gray-100:   #F5F5F5;
  --white:      #FFFFFF;
  --border:     #EBEBEB;
  --font-head:  'Montserrat', sans-serif;
  --font-body:  'Inter', sans-serif;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.13);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
  --radius:     12px;
  --radius-sm:  6px;
  --transition: 0.25s ease;
  --page-pad: 32px;   /* side padding — единый отступ для всех секций */
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; font-size:16px; }
body { background:var(--white); color:var(--dark); font-family:var(--font-body); font-weight:400; line-height:1.6; overflow-x:hidden; }
img { display:block; max-width:100%; }
button { cursor:pointer; font-family:var(--font-body); }
a { text-decoration:none; color:inherit; }

::-webkit-scrollbar { width:5px; }
::-webkit-scrollbar-track { background:#f1f1f1; }
::-webkit-scrollbar-thumb { background:var(--red); border-radius:3px; }

/* ═══════════════════════════════════
   PAGE SYSTEM
═══════════════════════════════════ */
.page { display:none; overflow-x: clip; }
.page.active { display:block; overflow-x: clip; background: var(--white); }

/* ═══════════════════════════════════
   HEADER
═══════════════════════════════════ */
header {
  position: fixed; top:0; left:0; right:0; z-index:1000;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex; align-items: center;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  width:100%; max-width:1400px; margin:0 auto;
  padding: 0 var(--page-pad);
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}

/* Logo */
.logo {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; flex-shrink: 0;
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px; flex-shrink:0;
}
/* Georgian cross SVG inline */
.logo-text { display: flex; flex-direction: column; line-height:1.1; }
.logo-text-top {
  font-family: var(--font-head);
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--dark);
}
.logo-text-bot {
  font-family: var(--font-head);
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--red);
}

/* Nav */
.header-nav {
  display: flex; align-items: center; gap: 0;
  flex: 1; justify-content: center;
}
.header-nav a {
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--gray-700);
  padding: 0 20px; height: 64px;
  display: flex; align-items: center;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.header-nav a::after {
  content:'';
  position:absolute; bottom:-1px; left:20px; right:20px;
  height:3px; background:var(--red);
  transform:scaleX(0); transform-origin:center;
  transition: transform var(--transition);
}
.header-nav a:hover { color: var(--red); }
.header-nav a:hover::after, .header-nav a.active::after { transform:scaleX(1); }
.header-nav a.active { color: var(--red); }

.nav-sep {
  color: var(--gray-300);
  font-size: 0.8rem; padding: 0 2px;
  user-select: none;
}

/* Header right */
.header-right {
  display: flex; align-items: center; gap: 20px; flex-shrink:0; touch-action: manipulation;
}
.header-phone {
  font-size: 0.82rem; font-weight: 600;
  color: var(--dark); letter-spacing: 0.02em;
  white-space: nowrap;
}
.lang-switch {
  display: flex; align-items: center; gap: 2px;
}
.lang-btn {
  background: none; border: none;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--gray-500); padding: 4px 6px;
  transition: color var(--transition);
  font-family: var(--font-body);
}
.lang-btn.active { color: var(--red); }
.lang-btn:hover { color: var(--dark); }
.lang-sep-char { color: var(--gray-300); font-size: 0.75rem; }

/* Mobile hamburger */
.hamburger { display:none; flex-direction:column; gap:5px; padding:10px; background:none; border:none; cursor:pointer; touch-action:manipulation; position:relative; z-index:1001; }
.hamburger span { display:block; width:22px; height:2px; background:var(--dark); transition:var(--transition); }

/* ═══════════════════════════════════
   PAGE TOP OFFSET
═══════════════════════════════════ */
.page-body { padding-top: 64px; }

/* ═══════════════════════════════════
   BUTTONS
═══════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 700;
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  height: 48px; padding: 0 28px; border-radius: var(--radius-sm);
  transition: var(--transition); cursor: pointer; border: 2px solid transparent;
  white-space: nowrap; position: relative; overflow: hidden;
}
/* Shimmer sweep on all buttons */
.btn::after {
  content: ''; position: absolute; top: 0; left: 0;
  width: 60%; height: 100%;
  background: rgba(255,255,255,0.14);
  transform: translateX(-150%) skewX(-15deg);
  transition: transform 0.5s ease;
  pointer-events: none;
}
.btn:hover::after { transform: translateX(280%) skewX(-15deg); }
.btn-red { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-red:hover { background: var(--red-hover); border-color: var(--red-hover); }
.btn-outline { background: transparent; color: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: var(--white); }
.btn-dark { background: var(--dark); color: var(--white); border-color: var(--dark); }
.btn-dark:hover { background: var(--dark-2); }
.btn-white { background: var(--white); color: var(--dark); border-color: var(--white); }
.btn-white:hover { background: var(--gray-100); }

/* ═══════════════════════════════════
   SECTION UTILITY
═══════════════════════════════════ */
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 var(--page-pad); }
.section-title {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700; color: var(--dark);
  margin-bottom: 8px;
}
.section-subtitle {
  font-size: 0.875rem; color: var(--gray-500);
  margin-bottom: 40px;
}
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 12px;
}
.see-all {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gray-500);
  display: flex; align-items: center; gap: 6px;
  transition: color var(--transition); cursor: pointer;
}
.see-all:hover { color: var(--red); }
.see-all::after { content: '→'; font-size: 0.9rem; }

/* ═══════════════════════════════════
   ████ PAGE: HOME ████
═══════════════════════════════════ */

/* HERO */
.hero {
  position: relative;
  height: calc(100vh - 64px); min-height: 560px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('https://images.unsplash.com/photo-1561731172-9d906d7b13bf?w=1920&h=900&fit=crop') center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    105deg,
    rgba(0,0,0,0.72) 0%,
    rgba(0,0,0,0.45) 50%,
    rgba(0,0,0,0.15) 100%
  );
}
.hero-content {
  position: relative; z-index: 1;
  padding: 0 var(--page-pad) 72px;
  max-width: 1400px; margin: 0 auto; width: 100%;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800; line-height: 1.1;
  color: var(--white);
  margin-bottom: 12px;
  max-width: 640px;
}
.hero-sub {
  font-size: 0.95rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  margin-bottom: 32px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ═══════════════════════════════════

/* Mobile-only nav elements */
.nav-mobile-footer { display:none; }

.section-text { font-size:0.9rem; color:var(--gray-700); line-height:1.8; margin-bottom:12px; }
.section-text:last-child { margin-bottom:0; }

/* ════════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════════ */

/* ── Sticky header transition ── */
header.header-anim {
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* ── Scroll reveal ── */

/* Начальное скрытое состояние */
.reveal-init {
  opacity: 0;
  transform: translateY(22px);
}

/* Финальное видимое состояние — transition только здесь,
   срабатывает в момент добавления класса reveal-in */
.reveal-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity   0.75s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Отключаем анимации для пользователей которые их не хотят */
@media (prefers-reduced-motion: reduce) {
  .header-anim { transition: none; }
  .reveal-init { opacity: 1; transform: none; transition: none; }
}

/* ── RTL support (Hebrew) ── */
body.rtl { direction: rtl; text-align: right; }
body.rtl .header-inner { flex-direction: row-reverse; }
body.rtl .header-nav { flex-direction: row-reverse; }
body.rtl .logo { flex-direction: row-reverse; }
body.rtl .filter-form { flex-direction: column; }
body.rtl .catalog-city-row { flex-direction: row-reverse; }
body.rtl .catalog-specs { flex-direction: row-reverse; }
body.rtl .catalog-card-footer { flex-direction: row-reverse; }
body.rtl .catalog-pills-row { flex-direction: row-reverse; }
body.rtl .prop-badge { left: auto; right: 12px; }
body.rtl .top-label { right: auto; left: 12px; }

/* ── RTL: filter bar (projects.html + homepage search) ──
   body.rtl already sets direction:rtl, which makes plain
   flex-direction:row containers lay out right-to-left on their own
   (the flex "row" axis follows the inline/text direction). Adding
   row-reverse on top double-flips them back to an LTR-looking
   order — so these containers are intentionally left at their
   default row, not reversed. */
body.rtl .filter-field {
  text-align: right;
}
/* Field separator dot — was anchored to the left edge of each field */
body.rtl .filter-field + .filter-field::before {
  left: auto; right: -7px;
}
/* Select dropdown arrow + padding mirror */
body.rtl .filter-select {
  padding: 0 12px 0 36px;
  background-position: left 12px center;
}
/* "Сброс / Найти" is the last DOM child of filter-row-2 — with plain
   row + direction:rtl it's already the leftmost item; margin-left:auto
   (not margin-right, since there's no row-reverse) pushes it flush
   against the row's left edge */
body.rtl .filter-row-2-actions {
  margin-right: 0;
  margin-left: auto;
  align-items: flex-end;
}
/* projects.html row 2 indent matched the toggle width on the left —
   same fix as the LTR fallback in pages.css: margin on the first
   field, not padding on the whole row (which would squeeze
   .filter-row-2-actions' available width on the other end) */
body.rtl .filter-row-2--projects {
  padding-left: 0;
  padding-right: 0;
}
body.rtl .filter-row-2--projects > .filter-field:first-child {
  margin-left: 0;
  margin-right: calc(var(--projects-toggle-w, 170px) + 10px);
}
/* Search field icon/clear button are absolutely positioned (not flex
   items), so row-reverse on the wrapper has no effect on them —
   mirror left/right directly instead */
body.rtl .search-field-icon {
  left: auto; right: 11px;
}
body.rtl .search-field-input {
  padding: 0 34px 0 32px;
  text-align: right;
}
body.rtl .search-field-clear {
  right: auto; left: 10px;
}

@media (max-width: 768px) {
  /* .filter-row-2-actions on mobile switches to flex-direction:row,
     width:100%, justify-content:space-between (see responsive.css) —
     that already lays out correctly under direction:rtl without
     needing row-reverse; just clear the desktop margin-left:auto */
  body.rtl .filter-row-2-actions {
    margin-left: 0;
  }
  body.rtl .filter-row-2--projects > .filter-field:first-child {
    margin-right: 0;
  }
}
