/* ==========================================================================
   v3 footer
   Figma: Footer 11160:11305 (1440x1226), Footer Mobile 11295:8891 (430x2129), Info manager 12161:27107.
   The Info manager is a static block next to the lead heading (not a fixed bar).
   Map: the Figma frame is scaled with container units (--u = container width / frame width).
   ========================================================================== */

.v3-footer {
  position: relative;
  padding-block: 96px;
  background: var(--v3-bg-light);
  color: var(--v3-dark);
  isolation: isolate;
}
.v3-footer::before,
.v3-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.v3-footer::before {
  background: url("../../../images/v3/header/noise.webp") 0 0 / 256px 256px;
  opacity: 0.03;
}
.v3-footer::after {
  background: url("../../../images/v3/footer/decorative-lines.svg") center top / 1340px 100% no-repeat;
}

.v3-footer a { transition: color 0.2s ease; }

/* ---- lead + form ---- */
.v3-footer__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 96px;
}
.v3-footer__lead {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 288px;
  padding-bottom: 48px;
  max-width: 400px;
}
.v3-footer__desc { font-size: 16px; line-height: 1.4; color: var(--v3-gray-200); }
.v3-footer__manager { display: flex; align-items: center; gap: 16px; margin-top: auto; }
.v3-footer__manager-photo {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}
.v3-footer__manager-text { display: flex; flex-direction: column; gap: 4px; font-size: 12px; line-height: 1.3; }
.v3-footer__manager-name { font-weight: 700; color: var(--v3-gray-500); }
.v3-footer__manager-role { color: var(--v3-gray-200); }
.v3-footer__form { min-width: 0; }
/* Bitrix24 inline form (rendered by the CDN loader): light theme close to the Figma form */
.v3-footer__form .b24-form-wrapper { background: transparent !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; }
.v3-footer__form .b24-form-padding-side { padding-inline: 0 !important; }
.v3-footer__form .b24-form-control-container { border-radius: var(--v3-radius-md) !important; }
/* Figma: 2 columns (name | phone, e-mail | city), consent full width; one column on phones */
.v3-footer__form form > div:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.v3-footer__form .b24-form-field-list { order: 4; }
.v3-footer__form .b24-form-field-bool { order: 5; grid-column: 1 / -1; }
@media (max-width: 480px) { .v3-footer__form form > div:first-child { grid-template-columns: minmax(0, 1fr); } }
.v3-footer__form .b24-form-btn {
  min-height: 52px;
  border-radius: var(--v3-radius-md) !important;
  background: var(--v3-dark) !important;
  color: var(--v3-white) !important;
  font-family: var(--v3-font);
  font-size: 16px;
  font-weight: 600;
  text-transform: none !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.v3-footer__form .b24-form-btn:hover { background: var(--v3-primary) !important; box-shadow: var(--v3-shadow-glow); }

/* ---- cards ---- */
.v3-footer__mid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 40px; }
.v3-footer__cards { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v3-footer__card { padding: 24px; border-radius: var(--v3-radius-lg); background: var(--v3-white); }

.v3-footer__label { font-size: 12px; line-height: 1.3; color: var(--v3-gray-100); }

.v3-footer__contacts { display: flex; flex-direction: column; gap: 20px; }
.v3-footer__group { display: flex; flex-direction: column; gap: 12px; }
.v3-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
}
.v3-footer__links li { position: relative; }
.v3-footer__links li + li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 1px;
  height: 21px;
  background: var(--v3-gray-50);
  transform: translateY(-50%);
}
.v3-footer__links--socials a { text-decoration: underline; text-underline-offset: 2px; }
.v3-footer__links a:hover,
.v3-footer__menu a:hover,
.v3-footer__legal a:hover { color: var(--v3-primary); }

.v3-footer__phone { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.v3-footer__flags { display: inline-flex; align-items: center; gap: 3px; }
.v3-footer__flags img { width: 13px; height: 13px; }

.v3-footer__chats { display: flex; flex-wrap: wrap; gap: 12px; }
.v3-footer__chat {
  --btn-bg: var(--v3-telegram);
  --btn-color: var(--v3-white);
  --btn-hover-bg: #0086c0;
  --btn-hover-shadow: none;
  gap: 8px;
  min-height: 0;
  padding: 9px 16px;
  border-radius: var(--v3-radius-sm);
  line-height: 1.4;
}
.v3-footer__chat img { width: 28px; height: 28px; }

/* ---- locations ---- */
.v3-footer__cities {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(3, auto);
  grid-auto-columns: max-content;
  gap: 8px 60px;
  margin-bottom: 20px;
}
.v3-footer__city {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  color: var(--v3-gray-100);
  transition: color 0.2s ease;
}
.v3-footer__city:hover,
.v3-footer__city[aria-selected="true"] { color: var(--v3-dark); }
.v3-footer__pin {
  width: 18px;
  height: 18px;
  flex: none;
  background: url("../../../images/v3/footer/pin.svg") center / contain no-repeat;
}
.v3-footer__city[aria-selected="true"] .v3-footer__pin { background-image: url("../../../images/v3/footer/pin-active.svg"); }

.v3-footer__place {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
  padding: 20px;
  border: 1px solid var(--v3-primary-light);
  border-radius: var(--v3-radius-md);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.v3-footer__place[hidden] { display: none; }
.v3-footer__address { display: flex; align-items: flex-start; gap: 4px; }
.v3-footer__address-pin { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.v3-footer__address a,
.v3-footer__address strong { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.v3-footer__address a:hover { color: var(--v3-primary); }

/* ---- map ---- */
.v3-footer__map {
  --u: calc(100cqw / 652);
  container-type: inline-size;
  position: relative;
  align-self: start;
  width: 100%;
  aspect-ratio: 652 / 460;
  overflow: hidden;
  border-radius: var(--v3-radius-lg);
  background: linear-gradient(257.2deg, #4aefee 20.4%, #15c0bf 66.6%);
  color: var(--v3-dark);
}
.v3-footer__map-stage { position: absolute; inset: 0; }
.v3-footer__map-stage img { display: block; max-width: none; }

.v3-footer__map-poland {
  position: absolute;
  left: calc(var(--u) * 106);
  top: calc(var(--u) * 25);
  width: calc(var(--u) * 442.478) !important;
  height: calc(var(--u) * 414) !important;
}
.v3-footer__map-line {
  position: absolute;
  left: calc(var(--u) * var(--cx));
  top: calc(var(--u) * var(--cy));
  width: calc(var(--u) * var(--w));
  height: calc(var(--u) * var(--h));
  transform: translate(-50%, -50%) rotate(var(--rot)) scaleY(-1);
}
.v3-footer__map-line > span { position: absolute; inset: var(--inset); }
.v3-footer__map-line img { width: 100% !important; height: 100% !important; }
.v3-footer__map-line--1 { --cx: 146.5; --cy: 435.6; --w: 191.662; --h: 383.372; --rot: -52.58deg; --inset: 0 -0.37% -0.15% 32.48%; }
.v3-footer__map-line--2 { --cx: 594.76; --cy: 115.3; --w: 189.822; --h: 290.4; --rot: -30.71deg; --inset: -0.23% 3.83% -0.23% 31%; }

.v3-footer__marker {
  --x: var(--dx);
  --y: var(--dy);
  position: absolute;
  left: calc(var(--u) * var(--x));
  top: calc(var(--u) * var(--y));
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.v3-footer__marker.is-label-first { flex-direction: row-reverse; }
.v3-footer__marker img { width: 16.59px; height: 16.59px; }

/* ---- menus + info ---- */
.v3-footer__bottom { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.v3-footer__menus { display: grid; grid-template-columns: repeat(var(--cols, 3), 219px); column-gap: 113px; }
.v3-footer__col { min-width: 0; }
.v3-footer__col .v3-footer__label { margin-bottom: 12px; }
.v3-footer__menu { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.3; color: var(--v3-gray-200); }

.v3-footer__info { display: flex; flex-direction: column; align-items: flex-end; gap: 62px; width: 282px; flex: none; }
.v3-footer__logo img { width: 104px; height: 40px; object-fit: cover; }
.v3-footer__legal { display: flex; flex-direction: column; align-items: flex-end; gap: 16px; font-size: 14px; line-height: 1.3; color: var(--v3-gray-100); }
.v3-footer__legal a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 1280px) {
  .v3-footer__menus { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); column-gap: 48px; flex: 1; max-width: calc(var(--cols, 3) * 233px); }
  .v3-footer__cities { column-gap: 32px; }
}

/* ---- mobile / tablet: single column (Footer Mobile) ---- */
@media (max-width: 1024px) {
  .v3-footer { padding-block: 48px; }
  .v3-footer::after { background-size: 398px 100%; }

  .v3-footer__top { grid-template-columns: 1fr; gap: 32px; margin-bottom: 32px; }
  .v3-footer__lead { gap: 20px; min-height: 0; padding-bottom: 0; max-width: none; }
  .v3-footer__title { max-width: 400px; }
  .v3-footer__desc { max-width: 334px; }
  .v3-footer__manager { margin-top: 12px; }

  .v3-footer__mid { grid-template-columns: 1fr; margin-bottom: 32px; }
  /* Figma 430 order: contacts card, map, city tabs card */
  .v3-footer__cards { display: contents; }
  .v3-footer__contacts { order: 1; }
  .v3-footer__map { order: 2; }
  .v3-footer__places { order: 3; }
  .v3-footer__card { padding: 20px; border-radius: var(--v3-radius-md); }
  .v3-footer__label { font-size: 14px; }
  .v3-footer__links--contacts { flex-direction: column; align-items: flex-start; gap: 9px; }
  .v3-footer__links--contacts li + li::before { display: none; }
  .v3-footer__chats { flex-direction: column; align-items: flex-start; gap: 8px; }

  .v3-footer__cities { grid-template-rows: repeat(5, auto); gap: 12px clamp(24px, 12vw, 65px); }
  .v3-footer__place { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border-radius: var(--v3-radius-sm); }

  .v3-footer__map {
    --u: calc(100cqw / 390);
    aspect-ratio: 390 / 358;
    border-radius: var(--v3-radius-md);
  }
  .v3-footer__map-poland { left: calc(var(--u) * 37); top: calc(var(--u) * 29); width: calc(var(--u) * 321.565) !important; height: calc(var(--u) * 300.869) !important; }
  .v3-footer__map-line--1 { --cx: 66.95; --cy: 330.96; --w: 139.288; --h: 278.61; }
  .v3-footer__map-line--2 { --cx: 392.1; --cy: 84.65; --w: 137.95; --h: 211.044; }
  .v3-footer__marker { --x: var(--mx); --y: var(--my); gap: 4.29px; }
  .v3-footer__marker img { width: 14.22px; height: 14.22px; }

  .v3-footer__bottom { flex-direction: column; gap: 32px; }
  .v3-footer__menus { grid-template-columns: repeat(var(--cols, 3), minmax(0, max-content)); justify-content: start; column-gap: clamp(24px, 14vw, 60px); width: 100%; max-width: 390px; }
  .v3-footer__info { align-items: flex-start; gap: 32px; width: auto; }
  .v3-footer__legal { align-items: flex-start; gap: 8px; }
}
