/* ============================================================
   Ниткин Дом — стили сайта
   Mobile-first: базовые стили для 320px, затем адаптация
   ============================================================ */

/* ---------- CSS-переменные ---------- */
:root {
  --bg: #F5F0EB;
  --bg-alt: #EFE6DA;
  --surface: #FFFFFF;
  --text: #4A3F35;
  --text-muted: #7A6A5A;
  --brown: #8B6F47;
  --brown-dark: #6E5636;
  --terracotta: #C4956A;
  --terracotta-light: #E3CBB1;
  --accent: #8B3A3A;
  --olive: #6B7B3A;
  --gold: #B98A3B;
  --border: #E4D8C8;
  --shadow: 0 6px 24px rgba(74, 63, 53, 0.10);
  --shadow-sm: 0 2px 8px rgba(74, 63, 53, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --touch: 44px; /* минимальный размер тач-элемента */
  --header-h: 64px;
}

/* ---------- Сброс и база ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 10px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--text);
}

p { margin: 0 0 12px; }

a { color: var(--brown-dark); text-decoration: none; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* Ссылка-якорь для скролла */
.anchor { scroll-margin-top: calc(var(--header-h) + 14px); }

/* ---------- Утилиты ---------- */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 48px 0;
}

.section--alt { background: var(--bg-alt); }

.section__head {
  text-align: center;
  margin-bottom: 28px;
}

.section__title {
  font-size: 28px;
  letter-spacing: 0.3px;
}

.section__subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 520px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  transition: transform 0.15s ease, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: #7a3030; }

.btn--outline {
  background: transparent;
  border-color: var(--brown);
  color: var(--brown-dark);
}
.btn--outline:hover { background: var(--terracotta-light); }

.btn--light {
  background: #fff;
  color: var(--accent);
}
.btn--light:hover { background: var(--terracotta-light); }

.btn--ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brown-dark);
  font-weight: 600;
  min-height: var(--touch);
  padding: 8px 12px;
}
.btn--ghost-link svg { transition: transform 0.2s; }
.btn--ghost-link:hover svg { transform: translateX(4px); }

/* ---------- Шапка ---------- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(245, 240, 235, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--terracotta-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.brand__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand__name {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

.brand__tagline {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Мобильные контакты в шапке */
.header__contacts {
  display: none;
}

.header__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--accent);
  min-height: var(--touch);
  padding: 0 10px;
}

/* Бургер-кнопка */
.burger {
  width: var(--touch);
  height: var(--touch);
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.burger__line {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}

.burger[aria-expanded="true"] .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Мобильное меню */
.nav-mobile {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 99;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.nav-mobile--open { transform: translateX(0); }

.nav-mobile__list {
  list-style: none;
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-mobile__link {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
}
.nav-mobile__link:hover,
.nav-mobile__link:focus-visible { background: var(--terracotta-light); }

.nav-mobile__contacts {
  padding: 12px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border);
}

/* Десктопная навигация */
.nav-desktop {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav-desktop__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-radius: 999px;
  transition: background 0.2s;
}
.nav-desktop__link:hover { background: var(--terracotta-light); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--bg-alt);
  padding-top: calc(var(--header-h) + 24px);
  padding-bottom: 40px;
}

.hero__content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero__title {
  font-size: 32px;
  margin-bottom: 12px;
}

.hero__subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 20px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* ---------- Карточки услуг ---------- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--terracotta-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.service-card__icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--brown-dark);
}

.service-card__title {
  font-family: var(--font-head);
  font-size: 18px;
  margin-bottom: 4px;
}

.service-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Цены ---------- */
.price-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: transform 0.2s;
}

.price-item__label {
  font-weight: 600;
  font-size: 15px;
}

.price-item__note {
  font-size: 13px;
  color: var(--text-muted);
}

.price-item__price {
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ---------- Акцентный блок «Вышивка» ---------- */
.embroidery {
  background: linear-gradient(160deg, var(--bg-alt), var(--terracotta-light));
  border-radius: var(--radius);
  padding: 28px 20px;
  display: grid;
  gap: 20px;
}

.embroidery__title {
  font-size: 26px;
}

.embroidery__text {
  font-size: 15px;
  color: var(--text);
}

.embroidery__price {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.embroidery__gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.embroidery__gallery img {
  border-radius: var(--radius-sm);
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.2s;
}
.embroidery__gallery img:hover { transform: scale(1.03); }

.embroidery__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Магазин ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s;
}

.shop-card:hover { transform: translateY(-4px); }

.shop-card__img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-alt);
}

.shop-card__body {
  padding: 12px;
}

.shop-card__title {
  font-family: var(--font-head);
  font-size: 16px;
  margin: 0 0 2px;
}

.shop-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.shop-more {
  margin: 20px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Галерея ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  border: none;
  padding: 0;
  background: var(--bg-alt);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 10px 8px;
  background: linear-gradient(transparent, rgba(74, 63, 53, 0.75));
  color: #fff;
  font-size: 12px;
  text-align: left;
}

/* ---------- Контакты ---------- */
.contact-grid {
  display: grid;
  gap: 20px;
  max-width: 640px;
  margin: 0 auto;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.contact-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.contact-item:last-of-type { border-bottom: none; }

.contact-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--terracotta-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-item__title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}

.contact-item__value {
  font-size: 15px;
  color: var(--text);
}
.contact-item__value--link:hover { color: var(--accent); }

.work-hours {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.work-hours li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--text);
}
.work-hours li span { color: var(--text-muted); }

/* ---------- Футер ---------- */
.footer {
  background: var(--brown-dark);
  color: #F5F0EB;
  padding: 32px 0 96px; /* нижний отступ под плавающую кнопку на мобильных */
}

.footer__grid {
  display: grid;
  gap: 24px;
}

.footer h3 {
  color: #fff;
  font-size: 18px;
}

.footer__text {
  font-size: 14px;
  color: #D9CBB8;
  margin: 0;
}

.footer__link {
  color: #F5F0EB;
  font-size: 15px;
  display: inline-block;
  padding: 6px 0;
}

.footer__link:hover { color: var(--terracotta-light); }

.footer__bottom {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: #C9BAA4;
}

.footer__admin {
  color: #C9BAA4;
  text-decoration: underline;
  font-size: 12px;
  opacity: 0.6;
}
.footer__admin:hover { opacity: 1; }

/* ---------- Плавающая кнопка звонка ---------- */
.floating-call {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(139, 58, 58, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}
.floating-call:hover { transform: scale(1.06); }
.floating-call svg { width: 26px; height: 26px; }

/* ---------- Лайтбокс ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 16, 12, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lightbox--open { display: flex; }

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lightbox__caption {
  position: absolute;
  bottom: 20px;
  left: 16px; right: 16px;
  text-align: center;
  color: #fff;
  font-size: 15px;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: var(--touch);
  height: var(--touch);
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox__close:hover { background: rgba(255,255,255,0.3); }

/* ---------- Анимации ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal--visible {
  opacity: 1;
  transform: none;
}

/* ---------- Брейкпоинт 480px ---------- */
@media (min-width: 480px) {
  .container { padding: 0 20px; }
  .hero__title { font-size: 38px; }
  .section { padding: 56px 0; }
  .embroidery { padding: 32px 24px; }
}

/* ---------- Брейкпоинт 768px ---------- */
@media (min-width: 768px) {
  .header__contacts { display: flex; align-items: center; gap: 8px; }

  .nav-mobile, .burger { display: none; }

  .nav-desktop { display: flex; }

  .hero__title { font-size: 46px; }
  .hero__subtitle { font-size: 17px; }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .embroidery {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }

  .shop-grid { grid-template-columns: repeat(4, 1fr); }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); }

  .footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer { padding-bottom: 32px; }

  .floating-call { display: none; }
}

/* ---------- Брейкпоинт 1024px ---------- */
@media (min-width: 1024px) {
  .section { padding: 72px 0; }
  .hero { padding-top: calc(var(--header-h) + 56px); padding-bottom: 72px; }
  .hero__title { font-size: 54px; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); }
  .section__title { font-size: 34px; }
}