* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* растягиваем body на весь экран */
}

:root {
  --main-color: #00a651;
  --border-color: #333333;
  --text-color: white;
  --activ-color: rgb(44, 136, 88);
  --text-activ: rgb(232, 232, 232);
}

/* ====== Шапка ====== */
.header {
  padding: 20px 0;
}
.container {
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}
.header__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header__logo {
  width: 100px;
}
.header__logo img {
  width: 100%;
  border-radius: 20px;
}
.header__nav {
  display: flex;
  gap: 60px;
  list-style: none;
}
.header__nav__link {
  text-decoration: none;
  color: var(--text-color);
  background-color: var(--main-color);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 18px;
  transition: 0.3s;
}
.header__nav__link:hover {
  color: var(--text-activ);
  background-color: var(--activ-color);
}
.phone {
  display: flex;
  align-items: center;
  gap: 5px;
  border: 2px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 10px;
}
.phone-icon {
  width: 18px;
}
.header-contact {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.form__search {
  position: relative;
  width: 550px;
}
.form__search__field {
  width: 100%;
  height: 45px;
  padding-left: 10px;
  border: 2px solid var(--main-color);
  border-radius: 5px;
  outline: none;
  color: #232323;
}
.header__form__btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 45px;
  height: 45px;
  border: none;
  background: var(--main-color);
  border-radius: 0 5px 5px 0;
  cursor: pointer;
  transition: 0.3s;
}
.header__form__btn:hover {
  background-color: var(--activ-color);
}
.header__form__btn:before {
  content: "\f002";
  font-family: FontAwesome;
  font-size: 16px;
  color: #ffffff;
}

.header__btn {
  color: var(--text-color);
  background-color: var(--main-color);
  padding: 10px 25px;
  border-radius: 8px;
  transition: 0.3s;
  border: none;
}
.header__btn:hover {
  background-color: var(--activ-color);
  color: var(--text-activ);
}

.admin-login {
  color: black;
  font-size: 30px;
  margin-left: 15px;
  text-decoration: none;
  transition: 0.3s;
  display: inline-flex;
  align-items: center;
}

.admin-login:hover {
  color: var(--activ-color);
}

/* ====== Контент ====== */
/* Контейнер фильтров и таблицы */
.content__catalog {
  display: flex;
  flex: 1;
  align-items: flex-start; /* фильтры и таблица на одной высоте */
  gap: 5px; /* расстояние между фильтрами и таблицей */
  padding: 0 50px; /* отступ слева и справа страницы */
  margin-top: 20px; /* отступ от строки поиска */
  flex-wrap: nowrap; /* блоки в одной строке */
}

/* Сайдбар фильтров */
.filters {
  width: 220px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.filter-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
}
.filter-group strong {
  margin-bottom: 8px;
  font-size: 14px;
  color: #333;
}
.filters select {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.filter-btn {
  width: 100%;
  padding: 10px 0;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: var(--main-color);
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}
.filter-btn:hover {
  background: var(--activ-color);
}

/* Основная зона таблицы */
.main-area {
  flex: 1; /* занимает оставшееся место */
  min-width: 0;
  padding: 0;
}

/* Таблица товаров */
.product-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}
.product-table th,
.product-table td {
  border: 1px solid #e0e0e0;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}
.product-table th {
  background: var(--main-color);
  color: #fff;
}
.add-btn {
  border: none;
  border-radius: 6px;

  cursor: pointer;
  font-size: 14px;
  transition: 0.3s;
}
.add-btn:hover {
  background: gray;
}

/* Пагинация в одну строку, скрываем лишние номера, только "Вперед" и текущие видны */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
}
.pagination a,
.pagination strong,
.pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--main-color);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  transition: 0.3s;
  flex-shrink: 0;
}
.pagination a:hover {
  background: var(--activ-color);
}
.pagination strong {
  background: var(--activ-color);
}
.pagination span {
  background: none;
  color: #000;
}

/* ====== Подвал ====== */
.site-footer {
  background-color: var(--main-color);
  color: var(--text-color);
  padding: 30px 0;
  margin-top: 40px;
}
.footer__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  gap: 100px;
  flex-wrap: wrap;
}
.footer__logo {
  width: 150px;
  border-radius: 20px;
}
.footer__socials {
  display: flex;
  gap: 12px; /* расстояние между иконками */
  align-items: center;
}

.footer__social-icon {
  width: 55px;
  height: 55px;
  object-fit: contain;
  transition: opacity 0.2s, transform 0.2s;
}

.footer__socials a:hover .footer__social-icon {
  opacity: 0.7;
  transform: scale(1.2);
}
.footer__block h4 {
  color: var(--border-color);
  margin-bottom: 12px;
}
.footer__block ul {
  list-style: none;
  padding: 0;
}
.footer__block ul li {
  margin-bottom: 10px;
}
.footer__block a {
  color: var(--text-color);
  text-decoration: none;
}
.footer__block a:hover {
  text-decoration: underline;
}

/* Контейнер уведомлений */
#toast-container {
  position: fixed; /* фиксируем относительно окна */
  bottom: 20px; /* отступ от низа */
  right: 20px; /* отступ от правого края */
  z-index: 9999; /* поверх всего */
}

/* Уведомление через тег <p> */
#toast-container p {
  background-color: var(--main-color);
  color: white;
  padding: 12px 20px;
  margin-top: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

/* Показ уведомления */
#toast-container p.show {
  opacity: 1;
  transform: translateY(0);
}
/* ===================== АДАПТИВКА CATALOG.PHP ===================== */

/* Планшеты: до 1024px */
@media (max-width: 1024px) {
  .header__row {
    flex-wrap: wrap;
    gap: 15px;
  }
  .header__nav {
    gap: 25px;
  }
  .header__nav__link {
    font-size: 16px;
    padding: 8px 16px;
  }
  .phone {
    font-size: 16px;
    padding: 8px 12px;
  }
  .form__search {
    width: 100%;
    max-width: 500px;
  }
  .filters {
    width: 180px;
    padding: 15px;
  }
  .filters select {
    font-size: 13px;
  }
  .filter-btn {
    font-size: 14px;
  }
  .product-table th,
  .product-table td {
    font-size: 13px;
    padding: 8px;
  }
  .add-btn {
    font-size: 13px;
  }
}

/* Смартфоны: до 768px */
@media (max-width: 768px) {
  .header__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .header__nav {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header__nav__link {
    font-size: 14px;
    padding: 6px 12px;
  }
  .phone {
    font-size: 14px;
    padding: 6px 10px;
  }
  .header-contact {
    flex-wrap: wrap;
    gap: 8px;
  }
  .form__search {
    width: 100%;
    max-width: 100%;
    margin-bottom: 10px;
  }
  .content__catalog {
    flex-direction: column;
    padding: 0 15px;
  }
  .filters {
    width: 100%;
    margin-bottom: 15px;
  }
  .main-area {
    width: 100%;
    overflow-x: auto; /* горизонтальный скролл для таблицы */
  }
  .product-table th,
  .product-table td {
    font-size: 12px;
    padding: 6px;
  }
  .add-btn {
    font-size: 12px;
  }
  .filter-btn {
    font-size: 14px;
  }
}

/* Очень маленькие экраны: до 480px */
@media (max-width: 480px) {
  .header__nav {
    flex-direction: column;
    width: 100%;
    gap: 5px;
  }
  .header__nav__link {
    font-size: 12px;
    padding: 5px 8px;
  }
  .phone {
    font-size: 12px;
    padding: 5px 8px;
  }
  .header-contact {
    flex-direction: column;
    align-items: flex-start;
  }
  .filters {
    padding: 10px;
  }
  .filters select {
    font-size: 12px;
    padding: 6px;
  }
  .filter-btn {
    font-size: 13px;
    padding: 8px 0;
  }
  .main-area {
    width: 100%;
    overflow-x: auto;
  }
  .product-table th,
  .product-table td {
    font-size: 11px;
    padding: 5px;
  }
  .add-btn {
    font-size: 11px;
    padding: 4px 6px;
  }
  .pagination a,
  .pagination strong,
  .pagination span {
    font-size: 12px;
    padding: 6px 10px;
  }
  .footer__container {
    flex-direction: column;
    gap: 15px;
  }
  .footer__logo {
    width: 100px;
  }
  .footer__social-icon {
    width: 16px;
    height: 16px;
  }
}
