/* =====================================================================
   Contacts popup — сайтовый виджет контактов из кнопки «Контакты»
   Работает на всех страницах: лендинги, блог, статьи.
   ===================================================================== */

/* ── Trigger button (заменяет <a> в обоих хедерах) ─────────────────── */
.ag-contacts-trigger {
  display: inline-flex;
  box-sizing: border-box;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: #c9e5de;
  color: #1e4c43;
  font-family: 'TTFirsNeue', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .16s ease;
}
.ag-contacts-trigger:hover { filter: brightness(.95); }
.ag-contacts-trigger:focus-visible { outline: 2px solid #1e4c43; outline-offset: 2px; }

/* Landing header width matches original <a> */
#ag-header .ag-contacts-trigger { width: 105px; }
@media screen and (max-width: 1199px) and (min-width: 960px) {
  #ag-header .ag-contacts-trigger { width: 84px; }
}

/* Blog header */
.ag-blog-header .ag-contacts-trigger {
  min-height: 43px;
  padding: 0 20px;
  font-size: 14px;
}

/* ── Backdrop ───────────────────────────────────────────────────────── */
.ag-contacts-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(10, 40, 34, 0.48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.ag-contacts-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Panel ──────────────────────────────────────────────────────────── */
.ag-contacts-panel {
  position: fixed;
  z-index: 100001;
  top: 50%;
  left: 50%;
  width: 480px;
  max-width: calc(100vw - 32px);
  display: none;
  transform: translate(-50%, calc(-50% + 16px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s cubic-bezier(.22, .61, .36, 1);
  border-radius: 20px;
  background: linear-gradient(145deg, #157e68 0%, #1e4c43 100%);
  color: #fff;
  font-family: 'TTFirsNeue', Arial, sans-serif;
  box-shadow: 0 24px 60px rgba(8, 40, 32, .38), 0 4px 16px rgba(8, 40, 32, .18);
  overflow: hidden;
}
.ag-contacts-panel.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

/* ── Decorative accent line (top) ───────────────────────────────────── */
.ag-contacts-panel::before {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #c9eb67 50%, transparent);
  content: '';
}

/* ── Inner layout ────────────────��──────────────────────────────────── */
.ag-contacts-inner {
  padding: 36px 36px 32px;
}

/* ── Close button ───────────────────────────────────────────────────── */
.ag-contacts-close {
  position: absolute;
  top: 16px; right: 16px;
  display: flex;
  width: 34px; height: 34px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.ag-contacts-close:hover { background: rgba(255,255,255,.22); color: #fff; }
.ag-contacts-close:focus-visible { outline: 2px solid #c9eb67; outline-offset: 2px; }

/* ── Header ─────────────────────────────────────────────────────────── */
.ag-contacts-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -.6px;
  line-height: 1.1;
}
.ag-contacts-subtitle {
  margin: 0 0 28px;
  color: rgba(209, 238, 220, .8);
  font-size: 14px;
  line-height: 1.4;
}

/* ── Rows ───────────────────────────────────────────────────────────── */
.ag-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ag-contacts-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  transition: background .16s ease;
}
.ag-contacts-list li:hover { background: rgba(255,255,255,.13); }

.ag-contacts-list__icon {
  display: flex;
  flex-shrink: 0;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(201, 235, 103, .15);
}
.ag-contacts-list__icon svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: #c9eb67;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ag-contacts-list__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ag-contacts-list__label {
  color: rgba(209, 238, 220, .65);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ag-contacts-list__value {
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  word-break: break-all;
}
a.ag-contacts-list__value:hover { text-decoration: underline; text-decoration-color: rgba(201,235,103,.5); }

/* ── Telegram CTA row ───────────────────────────────────────────────── */
.ag-contacts-list li.is-telegram {
  background: rgba(201, 235, 103, .12);
  border: 1px solid rgba(201, 235, 103, .22);
}
.ag-contacts-list li.is-telegram:hover { background: rgba(201, 235, 103, .18); }
.ag-contacts-list li.is-telegram .ag-contacts-list__icon {
  background: rgba(201, 235, 103, .2);
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media screen and (max-width: 540px) {
  .ag-contacts-inner { padding: 28px 20px 24px; }
  .ag-contacts-title { font-size: 23px; }
  .ag-contacts-list__value { font-size: 14px; }
}
