html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  overflow-x: hidden;
}

/* ====== Навбар ====== */

/* ====== Секции ====== */
.section {
  padding: 0;
  margin: 0;
  text-align: center;
}

/* ====== Каталог ====== */
#catalog {
  background: linear-gradient(180deg, rgba(0, 0, 50, 0.9), rgba(0, 0, 30, 0.9));
  padding: 50px 20px;
  overflow: hidden;
}

.catalog-title {
  text-align: center;
  margin-bottom: 40px;
}

.catalog-title h2 {
  color: #fff;
  font-size: 3em;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}

.catalog-title h2::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
  width: 60%;
  height: 4px;
  background-color: #ffcc00;
  z-index: -1;
  border-radius: 2px;
}

.catalog-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.catalog-item {
  width: 18%;
  background-color: rgba(42, 42, 62, 0.8);
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.catalog-container.show .catalog-item {
  opacity: 1;
  transform: translateY(0);
}

.catalog-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  transform: translateY(-5px);
}

.catalog-item img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

.catalog-item button {
  padding: 10px;
  background-color: #ffcc00;
  color: #1a1a2e;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.catalog-item button:hover {
  background-color: #ff9900;
}

/* ====== Секция "О нас" ====== */
#about {
  background: linear-gradient(180deg, rgba(0, 0, 50, 0.9), rgba(0, 0, 30, 0.9));
  padding: 50px 20px;
  color: #fff;
}

.about-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.about-text {
  flex: 1;
  padding-right: 20px;
}

.about-text h2 {
  font-size: 2.5em;
  margin-bottom: 20px;
}

.about-text p {
  font-size: 1.2em;
  line-height: 1.6em;
  margin-bottom: 10px;
}

.about-map {
  flex: 1;
}

#map {
  width: 100%;
  height: 600px;
  background-color: #ccc;
}

/* ====== Главная секция ====== */
#home {
  overflow: hidden; /* чтобы не выходило за пределы */
}

#MainImg {
  max-width: 1920px; /* максимальная ширина */
  max-height: 600px; /* максимальная высота */
  width: auto;
  height: auto;
  object-fit: contain;
  border: 0;
  box-sizing: border-box;
}

/* ====== Анимации ====== */
.section,
.catalog-item,
.footer,
.navbar,
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.show,
.fade-in.show {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Модальные окна ====== */
.modal,
#buyModal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content,
#buyModal .modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-content h2,
#buyModal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.modal-content form {
  display: flex;
  flex-direction: column;
}

.modal-content label {
  margin-bottom: 5px;
}

.modal-content input {
  margin-bottom: 15px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.modal-content button {
  padding: 10px;
  background-color: #1a1a2e;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.modal-content button:hover {
  background-color: #555;
}

.close,
#buyModal .close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus,
#buyModal .close:hover,
#buyModal .close:focus {
  color: black;
  text-decoration: none;
}

/* ====== Медиа-запросы ====== */
@media (max-width: 1024px) {
  .navbar .menu {
    display: none;
  }

  .navbar .menu.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #333;
    padding: 10px 0;
  }

  .navbar .menu.active a {
    padding: 10px 20px;
    text-align: center;
  }

  .navbar .toggle-menu {
    display: block;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
  }

  .navbar .logo a {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .catalog-item {
    width: 45%;
  }

  .catalog-item img {
    height: 150px;
  }

  .about-container {
    flex-direction: column;
  }

  .about-text {
    padding-right: 0;
    margin-bottom: 20px;
  }

  #map {
    height: 250px;
    max-width: 320px;
  }

  /* Скрываем ссылку с логотипом-изображением */
  .navbar .img {
    display: none;
  }

  /* Уменьшаем шрифт заголовка логотипа */
  .navbar .logo a.text-2xl {
    font-size: 0.9rem;
  }

  /* Делаем панель иконок компактной */
  .navbar .icons {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0px;
    font-size: 0.9em;
    padding: 5px 0;
  }

  .navbar .icons a,
  .navbar .icons button {
    white-space: nowrap;
    padding: 5px 8px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .catalog-item {
    width: 100%;
  }

  .catalog-item img {
    height: 130px;
  }
}
