:root {
  --color-primary: #3b82f6;          /* яркий, но не кислотный синий */
  --color-primary-light: #eaf3ff;    /* нежно-голубой фон */
  --color-primary-dark: #1e60d0;     /* немного глубже для контраста */
  --color-accent: #ffb84d;           /* тёплый солнечный акцент */
  --color-text: #2b2b2b;             /* чуть мягче, чем чисто чёрный */
  --color-text-light: #555555;
  --color-bg: #ffffff;               /* чистый светлый фон */
  --color-bg-alt: #f5f9ff;           /* слегка голубоватый, освежающий */
  --color-border: #d0d7e2;           /* светло-серый с холодным оттенком */
  --color-link: #0056cc;
  --color-price-old: #9a9a9a;
  --color-price-discount: #2d8b5f;   /* зелёно-бирюзовый — символ выгоды */
  --color-footer-bg: #f8f8fc;        /* едва заметный фон */
  --color-shadow: rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #82aaff;        /* мягкий голубой */
    --color-primary-light: #2a2e3a;  /* фон слегка графитовый, не чёрный */
    --color-primary-dark: #aac8ff;
    --color-accent: #ffd580;         /* тёплый золотистый */
    --color-text: #f0f0f0;
    --color-text-light: #cfcfcf;
    --color-bg: #1d1f27;             /* глубокий, но не чёрный */
    --color-bg-alt: #272b35;
    --color-border: #3a3f4a;
    --color-link: #9fc9ff;
    --color-price-old: #aaaaaa;
    --color-price-discount: #80e0b0; /* мятно-зелёный акцент */
    --color-footer-bg: #232631;
    --color-shadow: rgba(255, 255, 255, 0.05);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--color-bg);
  color: var(--color-text);
}

blockquote {
  font-style: italic;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 0;
}

header {
  background-color: var(--color-primary);
  color: #fff;
  padding: 20px 0;
}

header h1 {
  margin-bottom: 10px;
  font-size: 1.8rem;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

.hero {
  background-color: var(--color-primary-light);
  padding: 40px 0;
  text-align: center;
}

.hero h2,
.hero p {
  color: var(--color-primary-dark);
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
}

section h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: var(--color-primary);
}

ul {
  list-style: disc inside;
  margin-bottom: 20px;
}

ul li {
  margin-bottom: 5px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  box-shadow: 0 0 5px var(--color-shadow);
  transition: background-color 0.3s ease;
  table-layout: fixed;
}

table th,
table td {
  border: 1px solid var(--color-border);
  padding: 10px;
  text-align: left;
  overflow-wrap: normal;
  hyphens: auto;                /* Включает переносы */
  -webkit-hyphens: auto;        /* Safari / iOS */
  -ms-hyphens: auto;            /* Старые Edge */
  word-break: normal;           /* чтобы не ломал слова где попало */
}

table th {
  background-color: var(--color-bg-alt);
  font-weight: bold;
  text-align: center;
  overflow-wrap: break-word; /* перенос длинных слов */
  hyphens: auto;             /* перенос по правилам русского языка */
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  white-space: normal;       /* разрешаем перенос строк */
}

table td:nth-child(3),
table td:nth-child(4) {
  text-align: center;
}

.category-title {
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-top: 30px;
  margin-bottom: 10px;
  padding-bottom: 5px;
  font-weight: 600;
}

.price-discount {
  color: var(--color-price-discount);
}

.price-old {
  color: var(--color-price-old);
  margin-left: 8px;
  text-decoration: line-through;
}

.contact a {
  color: var(--color-link);
  text-decoration: none;
}

.contact a:hover {
  text-decoration: underline;
}

.stars {
  color: var(--color-accent);
  font-weight: bold;
  font-size: 1.2em;
}

footer {
  background-color: var(--color-footer-bg);
  color: var(--color-text-light);
  text-align: center;
  padding: 15px 0;
  font-size: 0.9rem;
  margin-top: 30px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    align-items: flex-start;
  }

  table th,
  table td {
    font-size: 0.9rem;
  }

  table th:nth-child(1),
  table td:nth-child(1) {
    width: 35%; /* Наименование */
  }

  table th:nth-child(2),
  table td:nth-child(2) {
    width: 25%; /* Описание */
  }

  table th:nth-child(3),
  table td:nth-child(3) {
    width: 25%; /* Цена */
  }

  table th:nth-child(4),
  table td:nth-child(4) {
    width: 15%; /* Единица */
    display: none;
  }
}
