/* ==========================================================
   BWD Modern Thank You Page
   Brand color: #338ae7
   ========================================================== */

.bwd-ty-wrap {
  --bwd-primary: #338ae7;
  --bwd-primary-dark: #e6741d;
  --bwd-primary-light: #fff2e6;
  --bwd-ink: #1f2937;
  --bwd-muted: #6b7280;
  --bwd-border: #eef0f3;
  --bwd-bg: #f7f8fa;
  --bwd-success: #22c55e;
  --bwd-radius: 16px;
  --bwd-shadow: 0 10px 40px rgba(17, 24, 39, 0.06);

  max-width: 980px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: 'Hind Siliguri', 'Noto Sans Bengali', 'Segoe UI', system-ui, sans-serif;
  color: var(--bwd-ink);
  box-sizing: border-box;
  position: relative;
}

.bwd-ty-wrap * {
  box-sizing: border-box;
}

/* Confetti */
.bwd-ty-confetti {
  position: absolute;
  inset: 0 0 auto 0;
  height: 220px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.bwd-ty-confetti-piece {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.85;
  animation: bwd-fall 3.2s linear infinite;
}

.bwd-ty-confetti-piece:nth-child(4n) { background: var(--bwd-primary); }
.bwd-ty-confetti-piece:nth-child(4n+1) { background: #ffcf86; }
.bwd-ty-confetti-piece:nth-child(4n+2) { background: var(--bwd-success); }
.bwd-ty-confetti-piece:nth-child(4n+3) { background: #60a5fa; }

.bwd-ty-confetti-piece:nth-child(1) { left: 4%; animation-delay: 0s; }
.bwd-ty-confetti-piece:nth-child(2) { left: 10%; animation-delay: .3s; }
.bwd-ty-confetti-piece:nth-child(3) { left: 18%; animation-delay: .6s; }
.bwd-ty-confetti-piece:nth-child(4) { left: 26%; animation-delay: .1s; }
.bwd-ty-confetti-piece:nth-child(5) { left: 34%; animation-delay: .8s; }
.bwd-ty-confetti-piece:nth-child(6) { left: 42%; animation-delay: .4s; }
.bwd-ty-confetti-piece:nth-child(7) { left: 50%; animation-delay: .2s; }
.bwd-ty-confetti-piece:nth-child(8) { left: 58%; animation-delay: .9s; }
.bwd-ty-confetti-piece:nth-child(9) { left: 66%; animation-delay: .5s; }
.bwd-ty-confetti-piece:nth-child(10) { left: 74%; animation-delay: .15s; }
.bwd-ty-confetti-piece:nth-child(11) { left: 82%; animation-delay: .7s; }
.bwd-ty-confetti-piece:nth-child(12) { left: 90%; animation-delay: .35s; }
.bwd-ty-confetti-piece:nth-child(13) { left: 96%; animation-delay: .55s; }
.bwd-ty-confetti-piece:nth-child(14) { left: 14%; animation-delay: 1.1s; }
.bwd-ty-confetti-piece:nth-child(15) { left: 46%; animation-delay: 1.3s; }
.bwd-ty-confetti-piece:nth-child(16) { left: 62%; animation-delay: 1s; }
.bwd-ty-confetti-piece:nth-child(17) { left: 78%; animation-delay: 1.4s; }
.bwd-ty-confetti-piece:nth-child(18) { left: 30%; animation-delay: 1.2s; }

@keyframes bwd-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: .9; }
  100% { transform: translateY(220px) rotate(260deg); opacity: 0; }
}

/* Hero */
.bwd-ty-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 20px 16px 8px;
}

.bwd-ty-check {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
}

.bwd-ty-check svg {
  width: 100%;
  height: 100%;
}

.bwd-ty-check-circle {
  stroke: var(--bwd-success);
  stroke-width: 3;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: bwd-draw 0.6s ease-out forwards;
}

.bwd-ty-check-mark {
  stroke: var(--bwd-success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: bwd-draw 0.4s ease-out 0.55s forwards;
}

@keyframes bwd-draw {
  to { stroke-dashoffset: 0; }
}

.bwd-ty-hero h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--bwd-ink);
}

.bwd-ty-sub {
  font-size: 16px;
  color: var(--bwd-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.bwd-ty-sub strong {
  color: var(--bwd-primary-dark);
}

/* Progress tracker */
.bwd-ty-tracker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 32px auto 36px;
  max-width: 640px;
  flex-wrap: wrap;
}

.bwd-ty-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 64px;
}

.bwd-ty-step-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--bwd-border);
  color: var(--bwd-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.bwd-ty-step-active .bwd-ty-step-dot {
  border-color: var(--bwd-primary);
  background: var(--bwd-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--bwd-primary-light);
}

.bwd-ty-step-done .bwd-ty-step-dot {
  border-color: var(--bwd-success);
  background: var(--bwd-success);
  color: #fff;
}

.bwd-ty-step-label {
  font-size: 12px;
  color: var(--bwd-muted);
  text-align: center;
  white-space: nowrap;
}

.bwd-ty-step-active .bwd-ty-step-label {
  color: var(--bwd-ink);
  font-weight: 600;
}

.bwd-ty-step-line {
  flex: 1;
  height: 2px;
  background: var(--bwd-border);
  min-width: 24px;
  margin-bottom: 20px;
}

.bwd-ty-step-line-done {
  background: var(--bwd-success);
}

/* Grid + cards */
.bwd-ty-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

.bwd-ty-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bwd-ty-card {
  background: #fff;
  border-radius: var(--bwd-radius);
  box-shadow: var(--bwd-shadow);
  border: 1px solid var(--bwd-border);
  padding: 24px;
}

.bwd-ty-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bwd-border);
}

/* Order items */
.bwd-ty-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--bwd-border);
}

.bwd-ty-item:last-child {
  border-bottom: none;
}

.bwd-ty-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--bwd-border);
  flex-shrink: 0;
}

.bwd-ty-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.bwd-ty-item-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--bwd-ink);
}

.bwd-ty-item-qty {
  font-size: 12px;
  color: var(--bwd-muted);
}

.bwd-ty-item-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--bwd-primary-dark);
  white-space: nowrap;
}

/* Totals */
.bwd-ty-totals {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bwd-border);
}

.bwd-ty-total-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--bwd-muted);
}

.bwd-ty-total-discount span:last-child {
  color: var(--bwd-success);
}

.bwd-ty-total-grand {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--bwd-border);
  font-size: 18px;
  font-weight: 800;
  color: var(--bwd-ink);
}

/* Meta list */
.bwd-ty-meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bwd-ty-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
}

.bwd-ty-meta-list li span {
  color: var(--bwd-muted);
}

.bwd-ty-meta-list li strong {
  text-align: right;
  color: var(--bwd-ink);
}

.bwd-ty-cod-note {
  margin-top: 16px;
  background: var(--bwd-primary-light);
  color: var(--bwd-primary-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
}

.bwd-ty-support p {
  font-size: 14px;
  color: var(--bwd-muted);
  margin: 0 0 14px;
  line-height: 1.6;
}

/* Buttons */
.bwd-ty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  border: 2px solid transparent;
}

.bwd-ty-btn-primary {
  background: linear-gradient(135deg, var(--bwd-primary), var(--bwd-primary-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(252, 137, 52, 0.35);
}

.bwd-ty-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(252, 137, 52, 0.4);
  color: #fff;
}

.bwd-ty-btn-outline {
  border-color: var(--bwd-primary);
  color: var(--bwd-primary-dark);
  background: #fff;
  width: 100%;
}

.bwd-ty-btn-outline:hover {
  background: var(--bwd-primary-light);
}

.bwd-ty-actions {
  text-align: center;
  margin: 36px 0 10px;
}

/* Empty / invalid state */
.bwd-ty-empty {
  text-align: center;
  padding: 60px 24px;
}

.bwd-ty-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.bwd-ty-empty h2 {
  font-size: 22px;
  margin: 0 0 10px;
}

.bwd-ty-empty p {
  color: var(--bwd-muted);
  max-width: 480px;
  margin: 0 auto 22px;
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 782px) {
  .bwd-ty-grid {
    grid-template-columns: 1fr;
  }

  .bwd-ty-hero h1 {
    font-size: 22px;
  }

  .bwd-ty-step-label {
    display: none;
  }

  .bwd-ty-tracker {
    gap: 4px;
  }
}
