/* ============================================================
   TEAM SECTION — homepage specialists block
   Brand: #155945 (primary green) / #d7b39a (warm accent)
   Fonts: "Montserrat" headings / "Inter" body
   ============================================================ */

:root {
  --team-bg: #f7f5ef;
  --team-card: #ffffff;
  --team-primary: #155945;
  --team-primary-strong: #0d3d2e;
  --team-accent: #d7b39a;
  --team-muted: #6b7280;
  --team-divider: #e8eeeb;
  --team-radius: 20px;
  --team-shadow: 0 2px 12px rgba(21,89,69,.07);
  --team-shadow-hover: 0 16px 48px rgba(21,89,69,.16), 0 4px 16px rgba(21,89,69,.08);
  --team-transition: all .32s cubic-bezier(.22,.61,.36,1);
}

/* ── Section wrapper ── */
.team-section {
  display: block;
  position: relative;
  z-index: 120;
  isolation: isolate;
  padding: 72px 20px;
  color: var(--team-primary);
  font-family: "Inter", "Segoe UI", sans-serif;
}
.team-section,
.team-section * { box-sizing: border-box; }

/* Force visibility (prevents flicker from other scripts) */
.team-section,
.team-section .manager-card,
.team-section .agent-card,
.team-section .agents-slider,
.team-section .agents-slider__track,
.team-section .team-slide {
  opacity: 1 !important;
  visibility: visible !important;
}

.team-section__shell { max-width: 1320px; margin: 0 auto; }
.team-section__controls { display: flex; gap: 10px; }

/* ── Nav buttons ── */
.team-nav {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--team-divider);
  background: #fff;
  color: var(--team-primary);
  cursor: pointer;
  transition: var(--team-transition);
  box-shadow: 0 4px 16px rgba(21,89,69,.08);
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.team-nav:hover {
  transform: translateY(-2px);
  border-color: var(--team-primary);
  background: var(--team-primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(21,89,69,.22);
}

/* ── Layout grid ── */
.team-section__layout {
  display: grid;
  grid-template-columns: minmax(300px, 32%) 1fr;
  gap: 26px;
  align-items: stretch;
}

/* ============================================================
   BASE CARD STYLES
   ============================================================ */

.manager-card,
.agent-card {
  background: var(--team-card);
  border: 1px solid var(--team-divider);
  border-radius: var(--team-radius);
  overflow: hidden;
  box-shadow: var(--team-shadow);
  transition: box-shadow .4s ease;
}

.manager-card:hover,
.agent-card:hover {
  box-shadow: 0 8px 32px rgba(21,89,69,.13);
}

/* ── Manager card specifics ── */
.manager-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.manager-card .card-body { flex: 1; display: flex; flex-direction: column; }
.manager-card .card-stats { margin-top: auto; }

/* ============================================================
   CARD MEDIA (photo)
   ============================================================ */

.card-media {
  aspect-ratio: 5/4;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* ============================================================
   CARD BODY
   ============================================================ */

.card-body {
  padding: 22px 24px 24px;
}

/* ── Role badge ── */
.card-label {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(21,89,69,.08);
  border: 1px solid rgba(21,89,69,.14);
  color: var(--team-primary);
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── Name ── */
.card-name {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--team-primary-strong);
  transition: color .22s ease;
}

.manager-card:hover .card-name,
.agent-card:hover .card-name {
  color: var(--team-primary);
}

/* ── Role / specialisation ── */
.card-role {
  margin: 7px 0 12px;
  color: var(--team-muted);
  font-family: "Inter", sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
}

/* ── Short description (manager only) ── */
.card-description {
  margin: 0 0 18px;
  color: #4b5563;
  font-family: "Inter", sans-serif;
  line-height: 1.65;
  font-size: 13.5px;
}

/* ── Stats row ── */
.card-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 10px;
  border-top: 1px solid var(--team-divider);
  padding-top: 14px;
  margin-top: 14px;
}

/* ── Quote (for non-realtor specialists) ── */
.card-quote {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-top: 1px solid var(--team-divider);
  border-left: 3px solid var(--team-accent, #2d7a4f);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
  color: var(--team-muted);
  background: transparent;
}

.card-stats > div {
  text-align: center;
}

.stat-label {
  display: block;
  color: var(--team-muted);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 3px;
}

.stat-value {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--team-primary-strong);
}

/* ── Social links ── */
.card-socials {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--team-divider);
}

.card-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(21,89,69,.07);
  border: 1px solid rgba(21,89,69,.1);
  color: var(--team-primary);
  font-size: 14px;
  text-decoration: none;
  transition: background .25s, color .25s, transform .22s, border-color .25s;
}

.card-social-link:hover {
  background: var(--team-primary);
  border-color: var(--team-primary);
  color: #fff;
  transform: translateY(-3px);
}

.card-social-link .fa-brands { line-height: 1; }

/* ── Phone ── */
.card-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--team-primary);
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-top: 1px solid var(--team-divider);
  padding-top: 14px;
  transition: color .22s;
}

.card-phone:hover { color: var(--team-primary-strong); }
.card-phone__icon { width: 15px; height: 15px; flex-shrink: 0; }

/* ── "Подробнее" link ── */
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 20px;
  background: rgba(21,89,69,.07);
  border: 1px solid rgba(21,89,69,.13);
  border-radius: 10px;
  color: var(--team-primary);
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  width: 100%;
  letter-spacing: .01em;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}

.card-link:hover {
  background: var(--team-primary);
  border-color: var(--team-primary);
  color: #fff;
}

/* ── Agent card name (smaller) ── */
.agent-card .card-name { font-size: 17px; }
.agent-card .card-media { height: 190px; aspect-ratio: auto; }

/* ============================================================
   SLIDER
   ============================================================ */

.agents-slider__viewport { overflow: hidden; }

.agents-slider__track {
  display: flex;
  width: 100%;
  min-height: 200px;
  transition: transform .7s cubic-bezier(.22,.61,.36,1);
}

.team-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.agent-card { cursor: pointer; }

/* ── Pagination dots ── */
.agents-slider__pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.team-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: #c4d0cb;
  cursor: pointer;
  transition: all .28s cubic-bezier(.22,.61,.36,1);
}

.team-dot.is-active {
  width: 28px;
  border-radius: 99px;
  background: var(--team-primary);
}

/* ── Empty state ── */
.agents-slider.is-empty .agents-slider__viewport {
  border: 1px dashed var(--team-divider);
  border-radius: 18px;
}

.agents-slider.is-empty .agents-slider__track::before {
  content: "Карточки специалистов временно недоступны";
  display: block;
  padding: 32px 20px;
  color: var(--team-muted);
  font-family: "Inter", sans-serif;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .team-section { padding: 60px 16px; }
  .team-section__layout { grid-template-columns: 1fr; }
  .team-slide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manager-card .card-name { font-size: 26px; }
  .manager-card .card-media { height: 240px; }
}

@media (max-width: 700px) {
  .team-section { padding: 48px 12px; }
  .team-section__header { padding-right: 0; }
  .team-section__controls { position: static; margin-top: 16px; }
  .team-section__layout { gap: 16px; }
  .team-slide { grid-template-columns: 1fr; gap: 12px; }
  .agent-card .card-media { height: 200px; }
  .card-name { font-size: 18px; }
  .agent-card .card-name { font-size: 16px; }
  .card-body { padding: 16px 18px 18px; }
  .card-stats { grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 8px; }
  .stat-value { font-size: 13px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .manager-card,
  .agent-card,
  .card-media img,
  .card-media::after,
  .card-link,
  .card-social-link,
  .team-nav { transition: none !important; }
}
