body{
  background-color: #f4f4f4 !important;
}
/* ==========================================================================
   ИСПРАВЛЕННЫЙ БЛОК ИСТОРИЙ (УВЕЛИЧЕННЫЙ ОТСТУП ОТ ПОИСКА)
   ========================================================================== */

.story-section {
  width: 100%;
  max-width: 1200px; /* Должно совпадать с шириной вашего каталога */
  
  /* ХОРОШИЙ ОТСТУП СВЕРХУ: 45px от поиска, 0 по бокам, 10px снизу */
  margin: 45px auto 10px; 
  
  padding: 0 20px;
  box-sizing: border-box;
}

.story-bar {
  display: flex;
  gap: 30px;
  padding: 10px 0 16px 0; 
  justify-content: center; 
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

/* Скрываем системный скроллбар */
.story-bar::-webkit-scrollbar {
  display: none;
}

/* Если карточек много, они плавно переключаются в режим скролла от левого края */
@media (max-width: 1200px) {
  .story-bar {
    justify-content: flex-start;
    padding-left: 4px;
    padding-right: 4px;
  }
}

.story-card {
  position: relative;
  flex: 0 0 130px;
  height: 190px;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  
  box-shadow: 
    0 0 0 2px #f4f4f4, 
    0 0 0 4.5px #ff8a14, 
    0 8px 20px rgba(0, 0, 0, 0.08);
  
  background: #e5e7eb;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  box-sizing: border-box;
  
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}

/* Ховер-эффекты для ПК */
@media (hover: hover) {
  .story-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 
      0 0 0 2px #f4f4f4, 
      0 0 0 4.5px #e68021, 
      0 12px 28px rgba(230, 128, 33, 0.25);
  }
  .story-card:hover img {
    transform: scale(1.06);
  }
}

.story-card:active {
  transform: scale(0.95);
}

.story-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.4s ease;
}

.story-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0) 100%);
  z-index: 2;
}

.story-card span {
  position: relative;
  z-index: 3;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  text-align: center;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ ПЛАНШЕТОВ И СМАРТФОНОВ
   ========================================================================== */
@media (max-width: 1024px) {
  .story-section {
    padding: 0 16px;
    margin: 30px auto 5px; /* Чуть уменьшаем отступ на планшетах */
  }
  .story-bar {
    padding: 8px 4px 14px 4px;
    gap: 14px;
    justify-content: flex-start;
  }
  .story-card {
    flex: 0 0 115px;
    height: 165px;
    border-radius: 20px;
    box-shadow: 
      0 0 0 2px #f4f4f4, 
      0 0 0 3.5px #ff8a14, 
      0 6px 14px rgba(0, 0, 0, 0.08);
  }
  .story-card span {
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .story-section {
    padding: 0 14px;
    margin: 20px auto 0; /* Аккуратный мобильный отступ сверху, чтобы не съедать экран */
  }
  .story-bar {
    padding: 6px 4px 12px 4px;
    gap: 10px;
  }
  .story-card {
    flex: 0 0 92px;
    height: 135px;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 
      0 0 0 1.5px #f4f4f4, 
      0 0 0 3px #ff8a14, 
      0 4px 10px rgba(0, 0, 0, 0.08);
  }
  .story-card span {
    font-size: 10.5px;
    font-weight: 600;
  }
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 35px 20px 15px;
  flex-wrap: wrap;
  gap: 15px;
}

.category-header h2 {
  font-size: 40px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -1px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #e68021, #ff8a14);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex: 1;
  min-width: 300px; /* Чтобы название не сжималось слишком сильно */
}

.subcategory-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.subcategory-btn {
  padding: 10px 24px;
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Montserrat', sans-serif;
  color: #555;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.subcategory-btn:hover {
  background: #e0e0e0;
}

.subcategory-btn.active {
  background: #e68021;
  color: white;
}

@media (max-width: 750px) {
  .category-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .subcategory-buttons {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 5px;
  }
  
  .category-header h2 {
    min-width: 100%;
  }
}

.insta-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

.insta-modal.hidden {
  display: none;
}

.insta-modal-content {
  position: relative;
  width: 360px;
  height: 640px;
  border-radius: 30px;
  overflow: hidden;
  background: black;
  box-shadow: 0 15px 60px rgba(0, 0, 0, 0.6);
}

.insta-modal-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.insta-caption {
  position: absolute;
  color: white;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  backdrop-filter: blur(2px);
}

.insta-modal-btn{
  position: absolute;
  top: 65%;
  left: 31%;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  z-index: 10;

  display: inline-block;
  padding: 0.3rem 1rem; /* было 0.5rem 1.5rem */
  font-size: 15px;
    background-image: linear-gradient(
    to right,
    rgba(246, 145, 29, 0.8),  /* #f6911d с прозрачностью 70% */
    rgba(212, 119, 19, 0.8)   /* #d47713 с прозрачностью 70% */
  );
  border: none;
  border-radius: 20px; /* закругление краёв */
  text-decoration: none;
  text-align: center;
  transition: background-color 0.3s ease;
}

.insta-modal-btn.hidden { display: none; }

.insta-reply-box {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  display: flex;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 8px 12px;
}

.insta-reply-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  background: transparent;
  color: #333;
}

.insta-reply-box button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #444;
}

.insta-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  z-index: 10;
}

@keyframes fadeIn {
  from { opacity: 0 }
  to { opacity: 1 }
}


.insta-single-caption {
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-size: 1rem;
  line-height: 1.4;
}

.insta-caption {
  position: absolute;
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 14px;
  border-radius: 18px;
  font-weight: 500;

  backdrop-filter: blur(2px);
}

.insta-reactions {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 14px;
  border-radius: 25px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
  z-index: 20;
}

.insta-reactions.hidden {
  display: none;
}

.insta-reactions .emoji {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.insta-reactions .emoji:hover {
  transform: scale(1.2);
}

/* Эффект вспышки эмодзи */
.emoji-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 3rem;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  outline: none !important;       /* Убирает стандартный outline */
  -webkit-tap-highlight-color: transparent;  /* Убирает подсветку на тач-устройствах */
}



.emoji-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 3rem;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
}

.emoji-flash:focus-visible {
  outline: none !important;
}

.emoji-flash.enter {
  animation: emojiEnter 0.5s ease-out forwards;
}

.emoji-flash.exit {
  animation: emojiExit 0.4s ease-in forwards;
}

@keyframes emojiEnter {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  70% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes emojiExit {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}


.insta-saved-reaction {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 1.7rem;
  z-index: 20;
}

/* Контейнер для заголовка и кнопки */
.category-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  flex-wrap: wrap; /* Чтобы на мобильных кнопка аккуратно переносилась */
}

/* Стили кнопки назад */
.back-btn-catalog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;

  font-size: 14px;
  font-weight: 700;
  color: #6b6b6b;
  text-decoration: none;

  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;

  box-shadow:
    0 2px 6px rgba(0, 0, 0, .04),
    0 6px 16px rgba(0, 0, 0, .06);

  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.back-btn-catalog:hover {
  color: #d47713;
  background: rgba(255, 255, 255, .9);
  transform: translateX(-2px);
}

/* Контейнер заглушки */
.no-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  width: 100%;
  max-width: 450px; /* Ограничиваем ширину для аккуратного вида на десктопе */
  margin: 0 auto;   /* Центрируем блок внутри product-grid */
}

/* Компактная картинка */
.no-products-img {
  width: 100%;
  max-width: 140px; /* Уменьшенный аккуратный размер */
  height: auto;
  object-fit: contain;
  margin-bottom: 20px;
  opacity: 0.85;    /* Слегка приглушаем яркость для мягкого дизайна */
}

/* Жирный заголовок по центру */
.no-products-title {
  font-size: 20px;
  font-weight: 700; /* Чуть жирный шрифт */
  color: #2c2c2c;
  margin: 0 0 10px 0;
  line-height: 1.3;
}

/* Описание проблемы */
.no-products-text {
  font-size: 14px;
  font-weight: 400;
  color: #7a7a7a;
  margin: 0;
  line-height: 1.5;
}

/* Адаптивность под мобильные устройства */
@media (max-width: 480px) {
  .no-products {
    padding: 30px 15px;
  }
  
  .no-products-img {
    max-width: 110px; /* На смартфонах делаем картинку еще чуть меньше */
    margin-bottom: 16px;
  }

  .no-products-title {
    font-size: 18px; /* Немного уменьшаем шрифт заголовка */
  }

  .no-products-text {
    font-size: 13px; /* Немного уменьшаем шрифт описания */
  }
}
