/* Общие стили сетки товаров (каталог, страница бренда, избранное) */

.size-scroll-wrapper {
  display: flex;
  overflow-x: auto;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.size-scroll-wrapper::-webkit-scrollbar { display: none; }

.size-option {
  border: 1px solid #000 !important;
  border-radius: 6px !important;
  background: #fff !important;
  color: #000 !important;
  padding: 0.2rem 0.35rem !important;
  font-size: 0.75rem !important;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  text-align: center;
}

#product-list {
  padding-left: 18px;
  padding-right: 18px;
}

.catalog-swiper img {
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.ff-card {
  border: none !important;
  box-shadow: none !important;
  background: transparent;
}

.product-image-area .favorite-toggle {
  top: 6px;
  right: 6px;
  margin: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  padding: 0;
  pointer-events: auto;
}

.product-image-area .favorite-toggle i {
  font-size: 1.1rem;
  line-height: 1;
  color: #666 !important;
  transition: color 0.2s;
}

.product-image-area .favorite-toggle:hover i,
.product-image-area .favorite-toggle.active i,
.product-image-area .favorite-toggle i.bi-heart-fill {
  color: #000 !important;
}

.product-image-area .ff-size-toggle {
  top: 6px;
  right: 36px;
  margin: 0;
  color: #666;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  pointer-events: auto;
}

.product-image-area .ff-size-toggle:hover {
  color: #000;
}

.product-image-area + .card-body {
  padding-top: 0.25rem !important;
}

.ff-card .ff-card-content {
  position: relative;
}

.ff-card .ff-card-content * {
  box-sizing: border-box;
}

.ff-card .ff-card-content .ff-info,
.ff-card .ff-card-content .ff-sizes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  transition: transform 220ms ease, opacity 220ms ease;
}

.ff-card .ff-card-content .ff-info {
  transform: translateX(0);
  opacity: 1;
}

.ff-card .ff-card-content .ff-sizes {
  transform: translateX(100%);
  opacity: 0;
}

.ff-card.show-sizes .ff-card-content .ff-info {
  transform: translateX(-100%);
  opacity: 0;
}

.ff-card.show-sizes .ff-card-content .ff-sizes {
  transform: translateX(0);
  opacity: 1;
}

.ff-info .card-title {
  margin-bottom: 0.85rem !important;
}

.card-price {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 2px 8px;
  width: 100%;
  text-align: left;
}

.card-price .ff-linebreak {
  flex-basis: 100%;
  width: 0;
  height: 0;
}

.ff-discount-badge-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dc3545;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 5px;
  margin-top: 0;
}

.catalog-pagination-block {
  min-height: 56px;
  width: 100%;
}

.catalog-pagination-inner {
  gap: 0.75rem;
}

/* Чипы фильтров / сортировки (как в каталоге) */
.ff-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 19px;
  border-radius: 7px;
  border: 1.3px solid #d2d2d2;
  background: #fff;
  color: #222;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ff-chip:hover,
.ff-chip:focus-visible {
  background: #f6f6f6;
  border-color: #bbb;
  outline: none;
  color: #222;
}

.ff-chip.is-active {
  border-color: #111;
  color: #111;
  font-weight: 700;
  background: #fff;
}

/* Лента категорий на странице бренда */
.brand-categories-bar {
  margin: 0 0 1.25rem;
  padding-left: 18px;
  padding-right: 18px;
}

.brand-categories-bar .ff-rail {
  position: relative;
  min-width: 0;
}

.brand-categories-bar .ff-scroll {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  touch-action: pan-x;
}

.brand-categories-bar .ff-scroll::-webkit-scrollbar {
  display: none;
}

.brand-categories-bar .ff-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: auto;
}

.brand-categories-bar .ff-edge[hidden] {
  display: none !important;
}

.brand-categories-bar .ff-edge-left {
  left: 0;
  background: linear-gradient(90deg, #fff 70%, rgba(255, 255, 255, 0));
}

.brand-categories-bar .ff-edge-right {
  right: 0;
  background: linear-gradient(270deg, #fff 70%, rgba(255, 255, 255, 0));
}

.brand-categories-bar .ff-chevron {
  border: 0;
  background: transparent;
  padding: 8px;
  margin: 0;
  color: #222;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-categories-bar .ff-chevron svg {
  width: 18px;
  height: 18px;
  display: block;
}

.brand-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-sort-label {
  font-size: 15px;
  font-weight: 500;
  color: #666;
  white-space: nowrap;
}

.ff-sort-box {
  position: relative;
}

.ff-sort-box-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: auto;
  height: 42px;
  padding: 0 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
}

.ff-sort-box-btn:hover,
.ff-sort-box-btn:focus,
.ff-sort-box-btn.show {
  border-color: transparent;
  background: transparent;
  color: #111;
  box-shadow: none;
}

.ff-sort-box-btn:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.ff-sort-box-btn.dropdown-toggle::after {
  display: inline-block;
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 10px;
  border: 0;
  border-right: 2.5px solid #111;
  border-bottom: 2.5px solid #111;
  vertical-align: middle;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.ff-sort-box-btn.dropdown-toggle.show::after {
  transform: rotate(-135deg);
}

.ff-sort-box-label {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.ff-sort-box-label.is-selected {
  font-weight: 600;
}

.ff-sort-box-label.is-selected::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: #111;
}

.ff-sort-tri {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  transform: translateY(-1px);
}

.ff-sort-tri-up {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid currentColor;
}

.ff-sort-tri-down {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transform: translateY(-2px);
}

.ff-sort-box-menu {
  width: 100%;
  min-width: 240px;
  border: 1.3px solid #d2d2d2;
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 6px;
  margin-top: 6px !important;
}

.ff-sort-box-menu .dropdown-item {
  border-radius: 5px;
  color: #222;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 500;
}

.ff-sort-box-menu .dropdown-item:hover,
.ff-sort-box-menu .dropdown-item:focus {
  background: #f6f6f6;
  color: #111;
}

.ff-sort-box-menu .dropdown-item.active {
  background: #f3f3f3;
  color: #111;
  font-weight: 700;
}

.catalog-pagination-btn {
  background: #181818;
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, color 0.15s;
  outline: none;
  padding: 0;
  box-shadow: none;
  text-decoration: none;
}

.catalog-pagination-btn[disabled],
.catalog-pagination-btn:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.catalog-pagination-btn:focus,
.catalog-pagination-btn:hover {
  background: #000;
  color: #fff;
}

.catalog-pagination-counter {
  min-width: 65px;
  text-align: center;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: #181818;
  user-select: none;
}

.brand-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.brand-toolbar-start {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}

.brand-toolbar-end {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.ff-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 7px;
  border: 1.3px solid #d2d2d2;
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  box-shadow: none;
  transition: border-color 0.15s;
}

.ff-side-btn:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.ff-side-btn:hover {
  border-color: #bbb;
}

#brandFiltersCount {
  display: inline-block;
  margin-left: 6px;
  font-weight: 700;
}

.ff-applied {
  margin-bottom: 1.25rem;
  padding-left: 18px;
  padding-right: 18px;
}

.ff-applied[hidden] {
  display: none !important;
}

.ff-applied-scroll {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 18px;
}

.ff-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1.1px solid #e3e3e3;
  background: #f6f6f6;
  color: #222;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.16s, border-color 0.16s;
}

.ff-tag:hover {
  background: #ededed;
  border-color: #ccc;
}

.ff-tag .ff-tag-close {
  margin-left: 9px;
  font-size: 16px;
  line-height: 1;
  color: #999;
}

.ff-clear {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.ff-clear:hover,
.ff-clear:focus-visible {
  background: #efefef;
  outline: none;
}

.ff-sheet {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: block;
  pointer-events: none;
}

.ff-sheet.is-open {
  pointer-events: auto;
}

.ff-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.ff-sheet.is-open .ff-sheet-backdrop {
  opacity: 1;
}

.ff-sheet-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  max-width: 88vw;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 10px 30px rgba(0, 0, 0, 0.18);
  transform: translateX(-104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.ff-sheet.is-open .ff-sheet-panel {
  transform: translateX(0);
}

.ff-sheet-panel--from-right {
  left: auto;
  right: 0;
  transform: translateX(104%);
}

.ff-sheet.is-open .ff-sheet-panel--from-right {
  transform: translateX(0);
}

.ff-sort-sheet-menu {
  list-style: none;
  margin: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  width: 100%;
  position: static !important;
  display: block !important;
  transform: none !important;
  float: none !important;
}

.ff-sort-sheet-menu .dropdown-item {
  padding: 16px 6px;
  border-radius: 0;
  border-bottom: 1px solid #f2f2f2;
}

.ff-sort-sheet-menu .dropdown-item:last-child {
  border-bottom: 0;
}

.ff-sheet-header {
  padding: 14px 16px;
  border-bottom: 1px solid #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ff-sheet-title {
  font-size: 1.18rem;
  font-weight: 600;
  margin: 0;
  color: #111;
}

.ff-sheet-close {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
  padding: 4px 8px;
}

.ff-sheet-body {
  padding: 8px 18px 12px 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ff-sheet-footer {
  margin-top: auto;
  padding: 16px 12px 22px;
  border-top: 1px solid #f2f2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ff-acc {
  border: 0;
}

.ff-acc + .ff-acc {
  margin-top: 4px;
}

.ff-acc-head {
  position: relative;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 16px 36px 16px 6px;
  font-size: 1.02rem;
  font-weight: 400;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ff-acc-head .ff-acc-meta {
  color: #333;
  margin-left: 3px;
}

.ff-acc-body {
  padding: 4px 4px 14px;
}

.ff-acc-body[hidden] {
  display: none;
}

.ff-acc-head .ff-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #111;
  transition: transform 0.18s ease;
}

.ff-acc-head[aria-expanded="true"] .ff-caret {
  transform: translateY(-50%) rotate(-180deg);
}

.ff-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.ff-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease;
}

.ff-option:hover {
  background: #f6f6f6;
}

.ff-option[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.ff-option input {
  pointer-events: none;
}

.ff-option-label {
  flex: 1 1 auto;
  color: #111;
}

.ff-option-count {
  color: #777;
  font-weight: 600;
}

.ff-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ff-option .ff-option-label {
  position: relative;
  padding-left: 28px;
}

.ff-option .ff-option-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 1.6px solid #111;
  border-radius: 3px;
  background: #fff;
}

.ff-option .ff-option-label::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-65%) rotate(45deg) scale(0);
  pointer-events: none;
}

.ff-option input[type="checkbox"]:checked + .ff-option-label::before {
  background: #111;
  border-color: #111;
}

.ff-option input[type="checkbox"]:checked + .ff-option-label::after {
  transform: translateY(-65%) rotate(45deg) scale(1);
}

.ff-option.ff-no-check .ff-option-label::before,
.ff-option.ff-no-check .ff-option-label::after {
  display: none !important;
}

.ff-option.ff-no-check .ff-option-label {
  padding-left: 0;
}

.ff-color-chip {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #d4d4d4;
}

.ff-option.is-selected {
  background: #f3f3f3;
}

.ff-option.is-selected .ff-option-label {
  font-weight: 600;
}

.ff-option.is-selected .ff-color-chip {
  box-shadow: 0 0 0 2px #111 inset, 0 0 0 2px #111;
}

.ff-sizes-systems {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ff-size-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #d7d7d7;
  background: #fff;
  cursor: pointer;
  color: #111;
}

.ff-size-chip:hover {
  background: #f7f7f7;
}

.ff-size-chip.is-selected {
  border-color: #111;
  font-weight: 700;
}

.ff-size-chip[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}

.ff-apply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ff-apply-btn:hover {
  background: #000;
}

.ff-apply-btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

@media (max-width: 768px) {
  .product-image-area {
    height: 240px !important;
  }

  .catalog-pagination-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 8px;
  }

  .catalog-pagination-counter {
    font-size: 1rem;
    min-width: 50px;
  }

  .catalog-pagination-block {
    min-height: 50px;
  }

  .catalog-pagination-inner {
    gap: 0.5rem;
  }

  .ff-chip {
    height: 36px;
    font-size: 15px;
    padding: 0 12px;
  }

  .ff-sort-box-btn {
    height: 36px;
    font-size: 15px;
  }

  .ff-sort-box-label {
    font-size: 15px;
  }

  .ff-sort-box-menu {
    min-width: 200px;
  }

  .ff-sort-box .dropdown-menu {
    display: none !important;
  }

  .brand-categories-bar {
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 1rem;
  }

  .brand-categories-bar .ff-edge {
    display: none !important;
  }

  .brand-categories-bar .ff-rail {
    display: block;
  }

  .brand-categories-bar .ff-scroll {
    gap: 8px;
  }

  .brand-categories-bar .ff-chip {
    height: 36px;
    font-size: 15px;
    padding: 0 12px;
  }

  .catalog-toolbar {
    padding-left: 6px;
    padding-right: 6px;
  }

  .ff-applied {
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 1rem;
  }

  .ff-side-btn {
    height: 36px;
    font-size: 15px;
    padding: 0 12px;
  }
}
