/* ==========================================================================
   SPB-KATALOG V5 — 1-SCREEN RIGHT-SIDE CART DRAWER (#v5CartDrawer)
   Strictly 100vh / 100dvh height, right slide-over, internal scroll list,
   sticky header + sticky checkout summary footer.
   ========================================================================== */

html.v5-cdrawer-open,
html.v5-cdrawer-open body {
  overflow: hidden !important;
}

.v5-cdrawer {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10050 !important;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.26s;
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.v5-cdrawer.is-open {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.v5-cdrawer__backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 16, 19, 0.46) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.24s ease;
  cursor: pointer;
}

.v5-cdrawer.is-open .v5-cdrawer__backdrop {
  opacity: 1;
}

.v5-cdrawer__panel {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: auto !important;
  width: 440px !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100vh !important;
  max-height: 100dvh !important;
  background: #ffffff !important;
  box-shadow: -16px 0 48px rgba(15, 16, 19, 0.2) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  z-index: 1;
}

.v5-cdrawer.is-open .v5-cdrawer__panel {
  transform: translate3d(0, 0, 0);
}

.v5-cdrawer__panel.is-busy .v5-cdrawer__body {
  opacity: 0.62;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.v5-cdrawer__mount,
.v5-cdrawer__root,
.v5-cdrawer__inner,
.v5-cdrawer__box {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

/* Header */
.v5-cdrawer__head {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 18px 22px 16px !important;
  border-bottom: 1px solid #eef0f5 !important;
  background: #ffffff !important;
}

.v5-cdrawer__head-left {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.v5-cdrawer__title {
  margin: 0 !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  color: #14161c !important;
}

.v5-cdrawer__count {
  display: inline-flex !important;
  align-items: center !important;
  height: 24px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  background: #eef3ff !important;
  color: #2355df !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}

.v5-cdrawer__head-right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

.v5-cdrawer__clear {
  border: 0 !important;
  background: transparent !important;
  padding: 4px 6px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #8b919f !important;
  cursor: pointer !important;
  transition: color 0.16s ease !important;
}

.v5-cdrawer__clear:hover {
  color: #dc2626 !important;
}

.v5-cdrawer__close {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: #f3f5f8 !important;
  color: #14161c !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: background-color 0.16s ease, transform 0.16s ease !important;
}

.v5-cdrawer__close:hover {
  background: #e6eaf2 !important;
}

/* Added confirmation strip */
.v5-cdrawer__added {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 12px 22px 0 !important;
  padding: 9px 14px !important;
  border-radius: 12px !important;
  background: #ecfdf3 !important;
  border: 1px solid #bbf7d0 !important;
  color: #15803d !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.v5-cdrawer__added[hidden] {
  display: none !important;
}

.v5-cdrawer__added-ico {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: #16a34a !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

/* Internal scrollable body — ONLY this scrolls inside the 1-screen drawer */
.v5-cdrawer__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch;
  padding: 14px 22px !important;
}

.v5-cdrawer__body::-webkit-scrollbar {
  width: 5px;
}

.v5-cdrawer__body::-webkit-scrollbar-thumb {
  background: #d8dde8;
  border-radius: 999px;
}

.v5-cdrawer__alert {
  margin-bottom: 12px !important;
  padding: 10px 14px !important;
  border-radius: 12px !important;
  background: #fef2f2 !important;
  color: #b91c1c !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.v5-cdrawer__alert--info {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

/* Items list */
.v5-cdrawer__list {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.v5-cdrawer__item {
  display: grid !important;
  grid-template-columns: 76px minmax(0, 1fr) !important;
  gap: 14px !important;
  align-items: start !important;
  padding: 14px !important;
  border-radius: 18px !important;
  background: #f8f9fc !important;
  border: 1px solid #eef0f5 !important;
  transition: border-color 0.16s ease, background-color 0.16s ease !important;
}

.v5-cdrawer__item:hover {
  border-color: #dfe4ef !important;
  background: #ffffff !important;
}

.v5-cdrawer__thumb {
  width: 76px !important;
  height: 76px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  border: 1px solid #eef0f5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
}

.v5-cdrawer__thumb img {
  width: 68px !important;
  height: 68px !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.v5-cdrawer__info {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  min-width: 0 !important;
}

.v5-cdrawer__top {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.v5-cdrawer__name {
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: #14161c !important;
  text-decoration: none !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: color 0.16s ease !important;
}

.v5-cdrawer__name:hover {
  color: #2355df !important;
}

.v5-cdrawer__remove {
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  border: 0 !important;
  background: transparent !important;
  color: #9aa0ae !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  transition: color 0.16s ease, background-color 0.16s ease !important;
}

.v5-cdrawer__remove:hover {
  color: #dc2626 !important;
  background: #fee2e2 !important;
}

.v5-cdrawer__meta {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px 10px !important;
}

.v5-cdrawer__stock {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #16a34a !important;
}

.v5-cdrawer__stock::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
}

.v5-cdrawer__stock.is-warn {
  color: #d97706 !important;
}

.v5-cdrawer__stock.is-warn::before {
  background: #d97706;
}

.v5-cdrawer__opt {
  font-size: 12px !important;
  color: #6b7080 !important;
  background: #eef0f5 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
}

.v5-cdrawer__row-btm {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-top: 4px !important;
}

.v5-cdrawer__qty {
  display: inline-flex !important;
  align-items: center !important;
  height: 32px !important;
  padding: 2px !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  border: 1px solid #e2e6ef !important;
}

.v5-cdrawer__step {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  color: #14161c !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

.v5-cdrawer__step:hover:not(:disabled) {
  background: #eef3ff !important;
  color: #2355df !important;
}

.v5-cdrawer__step:disabled {
  opacity: 0.35 !important;
  cursor: default !important;
}

.v5-cdrawer__qty-val {
  min-width: 26px !important;
  text-align: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #14161c !important;
}

.v5-cdrawer__prices {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  text-align: right !important;
}

.v5-cdrawer__price {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  color: #14161c !important;
  white-space: nowrap !important;
}

.v5-cdrawer__unit {
  font-size: 11.5px !important;
  color: #8b919f !important;
  margin-top: 2px !important;
}

/* Empty State & Loading Skeleton */
.v5-cdrawer__empty {
  height: 100% !important;
  min-height: 300px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 24px 16px !important;
  gap: 10px !important;
}

.v5-cdrawer__empty-ico {
  width: 64px !important;
  height: 64px !important;
  border-radius: 50% !important;
  background: #eef3ff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 4px !important;
}

.v5-cdrawer__empty-title {
  margin: 0 !important;
  font-size: 19px !important;
  font-weight: 700 !important;
  color: #14161c !important;
}

.v5-cdrawer__empty-desc {
  margin: 0 0 10px !important;
  max-width: 320px !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  color: #6b7080 !important;
}

.v5-cdrawer__empty .v5-cdrawer__cta,
.v5-cdrawer__empty .v5-cdrawer__sec {
  width: 100% !important;
  max-width: 280px !important;
}

.v5-cdrawer__loading {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #6b7080 !important;
  font-size: 14px !important;
}

/* Sticky Bottom Summary & CTA Footer */
.v5-cdrawer__foot {
  flex: 0 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  border-top: 1px solid #eef0f5 !important;
  background: #ffffff !important;
  box-shadow: 0 -8px 24px rgba(15, 16, 19, 0.04) !important;
}

.v5-cdrawer__bonus {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
  font-size: 12.5px !important;
  line-height: 1.3 !important;
}

.v5-cdrawer__bonus-pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  background: #16a34a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
}

.v5-cdrawer__perk {
  font-size: 12.5px !important;
  color: #6b7080 !important;
  line-height: 1.35 !important;
}

.v5-cdrawer__perk b {
  color: #14161c !important;
  font-weight: 600 !important;
}

.v5-cdrawer__sum-row {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding-top: 2px !important;
}

.v5-cdrawer__sum-lbl {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #6b7080 !important;
}

.v5-cdrawer__total {
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  color: #14161c !important;
  white-space: nowrap !important;
}

.v5-cdrawer__actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-top: 2px !important;
}

.v5-cdrawer__cta {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: 48px !important;
  padding: 0 20px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #2355df !important;
  color: #ffffff !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: background-color 0.16s ease, transform 0.16s ease !important;
}

.v5-cdrawer__cta:hover {
  background: #1b46c2 !important;
  color: #ffffff !important;
}

.v5-cdrawer__sec {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 40px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: #f3f5f8 !important;
  color: #14161c !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background-color 0.16s ease !important;
}

.v5-cdrawer__sec:hover {
  background: #e7ebf2 !important;
}

/* Fallback if MagnificPopup ever wraps #ocmod-popup-okno directly */
.mfp-wrap:has(#ocmod-popup-okno) .mfp-container {
  padding: 0 !important;
  text-align: right !important;
}
.mfp-wrap:has(#ocmod-popup-okno) .mfp-content {
  width: 440px !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  margin: 0 0 0 auto !important;
  vertical-align: top !important;
}

@media (max-width: 639px) {
  .v5-cdrawer__panel {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  .v5-cdrawer__head {
    padding: 15px 16px 13px !important;
  }
  .v5-cdrawer__title {
    font-size: 19px !important;
  }
  .v5-cdrawer__added {
    margin: 10px 16px 0 !important;
  }
  .v5-cdrawer__body {
    padding: 12px 16px !important;
  }
  .v5-cdrawer__item {
    grid-template-columns: 68px minmax(0, 1fr) !important;
    gap: 12px !important;
    padding: 12px !important;
    border-radius: 16px !important;
  }
  .v5-cdrawer__thumb {
    width: 68px !important;
    height: 68px !important;
  }
  .v5-cdrawer__thumb img {
    width: 60px !important;
    height: 60px !important;
  }
  .v5-cdrawer__foot {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 8px !important;
  }
  .v5-cdrawer__total {
    font-size: 20px !important;
  }
  .v5-cdrawer__cta {
    height: 46px !important;
    font-size: 14.5px !important;
  }
}
