/* =============================
   RESET & VARIABLES
============================= */
:root {
  --color-bg: #ffffff;
  --color-surface: #fff7f7; /* очень светлый розово-кремовый (поверхности) */
  --color-text: #111827;    /* тёмный текст (контраст) */
  --color-muted: #7f1d1d;   /* вторичный/мутный текст в красных тонах */
  --color-border: rgba(185,28,28,0.08); /* мягкая красная граница */
  --accent1: #b91c1c; /* глубокий красный (акцент) */
  --accent2: #ef4444; /* яркий красный (всплески) */
  --radius: 16px;
  --container: 1280px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --transition: all 0.2s ease;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  --header-opacity: 0.78; /* контролирует прозрачность шапки */
  --header-blur: 12px;     /* контролирует размытие бекдропа в шапке */
  --header-compact-padding: 10px; /* вертикальный padding для компактного header */
}

/* helper to avoid seam artefacts on many elements */
.no-seam {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

/* keep box-sizing */
* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  /* Красно-белый полупрозрачный фон */
  background-image:
    linear-gradient(180deg, rgba(255,240,240,0.65) 0%, rgba(255,255,255,0.6) 45%, rgba(255,245,245,0.6) 100%),
    radial-gradient(circle at 10% 10%, rgba(235,60,60,0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 90%, rgba(200,30,30,0.04) 0%, transparent 18%);
  background-blend-mode: normal, overlay, overlay;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-text);
  line-height: 1.6;
  position: relative;
}
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 50% 50%, rgba(185,28,28,0.05) 0%, transparent 50%),
                    radial-gradient(circle at 20% 80%, rgba(239,68,68,0.05) 0%, transparent 50%);
  opacity: 0.75;
  pointer-events: none;
  z-index: -1;
  animation: subtle-glow 20s ease-in-out infinite alternate;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: opacity, transform;
}
@keyframes subtle-glow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.05); opacity: 0.6; }
}
main { flex: 1; }
.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
}
h1 {
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.1;
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p { margin: 0 0 16px; }
a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}
a:hover { text-decoration: underline; text-underline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }

/* =============================
   HEADER (COMPACT & SEMI-TRANSPARENT)
============================= */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  /* полупрозрачный фон, уменьшенное blur */
  background: rgba(255,255,255,var(--header-opacity));
  backdrop-filter: blur(var(--header-blur));
  /* убираем border-bottom, используем лёгкую тень/инсет вместо жёсткой линии */
  box-shadow: var(--shadow-sm), 0 1px 0 0 rgba(0,0,0,0.02) inset;
  transition: background 0.25s ease, box-shadow 0.25s ease, padding 0.2s ease;
  /* слегка уменьшенный размер для компактности */
  padding: 6px 0;
  /* отдельный слой рендеринга, чтобы уменьшить артефакты */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ещё более сжатый вид при скролле (опционально, оставлено в CSS) */
header.scrolled {
  background: rgba(255,255,255, calc(var(--header-opacity) + 0.1) );
  box-shadow: var(--shadow-md), 0 1px 0 0 rgba(0,0,0,0.03) inset;
}

/* внутренности header сделаны компактнее */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px; /* уменьшен gap */
  padding: var(--header-compact-padding) 0; /* компактный вертикальный padding */
}

/* Логотип уменьшен: круг и текст меньше, чтобы не привлекать лишнего внимания */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
  transition: var(--transition);
}
.logo:hover { transform: translateY(-1px); }
.logo .circle {
  width: 36px;    /* уменьшено */
  height: 36px;   /* уменьшено */
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: grid;
  place-items: center;
  color: var(--color-bg);
  font-size: 20px; /* уменьшено */
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(185,28,28,0.18);
  transition: var(--transition);
}
.logo:hover .circle { transform: rotate(8deg) scale(1.03); }
.logo .brand { font-size: 18px; font-weight: 800; }
.logo .small.muted { font-size: 11px; color: var(--color-muted); font-weight: 400; }

/* Навигация сделана компактнее: меньшие отступы и шрифт */
nav {
  display: flex;
  gap: 12px; /* уменьшен gap */
  flex-wrap: wrap;
  align-items: center;
}
nav a {
  text-decoration: none;
  padding: 8px 0; /* уменьшено */
  border-radius: 0;
  font-weight: 600;
  font-size: 14px; /* уменьшен шрифт */
  position: relative;
  transition: var(--transition);
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transition: width 0.3s ease;
}
nav a:hover::after { width: 100%; }
nav a:hover { text-decoration: none; color: var(--accent1); }

/* Блок действий (регистрация/войти/корзина) компактнее */
.actions {
  display: flex;
  gap: 8px; /* уменьшен gap для компактности */
  align-items: center;
}
.btn {
  padding: 8px 14px; /* уменьшена обводка */
  border-radius: 999px;
  background: var(--color-bg);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(0,0,0,0.02) inset;
  border: none;
  font-size: 14px;
}
.btn:hover {
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn.primary {
  padding: 9px 16px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border: none;
  box-shadow: var(--shadow-md);
}
.btn.primary:hover {
  filter: brightness(1.05);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  transform: translateY(-1px);
}

/* =============================
   HERO
============================= */
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(400px, 520px);
  gap: 40px;
  align-items: center;
  padding: clamp(40px, 6vw, 80px) 0;
}
.gradient-text {
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
p.lead {
  color: var(--color-muted);
  font-size: clamp(16px, 1.8vw, 16px);
  max-width: 65ch;
  margin: 12px 0 24px;
}
.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-right {
  height: 360px;
  background: var(--color-surface);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
  overflow: hidden;
  position: relative;
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
@keyframes rotate {
  to { transform: rotate(360deg); }
}

/* =============================
   SECTIONS & CARDS
============================= */
section { padding: 48px 0; }
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.section-title a {
  font-weight: 600;
  color: var(--accent1);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.grid { display: grid; gap: 24px; }

.categories { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cat-card {
  background: var(--color-bg);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.cat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-border);
}
.cat-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-bg);
  font-weight: 800;
  font-size: 28px;
  margin-bottom: 16px;
}
.cat-card h3 { font-size: 20px; margin: 0 0 8px; }
.cat-card p { color: var(--color-muted); font-size: 14px; margin: 0; }

.products { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.product {
  background: var(--color-bg);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition);
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.product:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--color-border);
}
.product .thumb {
  height: 200px;
  background: var(--color-surface);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02) inset;
  overflow: hidden;
  position: relative;
}
.product .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product:hover .thumb img { transform: scale(1.05); }
.product h3 { font-size: 18px; margin: 0; }
.product p { color: var(--color-muted); font-size: 14px; margin: 0; }
.price { font-weight: 800; font-size: 18px; margin-top: auto; }

.reviews { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.review {
  background: var(--color-bg);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.review .stars { color: var(--accent2); margin-bottom: 8px; }
.review p { font-style: italic; }
.review .author { font-weight: 600; margin-top: 12px; color: var(--color-muted); }

/* =============================
   FAQ & NEWSLETTER
============================= */
.faq .grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.faq .item {
  background: var(--color-bg);
  box-shadow: 0 1px 6px rgba(0,0,0,0.02), 0 0 0 1px var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.faq button {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: none;
  border: none;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq button::after {
  content: '+';
  font-size: 24px;
  color: var(--color-muted);
  transition: transform 0.3s ease;
}
.faq button[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq button:hover { background: var(--color-surface); }
.faq .answer {
  padding: 0 20px 20px;
  color: var(--color-muted);
  font-size: 15px;
  display: none;
}
.newsletter {
  margin-top: 32px;
  background: linear-gradient(135deg, var(--color-surface), var(--color-bg));
  box-shadow: var(--shadow-md), 0 0 0 1px var(--color-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background-clip: padding-box;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.subscribe {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}
.subscribe input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 14px 20px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02) inset;
  font-size: 16px;
  transition: var(--transition);
}
.subscribe input[type="email"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(185,28,28,0.08);
}

/* =============================
   FOOTER
============================= */
footer {
  background: var(--color-surface);
  padding: 32px 0;
  color: var(--color-muted);
  font-size: 14px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.02) inset;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.footer-grid a {
  display: block;
  margin-bottom: 8px;
  color: var(--color-muted);
}
.footer-grid a:hover { color: var(--color-text); }
.footer-bottom {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  font-size: 13px;
}

/* =============================
   RESPONSIVE (compact header tweaks)
============================= */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .newsletter { flex-direction: column; text-align: center; }
  .subscribe { justify-content: center; }

  /* чуть более компактный header на планшетах */
  :root { --header-compact-padding: 8px; --header-opacity: 0.75; --header-blur: 10px; }
  .header-inner { gap: 14px; padding: 8px 0; }
  .logo .circle { width: 34px; height: 34px; font-size: 18px; }
  nav a { font-size: 13px; padding: 6px 0; }
  .btn { padding: 7px 12px; font-size: 13px; }
}

@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-cta { justify-content: center; }
  .header-inner { flex-wrap: wrap; justify-content: center; gap: 12px; }
  nav { order: 3; width: 100%; justify-content: center; gap: 10px; }
  .actions { order: 2; gap: 8px; }
  .section-title { flex-direction: column; align-items: flex-start; }

  /* мобильная версия — максимально компактная и полупрозрачная */
  :root { --header-compact-padding: 6px; --header-opacity: 0.7; --header-blur: 8px; }
  .logo { font-size: 16px; }
  .logo .circle { width: 30px; height: 30px; font-size: 16px; }
  nav a { font-size: 13px; padding: 6px 0; }
  .btn { padding: 8px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
  .btn { width: 100%; text-align: center; }
  .hero-cta { flex-direction: column; }
  .subscribe { flex-direction: column; }
  .subscribe input[type="email"] { width: 100%; }
  /* ещё более компактно для узких экранов */
  :root { --header-opacity: 0.68; --header-blur: 6px; --header-compact-padding: 6px; }
  .header-inner { padding: 6px 0; gap: 10px; }
  nav { gap: 8px; }
}
