/* ================================================================
   CART DRAWER — Moon Juice style  (biomentor / myshop)
   ================================================================ */

/* ── Overlay wrapper ── */
.bm-cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 9800;
  visibility: hidden;
  pointer-events: none;
}
.bm-cart-drawer.is-open {
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop */
.bm-cart-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 300ms ease;
}
.bm-cart-drawer.is-open .bm-cart-drawer__backdrop { opacity: 1; }

/* Sliding panel */
.bm-cart-drawer__panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
}
.bm-cart-drawer.is-open .bm-cart-drawer__panel { transform: translateX(0); }

/* ── HEAD ── */
.bm-cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid #E8E0D4;
  flex-shrink: 0;
}
.bm-cart-drawer__title {
  font-family: 'Golos Text', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #1A1A1A;
  margin: 0;
}
.bm-cart-drawer__head-count {
  font-weight: 400;
  color: #9B9589;
  margin-left: 4px;
}
.bm-cart-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9B9589;
  padding: 6px;
  line-height: 0;
  transition: color 150ms;
  margin-right: -6px;
}
.bm-cart-drawer__close:hover { color: #1A1A1A; }

/* ── Fragment wrapper ── */
#bm-cart-fragment {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  transition: opacity 200ms;
}
#bm-cart-fragment.bm-cart-loading {
  opacity: 0.45;
  pointer-events: none;
}

/* ── PROGRESS BAR ── */
.bm-cart-progress {
  flex-shrink: 0;
  padding: 14px 24px 16px;
  background: #FAF8F3;
  border-bottom: 1px solid #EFE9DF;
}
.bm-cart-progress__text {
  font-family: 'Golos Text', sans-serif;
  font-size: 12px;
  color: #6B6560;
  margin: 0 0 10px;
  text-align: center;
  line-height: 1.5;
}
.bm-cart-progress__text strong { color: #1A1A1A; font-weight: 700; }
.bm-cart-progress__text--done {
  color: #059669;
  font-weight: 600;
}
.bm-cart-progress__track {
  position: relative;
  height: 3px;
  background: #E8E0D4;
  border-radius: 2px;
}
.bm-cart-progress__fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: #1A1A1A;
  border-radius: 2px;
  transition: width 500ms ease;
  max-width: 100%;
}
.bm-cart-progress__truck {
  position: absolute;
  left: 0; /* overridden by inline style from PHP */
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: #E8E0D4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9B9589;
  transition: background 400ms, color 400ms, left 500ms ease;
}
/* Shipping unlocked */
.bm-cart-progress--done .bm-cart-progress__fill { background: #059669; }
.bm-cart-progress--done .bm-cart-progress__truck { background: #059669; color: #fff; }

/* ── BODY (scrollable) ── */
.bm-cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Empty state */
.bm-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 56px 24px;
  text-align: center;
}
.bm-cart-empty__icon { color: #D8D0C4; }
.bm-cart-empty__text {
  font-family: 'Golos Text', sans-serif;
  font-size: 14px;
  color: #9B9589;
  margin: 0;
}
.bm-cart-empty__btn {
  display: inline-block;
  padding: 10px 28px;
  border: 1.5px solid #1A1A1A;
  font-family: 'Golos Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #1A1A1A;
  text-decoration: none;
  transition: background 180ms, color 180ms;
  border-radius: 2px;
}
.bm-cart-empty__btn:hover { background: #1A1A1A; color: #fff; }

/* Cart items list */
.bm-cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bm-cart-item {
  display: flex;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid #F0EBE3;
}

/* Thumbnail */
.bm-cart-item__img-wrap {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border: 1px solid #E8E0D4;
  border-radius: 6px;
  overflow: hidden;
  background: #FAF8F3;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.bm-cart-item__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}

/* Details column */
.bm-cart-item__details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bm-cart-item__name {
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
  text-decoration: none;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bm-cart-item__name:hover { text-decoration: underline; }
.bm-cart-item__price {
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  color: #6B6560;
}

/* Qty + Remove row */
.bm-cart-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Qty stepper */
.bm-cart-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #E8E0D4;
  border-radius: 4px;
  overflow: hidden;
}
.bm-cart-qty-btn {
  width: 30px;
  height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Golos Text', sans-serif;
  font-size: 17px;
  line-height: 1;
  color: #6B6560;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 150ms, color 150ms;
  flex-shrink: 0;
}
.bm-cart-qty-btn:hover { background: #F5F0E8; color: #1A1A1A; }
.bm-cart-qty-num {
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1A1A1A;
  min-width: 26px;
  text-align: center;
  padding: 0 2px;
}

/* Remove button */
.bm-cart-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #C8C0B4;
  padding: 4px;
  line-height: 0;
  transition: color 150ms;
}
.bm-cart-remove:hover { color: #1A1A1A; }

/* ── FOOTER ── */
.bm-cart-drawer__footer {
  flex-shrink: 0;
  padding: 18px 24px 28px;
  border-top: 1px solid #E8E0D4;
  background: #fff;
}
.bm-cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.bm-cart-subtotal__label {
  font-family: 'Golos Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #6B6560;
}
.bm-cart-subtotal__price {
  font-family: 'Golos Text', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1A1A1A;
}
.bm-cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #1A1A1A;
  color: #fff !important;
  font-family: 'Golos Text', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background 180ms;
  border-radius: 2px;
  margin-bottom: 12px;
  border: none;
}
.bm-cart-checkout-btn:hover { background: #000; color: #fff !important; }
.bm-cart-view-btn {
  display: block;
  text-align: center;
  font-family: 'Golos Text', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9B9589;
  text-decoration: none;
  transition: color 150ms;
}
.bm-cart-view-btn:hover { color: #1A1A1A; }

/* ── Body lock when drawer is open ── */
body.bm-cart-open { overflow: hidden; }

/* ── TOAST NOTIFICATION ── */
.bm-toast {
  position: fixed;
  bottom: 32px;
  left: 32px;
  z-index: 9900;
  background: #1A1A1A;
  color: #fff;
  font-family: 'Golos Text', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  max-width: 320px;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 250ms cubic-bezier(.4,0,.2,1), opacity 250ms;
  pointer-events: none;
}
.bm-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.bm-toast__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bm-toast__text { line-height: 1.4; }
.bm-toast__name { font-weight: 700; }

@media (max-width: 480px) {
  .bm-toast { left: 12px; right: 12px; bottom: 16px; max-width: none; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .bm-cart-drawer__panel { width: 100vw; }
  .bm-cart-drawer__head,
  .bm-cart-progress,
  .bm-cart-item,
  .bm-cart-drawer__footer { padding-left: 16px; padding-right: 16px; }
}

/* WooCommerce після AJAX-додавання дописує біля кнопки посилання «Переглянути кошик»
   (a.added_to_cart) — у нас відкривається шторка, тож воно зайве і ламає ряд «ціна / кнопка» */
.added_to_cart.wc-forward { display: none !important; }
