/* ==========================================================================
   СТИЛИ САЙТА «ХВОСТИКИ»
   --------------------------------------------------------------------------
   Вёрстка mobile-first: базовые стили — для телефона, дальше расширяем
   через @media (min-width: ...). Цвета заданы переменными — их меняют
   правила светлой и тёмной темы.
   ========================================================================== */

/* ---------------------------- 1. Темы ----------------------------------- */

:root {
  color-scheme: light;

  --bg: #fffaf4;
  --bg-soft: #fdf0e3;
  --surface: #ffffff;
  --text: #2b211c;
  --muted: #6f6058;
  --accent: #b9550f;
  --accent-hover: #9c460b;
  --accent-soft: #fbe2cd;
  --on-accent: #ffffff;
  --border: #ecdbca;
  --shadow: 0 8px 24px rgba(90, 58, 35, 0.08);
  --shadow-strong: 0 18px 44px rgba(90, 58, 35, 0.16);
  --header-bg: rgba(255, 250, 244, 0.88);

  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #17120f;
  --bg-soft: #201812;
  --surface: #221a15;
  --text: #f6ece2;
  --muted: #b3a094;
  --accent: #f0904a;
  --accent-hover: #ffa869;
  --accent-soft: #34231a;
  --on-accent: #1a120d;
  --border: #33261d;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-strong: 0 18px 44px rgba(0, 0, 0, 0.6);
  --header-bg: rgba(23, 18, 15, 0.88);
}

/* ---------------------------- 2. База ----------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
p,
figure,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------------------------- 3. Кнопки --------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 24px rgba(185, 85, 15, 0.22);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--secondary:hover {
  background: var(--accent-soft);
}

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

.btn--lg {
  min-height: 56px;
}

.btn--sm {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 15px;
}

/* ---------------------------- 4. Шапка ---------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  transition: min-height 0.25s var(--ease);
}

.header.is-scrolled .header__inner {
  min-height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo .icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Кнопка «Позвонить» в шапке: на узких экранах — только иконка. */
.btn--header {
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
}

.btn--header .btn__label {
  display: none;
}

/* Переключатель темы «лапка ↔ косточка» */
.theme-toggle {
  position: relative;
  width: 74px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease);
}

.theme-toggle__icon .icon {
  width: 22px;
  height: 22px;
}

.theme-toggle__icon--paw {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__icon--bone {
  opacity: 0;
  transform: rotate(-180deg) scale(0.6);
}

[data-theme="dark"] .theme-toggle__icon--paw {
  opacity: 0;
  transform: rotate(180deg) scale(0.6);
}

[data-theme="dark"] .theme-toggle__icon--bone {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ---------------------------- 5. Первый экран --------------------------- */

.hero {
  padding: 28px 0 34px;
}

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

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.hero__badge .icon {
  width: 18px;
  height: 18px;
}

.hero__title {
  margin-top: 16px;
  font-size: clamp(28px, 8vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  margin-top: 14px;
  max-width: 34em;
  color: var(--muted);
}

.hero__actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.hero__meta {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 15px;
}

.hero__meta li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__meta .icon {
  color: var(--accent);
}

/* ---------------------------- 6. Секции --------------------------------- */

.section {
  padding: 44px 0;
}

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

.section__head {
  max-width: 40em;
  margin-bottom: 24px;
}

.section__title {
  font-size: clamp(23px, 5.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.section__subtitle {
  margin-top: 10px;
  color: var(--muted);
}

/* ---------------------------- 7. Карточки ------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-strong);
}

.card__icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 0.25s var(--ease);
}

.card:hover .card__icon {
  transform: rotate(-6deg) scale(1.05);
}

.card__icon .icon {
  width: 24px;
  height: 24px;
}

.card__title {
  margin-top: 14px;
  font-size: 18px;
  line-height: 1.3;
}

.card__details {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.card__price {
  margin-top: 12px;
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
}

.services,
.advantages {
  display: grid;
  gap: 14px;
}

.note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------------------------- 8. Фотографии ----------------------------- */

.photo {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg-soft) 55%, var(--accent-soft) 100%);
  box-shadow: var(--shadow);
}

.photo--hero {
  aspect-ratio: 4 / 3;
}

.photo__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}

.photo.is-loaded .photo__img {
  opacity: 1;
}

.photo__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: opacity 0.4s var(--ease);
}

.photo__placeholder .icon {
  width: 46px;
  height: 46px;
  opacity: 0.6;
}

.photo.is-loaded .photo__placeholder {
  opacity: 0;
  visibility: hidden;
}

/* Подпись об источнике фото, например «Иллюстрация: Unsplash».
   Видна только поверх загруженного изображения. */
.photo__credit {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: none;
  max-width: calc(100% - 16px);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 12, 8, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.photo.is-loaded .photo__credit {
  display: inline-block;
}

/* ---------------------------- 9. Мастер --------------------------------- */

.master {
  display: grid;
  gap: 20px;
}

.master__name {
  font-size: 22px;
}

.master__text {
  margin-top: 12px;
  color: var(--muted);
}

.master__exp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.master__exp .icon {
  width: 18px;
  height: 18px;
}

/* ---------------------------- 10. Галерея ------------------------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery .photo {
  aspect-ratio: 1 / 1;
}

/* ---------------------------- 11. Контакты ------------------------------ */

.contacts {
  display: grid;
  gap: 20px;
}

.contacts__list {
  display: grid;
  gap: 16px;
}

.contacts__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.contacts__item .icon {
  margin-top: 4px;
  color: var(--accent);
}

.contacts__label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contacts__value {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 600;
}

.contacts__value--phone {
  font-size: 21px;
}

.address-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.contacts__card {
  display: grid;
  gap: 12px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contacts__card-title {
  font-size: 18px;
  font-weight: 700;
}

/* ---------------------------- 12. Подвал -------------------------------- */

.footer {
  margin-top: 44px;
  padding: 26px 0 30px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: grid;
  gap: 14px;
}

.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.footer__brand .icon {
  color: var(--accent);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 15px;
}

.footer__link {
  color: var(--text);
}

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

.footer__copy {
  color: var(--muted);
  font-size: 14px;
}

/* ---------------------------- 13. Нижняя панель ------------------------- */

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 28;
  display: flex;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
}

.actionbar .btn {
  flex: 1;
  padding: 12px 14px;
  font-size: 16px;
}

/* ---------------------------- 14. Модальное окно ------------------------ */

.modal {
  width: 100%;
  max-width: min(680px, calc(100vw - 28px));
  max-height: 86vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-strong);
}

.modal::backdrop {
  background: rgba(20, 12, 8, 0.55);
}

.modal[open] {
  animation: modal-in 0.25s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__inner {
  display: flex;
  flex-direction: column;
  max-height: 86vh;
}

.modal__notice {
  padding: 10px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 20px;
  line-height: 1.25;
}

.modal__close {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.modal__close:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.modal__body {
  display: grid;
  gap: 12px;
  padding: 16px 18px 24px;
  overflow: auto;
  color: var(--muted);
  font-size: 15px;
}

.modal__body h3 {
  margin-top: 6px;
  color: var(--text);
  font-size: 16px;
}

.modal__body a {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------------------------- 15. Cookie --------------------------------- */

.cookie {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  font-size: 14px;
}

.cookie__text {
  flex: 1 1 220px;
  color: var(--muted);
}

.cookie__link {
  color: var(--accent);
  text-decoration: underline;
}

/* ---------------------------- 16. Анимации ------------------------------ */

.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.js-anim [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.theme-anim,
.theme-anim *,
.theme-anim *::before,
.theme-anim *::after {
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
    border-color 0.3s var(--ease), box-shadow 0.3s var(--ease) !important;
}

html.is-locked {
  overflow: hidden;
}

/* ---------------------------- 17. Адаптивность -------------------------- */

@media (min-width: 480px) {
  .btn--header {
    width: auto;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 15px;
  }

  .btn--header .btn__label {
    display: inline;
  }
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .hero__actions {
    grid-template-columns: repeat(2, max-content);
  }

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

  .gallery {
    gap: 16px;
  }
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .actionbar {
    display: none;
  }

  .cookie {
    left: auto;
    right: 20px;
    bottom: 20px;
    max-width: 420px;
  }

  .contacts__card {
    padding: 26px;
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 56px 0 48px;
  }

  .hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 40px;
  }

  .hero__actions {
    margin-top: 28px;
  }

  .section {
    padding: 62px 0;
  }

  .services,
  .advantages {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .master {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 36px;
  }

  .contacts {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
    gap: 36px;
  }

  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 190px;
    grid-auto-flow: dense;
  }

  .gallery .photo {
    aspect-ratio: auto;
    height: 100%;
  }

  .gallery .photo:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery .photo:last-child {
    grid-column: span 2;
  }

  .footer__inner {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
  }

  .footer__copy {
    text-align: right;
  }
}

@media (min-width: 1100px) {
  .hero__title {
    font-size: 52px;
  }
}

/* ---------------------------- 18. Уменьшение движения ------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js-anim [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .card:hover {
    transform: none;
  }

  .card:hover .card__icon {
    transform: none;
  }
}

/* ---------------------------- 19. Страница оферты ----------------------- */

/* На странице оферты нет нижней панели — убираем её отступ. */
.page-legal {
  padding-bottom: 0;
}

.legal-banner {
  padding: 14px 18px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: clamp(17px, 4.6vw, 24px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  text-align: center;
}

.legal {
  padding: 34px 0 10px;
}

.legal__title {
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.legal__lead {
  max-width: 46em;
  margin-top: 12px;
  color: var(--muted);
}

.legal__body {
  display: grid;
  gap: 12px;
  max-width: 46em;
  margin-top: 26px;
  font-size: 16px;
}

.legal__body h2 {
  margin-top: 16px;
  font-size: clamp(19px, 4.6vw, 24px);
  line-height: 1.25;
}

.legal__body p,
.legal__body li {
  color: var(--muted);
}

.legal__body strong {
  color: var(--text);
}

.legal__body ul,
.legal__body ol {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  list-style: disc;
}

.legal__body ol {
  list-style: decimal;
}

/* Реквизиты: рамка вместо маркеров списка. */
.legal__body ul.legal__req {
  padding: 20px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.legal__req li {
  color: var(--text);
}

.legal__updated {
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}
