/* === Общие стили === */
body {
  margin: 0;
  font-family: 'Helvetica Neue', sans-serif;
  background: #111;
  color: #fff;
  display: flex;
}

/* Контейнер */

.catalogue-container {
  display: flex;
  padding-left: 240px; /* отступ под sidebar */
}
/* === Sidebar === */
.sidebar {
  width: 160px;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  padding: 5px 5px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}
.sidebar-logo {
  text-align: center;
  margin-bottom: 10px;
}
.sidebar-logo img {
  width: 140px;
  height: auto;
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  margin-top: -50px; /* поднимаем меню выше */
  gap: 1px;
}
.sidebar-menu a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  padding: 1px 10px;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease;
}
.sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #cf0303;
}
.submenu-title {
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: bold;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}


.catalogue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* адаптивные колонки */
  gap: 20px;
  padding: 20px;
  margin-left: 180px; /* отступ от меню */
  justify-content: start; /* прижимает сетку к левому краю */
  justify-items: start;   /* карточки прижаты влево */
  width: auto; /* позволяет сетке растягиваться до конца экрана */
  max-width: calc(100vw - 180px); /* гарантирует, что сетка не вылезет за окно */
  box-sizing: border-box;
}
/* === Карточки === */
.card {
  background: #222;
  border-radius: 30px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 1; /* квадрат */
}
.card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}
.card-img {
  flex: 8;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-name {
  flex: 2;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  background: #343434;
}

/* === Модальное окно === */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 4000;
}
.modal-content {
  background: #ffffffa7;
  color: #000;
  border-radius: 14px;
  padding: 20px;
  width: 400px;
  height: 450px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.modal-content img {
  width: 100%;
  height: auto;
  max-height: 60%;
  object-fit: contain;
  border-radius: 100px;
  background: #000;
}
.modal-content h2 {
  margin: 5px 0;
  font-size: 22px;
  color: #111;
}
.modal-content p {
  margin: 5px 0;
  font-size: 14px;
  color: #333;
}
.modal-content a {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;
  background: #cf0303;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: background 0.3s ease;
}
.modal-content a:hover {
  background: #a10202;
}
.close-btn {
  position: absolute;
  top: 10px; right: 15px;
  cursor: pointer;
  font-size: 22px;
  color: #444;
}

.catalogue-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  font-size: 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.5s ease;
  z-index: 5000;
}

.catalogue-message.show {
  opacity: 1;
}

.card {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 1;
  transform: translateY(0);
}



/* === Split-flap анимация (в стиле Oat Foundry) === */
@keyframes splitFlap {
  0% {
    transform: rotateX(0deg);
  }
  25% {
    transform: rotateX(90deg);
    opacity: 0.5;
  }
  50% {
    transform: rotateX(180deg);
    opacity: 1;
  }
  75% {
    transform: rotateX(270deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}

.card.split-flap {
  animation: splitFlap 0.6s cubic-bezier(0.45, 0, 0.55, 1);
  transform-origin: center center;
  backface-visibility: hidden;
}

/* === Split-Flap (реалистичный, независимые половины) === */
.split-top,
.split-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  background-size: cover;
  background-position: center;
  backface-visibility: hidden;
  transition: transform 0.12s ease;
  z-index: 5;
  perspective: 600px;
}

.split-top {
  top: 0;
  transform-origin: bottom;
}

.split-bottom {
  bottom: 0;
  transform-origin: top;
}
