/* ===================== Reset / Base ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #000000;
  --white: #ffffff;
  --gray: #f2f2f2;
  --text-muted: #6b6b6b;
  --radius-card: 14px;
  --radius-btn: 10px;
  --maxw: 1280px;
}

html { scroll-behavior: smooth; }
body { overflow-x: hidden; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--black);
  background: var(--white);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
  letter-spacing: .3px;
}
.btn:hover { transform: translateY(-2px); }

.btn--dark {
  background: var(--black);
  color: var(--white);
  padding: 22px 30px;
  font-size: 24px;
}
.btn--dark:hover { background: #1c1c1c; }

.btn--outline {
  background: var(--white);
  color: var(--black);
  border: 2px solid var(--black);
}
.btn--outline:hover { background: var(--black); color: var(--white); }

.btn--wide {
  min-width: 248px;
  height: 76px;
  font-size: 22px;
  padding: 0 24px;
}
.btn--sm { font-size: 20px; padding: 18px 28px; }

/* ===================== Header ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #f0f0f0;
}
/* Full-width header: logo aligns with page content on the left,
   the menu/CTA runs out to the right edge of the viewport. */
.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 96px;
  position: relative;
  padding-left: max(24px, calc((100vw - var(--maxw)) / 2 + 40px));
  padding-right: clamp(20px, 3vw, 56px);
}
.logo { display: inline-flex; align-items: center; flex: none; z-index: 2; }
.logo__img {
  height: 56px;
  width: auto;
  display: block;
}

.header__menu {
  display: flex;
  align-items: center;
  gap: 44px;
  margin-left: auto;
}
.nav {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav__link {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .3px;
  transition: opacity .15s ease;
}
.nav__link:hover { opacity: .55; }

/* Sale badge — reused in the header link and the training block */
.badge-sale {
  display: inline-block;
  vertical-align: middle;
  margin-left: .55em;
  background: var(--black);
  color: #c9d84a;
  font-size: .5em;
  font-weight: 800;
  letter-spacing: .3px;
  line-height: 1;
  padding: .35em .6em;
  border-radius: 999px;
  transform: translateY(-.12em);
  white-space: nowrap;
}
.header__cta { padding: 16px 30px; font-size: 20px; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 46px;
  height: 46px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}
.nav-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: var(--black);
  transition: transform .3s ease, opacity .2s ease;
}
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ===================== Hero ===================== */
.hero { padding: 40px 0 90px; overflow: hidden; }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(360px, 46vw, 760px);
  gap: 60px;
  align-items: start;
  /* Align left content with the page container, let the right image bleed to the viewport edge */
  padding-left: max(40px, calc((100vw - var(--maxw)) / 2 + 40px));
  padding-right: 0;
}
.hero__content { padding-top: 60px; }
.hero__title {
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1px;
  margin-bottom: 34px;
}
.hero__subtitle {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.55;
  max-width: 560px;
  margin-bottom: 18px;
}
.hero__location {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  margin-bottom: 48px;
}
.hero__location .pin { flex: none; }
.hero__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 248px));
  gap: 20px;
}
.hero__media { height: 100%; }
.hero__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px 0 0 6px;
}

/* ===================== Sections ===================== */
.section { padding: 40px 0; }

/* Offset anchor targets so the sticky header doesn't cover section titles */
:root { --header-h: 96px; }
#prices, #photos, #training, #contacts, .section__title[id], [id] {
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.section__title {
  font-size: clamp(30px, 3.6vw, 45px);
  font-weight: 800;
  letter-spacing: -.5px;
  margin: 60px 0 34px;
}

/* Cards */
.card {
  background: var(--gray);
  border-radius: var(--radius-card);
  padding: 44px 48px;
}
.card__title {
  font-size: clamp(26px, 3.2vw, 45px);
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 40px;
}
/* Keep «ТРЕНИРОВКИ» and the −50% badge on one line inside the narrow card.
   The column is ~260px on desktop, so the title is sized down to fit both. */
.card--training .card__title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;          /* graceful fallback on very narrow phones */
  gap: 7px;
  font-size: clamp(22px, 2.2vw, 27px);
}
.card--training .card__title .badge-sale {
  margin-left: 0;           /* spacing comes from the flex gap */
  transform: none;
}

/* Prices + Training layout */
.info-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}
.card--prices, .card--training { display: flex; flex-direction: column; }

.prices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
.price { display: flex; flex-direction: column; gap: 8px; }
.price__label { font-size: 24px; font-weight: 400; }
.price__value { font-size: clamp(34px, 3.4vw, 45px); font-weight: 800; letter-spacing: -1px; }
.price__unit { font-size: 24px; font-weight: 400; }

.training__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 24px;
  margin-bottom: auto;
}
.card--training .btn { align-self: flex-start; margin-top: 34px; }

/* Photos */
.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-card);
}

/* Contacts */
.contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  padding: 48px;
}
.contacts__info { display: flex; flex-direction: column; }
.contacts__address { font-size: 24px; line-height: 1.5; margin-bottom: 28px; }
.contacts__hours { font-size: 24px; line-height: 1.5; margin-bottom: 28px; }
.contacts__phone { font-size: 24px; font-weight: 700; margin-bottom: 22px; }
.contacts__phone a { transition: opacity .15s ease; }
.contacts__phone a:hover { opacity: .6; }
.contacts__social {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  transition: opacity .15s ease;
}
.contacts__social:hover { opacity: .6; }
.contacts__map {
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #f5f5f3;
  min-height: 360px;
}
.contacts__map img { width: 100%; height: 100%; object-fit: cover; }

/* Footer */
.footer {
  padding: 40px 0 60px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ===================== Responsive ===================== */

/* Large laptops: tighten the nav a touch so it stays on one line */
@media (max-width: 1180px) {
  .header__menu { gap: 32px; }
  .nav { gap: 30px; }
  .nav__link { font-size: 20px; }
}

/* Tablet landscape: stack hero, keep single-line header */
@media (max-width: 1080px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-left: clamp(20px, 5vw, 40px);
    padding-right: clamp(20px, 5vw, 40px);
    max-width: var(--maxw);
    margin: 0 auto;
  }
  .hero__content { padding-top: 0; order: 2; }
  .hero__media { order: 1; }
  .hero__media img { max-width: 760px; margin-inline: auto; border-radius: 10px; aspect-ratio: 16 / 10; }
  .info-grid { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; }
  .contacts__map { min-height: 320px; }
}

/* ---- Header collapses to a hamburger menu ---- */
@media (max-width: 940px) {
  :root { --header-h: 76px; }
  .header__inner {
    padding-left: clamp(20px, 5vw, 40px);
    padding-right: clamp(20px, 5vw, 40px);
    min-height: 76px;
  }
  .nav-toggle { display: flex; }

  .header__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-left: 0;
    padding: 12px clamp(20px, 5vw, 40px) 26px;
    background: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 24px 40px -24px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
  }
  .nav-open .header__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .25s ease, transform .25s ease;
  }
  .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav__link {
    font-size: 20px;
    padding: 16px 4px;
    border-bottom: 1px solid #eee;
  }
  .header__cta {
    margin-top: 18px;
    justify-content: center;
    width: 100%;
    font-size: 20px;
    padding: 18px 24px;
  }
}

/* Tablet portrait: single-column price/photo blocks */
@media (max-width: 820px) {
  .btn--dark { font-size: 20px; padding: 16px 24px; }
  .header__cta { font-size: 20px; }
  .prices { grid-template-columns: 1fr; gap: 22px; }
  .photos { grid-template-columns: 1fr; gap: 18px; }
  .card, .contacts { padding: 32px 26px; }
  .section__title { margin: 40px 0 26px; }
}

/* Phones */
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .hero__actions { grid-template-columns: 1fr; }
  .btn--wide { width: 100%; min-width: 0; height: 66px; }
  .hero__title { margin-bottom: 24px; }
  .hero__subtitle, .hero__location { font-size: 18px; }
  .price__label, .price__unit, .training__list,
  .contacts__address, .contacts__hours, .contacts__phone, .contacts__social { font-size: 20px; }
  .logo__img { height: 44px; }
  .hero__inner { padding-left: 20px; padding-right: 20px; }
  .hero { padding-bottom: 60px; }
  .card__title, .card--training .card__title { font-size: clamp(22px, 6.4vw, 30px); }
}

/* Small phones */
@media (max-width: 380px) {
  .logo__img { height: 40px; }
  .hero__title { font-size: 34px; }
  .price__value { font-size: 34px; }
}

/* ===================== Modal ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
  animation: fade .2s ease;
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: auto;
  background: var(--white);
  border-radius: 18px;
  padding: 32px clamp(20px, 4vw, 40px);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .5);
  animation: pop .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.modal__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--gray);
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: var(--black);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.modal__close:hover { background: #e4e4e4; transform: rotate(90deg); }
.modal__title { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.5px; }
.modal__subtitle { font-size: 15px; color: #555; margin: 6px 0 18px; }

/* Success mini-modal shown after a successful sign-up / booking */
.modal__dialog--mini { max-width: 420px; }
.modal.is-open .modal__dialog--mini { align-self: center; }
.success { text-align: center; padding: 8px 4px 4px; }
.success__icon {
  width: 68px;
  height: 68px;
  margin: 4px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #c9d84a;
  color: #000;
  animation: pop-in .35s cubic-bezier(.2, .9, .3, 1.3);
}
@keyframes pop-in { from { opacity: 0; transform: scale(.5); } }
.success__title { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 8px; }
.success__text { font-size: 16px; color: #555; line-height: 1.5; margin-bottom: 22px; }
.success__btn { min-width: 160px; }

/* Training cards */
.trainings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.trainings__state { grid-column: 1 / -1; color: #777; padding: 12px 0; }
.training-card {
  position: relative;
  border: 2px solid #ececec;
  border-radius: 12px;
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.training-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -16px rgba(0,0,0,.35); }
.training-card.is-selected { border-color: var(--black); }
.training-card--promo { border-color: #c9d84a; background: #fbfdec; }
.training-card--promo.is-selected { border-color: #000; }
.training-card__badge {
  display: inline-block;
  margin-top: 8px;
  background: #000;
  color: #c9d84a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.training-card__title { font-size: 17px; font-weight: 800; margin-bottom: 5px; }
.training-card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 0;
}
.training-card__price strong { font-size: 22px; font-weight: 800; }
.training-card__price s { color: #aaa; font-size: 14px; }
.training-card__unit { font-size: 13px; color: #777; }
.training-card__desc { font-size: 13px; line-height: 1.45; color: #444; margin-top: 8px; }

/* Description toggle — hidden on desktop, shown on mobile */
.training-card__more {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
}
.training-card__chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.training-card.is-expanded .training-card__chevron { transform: rotate(-135deg); }

/* Form */
.signup-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 11px; }
.field__label { font-size: 13px; font-weight: 600; }
.field__input {
  font: inherit;
  font-size: 15px;
  padding: 11px 13px;
  border: 2px solid #e2e2e2;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color .15s ease, background .15s ease;
  width: 100%;
}
.field__input:focus {
  outline: none;
  border-color: var(--black);
  background: #fff;
}
textarea.field__input { resize: vertical; min-height: 46px; }
.signup-form__submit { width: 100%; height: 52px; font-size: 17px; margin-top: 4px; }
.signup-form__status { font-size: 15px; margin-top: 12px; min-height: 20px; }
.signup-form__status.is-success { color: #1a7f37; font-weight: 600; }
.signup-form__status.is-error { color: #c0362c; font-weight: 600; }
.signup-form__status.is-hint { color: #777; }

@media (max-width: 560px) {
  .trainings { grid-template-columns: 1fr; }
  .signup-form__grid { grid-template-columns: 1fr; }
  .modal { padding: 0; }
  .modal__dialog { border-radius: 0; min-height: 100%; padding: 40px 20px; }

  /* The success mini-modal stays a compact centered card, not full-screen */
  .modal__dialog--mini {
    min-height: auto;
    border-radius: 18px;
    width: calc(100% - 36px);
    max-width: 360px;
    margin: auto;
    align-self: center;
    padding: 30px 22px;
  }
  .success__icon { width: 60px; height: 60px; margin-bottom: 14px; }
  .success__title { font-size: 22px; }
  .success__text { font-size: 15px; margin-bottom: 20px; }

  /* On mobile the badge sits above everything else */
  .training-card { display: flex; flex-direction: column; }
  .training-card__badge { order: -1; align-self: flex-start; margin: 0 0 8px; }

  /* Collapse training descriptions on mobile, reveal on tap */
  .training-card { padding-bottom: 16px; }
  .training-card__desc { display: none; margin-top: 6px; }
  .training-card.is-expanded .training-card__desc { display: block; }
  .training-card__more { display: flex; }
}
