/* ============ irtanails.online — стили ============ */
:root {
  --bg: #fffdfb;
  --ink: #2d2531;
  --muted: #6f6476;
  --brand: #b074a0;
  --brand-deep: #8e547f;
  --brand-soft: #f3e8f7;
  --line: #eee4ee;
  --radius: 16px;
  --shadow: 0 12px 32px rgba(176,116,160,.14);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; overflow-x: clip; width: 100%; max-width: 100vw; }
body.locked { overflow: hidden; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
.container { width: min(1080px, 92%); margin: 0 auto; }

/* NAV */
.nav { position: sticky; top: 0; background: rgba(255,253,251,.92); backdrop-filter: blur(8px); z-index: 50; border-bottom: 1px solid var(--line); transition: box-shadow .25s ease; }
.nav.nav--scrolled { box-shadow: 0 6px 20px rgba(45,37,49,.10); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.logo { font-size: 1.5rem; font-weight: 700; }
.logo b { color: var(--brand); }
.nav__menu { display: flex; align-items: center; gap: 24px; }
.nav__menu a:not(.btn) { color: var(--ink); font-weight: 500; }
.nav__menu a:not(.btn):hover { color: var(--brand-deep); }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 999px; font-weight: 600; transition: transform .2s, box-shadow .2s; }
.btn--primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; padding: 14px 28px; box-shadow: 0 8px 24px rgba(176,116,160,.35); }
.btn--primary:hover { transform: translateY(-2px); }
.btn--sm { padding: 9px 18px; font-size: .9rem; }
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }
.btn--block { width: 100%; }

/* HERO */
.hero { padding: 80px 0; }
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 60px; align-items: center; }
.hero__text h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: 1.1; margin: 14px 0 18px; }
.hero__text p { color: var(--muted); max-width: 480px; margin-bottom: 26px; }
.eyebrow { text-transform: none; letter-spacing: .06em; font-size: .95rem; font-weight: 700; color: var(--brand-deep); }
.hero__img { position: relative; border-radius: 30px 30px 30px 130px; overflow: hidden; height: 360px; background: linear-gradient(160deg, var(--brand-soft), var(--line)); display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 600; }
.hero__img::before { content: 'Фото'; opacity: .7; }
.hero__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px 30px 30px 130px; }
.hero__img img:not([hidden]) { position: absolute; inset: 0; }
.hero__img img:not([hidden]) ~ * { display: none; }
.hero__img:has(img:not([hidden]))::before { content: ''; display: none; }

/* SECTIONS */
.section { padding: 70px 0; }
.section--soft { background: var(--brand-soft); }
.section__head { margin-bottom: 40px; }
.section__head h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 8px; }
.section__head p { color: var(--muted); }

/* SERVICES (заполняется из API) */
.services { display: grid; gap: 40px; }
.service-cat {}
.service-cat__title { font-size: 1.5rem; font-weight: 700; color: var(--brand-deep); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--brand-soft); }
.service-cat__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.service-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.service-card__name { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.service-card__desc { color: var(--muted); font-size: .9rem; margin-bottom: 12px; min-height: 2.6em; }
.service-card__price { color: var(--brand-deep); font-weight: 700; font-size: 1.05rem; }
.service-card__dur { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.service-card__cat { display: inline-block; font-size: .75rem; background: var(--brand-soft); color: var(--brand-deep); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }

/* PORTFOLIO */
.portfolio { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.portfolio__item { aspect-ratio: 4/5; background: var(--line); border-radius: 12px; overflow: hidden; }
.portfolio__item img { width: 100%; height: 100%; object-fit: cover; }

/* BOOK */
.book__wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.book__info h2 { font-size: 2rem; margin-bottom: 12px; }
.book__form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.book__form label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--muted); }
.book__form input, .book__form select { font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; background: var(--bg); }
.book__form input:focus, .book__form select:focus { border-color: var(--brand); }
.book__form button { margin-top: 4px; }
.form-msg { font-size: .92rem; text-align: center; min-height: 1.2em; }
.form-msg.ok { color: #2e7d32; }
.form-msg.err { color: #c0564a; }

/* FOOTER */
.footer { background: var(--ink); color: #fff; text-align: center; padding: 24px 0; font-size: .9rem; }

@media (max-width: 760px) {
  .hero__inner, .book__wrap { grid-template-columns: 1fr; gap: 30px; }
  .nav__inner { flex-wrap: wrap; gap: 8px 12px; }
  .nav__menu { flex-wrap: wrap; gap: 8px 14px; font-size: .88rem; }
  .nav__menu .btn { margin-left: auto; }
}
@media (max-width: 480px) {
  .nav__menu a:not(.btn) { display: inline; font-size: .82rem; }
  .nav__menu { gap: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ===== МОДАЛЬНОЕ ОКНО ЗАПИСИ ===== */
.book-modal { position: fixed; inset: 0; width: 100vw; height: 100dvh; background: rgba(45,37,49,.55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 200; }
.book-modal[hidden] { display: none; }
.book-modal__card { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; max-height: 92dvh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.book-modal__head { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.book-modal__back, .book-modal__close { background: transparent; border: 0; color: #fff; font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.book-modal__close { margin-left: auto; font-size: 1.5rem; }
.book-modal__titles { display: flex; flex-direction: column; line-height: 1.2; }
.book-modal__titles span:first-child { font-size: 1.05rem; font-weight: 700; }
.book-modal__titles span:last-child { font-size: .78rem; opacity: .85; }
.book-modal__body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.book-modal__foot { padding: 14px 18px; border-top: 1px solid var(--line); }
.bm-primary { width: 100%; border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; font-weight: 700; font-size: 1.05rem; padding: 14px; border-radius: 999px; cursor: pointer; font-family: inherit; box-shadow: 0 8px 24px rgba(176,116,160,.35); transition: transform .2s; }
.bm-primary:hover { transform: translateY(-1px); }
.bm-primary:disabled { opacity: .5; cursor: not-allowed; }

.bm-steps { display: flex; gap: 8px; margin-bottom: 16px; }
.bm-step { font-size: .78rem; font-weight: 600; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); }
.bm-step.active { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; }

/* Шаг 1: услуги (аккордеон) */
.bm-cat { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.bm-cat__head { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 700; }
.bm-cat__head .bm-cat__arrow { transition: transform .2s; }
.bm-cat.open .bm-cat__arrow { transform: rotate(180deg); }
.bm-cat__body { display: none; }
.bm-cat.open .bm-cat__body { display: block; }
.bm-service { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; }
.bm-service:first-child { border-top: 0; }
.bm-service__info { flex: 1; }
.bm-service__name { font-weight: 700; font-size: .98rem; }
.bm-service__sub { color: var(--muted); font-size: .84rem; }
.bm-service__more { color: var(--brand-deep); font-size: .82rem; text-decoration: underline; cursor: pointer; margin-top: 3px; background: none; border: 0; padding: 0; font-family: inherit; }
.bm-service__desc { margin-top: 6px; padding: 10px 12px; background: #fff; border: 1px dashed var(--line); border-radius: 8px; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.bm-service__check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #cbd5e0; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .95rem; color: #fff; }
.bm-service.selected { background: var(--brand-soft); }
.bm-service.selected .bm-service__check { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); border-color: var(--brand-deep); }
.bm-service.dim { opacity: .55; }

/* Шаг 2: календарь и слоты */
.bm-selected-service { background: var(--brand-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: .9rem; }
.bm-selected-service b { display: block; color: var(--brand-deep); }
.bm-selected-service span { color: var(--muted); }
.bm-cal-wrap { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.bm-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.bm-cal-head button { border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--brand-deep); padding: 0 8px; }
.bm-cal-title { font-weight: 700; text-transform: capitalize; }
.bm-cal-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .75rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.bm-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bm-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: .88rem; cursor: default; }
.bm-day.empty { visibility: hidden; }
.bm-day.off { color: #c3c8d0; }
.bm-day.avail { color: var(--brand-deep); font-weight: 600; cursor: pointer; }
.bm-day.avail:hover { background: var(--brand-soft); }
.bm-day.selected { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff !important; }
.bm-day.today { box-shadow: inset 0 0 0 1.5px #c3c8d0; }
.bm-time-label { margin: 16px 0 8px; font-weight: 700; color: var(--ink); text-transform: capitalize; }
.bm-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.bm-slot { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px; font-family: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.bm-slot.selected { border-color: var(--brand-deep); background: var(--brand-soft); color: var(--brand-deep); font-weight: 700; }
.bm-slot:disabled { opacity: .4; cursor: not-allowed; }

/* Шаг 3: форма */
.bm-step-page label { display: grid; gap: 6px; font-size: .9rem; font-weight: 500; color: var(--muted); margin-bottom: 14px; }
.bm-step-page input { font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; }
.bm-step-page input:focus { border-color: var(--brand-deep); }

/* Мобильная адаптация модала */
@media (max-width: 520px) {
  .book-modal { padding: 0; align-items: flex-end; }
  .book-modal__card { max-width: none; width: 100%; height: auto; max-height: 100dvh; border-radius: 18px 18px 0 0; }
  .book-modal__head { padding: 16px 16px; }
  .book-modal__body { padding: 14px 14px; }
  .book-modal__foot { padding: 12px 14px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .book-modal__back, .book-modal__close { font-size: 1.9rem; }
  .bm-service { padding: 15px 14px; }
  .bm-service__check { width: 28px; height: 28px; font-size: 1.1rem; }
  .bm-slot { min-height: 46px; font-size: 1rem; }
  .bm-secondary { font-size: 1rem; }
  .bm-primary { min-height: 50px; }
  .bm-steps { gap: 6px; }
  .bm-step { font-size: .72rem; padding: 4px 8px; }
}
/* Планшеты: окно чуть уже */
@media (min-width: 521px) and (max-width: 760px) {
  .bm-service { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .bm-primary { transition: none; }
}