/**
 * Placement / busy / banner footprint only.
 * Digify UI Kit draws the widgets themselves.
 */

.bwdk-widget {
  margin: 0 0 16px;
}

.bwdk-widget--cart,
.bwdk-widget--checkout {
  margin: 0 0 20px;
}

.bwdk-widget__box {
  display: block;
  width: 100%;
  cursor: pointer;
  min-height: 72px;
}

.bwdk-widget__box.is-busy,
digify-clickable-box.is-busy,
digify-clickable-box-modal.is-busy {
  opacity: .6;
  pointer-events: none;
}

.bwdk-widget__error {
  margin: 8px 0 0;
  color: #c0392b;
  font-size: 13px;
  line-height: 1.6;
}

/* Own full-width row above Journal .button-group-page (not inside cart flex). */
.bwdk-product-box {
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
  flex: 0 0 100%;
  margin: 0 0 16px;
  box-sizing: border-box;
}

.bwdk-product-box digify-clickable-box-modal {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@property --bwdk-banner-h {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

:root {
  --bwdk-banner-h: 0px;
}

html.has-bwdk-banner {
  --bwdk-banner-h: 56px;
}

@media (max-width: 768px) {
  html.has-bwdk-banner {
    --bwdk-banner-h: 44px;
  }
}

/* Float only: reserve viewport space for the fixed bar (never in header mode). */
html.has-bwdk-banner body {
  padding-top: var(--bwdk-banner-h);
}

.bwdk-top-banner-wrap {
  display: block;
  width: 100%;
  position: relative;
  z-index: 5;
  pointer-events: auto;
}

/*
 * Header mode: bar is a normal first child of <header>.
 * Kill Digify SDK fixed overlay so Journal sticky takes the whole header together.
 */
.bwdk-top-banner-wrap:not(.bwdk-top-banner-wrap--floating) .bwdk-top-banner,
header .bwdk-top-banner:not(.bwdk-top-banner--floating),
.sticky-header .bwdk-top-banner:not(.bwdk-top-banner--floating),
.desktop-main-menu-wrapper .bwdk-top-banner:not(.bwdk-top-banner--floating) {
  display: block;
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  z-index: 2;
  pointer-events: auto;
  transform: none !important;
}

/* Empty-cart / start errors: single floating toast (top-right). */
.bwdk-toast {
  position: fixed;
  top: calc(var(--bwdk-banner-h, 0px) + 16px);
  right: 16px;
  z-index: 2147483646;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 10px 12px 16px;
  background: #b91c1c;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  direction: rtl;
  text-align: right;
}

.bwdk-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.bwdk-toast__text {
  flex: 1 1 auto;
  min-width: 0;
}

.bwdk-toast__close {
  flex: 0 0 auto;
  margin: -4px 0 -4px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}

.bwdk-toast__close:hover,
.bwdk-toast__close:focus {
  opacity: 1;
  outline: none;
}

/*
 * Float mode: wrap is moved to body (see front.js) and pinned at viewport top.
 * Header scrolls independently; sticky header sits below the bar.
 */
.bwdk-top-banner-wrap--floating {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483000;
  width: 100%;
  pointer-events: auto;
}

.bwdk-top-banner--floating {
  display: block;
  /* Stay in-flow inside the fixed wrap so height/measure stay correct. */
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  width: 100%;
  pointer-events: auto;
  transform: none !important;
}

/* Journal sticky header clearance when banner floats (outside header). */
html.has-bwdk-banner header.header-classic,
html.has-bwdk-banner header[class*="header-"],
html.has-bwdk-banner .desktop-main-menu-wrapper,
html.has-bwdk-banner .sticky-header {
  top: var(--bwdk-banner-h) !important;
}

/* Digikala license seal — same tile size as typical enamad (~125px), inline in footer. */
a.bwdk-trust,
#bwdk-trust-badge.bwdk-trust {
  display: inline-block;
  vertical-align: middle;
  margin: 4px 8px;
  padding: 0;
  line-height: 0;
  max-width: 125px;
  text-decoration: none;
  border: 0;
  background: transparent;
}

a.bwdk-trust img,
#bwdk-trust-badge.bwdk-trust img {
  width: 125px;
  max-width: 125px;
  height: auto;
  display: block;
  margin: 0;
  border: 0;
}

/* Preview mode badge */
.bwdk-preview-flag {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 20000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.bwdk-preview-flag__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}

.bwdk-preview-flag__exit {
  color: #93c5fd;
  margin-right: 4px;
}

/* Callback result card */
.bwdk-result-page #content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.bwdk-result {
  max-width: 520px;
  width: 100%;
  margin: 28px auto 40px;
  padding: 28px 24px 24px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.bwdk-result--success {
  border-color: #86efac;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 48%);
}

.bwdk-result--pending {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 48%);
}

.bwdk-result--failed {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 48%);
}

.bwdk-result__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.bwdk-result--success .bwdk-result__icon {
  background: #22c55e;
  color: #fff;
}

.bwdk-result--pending .bwdk-result__icon {
  background: #f59e0b;
  color: #fff;
}

.bwdk-result--failed .bwdk-result__icon {
  background: #ef4444;
  color: #fff;
}

.bwdk-result__title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.bwdk-result__message {
  margin: 0 0 18px;
  color: #4b5563;
  line-height: 1.7;
  font-size: 14px;
}

.bwdk-result__meta {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 10px;
  text-align: right;
}

.bwdk-result__meta > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.bwdk-result__meta > div:last-child {
  border-bottom: 0;
}

.bwdk-result__meta dt {
  margin: 0;
  color: #6b7280;
  font-weight: 400;
}

.bwdk-result__meta dd {
  margin: 0;
  color: #111827;
}

.bwdk-result__timer {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 13px;
}

.bwdk-result__timer [data-bwdk-count] {
  font-weight: 700;
  color: #111827;
}

.bwdk-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.bwdk-result__actions .btn {
  min-width: 140px;
}
