/* CSS переменные для темизации */
:root {
  /* Светлая тема (по умолчанию) - улучшенная палитра с лучшим контрастом */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --bg-tertiary: #ecf1f7;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-light: #7c8a9d;
  --accent-color: #e8d661;
  --accent-dark: #d4c04a;
  --border-color: rgba(15, 23, 42, 0.1);
  --section-bg: #f5f8fc;
  /* Цвета для sidebar */
  --sidebar-bg: #e8ecf1;
  --sidebar-link-bg: #d4dce8;
}

html.dark-mode {
  /* Темная тема */
  --bg-primary: #1a1a1a;
  --bg-secondary: #252525;
  --bg-tertiary: #333;
  --text-primary: #ffffff;
  --text-secondary: #e0e0e0;
  --text-light: #b0b0b0;
  --accent-color: #e8d661;
  --accent-dark: #f0e081;
  --border-color: rgba(232, 214, 97, 0.2);
  --section-bg: #1a1a1a;
}

/* Общие стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background 0.3s ease, color 0.3s ease;
}

[data-lang="ru"] .lang-kz {
  display: none;
}

[data-lang="kz"] .lang-ru {
  display: none;
}

.lang-ru,
.lang-kz {
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.city-coverage {
  background: var(--section-bg);
  padding: 80px 28px;
}

.city-coverage h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 12px;
}

.city-coverage p {
  max-width: 800px;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.city-grid a {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.city-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--border-color);
}

.city-swipe-hint {
  display: none;
  margin: 8px 0 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .city-coverage {
    padding: 48px 18px;
  }

  .city-coverage h2 {
    font-size: 1.5rem;
  }

  .city-coverage p {
    font-size: 0.95rem;
  }

  .city-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(92px, 1fr);
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }

  .city-swipe-hint {
    display: block;
  }

  .city-grid a {
    padding: 8px 10px;
    font-size: 0.85rem;
    border-radius: 10px;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    scroll-snap-align: start;
  }
}

.city-page main {
  padding: 140px 28px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.city-hero {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.city-hero h1 {
  color: var(--text-primary);
  font-size: 2.4rem;
}

.city-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.city-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.city-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.city-card {
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
}

.city-card h3 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.city-longform {
  margin-top: 28px;
  padding: 22px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.city-longform h2 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.city-longform p {
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.city-longform p:last-child {
  margin-bottom: 0;
}

.seo-block {
  margin-top: 32px;
  padding: 20px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
}

.seo-block h2,
.seo-block h3 {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.seo-block ul {
  padding-left: 18px;
  margin-top: 12px;
  color: var(--text-secondary);
}

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.seo-links a {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.faq-item {
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
}

.faq-item h4 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.contact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  margin-top: 20px;
}

.contact-strip a {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Хедер */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0;
  height: auto;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px var(--border-color);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border-bottom: 1px solid var(--border-color);
  overflow: visible;
}

header.collapsed {
  box-shadow: 0 2px 6px var(--border-color);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-color);
  gap: 20px;
  position: relative;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: visible;
}

.header-top .logo {
  font-family: 'Courier New', 'Courier', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-color), #f0e081);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  display: inline-block;
  animation: logoFloat 3s ease-in-out infinite;
}

.header-top .logo img {
  max-width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.header-top .logo::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(232, 214, 97, 0.3), rgba(240, 224, 129, 0.2));
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.header-top .logo:hover {
  transform: scale(1.08) translateY(-2px);
  filter: drop-shadow(0 8px 16px rgba(232, 214, 97, 0.4));
}

.header-top .logo:hover img {
  transform: scale(1.05);
}

.header-top .logo:hover::before {
  opacity: 1;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-3px);
  }
}

.top-right-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
  flex-shrink: 0;
  z-index: 1401;
  position: relative;
}

.search-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  flex-shrink: 0;
}

.search-toggle-btn:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  transform: scale(1.1);
}

.search-panel {
  position: absolute;
  right: 420px;
  transform: translateY(-8px) scaleX(0);
  transform-origin: right top;
  width: 360px;
  max-width: 70vw;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.header-top.search-active .search-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scaleX(1);
}

.search-panel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-panel-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  outline: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  flex: 1;
}

.search-panel-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(232, 214, 97, 0.25);
}

.search-panel-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--accent-color);
  color: var(--bg-primary);
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.search-panel-btn:hover {
  background: #f0e081;
  transform: translateY(-1px);
}

.search-panel-dropdown {
  margin-top: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: none;
}

.search-panel.has-results .search-panel-dropdown {
  display: block;
}

.search-suggestions {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.search-suggestions li {
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.search-suggestions li:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: translateX(4px);
}

.search-results {
  border-top: 1px solid var(--border-color);
  max-height: 260px;
  overflow: auto;
}

.search-result-item {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.search-result-item:hover {
  background: var(--hover-bg);
}

.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.search-result-snippet {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.search-empty {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .search-panel {
    right: 0;
    left: 0;
    top: calc(100% + 8px);
    transform: translateY(-8px) scaleX(1);
    max-width: 100%;
  }

  .header-top.search-active .search-panel {
    transform: translateY(0) scaleX(1);
  }
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
  transform: scale(1.1);
}

/* Поиск: по умолчанию спрятан и позиционируется справа рядом с кнопками */
/* Поиск: на desktop показывается справа под header-top, на mobile под header */
.search-bar {
  position: absolute;
  right: 180px;
  top: calc(100% + 4px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  width: 500px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transform-origin: top right;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1400;
}

.header-top.search-active .search-bar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Поведение поиска на мобильных: показывать в отдельной ячейке под header */
@media (max-width: 768px) {
  .header-top {
    padding: 10px 12px;
  }
  
  .search-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 4px);
    width: auto;
    padding: 10px;
    gap: 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transform-origin: top center;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1400;
  }
  
  .header-top.search-active {
    padding-bottom: 72px;
  }
  
  .header-top.search-active .search-bar {
    width: auto;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  
  .search-bar input,
  .search-bar select {
    flex: 1;
    min-width: 0;
  }
}

/* Гарантируем, что навигационная панель всегда видна и не прячется при сворачивании */
.header-nav {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  z-index: 1401;
}

header.collapsed .header-nav {
  position: relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
}

.header-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 20px 28px 24px 28px;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  max-height: 200px;
  overflow: visible;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}

body:not(.index) .header-nav {
  position: static !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
}

.header-nav .logo {
  flex-basis: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.6rem;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-bottom: 8px;
}

.header-nav .logo:hover {
  opacity: 0.85;
}

header.collapsed .header-nav {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0;
  gap: 8px;
  opacity: 1;
  max-height: none;
  flex-wrap: nowrap;
  width: auto;
  justify-content: center;
}

body:not(.index) header.collapsed .header-nav {
  position: static !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
}

header.collapsed .header-nav .logo {
  display: none;
}

.nav-btn {
  padding: 10px 22px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  white-space: nowrap;
}

header.collapsed .nav-btn {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.nav-btn:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

/* Dropdown меню */
.nav-item {
  position: relative;
}

header.collapsed .nav-item {
  display: inline-flex;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 1250;
  margin-top: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

header.collapsed .nav-item:hover .dropdown-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.dropdown-menu a {
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.dropdown-menu a:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-menu a:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-menu a:hover {
  background: rgba(232, 214, 97, 0.1);
  border-left-color: var(--accent-color);
  padding-left: 20px;
}

/* Поиск */
.search-bar input,
.search-bar select {
  padding: 8px 12px;
  border-radius: 5px;
  border: 2px solid rgba(232, 214, 97, 0.3);
  outline: none;
  font-size: 0.9rem;
  min-width: 0;
  flex: 1;
  background: var(--input-bg);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.search-bar input:focus,
.search-bar select:focus {
  border-color: #e8d661;
  box-shadow: 0 0 12px rgba(232, 214, 97, 0.4);
}

.search-bar input::placeholder {
  color: #999;
}

.search-bar select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  padding-right: 28px;
  flex: 0 1 auto;
  min-width: 120px;
}

.search-bar button {
  padding: 8px 12px;
  border-radius: 5px;
  border: none;
  background: #e8d661;
  color: #1a1a1a;
  cursor: pointer;
  transition: 0.3s;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.search-bar button:hover {
  background: #f0e081;
  transform: translateY(-1px);
}

/* Боковая навигация */
.sidebar {
  position: fixed;
  top: 20px;
  left: 0;
  width: 70px;
  height: calc(200% - 140px);
  background: var(--sidebar-bg, var(--bg-secondary));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 150px;
  gap: 20px;
  transition: width 0.18s ease;
  z-index: 1200;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% - 20px);
  height: 44px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 600;
  background: var(--sidebar-link-bg, var(--bg-tertiary));
  transition: background 0.18s, transform 0.18s;
  justify-content: flex-start;
  position: relative;
}

.sidebar a:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
}

/* Animated sidebar icons — minimal, accessible and interactive */
.sidebar a .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.04));
  font-size: 20px;
  transition: transform 0.28s cubic-bezier(.2, .9, .2, 1), box-shadow 0.28s;
  will-change: transform;
}

.sidebar a .icon::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
}

/* gentle idle float */
@keyframes floaty {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }

  100% {
    transform: translateY(0);
  }
}

.sidebar a .icon {
  animation: floaty 4.8s ease-in-out infinite;
}

.sidebar a:hover .icon {
  transform: translateX(6px) scale(1.06);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
  animation-play-state: paused;
  /* pause idle on hover for crisp reaction */
}

/* make emoji/icons clearer on small screens */
.sidebar a .icon[aria-hidden="true"] {
  line-height: 1;
}

/* Ensure inline SVGs size and use current color */
.sidebar a .icon svg,
.sidebar a .icon .icon-svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
  fill: currentColor;
}

/* Sidebar expanded labels and tooltips */
.sidebar:hover {
  width: 220px;
}

/* При открытии сайдбара: уменьшить иконки, чтобы больше места заняли метки */
.sidebar:hover a .icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  animation-play-state: paused;
  transform: translateX(4px) scale(0.96);
}

.sidebar:hover a .icon svg,
.sidebar:hover a .icon .icon-svg {
  width: 14px;
  height: 14px;
}

/* Если нужно полностью убирать иконки при открытии сайдбара, добавьте класс hide-icons к .sidebar */
.sidebar.hide-icons:hover a .icon {
  display: none;
}

.sidebar.hide-icons:hover a {
  justify-content: center;
}

/* Языковая панель */
.lang-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1401;
}

.lang-tab {
  padding: 8px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.lang-tab:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
}

.lang-panel {
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1400;
  margin-top: 8px;
  min-width: 120px;
}

/* Поддерживаем оба класса: .open (CSS) и .active (если скрипт использует его) */
.lang-panel.open,
.lang-panel.active {
  display: flex;
}

.lang-option {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 16px;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.2;
  -webkit-tap-highlight-color: transparent;
}

.lang-option:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
}

.sidebar a .label {
  display: none;
  opacity: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.sidebar:hover a .label {
  display: inline-block;
  opacity: 1;
}

.sidebar a::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-8px);
  background: rgba(26, 26, 26, 0.98);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 1001;
}

/* Показывать подсказку только если панель НЕ развернута */
.sidebar:not(:hover) a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Hero banner */
.hero {
  position: relative;
  background: #1a1a1a;
  color: #fff;
  margin-left: 0;
  margin-top: 130px;
  overflow: hidden;
  padding: 60px 40px;
  min-height: 600px;
}

header.collapsed~.sidebar~.hero {
  margin-top: 64px;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-content {
  position: relative;
  z-index: 10;
  padding: 40px 0;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px 0;
  color: #fff;
}

.hero-description {
  font-size: 1.3rem;
  line-height: 1.6;
  margin: 0 0 32px 0;
  opacity: 0.9;
  color: #ddd;
}

.hero-cta {
  display: inline-block;
  padding: 16px 48px;
  background: #e8d661;
  color: #1a1a1a;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(232, 214, 97, 0.3);
}

.hero-cta:hover {
  background: #f0e078;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(232, 214, 97, 0.4);
}

.hero-images-container {
  position: relative;
  z-index: 5;
}

.hero-carousel {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.hero-img-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.hero-img-wrapper.active {
  opacity: 1;
}

.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
}

.hero-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 5;
}

.hero-progress__bar {
  height: 100%;
  width: 0%;
  background: #e8d661;
  transition: width 0.1s linear;
}

.hero-pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 0.95rem;
  opacity: 0.8;
}

.pagination-text {
  margin-left: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.hero-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
}

.hero-btn:hover {
  border-color: #e8d661;
  transform: scale(1.2);
}

.hero-btn.active {
  background: #e8d661;
  border-color: #e8d661;
  color: #000;
  transform: scale(1.1);
}

/* Responsive Hero */
@media (max-width: 1100px) {
  .hero {
    padding: 40px 30px;
    min-height: auto;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .hero {
    margin-top: 100px;
    padding: 30px 20px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .hero-cta {
    padding: 14px 36px;
    font-size: 0.9rem;
  }
}

/* Контент */
main {
  margin-left: 80px;
  padding: 60px 40px 40px 40px;
  position: relative;
  z-index: 1;
  background: var(--bg-primary);
}

section {
  margin-bottom: 0;
  background: var(--section-bg);
  padding: 80px 40px;
  border-radius: 8px;
  margin: 20px 0;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  position: relative;
  color: var(--text-primary);
  font-weight: 700;
}

h2::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 4px;
  background: #e8d661;
  bottom: -15px;
  left: 0;
  border-radius: 2px;
}

/* Вкладки */
.tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 20px;
}

.tab {
  padding: 12px 24px;
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.tab:hover {
  border-color: #e8d661;
  color: #e8d661;
}

.tab.active {
  background: #e8d661;
  color: #1a1a1a;
  border-color: #e8d661;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s forwards;
  color: #ddd;
  font-size: 1.1rem;
  line-height: 1.8;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Галерея */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.gallery-item {
  background: #333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gallery-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 40px rgba(232, 214, 97, 0.3);
  border-color: #e8d661;
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.gallery-item h3 {
  padding: 16px;
  color: #fff;
  margin: 0;
  font-size: 1.1rem;
}

/* Контакты */
.contact-form {
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  outline: none;
  resize: none;
}

.contact-form button {
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #e8d661;
  color: #1a1a1a;
  cursor: pointer;
  transition: 0.3s;
}

.contact-form button:hover {
  background: #f0e081;
  cursor: grab;
}

/* Back button common */
.back-button {
  display: inline-block;
  margin: 140px 0 18px 0;
  padding: 8px 12px;
  background: #0f172a;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.35);
  transition: all 0.3s ease;
}

.back-button:hover {
  background: #1a2a4a;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.45);
}

.sidebar a.active {
  background: #e8d661;
  color: #1a1a1a;
  transform: translateX(2px);
}

/* Поиск в header */
.search-bar {
  flex-shrink: 0;
}

/* Контакты и информационные карточки */
.card {
  background: #333;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  margin-bottom: 40px;
  border: 1px solid rgba(232, 214, 97, 0.2);
  color: #e0e0e0;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.info-cell {
  background: #252525;
  color: #e0e0e0;
  padding: 15px;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  border: 1px solid rgba(232, 214, 97, 0.3);
  cursor: pointer;
}

.info-cell:hover {
  background: #e8d661;
  border-color: #e8d661;
  color: #1a1a1a;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

/* Футер */
.footer {
  text-align: center;
  background: #252525;
  color: #e0e0e0;
  padding: 60px 40px;
  margin-top: 400px;
  border-top: 1px solid rgba(232, 214, 97, 0.2);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content h3 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #e8d661;
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #fff;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  padding: 8px 0;
  color: #b0b0b0;
  transition: color 0.3s ease;
}

.footer-section li:hover {
  color: #e8d661;
}

.footer-copyright {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-size: 0.9rem;
}

.footer-links {
  text-align: center;
  margin-bottom: 20px;
}

.footer-btn {
  display: inline-block;
  padding: 12px 24px;
  background: #e8d661;
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.footer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

/* Секция с ссылкой на условия пользования на главной странице */
.terms-link-section {
  text-align: center;
  padding: 60px 40px;
  background: #1a1a1a;
  margin-bottom: 0;
}

.terms-link-btn {
  display: inline-block;
  padding: 14px 32px;
  background: #e8d661;
  color: #1a1a1a;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.terms-link-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(232, 214, 97, 0.4);
}

/* Секция "Почему выбирают нас" */
.why-us {
  padding: 64px 24px;
  background: #1a1a1a;
}

.why-container {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.why-container h2 {
  font-size: 2rem;
  color: #0f172a;
}

.why-slider {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  margin-top: 26px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.why-slide {
  background: #333;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 12px 30px rgba(232, 214, 97, 0.05);
  width: 460px;
  max-width: 94%;
  opacity: 0;
  transform: translateY(20px) scale(0.985);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.why-slide {
  position: relative;
}

.why-progress {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.why-progress__bar {
  width: 0%;
  height: 100%;
  background: #e8d661;
}

@keyframes progressFill {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

@keyframes heroProgressFill {
  from {
    width: 0%;
  }

  to {
    width: 100%;
  }
}

.why-icon {
  font-size: 44px;
  margin-bottom: 14px;
}

.why-slide h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  color: #fff;
}

.why-slide p {
  color: #b0b0b0;
  font-size: 1rem;
}

.why-slider.in-view {
  opacity: 1;
  transform: translateY(0);
}

.why-slide.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.09);
}

/* Активный слайд (автоплей) */
.why-slide.active {
  transform: translateY(-6px) scale(1.06);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(232, 214, 97, 0.18);
}

/* Анимация при наведении: плавный подъем и масштаб */
.why-slide:hover,
.why-slide:focus {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 0 34px 70px rgba(15, 23, 42, 0.22);
  cursor: pointer;
}

/* Когда и active и in-view одновременно - применяем более заметный эффект */
.why-slide.in-view.active {
  transform: translateY(-8px) scale(1.08);
  box-shadow: 0 34px 70px rgba(15, 23, 42, 0.22);
}

/* Запуск анимации прогресса через класс active (duration задаётся в стиле: --progress-duration) */
.why-slide.active .why-progress__bar {
  animation: progressFill var(--progress-duration, 5s) linear forwards;
}

@media (max-width: 1100px) {
  .why-slider {
    flex-direction: column;
    gap: 18px;
    align-items: center;
  }

  .why-slide {
    width: 92%;
  }
}

/* Секция "Контейнеры" - современный лейаут */
.containers-section {
  background: linear-gradient(180deg, var(--section-bg), rgba(0, 0, 0, 0.02));
  padding: 48px 36px;
  border-radius: 14px;
  margin-bottom: 48px;
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.containers-section h3 {
  font-size: 1.9rem;
  color: var(--accent-color);
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.containers-section .lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.containers-grid {
  display: grid;
  grid-template-columns: 1fr 520px;
  gap: 28px;
  align-items: start;
}

.containers-text {
  padding-right: 8px;
}

.containers-cta {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 20px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(232, 214, 97, 0.12);
}

.btn-outline {
  display: inline-block;
  padding: 12px 20px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

.containers-media {
  display: flex;
  flex-direction: column;
  gap: 12px;

  max-width: 900px;
}

/* Секция "Реализованные проекты" */
.projects-section {
  margin-bottom: 60px;
}

.projects-section h2 {
  margin-bottom: 40px;
}

.projects-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.projects-tab {
  padding: 12px 24px;
  background: #252525;
  border: 2px solid rgba(232, 214, 97, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  color: #e0e0e0;
}

.projects-tab:hover {
  border-color: #e8d661;
  background: rgba(232, 214, 97, 0.1);
  transform: translateY(-2px);
}

.projects-tab.active {
  background: #e8d661;
  color: #1a1a1a;
  border-color: #e8d661;
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: #333;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
  border: 2px solid transparent;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(232, 214, 97, 0.2);
  border-color: #e8d661;
}

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-card-content {
  padding: 20px;
}

.project-card h4 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #fff;
  font-weight: 700;
}

.project-card p {
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.6;
}

.project-card .badge {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  background: #e8d661;
  color: #1a1a1a;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.projects-content {
  display: none;
  animation: fadeInProjects 0.5s ease forwards;
}

.projects-content.active {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

@keyframes fadeInProjects {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Кнопки листания проектов */
.projects-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 50px;
  padding: 30px;
  background: #252525;
  border-radius: 12px;
}

.pagination-btn {
  padding: 12px 24px;
  background: #e8d661;
  color: #1a1a1a;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

.pagination-btn:active {
  transform: translateY(0);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Секция услуг - современный и интерактивный дизайн */
.services-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: -30px 0 50px 0;
  font-weight: 500;
  opacity: 0.9;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.service-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 16px;
  padding: 32px 24px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  transition: left 0.6s ease;
}

.service-card:hover::before {
  left: 100%;
}

.service-card:hover {
  transform: translateY(-12px);
  border-color: var(--accent-color);
  box-shadow: 0 16px 40px rgba(232, 214, 97, 0.15);
}

.service-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.service-icon {
  font-size: 2.8rem;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 12px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.service-card:hover .service-icon {
  background: var(--accent-color);
  transform: scale(1.1) rotate(5deg);
  color: var(--bg-primary);
}

.service-card-header h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin: 0;
  padding-top: 8px;
  font-weight: 700;
}

.service-card-content {
  flex: 1;
  margin-bottom: 20px;
}

.service-card-content p {
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.service-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-features li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding-left: 0;
  transition: all 0.3s ease;
  line-height: 1.5;
}

.service-card:hover .service-features li {
  color: var(--text-primary);
  transform: translateX(4px);
}

.service-card-footer {
  margin-top: auto;
}

.service-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--accent-color);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.service-btn:hover {
  background: var(--accent-dark);
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(232, 214, 97, 0.3);
}

.service-btn:active {
  transform: scale(0.98);
}

/* Разворачиваемое полное описание услуги */
.service-full-desc {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.36s ease, opacity 0.28s ease, padding 0.28s ease;
  opacity: 0;
  padding-top: 0;
}

.service-card.expanded .service-full-desc {
  max-height: 480px;
  opacity: 1;
  padding-top: 12px;
}

.service-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}

.service-close-btn:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .service-card {
    padding: 24px 18px;
  }

  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 2.2rem;
  }

  .service-card-header h3 {
    font-size: 1.1rem;
  }
}

.pagination-info {
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Containers section media blocks */
.containers-media {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-main img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.containers-blocks {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.container-block {
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

/* Сделать первые два блока шире */
.containers-blocks .container-block:nth-child(1),
.containers-blocks .container-block:nth-child(2) {
  flex: 1.6;
}

.containers-blocks .container-block:nth-child(3) {
  flex: 1;
}

.container-block h4 {
  margin: 0 0 8px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.container-block p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.container-block:hover {
  transform: translateY(-6px);
  border-color: var(--accent-color);
}

@media (max-width: 768px) {
  .containers-blocks {
    flex-direction: column;
  }
}

@media (max-width: 900px) {
  .containers-grid {
    grid-template-columns: 1fr;
  }

  .containers-text {
    order: 1;
  }

  .containers-media {
    order: 2;
  }
}

/* Стили для языковой панели */
.lang-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  z-index: 1401;
}

#lang-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  font-weight: bold;
  color: inherit;
  transition: all 0.3s ease;
}

#lang-toggle:hover {
  opacity: 0.7;
}

#lang-panel {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  min-width: 100px;
  display: none;
  flex-direction: column;
  z-index: 1500;
  margin-top: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#lang-panel.active {
  display: flex;
}

.lang-option {
  padding: 10px 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: inherit;
  transition: background 0.2s;
}

.lang-option:hover {
  background: var(--bg-tertiary);
}

/* Стили для калькулятора-конструктора */
.calculator {
  padding: 32px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-secondary), var(--section-bg));
  margin-top: 28px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}

.calculator-controls label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.calculator-controls select,
.calculator-controls input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-top: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.pc-addons label {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.pc-presets {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.pc-presets button {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  /* цвет зависит от темы: тёмный в светлой теме, белый в dark-mode */
  cursor: pointer;
}

.pc-actions {
  margin-top: 10px;
}

.calculator-result {
  padding: 18px;
  border-radius: 10px;
  background: var(--bg-primary);
}

.pc-breakdown {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.pc-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.pc-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  margin-top: 12px;
}

.pc-note {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 24px;
  }
}

/* ===== MOBILE ADAPTATION ===== */

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  position: relative;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  z-index: 1402;
}

.mobile-menu-toggle:hover {
  background: var(--accent-color);
  color: var(--bg-primary);
}

.mobile-menu-toggle.active {
  background: var(--accent-color);
  color: var(--bg-primary);
}

/* Tablet devices (768px - 1024px) */
@media (max-width: 1024px) {
  /* Header adjustments */
  .header-top {
    padding: 12px 20px;
    gap: 12px;
  }

  .header-top .logo {
    font-size: 1.5rem;
  }

  .search-bar {
    right: 180px;
  }

  .header-top.search-active .search-bar {
    max-width: 300px;
  }

  .header-nav {
    padding: 16px 20px 20px 20px;
    gap: 8px;
  }

  .nav-btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  /* Main content */
  main {
    margin-left: 70px;
    padding: 40px 24px;
  }

  section {
    padding: 60px 30px;
  }

  h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }

  /* Hero section */
  .hero {
    padding: 40px 24px;
    margin-top: 120px;
  }

  .hero-container {
    gap: 40px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
  }

  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Projects grid */
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Cards */
  .card {
    padding: 24px;
  }

  /* Calculator */
  .calculator {
    padding: 24px;
  }

  /* Footer */
  .footer {
    padding: 40px 30px;
    margin-top: 300px;
  }

  .footer-sections {
    gap: 30px;
  }
}

/* Small tablets (640px - 768px) */
@media (max-width: 768px) {
  /* Show hamburger menu on small screens */
  .mobile-menu-toggle {
    display: block;
  }

  /* Auth controls: combined vs split */
  .auth-combined { display: none !important; }
  .auth-split { display: inline-block !important; }

  /* Hide sidebar on small screens, show mobile menu instead */
  .sidebar {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .sidebar.active {
    /* On mobile, expand fully to show labels */
    width: 240px;
    opacity: 1;
    pointer-events: auto;
  }

  /* When mobile sidebar is active, show full labels */
  .sidebar.active a .label {
    display: inline-block;
    opacity: 1;
    transition: opacity 180ms ease;
  }

  /* Ensure icon and label layout fits mobile width */
  .sidebar.active a {
    padding: 12px 16px;
  }

  /* Main content adjustment */
  main {
    margin-left: 0;
    padding: 20px 16px;
  }

  section {
    padding: 40px 20px;
    margin: 16px 0;
  }

  h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
  }

  h2::after {
    width: 50px;
    height: 3px;
  }

  /* Header */

  /* Mobile: hide split auth buttons and show combined control */
  @media (max-width: 768px) {
    .auth-split { display: none !important; }
    .auth-combined { display: inline-block !important; position: relative; }
    .auth-combined-btn { padding: 6px 10px; background: var(--accent-color); color: var(--bg-primary); border-radius: 6px; border: 0; cursor: pointer; font-weight:600; font-size: 0.85rem; transition: all 0.2s ease; white-space: nowrap; }
    .auth-combined-btn:hover { opacity: 0.9; }
    .auth-combined-btn:active { transform: scale(0.98); }
    .auth-combined-menu { 
      display: none; 
      position: absolute; 
      right: 0; 
      top: 100%;
      margin-top: 6px;
      background: var(--bg-primary); 
      color: var(--text-primary); 
      border-radius: 8px; 
      box-shadow: 0 6px 20px rgba(0,0,0,0.2); 
      overflow: visible; 
      z-index: 1000; 
      min-width: 150px;
      pointer-events: auto;
      max-height: calc(100vh - 120px);
      overflow-y: auto;
    }
    }
    .auth-combined.open .auth-combined-menu { 
      display: block;
      animation: slideDown 200ms ease-out;
    }
    .auth-combined-menu a { 
      display: block; 
      padding: 10px 14px; 
      color: var(--text-primary); 
      text-decoration: none;
      pointer-events: auto;
      cursor: pointer;
      transition: background 150ms ease;
    }
    .auth-combined-menu a:hover { 
      background: var(--bg-secondary);
    }
    @keyframes slideDown {
      from { opacity: 0; transform: translateY(-8px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }

  .header-top {
    padding: 12px 16px;
  }

  .header-top .logo {
    font-size: 1.3rem;
  }

  .search-bar {
    right: 140px;
  }

  .header-top.search-active .search-bar {
    max-width: 250px;
  }

  .header-nav {
    padding: 12px 16px 16px 16px;
    gap: 6px;
  }

  .nav-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }

  /* Hero */
  .hero {
    padding: 24px 16px;
    margin-top: 100px;
    min-height: auto;
  }

  .hero-container {
    gap: 24px;
  }

  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 12px;
    line-height: 1.3;
  }

  .hero-description {
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.5;
  }

  .hero-cta {
    padding: 12px 32px;
    font-size: 0.9rem;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }

  .gallery-item img {
    height: 180px;
  }

  .gallery-item h3 {
    padding: 12px;
    font-size: 1rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-card {
    padding: 20px 16px;
  }

  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .service-card-header h3 {
    font-size: 1.1rem;
  }

  .service-card-content p {
    font-size: 0.9rem;
  }

  /* Projects */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .projects-tab {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  /* Info cards */
  .info-cards {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .info-cell {
    padding: 12px;
    font-size: 0.9rem;
  }

  /* Contact form */
  .contact-form {
    max-width: 100%;
  }

  /* Containers section */
  .containers-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .containers-media {
    gap: 12px;
  }

  .containers-blocks {
    flex-direction: column;
    gap: 12px;
  }

  /* Calculator */
  .calculator {
    padding: 20px 16px;
  }

  .calculator-grid {
    gap: 16px;
  }

  /* Footer */
  .footer {
    padding: 30px 20px;
    margin-top: 250px;
  }

  .footer-content h3 {
    font-size: 1.5rem;
  }

  .footer-sections {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Why us section */
  .why-slider {
    gap: 16px;
  }

  .why-slide {
    width: 100%;
    max-width: 100%;
  }

  .why-slide h3 {
    font-size: 1.1rem;
  }

  /* Tabs */
  .tabs {
    gap: 12px;
    flex-wrap: wrap;
  }

  .tab {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  /* Back button */
  .back-button {
    margin: 100px 0 12px 0;
    padding: 8px 16px;
    font-size: 0.9rem;
  }


/* Mobile phones (480px - 640px) */
@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  main {
    padding: 14px 10px;
  }

  section {
    padding: 28px 12px;
    margin: 8px 0;
  }

  h1 {
    font-size: 1.3rem;
  }

  h2 {
    font-size: 1.3rem;
    margin-bottom: 14px;
  }

  h2::after {
    width: 40px;
    height: 2px;
    bottom: -8px;
  }

  h3 {
    font-size: 0.95rem;
  }

  /* Header - упрощено */
  .header-top {
    padding: 8px 8px;
    gap: 6px;
  }

  .header-top .logo {
    font-size: 0.95rem;
    letter-spacing: 0;
  }

  .top-right-controls {
    gap: 4px;
  }

  .search-toggle-btn,
  .theme-toggle-btn {
    padding: 4px 6px;
    font-size: 0.9rem;
  }

  /* Navigation */
  .header-nav {
    padding: 8px 8px 10px 8px;
    gap: 4px;
  }

  .nav-btn {
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  header.collapsed .nav-btn {
    padding: 4px 6px;
    font-size: 0.6rem;
  }

  /* Dropdown */
  .dropdown-menu {
    min-width: 110px;
  }

  .dropdown-menu a {
    padding: 8px 8px;
    font-size: 0.7rem;
  }

  /* Hero */
  .hero {
    padding: 16px 10px;
    margin-top: 75px;
  }

  .hero-container {
    gap: 12px;
  }

  .hero-title {
    font-size: 1.3rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 0.8rem;
    margin-bottom: 10px;
  }

  .hero-cta {
    padding: 8px 16px;
    font-size: 0.75rem;
  }

  .hero-progress {
    height: 2px;
  }

  .hero-pagination {
    gap: 6px;
    font-size: 0.7rem;
    margin-top: 10px;
  }

  .hero-btn {
    width: 6px;
    height: 6px;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-item {
    border-radius: 6px;
  }

  .gallery-item img {
    height: 120px;
  }

  .gallery-item h3 {
    padding: 6px;
    font-size: 0.75rem;
  }

  /* Services */
  .services-subtitle {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .services-grid {
    gap: 10px;
  }

  .service-card {
    padding: 12px 10px;
    border-radius: 10px;
  }

  .service-icon {
    width: 45px;
    height: 45px;
    font-size: 1.6rem;
  }

  .service-card-header h3 {
    font-size: 0.9rem;
  }

  .service-card-content p {
    font-size: 0.75rem;
  }

  .service-features li {
    font-size: 0.7rem;
  }

  .service-btn {
    padding: 8px 12px;
    font-size: 0.7rem;
  }

  /* Projects */
  .projects-tabs {
    gap: 6px;
    flex-wrap: wrap;
  }

  .projects-tab {
    padding: 6px 8px;
    font-size: 0.65rem;
  }

  .project-card img {
    height: 140px;
  }

  .project-card-content {
    padding: 8px;
  }

  .project-card h4 {
    font-size: 0.9rem;
  }

  .project-card p {
    font-size: 0.7rem;
  }

  /* Cards */
  .card {
    padding: 12px;
    border-radius: 8px;
  }

  .info-cards {
    gap: 8px;
  }

  .info-cell {
    padding: 8px;
    font-size: 0.75rem;
  }

  /* Contact form */
  .contact-form {
    gap: 8px;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 6px;
    font-size: 0.85rem;
  }

  .contact-form button {
    padding: 8px;
    font-size: 0.85rem;
  }

  /* Containers */
  .containers-section {
    padding: 20px 12px;
    border-radius: 8px;
  }

  .containers-section h3 {
    font-size: 1.1rem;
  }

  .containers-grid {
    gap: 12px;
  }

  .containers-blocks {
    gap: 8px;
  }

  .container-block {
    padding: 8px;
    border-radius: 6px;
  }

  .container-block h4 {
    font-size: 0.75rem;
  }

  .container-block p {
    font-size: 0.7rem;
  }

  /* Calculator */
  .calculator {
    padding: 12px 10px;
  }

  .calculator-controls label {
    font-size: 0.8rem;
    margin-bottom: 6px;
  }

  .pc-presets button {
    padding: 4px 6px;
    font-size: 0.6rem;
  }

  .calculator-result {
    padding: 10px;
  }

  .pc-total {
    font-size: 0.95rem;
  }

  /* Footer */
  .footer {
    padding: 18px 10px;
    margin-top: 150px;
  }

  .footer-content h3 {
    font-size: 1rem;
    margin-bottom: 14px;
  }

  .footer-section h4 {
    font-size: 0.9rem;
  }

  .footer-section li {
    padding: 3px 0;
    font-size: 0.75rem;
  }

  .footer-copyright {
    font-size: 0.7rem;
  }

  .footer-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  /* Why us */
  .why-slider {
    gap: 10px;
  }

  .why-slide {
    padding: 14px 10px;
  }

  .why-icon {
    font-size: 1.8rem;
  }

  .why-slide h3 {
    font-size: 0.9rem;
  }

  .why-slide p {
    font-size: 0.75rem;
  }

  /* Tabs */
  .tab {
    padding: 6px 8px;
    font-size: 0.65rem;
  }

  /* Back button */
  .back-button {
    margin: 60px 0 8px 0;
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  /* Language wrapper */
  .lang-wrapper {
    font-size: 0.75rem;
  }

  #lang-toggle {
    padding: 4px 6px;
  }

  /* Pagination */
  .pagination-info {
    font-size: 0.75rem;
  }

  .pagination-btn {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}

/* Small phones (320px - 480px) */
@media (max-width: 480px) {
  body {
    font-size: 12px;
  }

  main {
    padding: 10px 8px;
  }

  section {
    padding: 20px 8px;
    margin: 6px 0;
  }

  h1 {
    font-size: 1.1rem;
  }

  h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  h2::after {
    width: 35px;
    height: 2px;
    bottom: -6px;
  }

  h3 {
    font-size: 0.85rem;
  }

  /* Header */
  .header-top {
    padding: 6px 6px;
    gap: 4px;
  }

  .header-top .logo {
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  .top-right-controls {
    gap: 3px;
  }

  .search-toggle-btn,
  .theme-toggle-btn {
    padding: 3px 5px;
    font-size: 0.85rem;
  }

  /* Navigation */
  .header-nav {
    padding: 6px 6px 8px 6px;
    gap: 3px;
  }

  .nav-btn {
    padding: 5px 6px;
    font-size: 0.6rem;
  }

  /* Hero */
  .hero {
    padding: 12px 8px;
    margin-top: 65px;
  }

  .hero-container {
    gap: 10px;
  }

  .hero-title {
    font-size: 1.1rem;
    margin-bottom: 4px;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .hero-cta {
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .hero-pagination {
    gap: 4px;
    font-size: 0.6rem;
    margin-top: 8px;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .gallery-item img {
    height: 100px;
  }

  .gallery-item h3 {
    padding: 4px;
    font-size: 0.65rem;
  }

  /* Services */
  .services-subtitle {
    font-size: 0.8rem;
    margin-bottom: 16px;
  }

  .services-grid {
    gap: 8px;
  }

  .service-card {
    padding: 10px 8px;
  }

  .service-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .service-card-header h3 {
    font-size: 0.8rem;
  }

  .service-card-content p {
    font-size: 0.7rem;
  }

  .service-features li {
    font-size: 0.65rem;
  }

  .service-btn {
    padding: 6px 10px;
    font-size: 0.65rem;
  }

  /* Projects */
  .projects-tab {
    padding: 5px 6px;
    font-size: 0.55rem;
  }

  .project-card img {
    height: 120px;
  }

  .project-card-content {
    padding: 6px;
  }

  .project-card h4 {
    font-size: 0.8rem;
  }

  .project-card p {
    font-size: 0.65rem;
  }

  /* Cards */
  .card {
    padding: 10px;
    border-radius: 6px;
  }

  .info-cell {
    padding: 6px;
    font-size: 0.7rem;
  }

  /* Contact form */
  .contact-form {
    gap: 6px;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 5px;
    font-size: 0.8rem;
  }

  /* Containers */
  .containers-section {
    padding: 16px 10px;
  }

  .containers-section h3 {
    font-size: 1rem;
  }

  .container-block {
    padding: 6px;
  }

  .container-block h4 {
    font-size: 0.7rem;
  }

  .container-block p {
    font-size: 0.65rem;
  }

  /* Calculator */
  .calculator {
    padding: 10px 8px;
  }

  .pc-presets button {
    padding: 3px 5px;
    font-size: 0.55rem;
  }

  .calculator-result {
    padding: 8px;
  }

  .pc-total {
    font-size: 0.9rem;
  }

  /* Footer */
  .footer {
    padding: 14px 8px;
    margin-top: 120px;
  }

  .footer-content h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .footer-section h4 {
    font-size: 0.8rem;
  }

  .footer-section li {
    padding: 2px 0;
    font-size: 0.7rem;
  }

  .footer-copyright {
    font-size: 0.65rem;
  }

  .footer-btn {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  /* Why us */
  .why-slide {
    padding: 12px 8px;
  }

  .why-icon {
    font-size: 1.6rem;
  }

  .why-slide h3 {
    font-size: 0.8rem;
  }

  .why-slide p {
    font-size: 0.7rem;
  }

  /* Back button */
  .back-button {
    margin: 50px 0 6px 0;
    padding: 5px 6px;
    font-size: 0.7rem;
  }

  #lang-toggle {
    padding: 3px 5px;
    font-size: 0.7rem;
  }
}

/* Orientation: Landscape mode */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 20px 40px;
    margin-top: 60px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-container {
    gap: 30px;
  }

  section {
    padding: 40px 40px;
  }

  main {
    padding: 30px 40px;
  }
}

/* Orientation: Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
  header {
    height: auto;
  }

  .hero {
    margin-top: 50px;
    padding: 16px 24px;
  }

  .hero-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
  }

  .hero-description {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  section {
    padding: 24px 20px;
  }

  main {
    padding: 16px 20px;
  }

  h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
}

/* Cookie consent banner */
.cookie-consent{
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(18,20,22,0.95);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 9999;
  transform: translateY(24px);
  opacity: 0;
  transition: transform 240ms ease, opacity 240ms ease;
  overflow: hidden;
}
.cookie-consent.visible{
  transform: translateY(0);
  opacity: 1;
}
.cookie-inner{
  display:flex;
  gap:8px;
  align-items:center;
  padding:12px 14px;
}
.cookie-text{ flex:1; min-width:160px }
.cookie-text p{ margin:4px 0 0; font-size:14px; color: #ddd }
.cookie-actions{ display:flex; gap:6px; margin-left:8px }
.btn{ padding:8px 12px; border-radius:6px; cursor:pointer; border:0 }
.btn-primary{ background:#2b8aef; color:#fff }
.btn-outline{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,0.12) }

/* Inline settings button placed near footer terms link */
.cookie-settings-inline{
  background:transparent;
  border:0;
  color: #cfd8dc;
  margin-left:8px;
  cursor:pointer;
  font-size:13px;
  text-decoration:underline;
  padding:2px 6px;
}
.cookie-settings-inline:hover{ color:#fff }

/* Cookie Settings Modal */
.cookie-modal{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 300ms ease;
}
.cookie-modal.visible{
  opacity: 1;
}
.cookie-modal-overlay{
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.cookie-modal-content{
  position: relative;
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.9);
  transition: transform 300ms ease;
}
.cookie-modal.visible .cookie-modal-content{
  transform: scale(1);
}
.cookie-modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}
.cookie-modal-header h2{
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}
.cookie-modal-close{
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 200ms, color 200ms;
}
.cookie-modal-close:hover{
  background: var(--hover-bg);
  color: var(--text-color);
}
.cookie-modal-body{
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.cookie-modal-intro{
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.cookie-category{
  margin-bottom: 24px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.cookie-category-header{
  margin-bottom: 8px;
}
.cookie-toggle-label{
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.cookie-toggle-input{
  position: relative;
  width: 44px;
  height: 24px;
  appearance: none;
  background: #ccc;
  border-radius: 12px;
  outline: none;
  cursor: pointer;
  transition: background 200ms;
  margin-right: 12px;
  flex-shrink: 0;
}
.cookie-toggle-input:checked{
  background: #2b8aef;
}
.cookie-toggle-input:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.cookie-toggle-input::before{
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 200ms;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.cookie-toggle-input:checked::before{
  transform: translateX(20px);
}
.cookie-category-title{
  font-weight: 600;
  font-size: 1.05rem;
}
.cookie-category-desc{
  margin: 8px 0 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 56px;
}
.cookie-modal-footer{
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  justify-content: flex-end;
}
.cookie-modal-footer .btn{
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: all 200ms;
}
.cookie-modal-footer .btn-primary{
  background: #2b8aef;
  color: white;
}
.cookie-modal-footer .btn-primary:hover{
  background: #2470c7;
}
.cookie-modal-footer .btn-outline{
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
}
.cookie-modal-footer .btn-outline:hover{
  background: var(--hover-bg);
}

@media (max-width: 600px) {
  .cookie-modal-content{
    width: 95%;
    max-height: 90vh;
  }
  .cookie-modal-header{
    padding: 16px 20px;
  }
  .cookie-modal-header h2{
    font-size: 1.25rem;
  }
  .cookie-modal-body{
    padding: 20px;
  }
  .cookie-category-desc{
    padding-left: 0;
    margin-top: 12px;
  }
  .cookie-modal-footer{
    flex-direction: column;
    padding: 12px 20px;
  }
  .cookie-modal-footer .btn{
    width: 100%;
  }
}

/* Adaptive user profile name */
#profile-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

@media (max-width: 480px) {
  #profile-name {
    max-width: 80px;
    font-size: 0.75rem !important;
  }
}

@media (max-width: 360px) {
  #profile-name {
    max-width: 60px;
    font-size: 0.7rem !important;
  }
}
