/* style.css */

/* 1) Основной способ: Chromium/Safari */
html {
  zoom: 0.9; /* 90% от текущего размера */
}

/* 2) Фолбэк для Firefox (у него нет zoom) */
@supports not (zoom: 1) {
  html { overflow-x: hidden; } /* чтобы не было горизонтального скролла */
  body {
    /* Масштабируем всё содержимое страницы */
    transform: scale(0.9);
    transform-origin: top center;
    /* Компенсируем масштаб, чтобы визуальная ширина осталась 100% вьюпорта:
       0.9 * 111.111% ≈ 100% */
    width: 111.111%;
  }

  /* (опционально) если есть 100vh-секции во вьюпорте на мобильном Firefox */
  @media (max-width: 768px) {
    body { min-height: calc(100vh / 0.9); }
  }
}


/* -------- БАЗА -------- */
body {
  background-color: #f3e3ca;
  font-family: 'Merriweather', serif;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

h1 { font-size: 50px; }
h2 { font-size: 32px; }
p  { font-size: 16px; }

nav a,
a[href^="mailto:"],
a[href^="tel:"],
button { font-size: 20px; }

/* -------- HEADER -------- */
header {
  padding-top: 48px;
  padding-bottom: 0;
  margin-bottom: 48px;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Логотип + подпись */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.brand-text {
  font-size: 20px;
  line-height: 1.2;
  color: #b3392b;
  font-style: italic;
  font-weight: 700;
}

/* -------- НАВ -------- */
nav ul {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

nav a {
  position: relative;
  text-decoration: none;
  color: #050702;
  font-weight: 700;
  transition: color 0.25s ease, transform 0.2s ease;
}

/* стильное подчёркивание с анимацией */
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg, #b3392b, #cf4a3b);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

nav a:hover,
nav a:focus-visible {
  color: #b3392b;
  transform: translateY(-1px);
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
}

/* -------- HERO -------- */
:root { --hero-h: 500px; }

#hero { margin: 0 0 48px; }

.hero-image {
  position: relative;
  height: var(--hero-h);
  border-radius: 24px;
  overflow: hidden;
  background-image: url('img/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding-right: 12%;
}

.hero-doll {
  position: absolute;
  left: clamp(16px, 6vw, 72px);
  height: calc(var(--hero-h) * 1.15);
  bottom: calc(var(--hero-h) * -0.25);
  object-fit: contain;
  pointer-events: none;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 562px;
}

.hero-content h1 {
  color: #F3E3CA;
  line-height: 1.15;
  margin: 0;
}

/* -------- КНОПКИ -------- */
.btn,
.gallery-grid + p a {
  --btn-1: #b3392b;
  --btn-2: #c24436;
  --btn-3: #cf4a3b;
  --btn-press: #f37363;

  display: inline-block;
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
  color: #fff;

  padding: 24px 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--btn-2) 0%, var(--btn-1) 100%);
  box-shadow: 0 8px 16px rgba(179, 57, 43, 0.25),
              inset 0 1px 0 rgba(255,255,255,0.12);
  transition: background 0.25s ease,
              box-shadow 0.25s ease,
              transform 0.15s ease;
}

.btn:hover,
.gallery-grid + p a:hover {
  background: linear-gradient(180deg, var(--btn-3) 0%, var(--btn-2) 100%);
  box-shadow: 0 10px 18px rgba(179, 57, 43, 0.32),
              inset 0 1px 0 rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.btn:active,
.gallery-grid + p a:active {
  background: var(--btn-press);
  box-shadow: 0 4px 10px rgba(179, 57, 43, 0.28),
              inset 0 2px 6px rgba(0,0,0,0.12);
  transform: translateY(2px);
}

.btn:focus-visible,
.gallery-grid + p a:focus-visible {
  outline: 3px solid rgba(179,57,43,0.35);
  outline-offset: 2px;
}

/* -------- ABOUT + GALLERY -------- */
#about { margin: 0 0 48px; }
#about .container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 580px;
  column-gap: 60px;
  align-items: start;
}

.about-text h2 {
  color: #b3392b;
  margin: 0 0 20px 0;
}
.about-description { max-width: 474px; }
.about-description p { margin: 0 0 16px 0; line-height: 1.6; }

/* -------- CONTACTS -------- */
#contacts {
  background-color: #fff;
  background-image: url('img/footer.jpg');
  background-position: center cover;
  background-size: cover;
  padding-top: 48px;
  padding-bottom: 48px;
  height: 920px;
  margin: 0;
}

.contacts-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 580px;
  column-gap: 60px;
  align-items: start;
}

.contacts-info { max-width: 474px; }
.contacts-info h2 { color: #b3392b; margin: 0 0 20px 0; }
.contacts-info p { margin: 0 0 16px 0; line-height: 1.6; }

address { font-style: normal; }
address a { font-style: normal; }
address p { font-size: 20px; }

.contacts-image { display: flex; justify-content: center; align-items: flex-start; }
.contacts-image img {
  width: 260px; border-radius: 8px; object-fit: cover; display: block; margin-bottom: -48px;
}

/* центрируем кнопку под галереей */
.gallery-button-wrap {
  text-align: center;
  margin-top: 24px;
}

.gallery-btn {
  display: inline-block;
  padding: 24px 40px;
  border-radius: 10px;
  font-size: 20px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(180deg, #c24436 0%, #b3392b 100%);
  box-shadow: 0 8px 16px rgba(179,57,43,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: all 0.25s ease;
}

.gallery-btn:hover {
  background: linear-gradient(180deg, #cf4a3b 0%, #c24436 100%);
  transform: translateY(-1px);
}

.gallery-btn:active {
  background: #f37363;
  transform: translateY(2px);
}


/* -------- ГАЛЕРЕЯ (СТРАНИЦА КАТАЛОГА) -------- */
#gallery-page { margin: 0 0 48px; }
#gallery-page h2 { color: #b3392b; margin: 0; }

.gallery-large {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  column-gap: 20px;
  row-gap: 48px;
  padding: 0;
  margin: 0;
  margin-bottom: 48px;
}
.gallery-large li { list-style: none; }
.gallery-large a {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
  cursor: pointer;
}
.gallery-large img { width: 380px; height: 380px; object-fit: cover; display: block; border-radius: 4px; }

.gallery-large h3 {
  margin-top: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #050702;
  text-align: center;
}

/* -------- ГАЛЕРЕЯ (ГЛАВНАЯ, ПРЕВЬЮ 180×180) -------- */
.gallery-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 20px;
  padding: 0;
  margin: 0;
  align-items: start;
}
.gallery-grid li { 
  list-style: none; 
  text-align: center;
}
.gallery-grid a {
  display: block;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
  cursor: pointer;
}
.gallery-grid img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

/* === hover/focus для интерактивных изображений (общий + «обводка как раньше») === */
.gallery-grid img,
.gallery-large img {
  transform: translateZ(0);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.gallery-grid a:hover img,
.gallery-large a:hover img {
  transform: scale(1.03);
  filter: saturate(1.05) contrast(1.02);
}

/* кольцо-обводка на hover/focus */
.gallery-grid a:hover,
.gallery-grid a:focus-visible,
.gallery-large a:hover,
.gallery-large a:focus-visible,
.product-thumbs .thumb:hover,
.product-thumbs .thumb:focus-visible {
  box-shadow:
    0 0 0 3px rgba(179,57,43,.35),
    0 1px 0 rgba(0,0,0,.06);
  outline: none;
}

/* ====== CARD LAYOUT (580×580 + thumbs + 380 текст) ====== */
#product { margin: 0 0 48px; }
.product-grid {
  display: grid;
  grid-template-columns: 84px 580px minmax(0, 1fr);
  column-gap: 60px;
  align-items: start;
}

/* левая часть */
.product-view {
  grid-column: 1 / span 2;
  display: grid;
  grid-template-columns: 580px 84px;
  grid-template-rows: 580px;
  column-gap: 16px;
  align-items: start;
  position: relative;
}
.product-view input[type="radio"] {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.product-stage {
  grid-column: 1; grid-row: 1;
  position: relative; width: 580px; height: 580px;
  overflow: hidden; border-radius: 12px; background: #e7d3b4;
}
.product-stage .slide {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .25s ease;
}
.product-stage .s1 { opacity: 1; }
#pv-1:checked ~ .product-stage .s1 { opacity: 1; }
#pv-1:checked ~ .product-stage .s2, #pv-1:checked ~ .product-stage .s3 { opacity: 0; }
#pv-2:checked ~ .product-stage .s2 { opacity: 1; }
#pv-2:checked ~ .product-stage .s1, #pv-2:checked ~ .product-stage .s3 { opacity: 0; }
#pv-3:checked ~ .product-stage .s3 { opacity: 1; }
#pv-3:checked ~ .product-stage .s1, #pv-3:checked ~ .product-stage .s2 { opacity: 0; }

/* превью справа от фото */
.product-thumbs {
  grid-column: 2; grid-row: 1;
  display: grid; grid-auto-rows: 72px; row-gap: 16px;
}
.product-thumbs .thumb {
  display: inline-flex;
  width: 72px; height: 72px;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,.06);
  transition: transform .15s ease, box-shadow .2s ease;
  cursor: pointer;
}
.product-thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumbs .thumb:hover { transform: translateY(-1px); }
#pv-1:checked ~ .product-thumbs label[for="pv-1"],
#pv-2:checked ~ .product-thumbs label[for="pv-2"],
#pv-3:checked ~ .product-thumbs label[for="pv-3"] {
  outline: 3px solid rgba(179,57,43,.35);
  outline-offset: 2px;
}

/* правая колонка: текстовый блок 380px */
.product-info {
  grid-column: 3;
  min-height: 580px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: auto;
  width: 380px;
}
.product-info h2 {
  color: #b3392b;
  margin: 0 0 16px 0;
  max-width: 380px;
}
.product-desc { width: 100%; max-width: 380px; }
.product-desc p { margin: 0 0 16px 0; line-height: 1.6; }

/* ===== навигация Пред/След ===== */
.product-nav {
  margin-top: auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

/* блок о покупке (красный текст с рамкой) */
.product-buy {
  margin: 16px 0 32px;
  padding: 14px 18px;
  border: 2px solid #b3392b;
  color: #b3392b;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  max-width: 380px;
  text-align: left;
}

.nav-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
  color: #050702;
  transition: color .25s ease, transform .15s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: linear-gradient(90deg, #b3392b, #cf4a3b);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: #b3392b;
  transform: translateY(-1px);
}
.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.prev-link { text-align: left; }
.next-link { text-align: right; }

/* ==== ТУЛТИП-ПРЕВЬЮ ДЛЯ ССЫЛОК Пред/След (уменьшенные, без «клювика») ==== */
.nav-link .nav-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(-50%, -6px) scale(.98);
  opacity: 0;
  pointer-events: none;
  z-index: 50;

  background: #fff;
  border: 1px solid rgba(5,7,2,0.08);
  border-radius: 12px;
  box-shadow:
    0 8px 20px rgba(5,7,2,0.15),
    0 2px 6px rgba(5,7,2,0.08);
  padding: 6px;
  transition: opacity .18s ease, transform .18s ease;
}

/* без стрелочки */
.nav-link .nav-tooltip::after {
  content: none;
  display: none;
}

/* изображение в 1.5 раза меньше (≈134px вместо 200px) */
.nav-link .nav-tooltip img {
  display: block;
  width: 134px;
  height: 134px;
  object-fit: cover;
  border-radius: 8px;
}

/* показываем тултип только там, где есть hover (не тач) */
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover .nav-tooltip,
  .nav-link:focus-visible .nav-tooltip {
    opacity: 1;
    transform: translate(-50%, -2px) scale(1);
  }
}

/* -------- АДАПТИВ -------- */
@media (max-width: 1080px) {
  #about .container { grid-template-columns: 1fr; row-gap: 40px; }
  .contacts-layout { grid-template-columns: 1fr; row-gap: 32px; }
  .contacts-image { justify-content: flex-start; }

  .gallery-large img { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .gallery-grid { justify-content: start; }
}
