/* АГП-Логистика — стили компонентов. Все значения берутся из токенов (tokens.css). */

.agp, .agp *, .agp *::before, .agp *::after { box-sizing: border-box; }
.agp {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
}
:where(.agp) img { display: block; max-width: 100%; }
/* сброс с нулевой специфичностью, чтобы его перекрывал любой класс компонента */
:where(.agp) :where(h1, h2, h3, h4, p, ul, ol) { margin: 0; padding: 0; }
:where(.agp) :where(ul, ol) { list-style: none; }
.agp-pad { padding: var(--space-5); }
.agp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.agp-grid { display: grid; gap: var(--space-5); }
.agp-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agp-ground-brand { background: var(--brand); color: var(--on-brand); }
.agp-ground-inverse { background: var(--surface-inverse); color: var(--on-inverse); }
.agp-ground-subtle { background: var(--surface-subtle); }
.agp-icon { display: inline-block; width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }

/* ---------- Заголовки и текст ---------- */
.agp-title { font-family: var(--font-head); font-weight: 700; color: var(--ink); text-wrap: balance; }
.agp-title--display { font-size: 48px; line-height: 52px; letter-spacing: -0.01em; }
.agp-title--h1 { font-size: 40px; line-height: 48px; }
.agp-title--h2 { font-size: 28px; line-height: 34px; }
.agp-title--h3 { font-size: 22px; line-height: 28px; }
.agp-title--center { text-align: center; }
.agp-eyebrow { font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.agp-lead { font-size: 18px; line-height: 28px; color: var(--ink-muted); max-width: 62ch; }
.agp-muted { color: var(--ink-muted); }
.agp-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.agp-link:hover { text-decoration-thickness: 2px; }
.agp-heading { display: grid; gap: var(--space-2); justify-items: center; text-align: center; }
.agp-heading--start { justify-items: start; text-align: left; }

/* ---------- Кнопка ---------- */
.agp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 10px var(--space-5);
  border: 2px solid var(--brand); border-radius: var(--radius-md);
  background: var(--brand); color: var(--on-brand);
  font-family: var(--font-body); font-size: 15px; line-height: 24px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.agp-btn:hover, .agp-btn.is-hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.agp-btn:focus-visible, .agp-btn.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.agp-btn--secondary { background: transparent; border-color: var(--ink); color: var(--ink); }
.agp-btn--secondary:hover, .agp-btn--secondary.is-hover { background: var(--ink); border-color: var(--ink); color: var(--on-inverse); }
.agp-btn--inverse { background: transparent; border-color: var(--brand); color: var(--on-inverse); }
.agp-btn--inverse:hover, .agp-btn--inverse.is-hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.agp-btn--inverse:focus-visible, .agp-btn--inverse.is-focus { outline-color: var(--focus-ring-inverse); }
.agp-btn--dark { background: var(--surface-deep); border-color: var(--surface-deep); color: var(--on-inverse); }
.agp-btn--dark:hover, .agp-btn--dark.is-hover { background: var(--ink); border-color: var(--ink); }
.agp-btn--sm { min-height: 40px; padding: 6px var(--space-4); font-size: 14px; }
.agp-btn--lg { min-height: 56px; padding: 14px var(--space-6); font-size: 16px; }
.agp-btn--block { display: flex; width: 100%; }
.agp-btn[disabled], .agp-btn.is-disabled { background: var(--surface-card); border-color: var(--surface-card); color: var(--ink-muted); cursor: not-allowed; }

/* ---------- Шапка ---------- */
.agp-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: var(--header-height); padding: var(--space-3) var(--space-5); background: var(--surface); border-bottom: 1px solid var(--line); }
.agp-header__logo img { height: 44px; width: auto; }
.agp-nav { display: flex; align-items: center; gap: var(--space-6); }
.agp-nav__link { position: relative; padding: var(--space-2) 0; color: var(--ink); font-size: 15px; line-height: 24px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.agp-nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: var(--radius-sm); background: transparent; }
.agp-nav__link:hover::after { background: var(--line); }
.agp-nav__link[aria-current="page"]::after { background: var(--brand); }
.agp-nav__link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.agp-header__phone { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.agp-header__phone .agp-icon { color: var(--brand-ink); }
.agp-burger { display: inline-grid; place-items: center; gap: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--surface-subtle); cursor: pointer; }
.agp-burger span { display: block; width: 22px; height: 2px; margin: 2.5px 0; background: var(--ink); border-radius: 1px; }
.agp-burger__bars { display: grid; }

/* ---------- Первый экран ---------- */
.agp-hero { position: relative; display: flex; align-items: center; min-height: 420px; padding: var(--space-7) var(--space-5); background: var(--surface-inverse) center / cover no-repeat; }
.agp-hero--center { justify-content: center; text-align: center; }
.agp-hero__box { display: grid; gap: var(--space-5); justify-items: start; width: 100%; max-width: 560px; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--scrim); color: var(--on-inverse); }
.agp-hero--center .agp-hero__box { justify-items: center; }
.agp-hero__title { font-family: var(--font-head); font-size: 44px; line-height: 50px; font-weight: 700; letter-spacing: -0.01em; color: var(--brand); text-wrap: balance; }
.agp-hero__text { font-size: 18px; line-height: 28px; color: var(--on-inverse); }

/* ---------- Карточка услуги ---------- */
.agp-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.agp-card__photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.agp-card__body { display: flex; flex-direction: column; flex: 1; gap: var(--space-3); padding: var(--space-5); }
.agp-card__title { font-family: var(--font-head); font-size: 20px; line-height: 26px; font-weight: 700; color: var(--ink); }
.agp-card__text { font-size: 14px; line-height: 22px; color: var(--ink-muted); }
.agp-card__text b { color: var(--ink); font-weight: 500; }
.agp-card__action { margin-top: auto; padding-top: var(--space-3); }

/* ---------- Этап работы ---------- */
.agp-step { display: grid; align-content: start; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface-card); }
.agp-step__head { display: flex; align-items: center; gap: var(--space-4); }
.agp-step__icon { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand); font-size: 28px; }
.agp-step__num { font-family: var(--font-head); font-size: 13px; line-height: 18px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.agp-step__title { font-family: var(--font-head); font-size: 20px; line-height: 26px; font-weight: 700; color: var(--ink); }
.agp-step__list { display: grid; gap: var(--space-2); counter-reset: agp-step; font-size: 14px; line-height: 22px; color: var(--ink); }
.agp-step__list li { position: relative; padding-left: var(--space-5); counter-increment: agp-step; }
.agp-step__list li::before { content: counter(agp-step) "."; position: absolute; left: 0; top: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Галерея ---------- */
.agp-gallery { position: relative; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-card); }
.agp-gallery__img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.agp-gallery__arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--surface); color: var(--ink); font-size: 22px; box-shadow: var(--shadow-card); cursor: pointer; }
.agp-gallery__arrow--prev { left: var(--space-4); }
.agp-gallery__arrow--next { right: var(--space-4); }
.agp-gallery__arrow[disabled] { color: var(--border-control); cursor: default; }
.agp-gallery__arrow:focus-visible { outline: 2px solid var(--focus-ring-inverse); outline-offset: 2px; }
.agp-gallery__dots { position: absolute; left: 50%; bottom: var(--space-4); display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-3); transform: translateX(-50%); border-radius: var(--radius-pill); background: var(--scrim); }
.agp-gallery__dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--on-inverse-muted); }
.agp-gallery__dot.is-active { width: 24px; background: var(--brand); }

/* ---------- Баннер с призывом ---------- */
.agp-promo { position: relative; display: flex; align-items: center; justify-content: flex-end; min-height: 320px; padding: var(--space-6); overflow: hidden; border-radius: var(--radius-lg); background: var(--surface-inverse) center / cover no-repeat; }
.agp-promo__box { display: grid; gap: var(--space-4); justify-items: start; width: 100%; max-width: 400px; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--scrim); color: var(--on-inverse); }
.agp-promo__title { font-family: var(--font-head); font-size: 28px; line-height: 34px; font-weight: 700; color: var(--on-inverse); text-wrap: balance; }
.agp-promo__title em { font-style: normal; color: var(--brand); }

/* ---------- Документ ---------- */
.agp-doc { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--ink); }
.agp-doc:hover { border-color: var(--border-control); }
.agp-doc:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.agp-doc__icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--radius-md); background: var(--brand-soft); color: var(--brand-ink); font-size: 22px; }
.agp-doc__body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.agp-doc__name { font-weight: 500; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.agp-doc__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.agp-doc__get { flex: none; color: var(--ink); font-size: 20px; }

/* ---------- Поле формы ---------- */
.agp-field { display: grid; gap: var(--space-2); }
.agp-field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.agp-field__label i { font-style: normal; color: var(--danger); }
.agp-input { display: block; width: 100%; min-height: 48px; padding: 10px var(--space-4); border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--surface); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 26px; }
.agp-input::placeholder { color: var(--ink-muted); }
.agp-input:focus, .agp-input.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-color: var(--ink); }
.agp-input.is-invalid { border-color: var(--danger); border-width: 2px; padding: 9px 15px; }
.agp-input[disabled] { background: var(--surface-subtle); color: var(--ink-muted); }
.agp-field__hint { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.agp-field__error { display: flex; gap: var(--space-2); align-items: center; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--danger); }

/* ---------- Сообщение ---------- */
.agp-note { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 14px; line-height: 22px; }
.agp-note--success { background: var(--success-soft); color: var(--success); }
.agp-note--danger { background: var(--danger-soft); color: var(--danger); }
.agp-note b { font-weight: 700; }

/* ---------- Окно заявки ---------- */
.agp-backdrop { display: grid; place-items: center; padding: var(--space-5); background: var(--overlay); }
.agp-modal { position: relative; display: grid; gap: var(--space-5); width: 100%; max-width: 440px; padding: var(--space-6); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-modal); }
.agp-modal__title { padding-right: var(--space-6); font-family: var(--font-head); font-size: 28px; line-height: 34px; font-weight: 700; color: var(--ink); }
.agp-modal__close { position: absolute; top: var(--space-4); right: var(--space-4); display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-pill); background: var(--surface-subtle); color: var(--ink); font-size: 16px; cursor: pointer; }
.agp-modal__close:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.agp-form { display: grid; gap: var(--space-4); }
.agp-form__legal { font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---------- Форма обратного звонка ---------- */
.agp-callback { display: grid; gap: var(--space-5); justify-items: center; padding: var(--space-7) var(--space-5); background: var(--brand); color: var(--on-brand); text-align: center; }
.agp-callback__title { font-family: var(--font-head); font-size: 32px; line-height: 40px; font-weight: 700; color: var(--on-brand); text-wrap: balance; }
.agp-callback__text { font-size: 16px; line-height: 26px; color: var(--on-brand); }
.agp-callback__form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-3); width: 100%; max-width: 860px; text-align: left; }
.agp-callback .agp-input { border-color: var(--on-brand); }

/* ---------- Подвал ---------- */
.agp-footer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); padding: var(--space-7) var(--space-5) var(--space-6); background: var(--surface-inverse); color: var(--on-inverse-muted); font-size: 15px; line-height: 24px; }
.agp-footer__brand { font-family: var(--font-head); font-size: 22px; line-height: 28px; font-weight: 700; color: var(--brand); text-wrap: balance; }
.agp-footer__title { margin-bottom: var(--space-3); font-size: 13px; line-height: 18px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-inverse-muted); }
.agp-footer__list { display: grid; gap: var(--space-3); }
.agp-footer__item { display: flex; gap: var(--space-3); align-items: flex-start; }
.agp-footer__item .agp-icon { margin-top: 4px; color: var(--brand); font-size: 16px; }
.agp-footer a { color: var(--on-inverse); font-weight: 500; text-decoration: none; }
.agp-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.agp-footer a:focus-visible { outline: 2px solid var(--focus-ring-inverse); outline-offset: 2px; }
.agp-footer__legal { grid-column: 1 / -1; padding-top: var(--space-5); border-top: 1px solid var(--surface-deep); font-size: 13px; line-height: 18px; color: var(--on-inverse-muted); }

@media (max-width: 767px) {
  .agp-grid--4, .agp-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .agp-title--display { font-size: 34px; line-height: 40px; }
  .agp-title--h1 { font-size: 30px; line-height: 36px; }
  .agp-hero__title { font-size: 32px; line-height: 38px; }
  .agp-hero__box, .agp-promo__box, .agp-modal { padding: var(--space-5); }
  .agp-promo { justify-content: center; }
  .agp-callback__form { grid-template-columns: minmax(0, 1fr); }
  .agp-footer { grid-template-columns: minmax(0, 1fr); }
  .agp-nav { display: none; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .agp-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .agp-btn { transition: none; } }
