/* =========================================================
   HÖFER — main.css
   ========================================================= */

/* ---------- 1. Дизайн-токены ---------- */
:root {
  /* Цвета */
  --c-black:        #111111;
  --c-black-soft:   #1c1c1c;
  --c-white:        #ffffff;
  --c-gray-50:      #f7f7f7;
  --c-gray-100:     #ededed;
  --c-gray-200:     #d9d9d9;
  --c-gray-400:     #9a9a9a;
  --c-gray-600:     #5a5a5a;
  --c-gray-800:     #2a2a2a;

  --c-text:         #1a1a1a;
  --c-text-muted:   #6a6a6a;

  --c-red:          #d40000;
  --c-red-hover:    #b00000;
  --c-yellow:       #ffcc00;
  --c-yellow-hover: #e6b800;

  /* Типографика */
  --font-display: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* Контейнер */
  --container:     1280px;
  --container-sm:  960px;
  --gutter:        24px;

  /* Радиусы */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Отступы секций */
  --section-y:    56px;
  --section-y-md: 40px;
  --section-y-sm: 28px;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08);

  /* Анимации */
  --tr-fast: .15s ease;
  --tr-base: .25s ease;
}

/* ---------- 2. Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
  padding: 0;
}

ul, ol {
  list-style: none;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tr-fast);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

button:focus { outline: none; }
button:focus-visible {
  outline: 2px solid var(--c-red);
  outline-offset: 2px;
}

/* Отступ для якорей */
:target,
section[id] {
  scroll-margin-top: 96px;
}

@media (max-width: 768px) {
  :target,
  section[id] {
    scroll-margin-top: 76px;
  }
}

/* ---------- 3. Базовая типографика ---------- */
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky footer */
main {
  flex: 1 0 auto;
}

.footer {
  flex-shrink: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
}

h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; }
h2 { font-size: clamp(26px, 3.2vw, 40px); font-weight: 800; }
h3 { font-size: clamp(20px, 2vw, 24px); }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--c-text);
  margin-bottom: 8px;
}

.section-subtitle {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  color: var(--c-text-muted);
  margin-bottom: 40px;
}

.section-title--light { color: var(--c-white); }
.section-subtitle--light { color: rgba(255,255,255,.65); }

p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 600; }

small { font-size: 13px; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: var(--c-gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--c-gray-200);
  margin: 16px 0;
}

/* ---------- 4. Контейнер ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--sm {
  max-width: var(--container-sm);
}

/* ---------- 5. Секции ---------- */
.section {
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section--gray { background: var(--c-gray-50); }
.section--white { background: var(--c-white); }
.section--dark  { background: var(--c-black); color: var(--c-white); }

@media (max-width: 1024px) {
  .section {
    padding-top: var(--section-y-md);
    padding-bottom: var(--section-y-md);
  }
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--section-y-sm);
    padding-bottom: var(--section-y-sm);
  }
}

/* Шапка секции */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.section-head__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-red);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color var(--tr-fast), color var(--tr-fast);
}

.section-head__link svg {
  flex-shrink: 0;
  transition: transform var(--tr-fast);
}

.section-head__link:hover {
  color: var(--c-red-hover);
  border-bottom-color: var(--c-red-hover);
}

.section-head__link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 600px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 28px;
  }
}

/* ---------- 6. Сетка ---------- */
.grid {
  display: grid;
  gap: 24px;
}

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

.grid--catalog {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.grid--news {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(3, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: 1fr; }
}

/* ---------- 7. Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 14px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--tr-fast), color var(--tr-fast),
              border-color var(--tr-fast);
  text-align: center;
  white-space: nowrap;
}

.btn--primary {
  background: var(--c-red);
  border-color: var(--c-red);
  color: var(--c-white);
}
.btn--primary:hover {
  background: var(--c-red-hover);
  border-color: var(--c-red-hover);
}

.btn--yellow {
  background: var(--c-yellow);
  border-color: var(--c-yellow);
  color: var(--c-black);
}
.btn--yellow:hover {
  background: var(--c-yellow-hover);
  border-color: var(--c-yellow-hover);
}

.btn--ghost {
  background: transparent;
  border-color: var(--c-black);
  color: var(--c-black);
}
.btn--ghost:hover {
  background: var(--c-black);
  color: var(--c-white);
}

.btn--ghost-light {
  background: transparent;
  border-color: rgba(255,255,255,.5);
  color: var(--c-white);
}
.btn--ghost-light:hover {
  border-color: var(--c-white);
  background: var(--c-white);
  color: var(--c-black);
}

.btn--light {
  background: var(--c-white);
  border-color: var(--c-white);
  color: var(--c-black);
}
.btn--light:hover {
  background: var(--c-gray-100);
  border-color: var(--c-gray-100);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--sm {
  padding: 10px 16px;
  font-size: 13px;
}

.btn--lg {
  padding: 18px 32px;
  font-size: 15px;
}

/* ---------- 8. Бейджи ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge--new    { background: var(--c-yellow); color: var(--c-black); }
.badge--sale   { background: var(--c-red);    color: var(--c-white); }
.badge--gray   { background: var(--c-gray-200); color: var(--c-text); }
.badge--dark   { background: var(--c-black); color: var(--c-white); }

/* ---------- 9. Формы ---------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text);
  margin-bottom: 8px;
}

.form-label .req {
  color: var(--c-red);
  margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  color: var(--c-text);
  background: var(--c-white);
  border: 2px solid var(--c-gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--c-gray-400);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px rgba(212,0,0,.1);
}

.form-input.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--c-red);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-note {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-top: 8px;
}

.form-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
}

.form-message--ok {
  background: #e7f5ec;
  border-left: 3px solid #28a745;
  color: #15632c;
}

.form-message--error {
  background: #fdeaea;
  border-left: 3px solid var(--c-red);
  color: #8a0000;
}

.form-error {
  font-size: 13px;
  color: var(--c-red);
  margin-top: 6px;
}

.g-recaptcha {
  margin: 16px 0;
}

/* ---------- 10. Красная полоса-разделитель ---------- */
.divider-red {
  height: 3px;
  background: var(--c-red);
  width: 100%;
}

.divider-red--thin { height: 2px; }

/* ---------- 11. Плейсхолдер ---------- */
.ph {
  background: repeating-linear-gradient(
    45deg,
    var(--c-gray-100),
    var(--c-gray-100) 10px,
    var(--c-gray-50) 10px,
    var(--c-gray-50) 20px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-gray-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- 12. Утилиты ---------- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-muted   { color: var(--c-text-muted); }
.text-red     { color: var(--c-red); }
.text-yellow  { color: var(--c-yellow); }
.text-white   { color: var(--c-white); }

.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }

.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-40 { margin-bottom: 40px; }

.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 13. Скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--c-gray-100); }
::-webkit-scrollbar-thumb {
  background: var(--c-gray-400);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: var(--c-gray-600); }

/* ---------- 14. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}