@-webkit-keyframes placeHolderShimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

@keyframes placeHolderShimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.skeleton {
  margin: 0 0 0 16px;
  border-radius: 7px;
  box-shadow: 0 4px 12px 0 rgb(0 0 0 / 8%);
  display: inline-block;
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: forwards;
  animation-fill-mode: forwards;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  -webkit-animation-name: placeHolderShimmer;
  animation-name: placeHolderShimmer;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  background: -webkit-gradient(linear, left top, right top, color-stop(8%, #fff), color-stop(18%, #efefef), color-stop(33%, #fff));
  background: -webkit-linear-gradient(left, #fff 8%, #efefef 18%, #fff 33%);
  background: linear-gradient(to right, #fff 8%, #efefef 18%, #fff 33%);
  -webkit-background-size: 800px 104px;
  background-size: 800px 104px;
  position: relative;
}

.skeleton-product {
  width: calc(100% - 32px);
}

.skeleton-cart {
  margin: 0 !important;
  background: -webkit-gradient(linear, left top, right top, color-stop(8%, #e8e8e8), color-stop(18%, #e0e0e0), color-stop(33%, #f6f6f6));
  background: -webkit-linear-gradient(left, #f6f6f6 8%, #f1f1f1 18%, #e1e1e1 33%);
  background: linear-gradient(to right, #ededed 8%, #c7c7c7 18%, #ededed 33%);
  -webkit-background-size: 800px 104px;
  background-size: 800px 104px;
}

.skeleton-half {
  width: calc(50% - 26px);
}

.skeleton-container {
  display: grid;
  grid-template: 1fr 3fr / 1fr 2fr;
  gap: calc(1rem * 0.5);
  width: 100%;
}

.skeleton-cart:first-of-type {
  grid-row: 1 / -1;
  aspect-ratio: 1;
}

.skeleton-shop {
  margin: 0 12px;
  height: 250px;
  width: calc(50% - 24px);
}

.skeleton-catalog {
  margin: 0;
  height: 250px;
  width: calc(50% - 24px);
}

.skeleton-catalog-item {
  margin: 0;
  width: 100%;
  border-radius: 15px;
}

@keyframes ScaleInOut {
  0% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1.5);
  }
}

.spinner-dot {
  width: 8px;
  height: 8px;
}

.spinner-dot1 {
  animation: ScaleInOut 0.6s ease-in-out 0.2s infinite alternate;
}

.spinner-dot2 {
  animation: ScaleInOut 0.6s ease-in-out 0.4s infinite alternate;
}

.spinner-dot3 {
  animation: ScaleInOut 0.6s ease-in-out 0.6s infinite alternate;
}

#search-spinner {
  height: 40px
}

.product_card_image {
  height: 170px;
  justify-content: center;
  align-items: center;
}

.product-o__discount {
  font-size: 14px;
  padding-left: 8px;
  text-decoration: line-through;
  color: grey !important;
}

.sale_heading {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #000 !important;
}

.sale_heading_background {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.category_name {
  color: #0d6efd !important;
}

.popular_product_content {
  display: grid;
}

.popular_product_price {
  display: grid;
  font-size: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 50px;
}

.h4_item_name {
  font-size: 16px !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popular_float {
  display: flex;
}

del {
  font-size: 15px;
  padding-right: 10px;
  font-size: 18px !important;
}

.theme-dark .divider {
  background-color: transparent !important;
}

.offerable_products_addtocart {
  display: block;
  width: 100%;
  margin-bottom: 15px;
}

.maybe_products_addtocart {
  display: block;
  width: 100%;
  top: -20px;
  position: relative;
  margin-bottom: 15px;
}

.random_products_name {
  font-size: 16px;
  line-height: 16px;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.accordion {
  margin-top: 0 !important;
  list-style: none;
  line-height: 35px;
  margin-bottom: 1rem !important;
}

.card_details {
  padding: 20px 20px !important;
}

.input-style select option {
  background-color: #000 !important;
}

.input-style.has-borders em {
  color: #DA4453 !important;
  opacity: 1 !important;
}

#apply-coupon {
  height: 53px;
}

#wishlist-products_area {
  min-height: 140px;
  max-height: calc(100vh - 220px);
  overflow-y: scroll;
}

.cart-products_area {
  min-height: 154px;
  max-height: calc(100vh - 260px);
  overflow-y: scroll;
}

#item_tabs {
  margin-top: 10px;
}

#footer-bar {
  bottom: -2px !important;
  transition: transform 0.3s ease;
}

body.has-checkout #footer-bar {
  transform: translateY(calc(-1 * var(--checkout-height)));
}

.card-overlay {
  bottom: -5px !important;
}

.addtocart_float {
  position: fixed;
  bottom: 70px;
  z-index: 100;
  right: 0;
  margin: 0 5px;
}

.cart-item-btn-delete {
  position: absolute;
  top: 0;
  right: -110px;
  height: 100%;
  width: 50px;
  line-height: 86px;
  padding-bottom: 1rem;
}

.delete-btn-inner {
  width: 50px;
  height: 100%;
  background-color: #DA4453;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-right-radius: 15px ;
  border-bottom-right-radius: 15px ;
}

.cart-item-btn-wishlist {
  position: absolute;
  top: 0;
  right: -60px;
  height: 100%;
  width: 50px;
  line-height: 86px;
  padding-bottom: 1rem;
}

.wishlist-btn-inner {
  width: 50px;
  height: 100%;
  background: #F6BB42;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item,
.wishlist-item {
  padding-bottom: 1rem;
  touch-action: pan-y;
  user-select: none;
  position: relative;
  transition: transform 0.3s ease-out;
  transform: translateX(0);
}

.cart-item.swiping,
.wishlist-item.swiping {
  touch-action: none;
  transition: none;
}

.cart-item.swiped,
.wishlist-item.swiped {
  transform: translateX(-110px);
  touch-action: pan-y;
}

.cart-item.closing,
.wishlist-item.closing {
  transform: translateX(0);
  opacity: 0.6;
  pointer-events: none;
}

.cart-item.closing .cart-item-btn-delete i.fa-times,
.wishlist-item.closing .wishlist-item-btn-delete i.fa-times {
  display: none;
}

.cart-item.closing .cart-item-btn-delete i.fa-spinner,
.wishlist-item.closing .wishlist-item-btn-delete i.fa-spinner {
  display: inline-block;
}


.wishlist-item-btn-cart {
  position: absolute;
  top: 0;
  right: -60px;
  height: 100%;
  width: 50px;
  line-height: 86px;
  padding-bottom: 1rem;
}

.wishlist-item-btn-inner {
  width: 50px;
  height: 100%;
  background: #8CC152;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category_card {
  background-size: cover;
  background-position-x: center;
  background-position-y: top;
  background-repeat: no-repeat;
  height: auto;
  padding-bottom: 15px;
}

.category_card_descr {
  z-index: 5;
}

.category_arrow {
  padding-left: 25px;
  position: relative;
  top: 2px;
  color: #737373;
}

.sidebar_categories_list {
  color: #fff !important;
}

.random-products-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.minicart_preview {
  align-items: center;
  display: grid;
}

.category_area {
  list-style: none !important;
  padding-left: 0.5rem !important;
}

.theme-dark label {
  background-color: transparent !important;
}

.search_icon_shop {
  left: 125px !important;
  bottom: -4px !important;
}

.theme-dark .menu label {
  font-size: 15px !important;
}

.brand_area {
  list-style: none !important;
  padding-left: 0.5rem !important;
}

/*.theme-dark input:not([type=submit]):not(.focus-color):focus {*/
/*  border-color: transparent!important;*/
/*}*/

#details_add_to_cart {
  position: -webkit-sticky;
  position: sticky;
  bottom: 30px;
}

.attributes_filters {

}

.search-box {
  border: none !important;
}

.shop-search-input {
  border-radius: 10px !important;
}

.apply-filters {
  position: sticky;
  bottom: 20px;
}

.shop_item_name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 46px;
}

.add_to_cart_floating {
  width: 92%;
  margin-left: 15px;
}

#product-wishlist-button {
  padding-top: 3px;
  padding-bottom: 2px;
  width: 40px;
  align-items: center;
  display: flex;
}

.footer-links {
  font-size: 11px !important;
}

#menu-cart, #menu-wishlist, #menu-sidebar, .menu-active {
  z-index: 99;
}

.add_to_cart_float_btn {
  width: 75%;
}

.random_products_img {
  border-radius: 15px 0 0 15px;
}

.details_main_card {
  margin: 0 10px 30px 10px;
}

.all_products_cat {
  max-width: 50%;
  font-size: 12px !important;
  margin-left: 5%;
  position: relative;
  z-index: 2;
  padding: 10px 0 !important;
}

.shop-search-input {
  background-color: #fff !important;
}

.header-clear-medium {
  padding-top: 16px !important;
}

a, img, .form-check-label, .emoji-check {
  transition: all 190ms ease-in-out;
  transform: scale(1);
}

a:active.btn, a:active > img, .form-check-label:active, .emoji-check:active {
  transform: scale(1.1);
}

.categories-tree a[data-bs-toggle="collapse"]:not(.collapsed) i,
.sidebar-menu a[data-bs-toggle="collapse"]:not(.collapsed) i.fa-angle-right {
  -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
  -webkit-transform: rotate(90deg);
  transform: rotate(90deg);
  opacity: 1;
}

.category-list-item {
  flex-direction: row;
  justify-content: space-between;
}

.list-custom-small {
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.emoji-check {
  width: 15%
}

.emoji-check input {
  display: none
}

.emoji-check input + label {
  font-size: 2rem;
  -webkit-filter: grayscale(100%);
  filter: grayscale(100%);
}

.emoji-check input:checked + label {
  -webkit-filter: none;
  filter: none;
}

.collapse img {
  max-width: 100% !important;
  border-radius: 5px;
}

.best-selling_area {
  max-height: 420px;
  object-fit: cover;
}

.hide-content {
  position: fixed;
  top: -110px;
  bottom: -100px;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, .80);
  z-index: 99;
  transition: 350ms;
}

.gnext, .gprev {
  visibility: hidden;
}

#ask_question_top_banner {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  width: 100%;
  background: linear-gradient(
    128deg,
    #3eb0f1 0%,
    #0e95d6 100%
  );
  padding: 5px 24px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.4s ease, opacity 0.4s ease;
  z-index: 30;
  display: flex;
  justify-content: center;
}

.ask-question-top-banner-show {
  transform: translateY(0) !important;
}

.ask-question-top-banner-content {
  position: relative;
  padding-left: 26px;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  color: white;
}

#ask-question-top-banner svg {
  position: absolute;
  top: -8px;
  left: -5px;
}

.back-btn {
  z-index: 1;
  width: 34px;
  text-align: center;
  top: 9px;
  left: 9px;
  cursor: pointer;
}

.preloader-logo {
  z-index: 1;
  width: 160px;
}

/*-------------------------------
    STORIES
-------------------------------*/

.stories-container {
  position: absolute;
  z-index: 999999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #111;
}

.stories-wrapper {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}

.stories-story {
  min-width: 100%;
  height: 100%;
  position: relative;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  background-size: cover;
  background-position: center;
}

.stories-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stories-progress-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 4px;
  display: flex;
  gap: 4px;
  z-index: 10;
}

.stories-progress {
  flex: 1;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.stories-progress-fill {
  height: 100%;
  width: 0;
  background: var(--theme-primary-color);
  transition: width 0.1s linear;
}

.stories-click {
  position: absolute;
  top: 0;
  bottom: 100px;
  width: 50%;
  z-index: 5;
}

.stories-click.right {
  right: 0;
}

.stories-click.left {
  left: 0;
}

.stories-story-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  z-index: 6;
  font-size: 30px;
}

.stories-story-content {
  position: absolute;
  bottom: var(--tg-safe-area-inset-bottom);
  left: 0;
  right: 0;
  padding: 0 12px 24px;
}

.stories-story-title {

}

.stories-story-description {

}

.stories-story-button {
  position: relative;
  z-index: 6;
}

.splide {
  margin-bottom: 10px;
}

/* Убираем стандартные стили списка */
#category-slider-home .splide__list,
#sliders-slider-home .splide__list,
#random-products-slider-home .splide__list {
  list-style: none;
  margin: 0;
  padding: 0;
}


/* 👇 ПРОЦЕНТЫ ОТ ШИРИНЫ ЭКРАНА */
#category-slider-home .splide__slide {
  width: 46vw !important;
  height: 150px;
}


.card-bottom {
  text-align: center;
}

#sliders-slider-home .splide__slide {
  width: 92vw !important;   /* 50% ширины экрана */
  height: 170px;
}

#random-products-slider-home .splide__slide {
  width: 92vw !important;   /* 50% ширины экрана */
}

:root {
  --checkout-height: 76px;
  --footer-height: calc(70px + var(--tg-safe-area-inset-bottom))
}

.checkout-bar {
  z-index: 99;
  padding-bottom: calc(env(safe-area-inset-bottom));
  height: calc(76px + env(safe-area-inset-bottom));

  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;

  background-color: #000;

  display: flex;
  align-items: center;

  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.checkout-bar:not(.hidden) {
  transform: translateY(0);
}

body {
  transition: padding-bottom 0.3s ease;
}

#checkout-btn, #create-order-button {
  width: 100%;
  height: 52px;
  margin: 0.3rem;

  background: #da4453;
  color: #fff;

  border: none;
  border-radius: 14px;

  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

#page-bottom-spacer {
  height: var(--footer-height);
  transition: height 0.3s ease;
}

body.menu-open #page-bottom-spacer {
  height: var(--footer-height);
}

body.menu-open .checkout-bar {
  z-index: 90;
}

.add_to_cart_floating_box {
  position: fixed;
  z-index: 94;
  bottom: calc(70px + var(--tg-safe-area-inset-bottom));
  padding: 5px 15px 0px 15px;
  background-color: #fff;
  border-bottom: 1px solid grey;
  display: flex;
  align-items: center;
  transition: bottom 0.3s ease, transform 0.3s ease;
}

body.has-checkout .add_to_cart_floating_box {
  bottom: calc(var(--footer-height) + var(--checkout-height));
}

#gallery-slider-home {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 360px;
  max-height: 520px;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

#gallery-slider-home .splide__track,
#gallery-slider-home .splide__list,
#gallery-slider-home .splide__slide {
  height: 100%;
  width: 100%;
}

#gallery-slider-home .splide__slide {
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: #fff;
}

#gallery-slider-home img,
#gallery-slider-home video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.gallery-slider video {
  background: #000;
}

.gallery-slider video::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.7);
}

.gallery-slider .splide__slide img[data-splide-lazy] {
  opacity: 0;
  transition: opacity 0.3s;
}

.gallery-slider .splide__slide img.is-loaded {
  opacity: 1;
}

/* Скрыть кнопку загрузки */
#gallery-slider-home video::-webkit-media-controls-download-button {
  display: none !important;
}

#gallery-slider-home video::-internal-media-controls-download-button {
  display: none !important;
}

/* Скрыть таймлайн (полоса прогресса) */
#gallery-slider-home video::-webkit-media-controls-timeline {
  display: none !important;
}

/* Скрыть отображение текущего времени */
#gallery-slider-home video::-webkit-media-controls-current-time-display {
  display: none !important;
}

/* Скрыть отображение оставшегося времени */
#gallery-slider-home video::-webkit-media-controls-time-remaining-display {
  display: none !important;
}

/* Скрыть кнопку звука */
#gallery-slider-home video::-webkit-media-controls-mute-button {
  display: none !important;
}

/* Скрыть слайдер громкости */
#gallery-slider-home video::-webkit-media-controls-volume-slider {
  display: none !important;
}

/* Скрыть кнопку полноэкранного режима */
#gallery-slider-home video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

/* Скрыть кнопку Picture-in-Picture */
#gallery-slider-home video::-webkit-media-controls-picture-in-picture-button {
  display: none !important;
}

/* Скрыть кнопку трансляции */
#gallery-slider-home video::-webkit-media-controls-toggle-closed-captions-button {
  display: none !important;
}

/* Оставить только play/pause */
#gallery-slider-home video::-webkit-media-controls-enclosure {
  overflow: hidden;
}

#gallery-slider-home video::-webkit-media-controls {
  overflow: hidden;
}

#gallery-slider-home video {
  pointer-events: auto;
}

* Альтернативная структура */
.category_area .custom-control.custom-checkbox {
  position: relative;
  display: block;
  padding-left: 0;
  margin-bottom: 14px;
}

.category_area .custom-control-input {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.category_area .custom-control-label {
  position: relative;
  display: inline-block;
  padding-left: 38px;
  cursor: pointer;
  user-select: none;
  line-height: 24px;
  transition: color 0.2s ease;
}

/* Квадрат чекбокса */
.category_area .custom-control-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background-color: #fff;
  transition: all 0.3s ease;
}

/* Галочка */
.category_area .custom-control-label::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 7px;
  height: 13px;
  border: solid white;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Состояние checked */
.category_area .custom-control-input:checked + .custom-control-label::before {
  background: linear-gradient(135deg, #DA4453, #4a1f80);
  border-color: #DA4453;
  box-shadow: 0 2px 8px rgba(107, 48, 186, 0.3);
}

.category_area .custom-control-input:checked + .custom-control-label::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.category_area .custom-control-input:checked + .custom-control-label {
  color: #DA4453;
  font-weight: 600;
}

/* Hover */
.category_area .custom-control-label:hover::before {
  border-color: #DA4453;
  box-shadow: 0 0 0 3px rgba(107, 48, 186, 0.1);
}

/* Focus */
.category_area .custom-control-input:focus + .custom-control-label::before {
  box-shadow: 0 0 0 3px rgba(107, 48, 186, 0.25);
  border-color: #DA4453;
}

a[data-bs-toggle="collapse"] i {
  transition: transform 0.3s ease;
}

a[data-bs-toggle="collapse"]:not(.collapsed) i {
  transform: rotate(90deg);
}

.order-item-name {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.order-item-price {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

/* Контейнер подкатегорий */
.subcategories-list {
  list-style: none;
  padding-left: 38px;
  margin: 4px 0 0 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin-top 0.3s ease;
}

/* Показываем подкатегории */
.subcategories-list[style*="display: block"] {
  max-height: 800px;
  opacity: 1;
}

/* Скрываем подкатегории */
.subcategories-list[style*="display: none"] {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Label подкатегории - меньше шрифт */
.subcategories-list .custom-control-label {
  font-size: 12px;
  color: #666;
  padding-left: 32px;
  line-height: 14px;
}


.subcategories-list .custom-control-label::before {
  width: 18px;
  height: 18px;
  border-width: 1.5px;
  border-radius: 5px;
  top: 2px;
}

/* Галочка подкатегории - скорректированная позиция */
.subcategories-list .custom-control-label::after {
  left: 6px;
  top: 4px;
  width: 5px;
  height: 10px;
  border-width: 0 2px 2px 0;
}

/* Выделенная подкатегория */
.subcategories-list .custom-control-input:checked + .custom-control-label {
  color: #DA4453;
  font-weight: 600;
}

/* Hover для подкатегории */
.subcategories-list .custom-control-label:hover {
  color: #DA4453;
}

.subcategories-list .custom-control-label:hover::before {
  border-color: #DA4453;
  box-shadow: 0 0 0 2px rgba(218, 68, 83, 0.1);
}

/* ============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ ПОДКАТЕГОРИЙ
   ============================================ */

@keyframes slideDownSubcategory {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subcategories-list[style*="display: block"] > li {
  animation: slideDownSubcategory 0.25s ease forwards;
}

.subcategories-list[style*="display: block"] > li:nth-child(1) {
  animation-delay: 0.05s;
}

.subcategories-list[style*="display: block"] > li:nth-child(2) {
  animation-delay: 0.08s;
}

.subcategories-list[style*="display: block"] > li:nth-child(3) {
  animation-delay: 0.11s;
}

.subcategories-list[style*="display: block"] > li:nth-child(4) {
  animation-delay: 0.14s;
}

.subcategories-list[style*="display: block"] > li:nth-child(n+5) {
  animation-delay: 0.17s;
}

/* ============================================
   COLLAPSE АНИМАЦИЯ ДЛЯ ФИЛЬТРОВ
   ============================================ */

#collapse-filter {
  overflow: hidden;
  transition: height 0.35s ease, opacity 0.35s ease;
}

#collapse-filter:not(.show) {
  height: 0 !important;
  opacity: 0;
}

#collapse-filter.show {
  opacity: 1;
}

.categories-filter-toggle i {
  transition: transform 0.3s ease;
}

.categories-filter-toggle:not(.collapsed) i {
  transform: rotate(90deg) !important;
}

/* ============================================
   ТЕМНАЯ ТЕМА ДЛЯ ПОДКАТЕГОРИЙ
   ============================================ */

.theme-dark .subcategories-list .custom-control-label {
  color: #999;
}

.theme-dark .subcategories-list .custom-control-label::before {
  border-color: #555;
  background-color: #2a2a2a;
}

.theme-dark .subcategories-list .custom-control-input:checked + .custom-control-label {
  color: #DA4453;
}

.theme-dark .subcategories-list .custom-control-input:checked + .custom-control-label::before {
  background: linear-gradient(135deg, #DA4453, #4a1f80);
  border-color: #DA4453;
}

/* ============================================
   DISABLED STATE ДЛЯ ПОДКАТЕГОРИЙ
   ============================================ */

.subcategories-list .custom-control-input:disabled + .custom-control-label {
  opacity: 0.5;
  cursor: not-allowed;
}

.subcategories-list .custom-control-input:disabled + .custom-control-label::before {
  background-color: #f5f5f5;
  border-color: #ddd;
}

/* ============================================
   СКРОЛЛ В МЕНЮ ФИЛЬТРОВ
   ============================================ */

#menu-filter .content {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(218, 68, 83, 0.3) transparent;
}

#menu-filter .content::-webkit-scrollbar {
  width: 6px;
}

#menu-filter .content::-webkit-scrollbar-track {
  background: transparent;
}

#menu-filter .content::-webkit-scrollbar-thumb {
  background: rgba(218, 68, 83, 0.3);
  border-radius: 3px;
}

#menu-filter .content::-webkit-scrollbar-thumb:hover {
  background: rgba(218, 68, 83, 0.5);
}

/* ============================================
   УЛУЧШЕНИЕ КЛИКАБЕЛЬНОСТИ
   ============================================ */

.subcategories-list .custom-control-label {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
}

/* ============================================
   АТРИБУТЫ - БАЗОВЫЕ СТИЛИ
   ============================================ */

.attribute-filter-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.attribute-filter-toggle i {
  transition: transform 0.3s ease;
}

.attribute-filter-toggle:not(.collapsed) i {
  transform: rotate(90deg) !important;
}

.attribute-filter-toggle.collapsed i {
  transform: rotate(0deg) !important;
}

/* Отступы между блоками атрибутов */
#filter-variants .list-group {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

#filter-variants .list-group:first-child {
  margin-top: 0;
}

/* ============================================
   COLLAPSE АНИМАЦИЯ
   ============================================ */

#filter-variants .collapse {
  overflow: hidden;
  transition: height 0.35s ease, opacity 0.35s ease;
}

#filter-variants .collapse:not(.show) {
  height: 0 !important;
  opacity: 0;
}

#filter-variants .collapse.show {
  opacity: 1;
}

/* ============================================
   ПЛАВНОЕ ПОЯВЛЕНИЕ/ИСЧЕЗНОВЕНИЕ
   ============================================ */

/* Анимация контейнера атрибутов */
#filter-variants {
  animation: fadeInAttributes 0.4s ease-out;
}

@keyframes fadeInAttributes {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cascade эффект для блоков атрибутов */
#filter-variants .list-group {
  animation: slideInAttribute 0.3s ease-out backwards;
}

#filter-variants .list-group:nth-child(1) {
  animation-delay: 0.05s;
}

#filter-variants .list-group:nth-child(3) {
  animation-delay: 0.1s;
}

#filter-variants .list-group:nth-child(5) {
  animation-delay: 0.15s;
}

#filter-variants .list-group:nth-child(7) {
  animation-delay: 0.2s;
}

#filter-variants .list-group:nth-child(9) {
  animation-delay: 0.25s;
}

@keyframes slideInAttribute {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Плавное исчезновение */
#filter-variants.fade-out {
  animation: fadeOutAttributes 0.3s ease-out forwards;
}

@keyframes fadeOutAttributes {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}


/* ============================================
   ФИКС СКРОЛЛА В МЕНЮ ФИЛЬТРОВ
   ============================================ */

#menu-filter {
  /* Блокировать скролл фона */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#menu-filter .content {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: hidden;

  /* ✅ ГЛАВНОЕ - останавливать propagation скролла */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
  scrollbar-color: rgba(218, 68, 83, 0.3) transparent;
}

/* Когда меню активно - блокируем скролл body */
body:has(#menu-filter.menu-active) {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Для iOS Safari */
#menu-filter.menu-active {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

#menu-filter.menu-active .content {
  touch-action: pan-y;
  overscroll-behavior-y: contain;
}
