:root {
  --scrollbarBg: rgba(33, 59, 28, 0.17);
  --scrollbarThumb: rgba(33, 59, 28, 0.34);
  --scrollbarWidth: thin;
  --scrollbarHeight: 8px;
  --scrollbarBorder: 2px solid var(--scrollbarBg);
  --scrollbarBorderRadius: calc(var(--scrollbarWidth) / 2);
}

/* W3C standard для Firefox */
* {
  scrollbar-width: var(--scrollbarWidth);
  scrollbar-color: var(--scrollbarThumb) var(--scrollbarBg);
}

/* для Chrome/Edge/Safari */
*::-webkit-scrollbar {
  height: var(--scrollbarHeight);
  width: var(--scrollbarWidth);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbarBg);
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbarBg);
  border-radius: var(--scrollbarBorderRadius);
  border: var(--scrollbarBorder);
}

.menu--wrapper {
  scrollbar-width: var(--scrollbarWidth);
  scrollbar-color: var(--scrollbarThumb) var(--scrollbarBg);
}

.menu--wrapper::-webkit-scrollbar {
  width: var(--scrollbarWidth);
}

.menu--wrapper::-webkit-scrollbar-track {
  background: var(--scrollbarBg);
  border-radius: var(--scrollbarBorderRadius);
}

.menu--wrapper::-webkit-scrollbar-thumb {
  background-color: var(--scrollbarThumb);
  border-radius: var(--scrollbarBorderRadius);
  border: var(--scrollbarBorder);
}

[class*="ymaps-2"][class*="-ground-pane"] {
  filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");
  -webkit-filter: grayscale(100%);
}

/* Стили для блока проверки заказа */
.checkout-review-info {
  margin-bottom: 20px;
}

.checkout-review-info-item {
  display: flex;
  margin-bottom: 10px;
  align-items: baseline;
}

.checkout-review-info-label {
  font-weight: 500;
  margin-right: 10px;
  min-width: 150px;
}

.checkout-review-info-value {
  flex: 1;
}

.checkout-review-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}
.sticky-footer--review .checkout-review-buttons {
  margin-top: 0;
}
@media (max-width: 767px) {
  .checkout-review-buttons {
    gap: 12px;
  }
}
@media (max-width: 479px) {
  .checkout-review-buttons {
    gap: 8px;
  }
}

/* Переключатель доставки */
/* Контейнер переключателя */
.shipping--wrapper {
  padding: 1em;
  background: transparent;
  border-radius: 1em;
  border: 1px solid var(--gray);
}

.shipping-layer {
  display: flex;
  border: 0px solid transparent;
  border-radius: 0;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0;
  font-size: 1em;
  justify-content: space-between;
  gap: 15px;
}

.shipping-text {
  font-weight: 500;
  font-size: 1em;
  color: var(--black);
  ;
  flex-grow: 1;
}

/* Material Design переключатель */
.shipping-switch {
  position: relative;
  display: inline-block;
  width: 4.25em;
  height: 2em;
  flex-shrink: 0;
}

.shipping-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.material-switch {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--black);
  transition: .4s;
  border-radius: 2em;
}

.material-switch:before {
  position: absolute;
  content: "";
  height: 2.25em;
  width: 2.25em;
  left: -0.125em;
  bottom: -0.125em;
  background-color: var(--smokie);
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 0.125em 0.25em rgba(0, 0, 0, 0.25);
}

#shipping_toggle:checked+.material-switch {
  background-color: var(--red);
}

#shipping_toggle:checked+.material-switch:before {
  transform: translateX(26px);
}

.fd-leftover-today-badge {
  position: absolute;
  z-index: 5;
  top: .5em;
  left: .5em;
  background: var(--red);
  color: var(--white);
  border-radius: 1em;
  padding: 0 .75em;
  font-size: .875em;
  font-weight: 500;
  line-height: 2em;
  white-space: nowrap;
}

.fd-purchase-layer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5em;
  width: 100%;
  margin-bottom: .75em;
}

.fd-purchase-layer__option {
  border: 1px solid var(--gray);
  border-radius: .5em;
  cursor: pointer;
  display: flex;
  align-items: center;
  min-height: 3em;
  padding: .65em .85em;
  color: var(--dark-gray);
  background: var(--white);
  font-size: .875em;
  font-weight: 500;
  line-height: 1.2;
}

.fd-purchase-layer__option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.fd-purchase-layer__option span {
  display: flex;
  flex-direction: column;
  gap: .15em;
}

.fd-purchase-layer__option em {
  color: inherit;
  font-style: normal;
  font-size: .85em;
  opacity: .8;
}

.fd-purchase-layer__option.is-active {
  border-color: var(--red);
  color: var(--red);
  background: rgba(201, 32, 39, .06);
}

@media screen and (max-width: 479px) {
  .fd-purchase-layer {
    grid-template-columns: 1fr;
  }
}

/* Единая нижняя навигация на всех страницах, включая карточки товаров. */
body footer.footer {
  position: fixed !important;
  right: auto !important;
  bottom: max(10px, env(safe-area-inset-bottom)) !important;
  left: 50% !important;
  width: min(380px, calc(100vw - 32px)) !important;
  height: 48px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #ffffff !important;
  border: 0 !important;
  border-radius: 30px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
  transform: translateX(-50%) !important;
  z-index: 9999 !important;
}

body footer.footer .w-container {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

body footer.footer .footer__menu {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  height: 100% !important;
  padding: 0 28px !important;
  margin: 0 !important;
  gap: 0 !important;
}

body footer.footer .footer__menu_link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 32px !important;
  width: 32px !important;
  height: 32px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
}

body footer.footer .footer__menu_link.is--cart {
  flex-basis: 32px !important;
  width: 32px !important;
  height: 32px !important;
}

body footer.footer .footer__menu_link.is--cart .header__btn_count {
  position: absolute !important;
  top: -2px !important;
  right: -2px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  padding: 0 !important;
  border: 1.5px solid #ffffff !important;
  border-radius: 50% !important;
  background: #e31e24 !important;
  color: #ffffff !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

@media screen and (min-width: 992px) {
  body footer.footer {
    width: 440px !important;
    height: 56px !important;
  }

  body footer.footer .footer__menu {
    padding: 0 36px !important;
  }

  body footer.footer .footer__menu_link,
  body footer.footer .footer__menu_link.is--cart {
    flex-basis: 38px !important;
    width: 38px !important;
    height: 38px !important;
  }

  body footer.footer .footer__menu_link.is--cart .header__btn_count {
    top: -1px !important;
    right: -1px !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    font-size: 11px !important;
  }
}

/* Без скачков/фильтров при hover/click на плавающих кнопках и нижних иконках. */
body .return-to-main-btn,
body .return-to-main-btn:hover,
body .return-to-main-btn:active,
body .return-to-main-btn:focus,
body .support-trigger-btn,
body .support-trigger-btn:hover,
body .support-trigger-btn:active,
body .support-trigger-btn:focus,
body footer.footer .footer__menu_link,
body footer.footer .footer__menu_link:hover,
body footer.footer .footer__menu_link:active,
body footer.footer .footer__menu_link:focus {
  transform: none !important;
  filter: none !important;
  outline: none !important;
}

body .return-to-main-btn,
body .support-trigger-btn {
  top: auto !important;
  bottom: 96px !important;
  box-sizing: border-box !important;
  min-height: 56px !important;
  height: 56px !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease !important;
}

body .return-to-main-btn {
  left: 2em !important;
  right: auto !important;
}

body .support-trigger-btn {
  right: 2em !important;
  left: auto !important;
}

body.woocommerce-cart .return-to-main-btn,
body.woocommerce-cart .support-trigger-btn,
body.woocommerce-checkout .return-to-main-btn,
body.woocommerce-checkout .support-trigger-btn,
body.fdvor-cart-page .return-to-main-btn,
body.fdvor-cart-page .support-trigger-btn,
body.fdvor-checkout-page .return-to-main-btn,
body.fdvor-checkout-page .support-trigger-btn,
body:has(.sticky-footer) .return-to-main-btn,
body:has(.sticky-footer) .support-trigger-btn {
  bottom: 18rem !important;
}

body .return-to-main-icon,
body .support-trigger-icon,
body footer.footer .footer__menu_link::before,
body footer.footer .footer__menu_link::after {
  pointer-events: none !important;
}

@media screen and (max-width: 767px) {
  body .return-to-main-btn,
  body .support-trigger-btn {
    bottom: 88px !important;
    min-height: 48px !important;
    height: 48px !important;
  }

  body .return-to-main-btn {
    left: 1em !important;
    padding: 0 1em !important;
  }

  body .support-trigger-btn {
    right: 1em !important;
    width: 48px !important;
    padding: 0 !important;
  }

  body.woocommerce-cart .return-to-main-btn,
  body.woocommerce-cart .support-trigger-btn,
  body.woocommerce-checkout .return-to-main-btn,
  body.woocommerce-checkout .support-trigger-btn,
  body.fdvor-cart-page .return-to-main-btn,
  body.fdvor-cart-page .support-trigger-btn,
  body.fdvor-checkout-page .return-to-main-btn,
  body.fdvor-checkout-page .support-trigger-btn,
  body:has(.sticky-footer) .return-to-main-btn,
  body:has(.sticky-footer) .support-trigger-btn {
    bottom: 14rem !important;
  }

  body.fdvor-product-page .return-to-main-btn,
  body.fdvor-product-page .support-trigger-btn,
  body:has(.footer-cart.product-page) .return-to-main-btn,
  body:has(.footer-cart.product-page) .support-trigger-btn {
    bottom: var(--fdvor-product-floating-bottom, 160px) !important;
  }
}

@media screen and (max-width: 479px) {
  body.woocommerce-cart .return-to-main-btn,
  body.woocommerce-cart .support-trigger-btn,
  body.woocommerce-checkout .return-to-main-btn,
  body.woocommerce-checkout .support-trigger-btn,
  body.fdvor-cart-page .return-to-main-btn,
  body.fdvor-cart-page .support-trigger-btn,
  body.fdvor-checkout-page .return-to-main-btn,
  body.fdvor-checkout-page .support-trigger-btn,
  body:has(.sticky-footer) .return-to-main-btn,
  body:has(.sticky-footer) .support-trigger-btn {
    bottom: 12rem !important;
  }

  body.fdvor-product-page .return-to-main-btn,
  body.fdvor-product-page .support-trigger-btn,
  body:has(.footer-cart.product-page) .return-to-main-btn,
  body:has(.footer-cart.product-page) .support-trigger-btn {
    bottom: var(--fdvor-product-floating-bottom, 150px) !important;
  }
}
