/* Ховаємо Webflow Commerce-корзину: відкривається наш React-drawer. */
.leader-shell-host [data-node-type='commerce-cart-container-wrapper'],
.leader-shell-host .w-commerce-commercecartcontainerwrapper.cart_popup {
  display: none !important;
}

.leader-cart-root {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
}

.leader-cart-root.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Після першого кадру: ховати з затримкою, щоб встигла анімація закриття.
   До .is-ready transition немає — інакше корзина з’їжджає з екрана при mount. */
.leader-cart-root.is-ready.is-open {
  transition: visibility 0s;
}

.leader-cart-root.is-ready:not(.is-open) {
  transition: visibility 0s linear 0.22s;
}

.leader-cart-overlay {
  position: absolute;
  inset: 0;
  background: #000c;
  opacity: 0;
}

.leader-cart-root.is-open .leader-cart-overlay {
  opacity: 1;
}

.leader-cart-root.is-ready .leader-cart-overlay {
  transition: opacity 0.22s ease;
}

.leader-cart-panel.cart_container {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  height: 100vh;
  height: 100dvh;
  width: 35vw;
  max-width: 35vw;
  min-width: 320px;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  z-index: 10000;
  color: var(--heading-black);
  font-family: Inter, Arial, sans-serif;
  font-size: 1.5em;
  line-height: 140%;
}

.leader-cart-root.is-open .leader-cart-panel {
  transform: translateX(0);
}

.leader-cart-root.is-ready .leader-cart-panel {
  transition: transform 0.22s ease;
}

.leader-cart-panel .w-commerce-commercecartheader,
.leader-cart-panel .cart-header {
  position: relative;
  top: 0;
  z-index: 10;
  background: #fff;
  flex-shrink: 0;
}

.leader-cart-panel .card-header-title {
  font-size: 1em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.leader-cart-panel .w-commerce-commercecartproductname {
  font-size: 0.7em;
  line-height: 140%;
  font-weight: 700;
}

.leader-cart-panel .compare_price_in_card_popup {
  color: var(--accessible-components--dark-grey);
  margin-top: 5px;
  font-size: 0.6em;
  line-height: 100%;
  text-decoration: line-through;
}

.leader-cart-panel .text-block-75 {
  font-size: 0.9em;
  font-weight: 600;
  line-height: 140%;
}

.leader-cart-panel .w-commerce-commercecartlineitem {
  font-size: 1em;
}

.leader-cart-panel .m__text.cart__popup {
  color: #c61717;
  font-size: 24px;
  line-height: 120%;
}

.leader-cart-panel .m__text.cart__popup.sumarna_znizhka_text {
  color: var(--accessible-components--dark-grey);
  font-size: 20px;
  font-weight: 400;
  text-decoration: line-through;
}

.leader-cart-panel .w-commerce-commercecartlist,
.leader-cart-panel .leader-cart-list {
  flex: 0 0 auto;
  overflow: visible;
  height: auto;
}

.leader-cart-panel .w-commerce-commercecartfooter {
  flex: 0 0 auto;
  position: static;
}

.leader-cart-close {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leader-cart-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
}

.leader-cart-panel .w-commerce-commercecartitemimage.image-50 {
  width: 100px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
}

.leader-cart-total-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.leader-cart-panel .div-block-92,
.leader-cart-panel [data-cart-additional-section] {
  display: block;
  margin-top: 24px;
}

.leader-cart-empty.w-commerce-commercecartemptystate {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px 24px;
  text-align: center;
}

.leader-cart-remove {
  margin-top: 0.6em;
  text-decoration: underline;
  display: inline-flex;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  font-size: 15px;
}

.leader-cart-item-link {
  color: inherit;
  text-decoration: none;
}

.leader-cart-item-link:hover .w-commerce-commercecartproductname {
  color: #c61717;
}

.leader-cart-crm {
  display: none;
}

.leader-cart-qty.div-block-93 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 150px;
  grid-column-gap: 10px;
  grid-row-gap: 10px;
}

.leader-cart-qty .cart-quantity {
  width: 90px;
  height: 34px;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  padding: 0;
  margin-bottom: 0;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}

.leader-cart-qty .cart-quantity::-webkit-outer-spin-button,
.leader-cart-qty .cart-quantity::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.leader-cart-qty .cart-quantity:focus {
  outline: none;
  border-color: #dc2626;
}

.leader-cart-qty .buttons_in_card_popup {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  pointer-events: none;
}

.leader-cart-qty .btn_in_card_popup {
  width: 26px;
  height: 36px;
  min-width: 2em;
  min-height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: auto;
  text-decoration: none;
  padding: 0;
}

.leader-cart-qty .text-block-73,
.leader-cart-qty .text-block-74 {
  font-size: 20px;
  font-weight: 500;
  color: #6b7280;
  line-height: 1;
}

.leader-cart-qty .btn_in_card_popup:hover .text-block-73,
.leader-cart-qty .btn_in_card_popup:hover .text-block-74 {
  color: #dc2626;
}

.leader-cart-checkout.primary__button-2 {
  width: 100%;
  border: 0;
  cursor: pointer;
  color: #fff;
  text-decoration: none;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 600;
}

.leader-cart-checkout.primary__button-2:hover {
  filter: brightness(0.95);
}

body.leader-cart-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* Віджет безкоштовної доставки (Slater) */
.free-shipping-widget {
  background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  position: relative;
  overflow: hidden;
}

.shipping-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.shipping-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.4;
  color: #333;
}

.shipping-amount {
  font-weight: 700;
  color: #d32f2f;
}

.shipping-amount.achieved {
  color: #2e7d32;
}

.shipping-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shipping-icon svg {
  width: 28px;
  height: 28px;
}

.progress-container {
  position: relative;
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b6b 0%, #ff8e53 50%, #ffa500 100%);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: leader-cart-shimmer 2s infinite;
}

.progress-bar.complete {
  background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
}

@keyframes leader-cart-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.achievement-message {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
  border-radius: 4px;
  font-size: 13px;
  color: #2e7d32;
  font-weight: 500;
}

.achievement-message.show {
  display: block;
  animation: leader-cart-slide-in 0.4s ease-out;
}

@keyframes leader-cart-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bonus-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: #888888;
}

.bonus-line-icon {
  opacity: 0.6;
  font-size: 13px;
}

.bonus-line strong {
  color: #636363;
  font-weight: 600;
}

/* Додаткові товари в корзині (Slater) */
[data-cart-additional-section] {
  position: relative;
  margin-top: 24px;
}

.wrapper_header_dop_block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
}

.wrapper_header_dop_block h4 {
  margin: 0;
  line-height: 32px;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.cart-additional-nav-container {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cart-additional-nav {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1.5px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  color: #6b7280;
  padding: 0;
}

.cart-additional-nav:hover:not(:disabled) {
  border-color: #dc2626;
  color: #dc2626;
}

.cart-additional-nav:active:not(:disabled) {
  transform: scale(0.95);
}

.cart-additional-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cart-additional-nav svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.cart-additional-swiper-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-top: 10px;
}

[data-cart-additional-items] {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

[data-cart-additional-items]::-webkit-scrollbar {
  display: none;
}

.cart-additional-item {
  flex: 0 0 calc(50% - 6px);
  min-width: calc(50% - 6px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  transition: all 0.2s;
  scroll-snap-align: start;
  position: relative;
  overflow: hidden;
}

.cart-additional-item:hover {
  border-color: #dc2626;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.cart-additional-item.is-leaving {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s, transform 0.3s;
}

.cart-additional-item__image-link {
  display: block;
  text-decoration: none;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9fafb;
  flex-shrink: 0;
}

.cart-additional-item__image,
.cart-additional-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-additional-item__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  flex: 1;
}

.cart-additional-item__name-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.cart-additional-item__name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cart-additional-item__name-link:hover .cart-additional-item__name {
  color: #dc2626;
}

.cart-additional-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.cart-additional-item__prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.cart-additional-item__price-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-additional-item__old-price {
  font-size: 11px;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
}

.cart-additional-item__discount {
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  background: #dc2626;
  padding: 2px 4px;
  border-radius: 3px;
}

.cart-additional-item__price {
  font-weight: 700;
  color: #111827;
  font-size: 16px;
  line-height: 1;
}

.cart-additional-add {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid #10b981;
  border-radius: 6px;
  cursor: pointer;
  color: #10b981;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.2s;
  padding: 0;
}

.cart-additional-add:hover:not(:disabled) {
  background: #10b981;
  color: #fff;
  transform: scale(1.05);
}

.cart-additional-add:disabled {
  opacity: 0.6;
  cursor: wait;
}

.cart-additional-item__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: #6b7280;
  transition: all 0.2s;
  padding: 0;
  z-index: 10;
}

.cart-additional-item__remove:hover {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
  transform: scale(1.1);
}

@media screen and (max-width: 991px) {
  .leader-cart-panel.cart_container,
  .cart_container {
    width: 65vw;
    max-width: 65vw;
    font-size: 2.3em;
    line-height: 1.4;
  }

  .leader-cart-panel .card-header-title,
  .card-header-title {
    font-size: 1.6em;
    font-weight: 600;
    line-height: 1.4;
  }

  .leader-cart-panel .w-commerce-commercecartiteminfo,
  .w-commerce-commercecartiteminfo {
    flex-direction: column;
    flex: 1;
    margin-left: 16px;
    margin-right: 16px;
    display: flex;
  }
}

@media (max-width: 767px) {
  .leader-cart-panel.cart_container {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    font-size: 3.3em;
    line-height: 1.4;
  }

  .leader-cart-panel .card-header-title {
    font-size: 1.6em;
    font-weight: 600;
    line-height: 1.4;
  }

  .leader-cart-panel .w-commerce-commercecartproductname {
    font-size: 1em;
    line-height: 140%;
    font-weight: 700;
  }

  .leader-cart-panel .compare_price_in_card_popup {
    font-size: 1em;
  }

  .leader-cart-panel .text-block-75 {
    font-size: 1.1em;
    font-weight: 400;
    line-height: 140%;
  }

  .leader-cart-panel .w-commerce-commercecartitem {
    align-items: flex-start;
  }

  .leader-cart-panel .w-commerce-commercecartitemimage.image-50 {
    width: 60px;
  }

  .leader-cart-panel .sumarno {
    align-items: flex-end;
  }

  .leader-cart-panel .sumarno .m__text.cart__popup.sumarna_znizhka_text {
    font-size: 20px;
    line-height: 1.2;
  }

  .leader-cart-qty {
    max-width: 80px;
    flex-shrink: 0;
  }

  .leader-cart-qty .cart-quantity {
    width: 72px;
    height: 38px;
    border-radius: 6px;
  }

  .leader-cart-qty .btn_in_card_popup {
    width: 22px;
    height: 32px;
    min-width: 0;
    min-height: 0;
  }

  .leader-cart-qty .text-block-73,
  .leader-cart-qty .text-block-74 {
    font-size: 18px;
  }

  [data-cart-additional-section] {
    margin-top: 16px;
  }

  .wrapper_header_dop_block h4 {
    font-size: 14px;
  }

  .cart-additional-item__name {
    font-size: 12px;
  }

  .cart-additional-item__old-price {
    font-size: 10px;
  }

  .cart-additional-item__discount {
    font-size: 9px;
  }

  .cart-additional-item__price {
    font-size: 15px;
  }

  .cart-additional-add {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .cart-additional-item__remove {
    font-size: 14px;
  }
}

@media (max-width: 479px) {
  .leader-cart-qty {
    max-width: 120px;
  }

  .leader-cart-qty .cart-quantity {
    width: 80px;
  }

  .leader-cart-qty .text-block-73,
  .leader-cart-qty .text-block-74 {
    font-size: 16px;
  }

  .cart-additional-item {
    flex: 0 0 calc(50% - 4px);
    min-width: calc(50% - 4px);
  }

  [data-cart-additional-items] {
    gap: 8px;
  }

  .cart-additional-item__content {
    padding: 8px;
  }

  .cart-additional-item__name {
    font-size: 11px;
  }

  .cart-additional-item__price {
    font-size: 14px;
  }

  .cart-additional-add {
    width: 37px;
    height: 37px;
    font-size: 18px;
    font-weight: 400;
  }

  .cart-additional-nav {
    width: 35px;
    height: 35px;
  }

  .shipping-text {
    font-size: 14px;
  }

  .free-shipping-widget {
    padding: 12px 16px;
  }
}
