* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, #2b3a73, transparent 55%),
    radial-gradient(circle at 100% 100%, #5a2c6d, transparent 55%),
    radial-gradient(circle at 50% 0%, #0b1020, #050712 70%);
  color: #fff;
}

/* БУРГЕР — стиль как у избранного */
.menu-button {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 14px;
  z-index: 50;

  width: 40px;
  height: 40px;
  border-radius: 14px;

  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  font-weight: 500;
  cursor: pointer;

  background: rgba(0, 0, 0, 0.45);
  color: #f5f5ff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    background 0.15s ease-out,
    transform 0.08s ease-out,
    box-shadow 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out,
    opacity 0.2s;
}

.menu-button.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.menu-button:active {
  transform: scale(0.95);
}

/* ХЕДЕР КАТЕГОРИИ */
.category-header {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 64px;
  right: 64px;
  z-index: 45;

  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;

  /* стеклянная таблетка */
  background: rgba(0, 0, 0, 0.28);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);

  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);

  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);

  pointer-events: none;
}

.category-header-row {
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: none;
}

.category-title {
  flex: 1;
  display: inline-flex;
  align-items: center;      /* вертикальное выравнивание */
  justify-content: center;  /* по центру по горизонтали */
  gap: 6px;                 /* расстояние между gif и текстом */

  font-size: 15px;
  font-weight: 600;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  color: #fff;
  pointer-events: none;

  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.16s ease-out,
    transform 0.16s ease-out;
}

/* состояние: уезжает вниз и исчезает */
.category-title.anim-out {
  opacity: 0;
  transform: translateY(6px);
}

/* состояние: появляется снизу вверх */
.category-title.anim-in {
  opacity: 1;
  transform: translateY(0);
}

/* Кнопка "Избранное" в хедере — как бургер */
.favorites-badge {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  right: 14px;
  z-index: 50;
  transform: none;

  width: 40px;
  height: 40px;
  border-radius: 14px;

  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  font-weight: 500;
  cursor: pointer;

  background: rgba(0, 0, 0, 0.45);
  color: #f5f5ff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    background 0.15s ease-out,
    transform 0.08s ease-out,
    box-shadow 0.15s ease-out,
    color 0.15s ease-out,
    border-color 0.15s ease-out;

  /* чтобы кликалась, даже если родители с pointer-events */
  pointer-events: auto;
}

.favorites-badge:hover {
  background: rgba(255, 255, 255, 0.08);
}

.favorites-badge:active {
  transform: scale(0.94);
}

.favorites-badge.active {
  background: rgba(255, 255, 255, 0.96);
  color: #e53935;
  border-color: rgba(255, 255, 255, 0.8);
}

/* маленькая красная точка, если есть избранные */
.favorites-badge.has-items::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ff5252;
  box-shadow: 0 0 6px rgba(255, 82, 82, 0.9);
}

/* ОВЕРЛЕЙ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 55;
}

.overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ВЫЕЗДНОЕ МЕНЮ */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;

  width: 220px;
  transform: translateX(-240px);
  transition: transform 0.3s ease-out;
  z-index: 60;

  background: linear-gradient(
    180deg,
    rgba(6, 10, 24, 0.7),
    rgba(6, 10, 24, 0.32)
  );
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-radius: 0 22px 22px 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.65);

  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  padding: 10px 10px 6px;
  gap: 10px;
}

.drawer-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.drawer-title {
  font-size: 16px;
  font-weight: 600;
}

/* СКРОЛЛ КАТЕГОРИЙ */
.drawer-scroll {
  flex: 1;
  padding: 4px 10px 18px;
  overflow-y: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.drawer-scroll::-webkit-scrollbar {
  width: 3px;
}

.topic {
  border: none;
  background: transparent;
  color: #f2f4ff;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, transform 0.1s;
}

.topic-emoji {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-right: 8px;
  border-radius: 6px;      /* если анимка в квадрате, это смягчит края */
  overflow: hidden;
}

.topic:hover {
  background: rgba(255, 255, 255, 0.08);
}

.topic.active {
  background: rgba(72, 101, 255, 0.8);
}

.topic:active {
  transform: scale(0.97);
}

.sidebar-separator {
  height: 12px;
}

/* ОСНОВНОЙ КОНТЕЙНЕР */
.main {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
}

.main-scroll {
  height: 100%;
  overflow-y: auto;

  padding: 90px 0 120px 0;

  background: rgba(8, 10, 22, 0.5);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ЛЕНТА ТОВАРОВ */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.items-empty {
  font-size: 13px;
  opacity: 0.85;
  padding: 16px;
}

/* Блокировка при неоплате */
.items-list.locked .item-card {
  filter: blur(4px);
  opacity: 0.7;
  pointer-events: none;
}

/* КАРТОЧКА */
.item-card {
  background: rgba(5, 6, 16, 0.88);
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* КАРУСЕЛЬ */
.item-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  aspect-ratio: 3 / 4;
}

.item-swiper-inner {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.25s ease-out;
}

.item-image {
  width: 100%;
  height: 100%;
  flex: 0 0 100%;
  object-fit: cover;
  display: block;
}

/* ОВЕРЛЕЙ НА ФОТО */
.item-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;

  padding: 10px 12px 12px;

  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9),
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0)
  );

  color: #ffffff;

  display: flex;
  flex-direction: column;
  gap: 4px;

  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

.item-overlay.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Плашка категории на карточке (в режиме "Все") — в левом верхнем углу */
.item-category-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;

  display: inline-flex;
  align-items: center;

  padding: 3px 9px;

  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.28);

  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #f5f5ff;

  max-width: 60%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* строка "Название | Цена" */
.item-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.item-title {
  font-size: 18px;
  font-weight: 800;
  word-break: break-word;
}

.item-price {
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
}

.item-description {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.94;
}

/* ТОЧКИ КАРУСЕЛИ */
.item-swiper-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.item-swiper-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.item-swiper-dot.active {
  width: 10px;
  background: #ffffff;
}

/* СТРЕЛКИ */
.item-swiper-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  outline: none;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;

  font-size: 26px;
  font-weight: 500;

  cursor: pointer;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);

  padding: 0;
  transition: transform 0.08s ease-out;
}

.item-swiper-arrow-left {
  left: 8px;
}

.item-swiper-arrow-right {
  right: 8px;
}

.item-swiper-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

/* КНОПКА "ПЕРЕЙТИ" */
.item-link-button {
  margin-top: 6px;
  align-self: stretch;
  text-align: center;

  padding: 9px 14px;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  display: flex;
  align-items: center;
  justify-content: center;

  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;

  transition:
    background 0.16s ease-out,
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out,
    transform 0.08s ease-out;
}

.item-link-button:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.6);
}

.item-link-button:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

/* СЕРДЕЧКО НА КАРТОЧКЕ */
.item-fav-button {
  position: absolute;
  top: 8px;
  right: 8px;

  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  outline: none;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);

  transition: transform 0.08s ease-out, background 0.15s ease-out, color 0.15s ease-out;
}

.item-fav-button:active {
  transform: scale(0.9);
}

.item-fav-button.active {
  background: rgba(255, 255, 255, 0.95);
  color: #e53935;
}

/* PAY-BAR */
.pay-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0));
  z-index: 50;
}

.pay-bar.hidden {
  display: none;
}

.pay-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-text {
  text-align: center;
  font-size: 13px;
  opacity: 0.85;
}

.pay-button {
  border: none;
  outline: none;
  width: 100%;
  padding: 10px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb300, #ff6f00);
  color: #1b1307;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 167, 38, 0.75);
  font-weight: 600;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.pay-button:active {
  transform: scale(0.97);
  box-shadow: 0 0 10px rgba(255, 167, 38, 0.6);
  filter: brightness(0.95);
}

.pay-title {
  font-size: 14px;
}

.pay-subtitle {
  font-size: 11px;
  opacity: 0.85;
}

/* ЛАЙТБОКС */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  padding: 20px;

  display: flex;
  flex-direction: column;

  justify-content: flex-start;
  align-items: center;
  gap: 8px;
}

.lightbox-image {
  max-width: 90%;
  max-height: 55vh;
  object-fit: contain;
  display: block;
  margin: 8px auto 0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
}

.lightbox-info {
  max-width: 90%;
  width: 90%;
  margin: 8px auto 0;
  padding: 10px 12px;
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);

  border: 1px solid rgba(255, 255, 255, 0.12);

  color: #ffffff;
  font-size: 13px;

  max-height: 32vh;
  overflow-y: auto;

  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.lightbox.open .lightbox-info {
  opacity: 1;
  transform: translateY(0);
}

.lightbox-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 4px;
}

.lightbox-title {
  font-size: 14px;
  font-weight: 600;
}

.lightbox-price {
  font-size: 14px;
  font-weight: 600;
}

.lightbox-description {
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.95;
  white-space: pre-line;
}

.lightbox-read-more {
  border: none;
  background: none;
  padding: 0;
  margin: 0;

  color: #9bb4ff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.lightbox-close {
  position: static;
  align-self: flex-end;
  margin-bottom: 4px;

  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;

  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 22px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lightbox-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
}

.lb-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.lb-dot.active {
  width: 12px;
  background: #ffffff;
}

/* АДАПТИВ */
@media (max-width: 768px) {
  .main-scroll {
    padding: 62px 0 110px 0;
  }

  .topic {
    font-size: 13px;
  }

  .item-title,
  .item-price {
    font-size: 16px;
  }
}

/* Размер иконки категории в хедере */
.category-emoji {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 6px;
}

