/*
 * Стили для переключателя языков
 */

body.page-is-home .lang-selector {
  display: none !important;
}

/* Контейнер для кнопок */
.lang-selector {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 20px;
  overflow: hidden;
  background-color: #f5f5f5;
}

/* Каждый элемент */
.lang-selector__item {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: #555;
  transition: all 0.2s ease-in-out;
  line-height: 1;
}

/* Стиль для неактивнога языка при наведении */
.lang-selector__item:hover {
  background-color: #e9e9e9;
  color: #111;
}

/* Стиль для активного яхыка */
.lang-selector__item_active {
  background-color: #2d9cdb;
  color: #ffffff;
  cursor: default;
}

.filters {
  position: relative;
}

.filter__header {
  line-height: 1.2;
  padding: 16px 0;
  cursor: pointer;
}

.filter__search + .filter__values {
  overflow-y: auto;
}

@supports not selector(::-webkit-scrollbar) {
  .filter__search + .filter__values {
    scrollbar-width: thin;
  }
}

.filter__values {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

.filters__footer {
  padding-top: 24px;
}

.filters__footer .button {
  margin-bottom: 8px;
}

.sorting-select__sorting {
  display: inline-block;
  line-height: 10px;
  margin-left: 10px;
}

.filters__footer .button:last-child {
  margin-bottom: 0px;
}

.products__filters {
  margin-bottom: 30px;
  margin-right: -10px;
  line-height: 1.2;
}

.products__filters-label {
  display: inline-block;
  vertical-align: top;
  padding: 7px 0;
  margin-right: 10px;
  margin-bottom: 10px;
  color: #686868;
}

.products__filters-button {
  padding: 6px 9px;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.products__filters-button,
.products__filters-reset {
  display: inline-block;
  vertical-align: top;
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: 3px;
  cursor: pointer;
}

.products__filters-reset {
  padding: 7px 10px;
  color: #686868;
  background-color: #f2f2f2;
  transition: background-color 0.2s ease-in-out;
}

.filters__hint {
  position: absolute;
  left: 100%;
  background-color: #fff;
  border: 1px solid #f2f2f2;
  border-radius: 3px;
  margin-top: -21px;
  margin-left: -9px;
  padding: 12px 10px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  white-space: nowrap;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
  z-index: 2;
}

.filters__hint_show {
  opacity: 1;
  transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
  transform: translateX(0);
}

.filter__search {
  position: relative;
  padding: 0 0 15px;
}

.filter__search-field {
  width: 100%;
  padding: 10px 55px 8px 14px;
}

.input-text {
  max-width: 100%;
  line-height: 1.2;
  font-size: 14px;
  vertical-align: top;
  border: 1px solid #f2f2f2;
  border-radius: var(--inputs-buttons-border-radius);
  background: #fff;
  outline: 0;
  transition: border-color 0.2s ease-in-out;
}

.filter__clear-search,
.filter__search-icon {
  position: absolute;
  color: #888;
  cursor: pointer;
}

.filter__clear-search {
  top: calc(50% - 17px);
  right: 40px;
  display: none;
  width: 12px;
  height: 12px;
}

.filter__search-icon {
  top: calc(50% - 15px);
  right: 15px;
  display: inline-block;
  width: 16px;
  height: 16px;
}

.filter__clear-search:hover,
.filter__search-icon:hover {
  color: #828282;
}

.button_size_l,
.button_size_xl {
  font-size: 16px;
  padding: 9px 19px 10px;
  text-align: center;
}

/* Fix: large gaps in mobile product thumbs due to auto top margin on prices */
@media (max-width: 560px) {
  .product-thumb__prices,
  .product-thumb_mobile .product-thumb__prices {
    margin-top: 0 !important;
  }

  /* Keep products bar in one line on mobile, prevent overflow */
  .products__bar .products-bar__content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .products__bar .products-bar__sorting {
    flex: 1 1 auto;
    min-width: 0;
  }

  .products__bar .products-bar__controls,
  .products__bar .products-bar__filters {
    flex: 0 0 auto;
  }

  /* Allow select to shrink and not force fixed width */
  .products__bar .select,
  .products__bar .select .select__box,
  .products__bar .select .select__dropdown {
    width: auto !important;
    max-width: 100% !important;
  }

  .products__bar .select .select__content {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .products__bar .sorting-select.products__sorting-select {
    max-width: 100%;
  }

  /* Make sorting select expand to the full content width */
  .products__bar .products-bar__sorting .inline-field__content {
    min-width: 0;
  }
  .products__bar .products-bar__sorting .select {
    display: block;
    min-width: 0;
    width: 100% !important;
  }
  .products__bar .products-bar__sorting .select .select__box {
    width: 100% !important;
  }
  .products__bar .products-bar__sorting .select .select__dropdown {
    min-width: 100% !important;
    width: auto !important;
  }

  /* Slightly compact filter button on mobile */
  .products__bar .r-filters__toggle.button.button_size_l {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Ensure a minimal gap between filter icon and text */
.products-bar__filters .icon-box__icon {
  padding-right: 2px !important; /* override base icon-box spacing if needed */
}
/* Fallback using flex gap to separate icon and text */
.products-bar__filters .icon-box {
  gap: 2px;
}

.products-bar__filters {
  flex-grow: 1;
  margin-left: 4px;
}

.sidebar-block__header {
  font-weight: 500;
  line-height: 1.2;
  color: var(--primary-color);
  padding: 16px;
  background-color: var(--light-color);
  border-radius: var(--inputs-buttons-border-radius);
}

@media (max-width: 1023px) {
  .inline-field__label {
    display: none;
  }

  .products-bar__sorting .select__content {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .products-bar__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .products-bar__filters {
    order: 3;
    margin-left: 20px;
  }

  .page_bar .content-columns__sidebar .sidebar-filters {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }

  .content-columns__sidebar .sidebar-filters_opened {
    display: block !important;
  }

  .content-columns__sidebar .sidebar-filters {
    display: none;
    position: fixed;
    z-index: 4;
    inset: 0;
    background: #fff;
    padding-top: 60px;
    padding-bottom: 60px;
  }

  /* Mobile filters: top duplicate footer under header */
  .content-columns__sidebar .sidebar-filters .filters__footer_top {
    position: static !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 15px;
    margin-top: 10px !important; /* add space below fixed header */
    background: #fff;
    height: auto;
    z-index: 1;
  }
  .content-columns__sidebar .sidebar-filters .filters__footer_top::before {
    display: none !important;
  }

  .content-columns__sidebar .sidebar-filters .sidebar-filters__header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    margin: auto;
    z-index: 2;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 23px;
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
    background: #fafafa;
    color: #686868;
    border: 0;
  }

  .content-columns__sidebar .blocks__item_filters .sidebar-block__content {
    height: 100%;
    border: 0;
  }

  .filters__filters {
    overflow: hidden auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    padding-left: 15px;
    padding-right: 15px;
  }

  .filters__filter:first-child {
    border-top: none;
  }

  .filters__filter {
    border: 0;
    border-top-width: 0px;
    border-top-style: none;
    border-top-color: currentColor;
    border-bottom-width: 0px;
    border-bottom-style: none;
    border-bottom-color: currentColor;
    margin-top: 0;
    border-top: 1px solid var(--light-color);
  }

  .content-columns__sidebar .sidebar-filters .sidebar-filters__header::before {
    left: 20px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='10' height='16' viewBox='0 0 6 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 1.175L2.288 5 6 8.825 4.852 10 0 5l4.852-5L6 1.175z' fill='%23BDBDBD'/%3E%3C/svg%3E");
    width: 10px;
    height: 16px;
    cursor: pointer;
  }

  .content-columns__sidebar .sidebar-filters .sidebar-filters__header::after {
    right: 15px;
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='16' height='16' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 1.209L10.791 0 6 4.791 1.209 0 0 1.209 4.791 6 0 10.791 1.209 12 6 7.209 10.791 12 12 10.791 7.209 6 12 1.209z' fill='%23BDBDBD'/%3E%3C/svg%3E");
    width: 16px;
    height: 16px;
    cursor: pointer;
  }
}

.input-search__input,
.ui-autocomplete-input {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.products-thumbs__wrapper.swiper-wrapper {
  min-height: 400px;
}

.range-slider__slider .ui-slider-range {
  pointer-events: none;
}
.range-slider__slider .ui-slider-handle {
  z-index: 999;
}
.range-slider__slider {
  touch-action: pan-y;
}

@media (max-width: 1023px) {
  .sidebar-filters .sidebar-block__content {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Линейки навигации на странице логина */
  .login-page__nav-buttons {
    display: flex;
    gap: 12px; /* расстояние между кнопками */
    margin-top: 12px;
  }

  .login-page__nav-buttons .button {
    flex: 1 1 0; /* каждая занимает половину строки */
    display: block;
    text-align: center;
    white-space: nowrap;
  }
}

.sidebar-filters .filter__values_collapsible[data-collapsed='1'] .filter__value_overflow {
  display: none;
}

.sidebar-filters .filter__more {
  margin-top: 10px;
  background: none;
  border: 0;
  padding: 0;
  color: #1a73e8;
  font: inherit;
  cursor: pointer;
}

.products-thumbs .product-thumb__image-container {
  line-height: 0;
}

.products-thumbs .product-thumb__image-box {
  display: block;
  position: relative;
}

.products-thumbs .product-thumb__image-box::before {
  content: '';
  display: block;
  padding-top: 100%;
}

.products-thumbs .product-thumb__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

@supports (aspect-ratio: 1 / 1) {
  .products-thumbs .product-thumb__image-box::before {
    display: none;
  }
  .products-thumbs .product-thumb__image-box {
    aspect-ratio: 1 / 1;
  }
  .products-thumbs .product-thumb__image {
    position: static;
    height: auto;
  }
}

.products-thumbs .product-thumb__image-box {
  vertical-align: top;
}

/* Если хочешь, чтобы на очень узких экранах они складывались в колонку: */
@media (max-width: 360px) {
  .login-page__nav-buttons {
    flex-direction: column;
  }
}

/* Product gallery sizing: keep desktop roomy but stop tablet stretch */
.product-images {
  --product-images-max-width: min(100%, 520px);
}

.product-images__images,
.product-images__image {
  width: 100%;
  max-width: var(--product-images-max-width);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1023px) {
  .product-images {
    --product-images-max-width: min(100%, 360px);
  }
}

.product-images__image .image-box_fill > *,
.product-images__image .image-box_fill picture img,
.product-images__image .image-box_fill noscript img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media screen and (max-width: 600px) {
  :root,
  html,
  body,
  a,
  h1,
  h2,
  h3,
  button,
  span,
  p,
  section {
    font-size: calc(93% + 1px) !important;
  }

  .counter {
    font-size: 10px !important;
  }

  .title_h1 {
    font-size: 26px !important;
  }

  .product-feature__name,
  .product-feature__value {
    font-size: 16px !important;
  }
}

/* === CLS fix: reserve space for lazy-loaded images === */
.product-thumb__image-wrapper {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-thumb__image {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.catalog-list__item-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: contain;
}
img.lazy-image[data-src] {
  min-height: 1px;
}

/* === FARBALAND-CART-FIX: hide gray delivery info strips (pickup address / novaposhta "До складу") === */

/* Hide the shipping-variants dropdown (the gray strip under each shipping type) */
.js-variants-select,
.wa-delivery-variants-section,
#js-delivery-variants-section {
    display: none !important;
}

/* Hide the possible-addresses selector when only one pickup option exists */
.wa-possible-addresses-section:has(.wa-dropdown-area .wa-dropdown-item:only-child) {
    display: none !important;
}

/* Hide any "description" sub-line Webasyst may render under a shipping type */
.wa-delivery-rate-description,
.wa-shipping-rate-description,
.wa-rate-description,
.wa-description-section,
.wa-type-wrapper .wa-description,
.wa-type-wrapper .wa-desc {
    display: none !important;
}

/* === FARBALAND-BUY1CLICK: cart-level Buy-in-1-click button on /order/ (layout only) === */
.farbaland-b1c-cart-container {
    margin-top: 14px;
    width: 100%;
    display: block;
}
.farbaland-b1c-cart-container .buy1click-decorator,
.farbaland-b1c-cart-container .buy1click-decorator_cart-button {
    display: block;
    width: 100%;
}
.farbaland-b1c-cart-container .farbaland-b1c-cart-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
/* === END FARBALAND-BUY1CLICK === */
/* === FARBALAND: sitewide subpages grid with arrow cards === */
.block__links {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 16px !important;
  margin-top: 20px !important;
  margin-bottom: 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.block__links_item {
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f7f7f7;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.block__links_item:hover {
  border-color: #2D9CDB;
  background: #f0f0f0;
  box-shadow: 0 2px 12px rgba(45, 156, 219, 0.15);
}

.block__links_item__link {
  position: relative;
  display: block !important;
  margin: 0 !important;
  padding: 24px 56px 24px 28px;
  color: #333;
  text-decoration: none;
  text-align: left !important;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  word-break: break-word;
  overflow-wrap: break-word;
}

.block__links_item__link::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999999' stroke-width='2'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease, background-image 0.2s ease;
}

.block__links_item:hover .block__links_item__link::after {
  transform: translateY(-50%) translateX(4px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232D9CDB' stroke-width='2'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E");
}

@media (max-width: 768px) {
  .block__links {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .block__links_item__link {
    padding: 18px 46px 18px 20px;
    font-size: 14px;
  }
  .block__links_item__link::after {
    right: 16px;
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .block__links {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  .block__links_item__link {
    padding: 16px 40px 16px 18px;
  }
  .block__links_item__link::after {
    right: 14px;
    width: 16px;
    height: 16px;
  }
}
/* === END FARBALAND: sitewide subpages grid with arrow cards === */

/* Цена в блоке "Купить" на карточке товара - мобильная версия, всегда, независимо от бонусов */
@media (max-width: 768px) {
  .product-add-to-cart__price {
    font-size: 32px !important;
    font-weight: 700 !important;
  }
  .product-add-to-cart__compare-price {
    font-size: 22px !important;
  }
}

/* =====================================================================
   FARBALAND 29.09: нижняя панель навигации (мобильная) - плавающая карточка
   Правила темы: css/megashop.common.css (.fixed-bar*, .page_bar)
   Откат: удалить этот блок целиком
   ===================================================================== */

/* Панель: отступ от краёв и от низа экрана (с учётом "чёлки" iPhone) */
.fixed-bar {
  left: 10px;
  right: 10px;
  bottom: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: auto;
}

/* Сама карточка */
.fixed-bar__menu {
  height: 46px;
  padding: 6px 4px 5px;
  padding-bottom: 5px;
  background-color: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14), 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* Полупрозрачность с размытием, где браузер это умеет */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .fixed-bar__menu {
    background-color: rgba(255, 255, 255, 0.86);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
  }
}

/* Кнопка */
.fixed-bar__item {
  justify-content: center;
  gap: 3px;
  padding: 0 2px;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #6b7280;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.fixed-bar__item:active {
  transform: scale(0.94);
  background-color: rgba(15, 23, 42, 0.05);
}

.fixed-bar__item-name {
  margin-top: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Иконки: одинаковая высота, спокойный серый */
.fixed-bar__icon,
.fixed-bar__icon_home {
  height: 20px;
  color: #4b5563;
}

/* Активная кнопка - фирменный цвет */
.fixed-bar__item_active,
.fixed-bar__item_active .fixed-bar__icon {
  color: var(--primary-color);
}

/* Счётчик корзины: аккуратная "таблетка" с белой обводкой */
.fixed-bar__counter {
  top: -6px;
  left: calc(50% + 5px);
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  font-size: 10px;
  line-height: 13px;
  font-weight: 600;
  border: 1.5px solid #fff;
  border-radius: 8px;
}

/* Отступ снизу страницы под плавающую панель: 46 + 6 + 5 + 2 (рамка) + 10 (отступ) + 5 (запас) = 74 */
.page_bar .index__wrapper,
.page_bar .r-header-menu__dropdown,
.page_bar .r-subdropdown,
.page_bar .r-header-contacts,
.page_bar .info-panel-container:not(.info-panel-container_top) {
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

@media (max-width: 1023px) {
  .page_bar .content-columns__sidebar .sidebar-filters {
    padding-bottom: calc(134px + env(safe-area-inset-bottom));
  }
  .page_bar .content-columns__sidebar .sidebar-filters .filters__footer {
    bottom: calc(74px + env(safe-area-inset-bottom));
  }
}


/* =====================================================================
   FARBALAND 30.09: цвет колеровки - жёлтая подсветка
   (корзина, мини-корзина, оформление заказа, окно "Купити в 1 клік")
   ===================================================================== */
.cart-item__color-tinting-name,
.color-tinting-cart-info > div:first-child,
.buy1click-color-tinting-info > div:first-child {
  display: inline-block;
  background-color: #fbe27a;
  color: #333;
  padding: 1px 6px;
  border-radius: 3px;
  line-height: 1.5;
}
