/* Сторінка каталогу — shop-right-sidebar layout */
.gf-shop-catalog-page .cs_filter_widgets .form-control {
  min-height: 44px;
  border-radius: 8px;
}

.gf-shop-filter-scroll {
  max-height: 220px;
  overflow-y: auto;
}

.gf-shop-catalog-page .cs_filter_widget_list label.cs_custom_checkbox {
  cursor: pointer;
  display: block;
  width: 100%;
  position: relative;
}

.gf-shop-catalog-page .cs_filter_widget_list label.cs_custom_checkbox > span {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-stock-badge {
  top: 12px;
  right: 12px;
}

.gf-shop-catalog-page .cs_products_with_sidebar {
  gap: 28px;
  align-items: flex-start;
}

.gf-shop-catalog-page .cs_products_wrap {
  min-width: 0;
  flex: 1 1 auto;
  width: 100%;
}

/* Картки мають вміщуватись у доступну ширину поруч із сайдбаром */
.gf-shop-catalog-page .gf-catalog-grid.cs_grid_style_2 {
  width: 100%;
  max-width: 100%;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
}

@media (max-width: 575px) {
  .gf-shop-catalog-page .gf-catalog-grid.cs_grid_style_2 {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_thumb {
    height: 150px;
    flex-basis: 150px;
  }

  .gf-shop-catalog-page .gf-catalog-grid .cs_product_thumb img {
    max-height: 130px;
  }

  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_info {
    padding: 10px 8px 10px;
  }

  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_title {
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_price,
  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_price.cs_fs_24 {
    font-size: 14px !important;
  }

  .gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_btn.cs_style_1 {
    min-height: 38px;
    font-size: 11px;
  }
}

.gf-shop-catalog-page .gf-catalog-grid .cs_grid_col,
.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card {
  min-width: 0;
  max-width: 100%;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_thumb {
  height: 200px;
  flex-basis: 200px;
}

.gf-shop-catalog-page .gf-catalog-grid .cs_product_thumb img {
  max-height: 180px;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_info {
  padding: 12px;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_category {
  font-size: 11px;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_title {
  font-size: 14px;
  line-height: 1.35;
  min-height: 0;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_price,
.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_product_price.cs_fs_24 {
  font-size: 16px !important;
  line-height: 1.3 !important;
}

.gf-shop-catalog-page .gf-catalog-grid .gf-catalog-card .cs_btn.cs_style_1 {
  min-width: 0 !important;
  max-width: 100%;
  font-size: 12px;
  letter-spacing: 0 !important;
  padding: 0 10px;
}

.gf-shop-catalog-page .gf-catalog-empty {
  grid-column: 1 / -1;
}

.gf-shop-catalog-page .cs_filter_heading_left h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-right: 12px;
}

.gf-shop-catalog-page #gf-shop-showing {
  white-space: nowrap;
}

.gf-shop-catalog-page .cs_pagination_box {
  margin-bottom: 0;
}

.gf-shop-catalog-page .cs_pagination_item.is-active,
.gf-shop-catalog-page .cs_pagination_item.active {
  pointer-events: none;
}

.gf-shop-catalog-page .cs_pagination_item[disabled],
.gf-shop-catalog-page .cs_pagination_arrow[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.gf-shop-catalog-page .cs_breadcamp_wrap.cs_radius_8 {
  padding: 48px 56px;
  min-height: auto;
}

.gf-shop-catalog-page .cs_breadcamp_wrap .breadcrumb-item a {
  color: inherit;
  text-decoration: none;
}

.gf-shop-catalog-page .cs_breadcamp_wrap .breadcrumb-item a:hover {
  color: var(--accent, #e61f7f);
}

.gf-shop-catalog-page .cs_breadcamp_wrap .breadcrumb-item.active {
  color: rgba(48, 48, 48, 0.65);
}

/* Груповані категорії в сайдбарі */
.gf-shop-catalog-page .gf-cat-all {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.gf-shop-catalog-page .gf-cat-sale {
  list-style: none;
  margin: 0 0 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.gf-shop-catalog-page .gf-cat-sale a {
  display: block;
  font-weight: 600;
  color: #303030;
  text-decoration: none;
}

.gf-shop-catalog-page .gf-cat-sale a:hover {
  color: var(--accent, #c45c7a);
}

.gf-shop-catalog-page .gf-cat-group {
  list-style: none;
  margin: 0 0 0.35rem;
}

.gf-shop-catalog-page .gf-cat-group__toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.55rem 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: #303030;
  cursor: pointer;
  text-align: left;
}

.gf-shop-catalog-page .gf-cat-group__label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gf-shop-catalog-page .gf-cat-group__toggle::after {
  content: "+";
  font-size: 1.1rem;
  line-height: 1;
  color: #888;
  flex-shrink: 0;
}

.gf-shop-catalog-page .gf-cat-group.is-open .gf-cat-group__toggle::after {
  content: "−";
}

.gf-shop-catalog-page .gf-cat-group__count {
  font-size: 0.8rem;
  font-weight: 500;
  color: #888;
  flex-shrink: 0;
  white-space: nowrap;
}

.gf-shop-catalog-page .gf-cat-group__list {
  list-style: none;
  margin: 0;
  padding: 0 0 0.5rem 0.65rem;
  display: none;
  border-left: 2px solid rgba(230, 31, 127, 0.25);
}

.gf-shop-catalog-page .gf-cat-group.is-open .gf-cat-group__list {
  display: block;
}

.gf-shop-catalog-page .gf-cat-group__list li {
  margin: 0.2rem 0;
}

.gf-shop-catalog-page .gf-cat-group__list label span em,
.gf-shop-catalog-page .gf-cat-all label span em {
  font-style: normal;
  color: #999;
  font-size: 0.85em;
}

.gf-shop-catalog-page .gf-cat-sublist {
  list-style: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0 0 0 0.85rem;
  border-left: 1px solid rgba(230, 31, 127, 0.15);
}

.gf-shop-catalog-page .gf-cat-depth-2 label span,
.gf-shop-catalog-page .gf-cat-depth-3 label span {
  font-size: 0.92em;
}

.gf-shop-catalog-page .gf-cat-depth-3 label span {
  font-size: 0.88em;
}

.gf-catalog-seo {
  background: #fff;
  border: 1px solid #ececf0;
  border-radius: 12px;
  padding: 1.5rem 1.6rem 1.35rem;
  margin: 2rem 0 0;
}

.gf-catalog-seo[hidden] {
  display: none !important;
}

.gf-catalog-seo__h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.gf-catalog-seo__body,
.gf-catalog-seo__text,
.gf-catalog-seo p {
  color: #555;
  line-height: 1.7;
  font-size: 0.98rem;
}

.gf-catalog-seo__body p:last-child {
  margin-bottom: 0;
}

.gf-catalog-seo__body h2,
.gf-catalog-seo__body h3 {
  color: #2b1522;
  margin: 1.1rem 0 0.5rem;
  font-size: 1.15rem;
}

.gf-shop-brands-list {
  max-height: 220px;
  overflow: auto;
}

.gf-shop-price-filter__row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gf-shop-price-filter__sep {
  color: #999;
}

/* Мобільна панель фільтрів */
.gf-shop-filter-overlay {
  display: none;
}

.gf-shop-filter-drawer-head {
  display: none;
}

@media (max-width: 991px) {
  .gf-shop-filter-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(30, 30, 40, 0.45);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  body.gf-filters-open {
    overflow: hidden;
  }

  body.gf-filters-open .gf-shop-filter-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .gf-shop-catalog-page .cs_products_with_sidebar {
    display: block;
  }

  .gf-shop-catalog-page .cs_products_with_sidebar .cs_filter_widgets {
    width: min(92vw, 360px);
    max-width: 360px;
    left: calc(-1 * min(92vw, 360px));
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: 0 0 max(24px, env(safe-area-inset-bottom, 0px));
    z-index: 1050;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  body.gf-filters-open .gf-shop-catalog-page .cs_products_with_sidebar .cs_filter_widgets,
  .gf-shop-catalog-page .cs_drawer_btn.cs_type_1.cs_accent_bg.active + .gf-shop-filter-overlay + .cs_products_with_sidebar .cs_filter_widgets {
    left: 0;
  }

  .gf-shop-catalog-page .cs_drawer_btn.cs_type_1 {
    top: auto;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    margin-top: 0;
    width: auto;
    min-width: 44px;
    height: auto;
    min-height: 44px;
    padding: 10px 14px 10px 10px;
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 18px rgba(230, 31, 127, 0.35);
    z-index: 1030;
  }

  .gf-shop-catalog-page .cs_drawer_btn.cs_type_1::after {
    content: "Фільтри";
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  .gf-shop-catalog-page .cs_drawer_btn.cs_type_1 svg {
    width: 8px;
    height: 16px;
    flex-shrink: 0;
  }

  .gf-shop-catalog-page .cs_drawer_btn.cs_type_1.active {
    left: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .gf-shop-filter-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px 16px 12px;
    margin-bottom: 4px;
    background: #faf0f4;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .gf-shop-filter-drawer-head__title {
    font-size: 1.1rem;
    font-weight: 600;
  }

  .gf-shop-filter-close {
    border: none;
    background: transparent;
    color: #303030;
    font-size: 1.35rem;
    line-height: 1;
    padding: 4px;
    cursor: pointer;
  }

  .gf-shop-catalog-page .cs_filter_widgets.cs_accent_light_bg {
    padding: 0;
  }

  .gf-shop-catalog-page .cs_filter_widgets .cs_filter_widget {
    border: none !important;
    border-radius: 0;
    padding: 0 16px;
    margin-bottom: 0;
  }

  .gf-shop-catalog-page .cs_filter_widgets.cs_accent_light_bg .cs_filter_widget:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .gf-shop-catalog-page .cs_filter_widgets .cs_filter_widget_title {
    cursor: default;
    pointer-events: none;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    padding-top: 4px;
  }

  .gf-shop-catalog-page .cs_filter_widgets .cs_filter_widget_title > svg {
    display: none;
  }

  .gf-shop-catalog-page .cs_filter_widgets .cs_filter_widget_content {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-top: 0;
  }

  .gf-shop-catalog-page .cs_filter_widgets .gf-shop-filter-scroll {
    max-height: 180px;
  }

  .gf-shop-catalog-page .cs_filter_widgets .gf-shop-brands-list {
    max-height: 180px;
  }

  .gf-shop-catalog-page .gf-shop-price-filter__row {
    flex-wrap: wrap;
  }

  .gf-shop-catalog-page .gf-shop-price-filter__row .form-control {
    flex: 1 1 calc(50% - 1rem);
    min-width: 0;
  }

  .gf-shop-catalog-page .cs_filter_heading.cs_style_1 {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .gf-shop-catalog-page .cs_filter_heading.cs_style_1 > * {
    width: 100%;
  }

  .gf-shop-catalog-page .cs_filter_heading_left {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .gf-shop-catalog-page .cs_filter_heading_left h3 {
    margin-right: 0;
  }

  .gf-shop-catalog-page .cs_filter_heading_left .cs_custom_select {
    width: 100%;
    flex: none;
    max-width: 100%;
  }

  .gf-shop-catalog-page .cs_filter_heading_right .cs_view_box {
    justify-content: flex-start;
  }

  .gf-shop-catalog-page #gf-shop-showing {
    white-space: normal;
    font-size: 0.92rem;
    line-height: 1.4;
  }
}

@media (max-width: 420px) {
  .gf-shop-catalog-page .cs_products_with_sidebar .cs_filter_widgets {
    width: min(94vw, 320px);
    left: calc(-1 * min(94vw, 320px));
  }
}
