/* ==========================================================================
   SD Funnels — Checkout Page Styles (Dynamic Custom UI)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --c-purple:  #6366f1;
  --c-purple2: #8b5cf6;
  --c-green:   #10b981;
  --c-red:     #ef4444;
  --c-text:    #111827;
  --c-muted:   #6b7280;
  --c-border:  #e5e7eb;
  --c-bg:      #f9fafb;
}

body.sdf-checkout-body {
  font-family: 'Inter', sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

.sdf-checkout-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---- Topbar ---- */
.sdf-topbar-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdfdfd;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.sdf-topbar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.sdf-icon-purple { color: var(--c-purple2); }
.sdf-topbar-item strong { display: block; font-weight: 700; font-size: 12px; margin-bottom: 2px; }
.sdf-topbar-item span { color: var(--c-muted); }

/* ---- Product Card ---- */
.sdf-product-card-new {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--c-border);
  display: flex;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.sdf-product-image-wrap {
  width: 40%;
  background: #fdfdfd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-right: 1px solid var(--c-border);
}
.sdf-product-image-wrap img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.sdf-product-details-new {
  width: 60%;
  padding: 24px;
}
.sdf-badge-purple {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f5f3ff;
  color: var(--c-purple2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.sdf-product-title-new {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
}

.sdf-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--c-border);
}
.sdf-stars { color: #fbbf24; font-size: 16px; letter-spacing: 2px; }
.sdf-rating-score { font-size: 13px; font-weight: 700; }
.sdf-rating-count { color: var(--c-muted); font-weight: 500; }

.sdf-product-description-dynamic {
  font-size: 13.5px;
  color: #374151;
  line-height: 1.6;
}
.sdf-product-description-dynamic p { margin-bottom: 12px; }
.sdf-product-description-dynamic p:last-child { margin-bottom: 0; }
.sdf-product-description-dynamic ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sdf-product-description-dynamic ul li {
  position: relative;
  padding-left: 26px;
  font-weight: 500;
}
.sdf-product-description-dynamic ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--c-purple2);
  font-weight: 900;
  font-size: 14px;
}


/* ---- Form Block ---- */
.sdf-form-block {
  margin-top: 10px;
}
.sdf-block-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--c-purple2);
}
.sdf-block-title svg { color: var(--c-purple2); }
.sdf-input-group {
  position: relative !important;
  margin-bottom: 12px !important;
  display: block !important;
}
.sdf-input-icon {
  position: absolute !important;
  left: 14px !important;
  top: 14px !important;
  color: #9ca3af !important;
  z-index: 10 !important;
  pointer-events: none !important;
}
.sdf-checkout-container .sdf-input-field {
  width: 100% !important;
  padding: 14px 14px 14px 44px !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  transition: all 0.2s !important;
  box-sizing: border-box !important;
  height: auto !important;
  line-height: normal !important;
  background: #fff !important;
  color: var(--c-text) !important;
}
.sdf-checkout-container .sdf-input-field:focus {
  outline: none !important;
  border-color: var(--c-purple2) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
}
.sdf-form-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #059669;
  font-weight: 500;
  margin-top: -4px;
}
.sdf-form-hint svg { color: #10b981; }

/* ---- Order Bump ---- */
.sdf-bump-box-new {
  display: block;
  background: #f0fdf4;
  border: 2px dashed #22c55e;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 16px 0;
  position: relative;
}
.sdf-bump-box-new:hover { background: #dcfce7; }
.sdf-bump-header-new {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.sdf-bump-checkbox-custom {
  width: 24px;
  height: 24px;
  border: 2px solid #22c55e;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sdf-bump-check:checked + .sdf-bump-main .sdf-bump-checkbox-custom {
  background: #22c55e;
}
.sdf-bump-check-icon {
  width: 14px;
  height: 14px;
  color: #fff;
  opacity: 0;
}
.sdf-bump-check:checked + .sdf-bump-main .sdf-bump-check-icon { opacity: 1; }
.sdf-bump-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.sdf-bump-fire { font-size: 18px; }
.sdf-bump-h3 { font-size: 16px; font-weight: 800; color: #1f2937; line-height: 1.2; }
.sdf-bump-badge {
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.sdf-bump-dynamic-content {
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  margin-top: 12px;
}
.sdf-bump-prod-name { font-size: 15px; font-weight: 800; color: #166534; margin-bottom: 6px; }
.sdf-bump-dynamic-desc {
  font-size: 13px;
  color: #374151;
  line-height: 1.5;
}
.sdf-bump-dynamic-desc p { margin-bottom: 8px; }
.sdf-bump-dynamic-desc p:last-child { margin-bottom: 0; }

.sdf-bump-prices { display: inline-flex; align-items: center; gap: 8px; margin-left: 8px; }
.sdf-bump-old-price { font-size: 13px; text-decoration: line-through; color: #9ca3af; font-weight: 500; }
.sdf-bump-new-price { font-size: 16px; font-weight: 800; color: #ea580c; }


/* ---- Order Summary ---- */
.sdf-order-summary-new {
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.sdf-summary-item-new {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #374151;
  padding: 8px 0;
}
.sdf-summary-item-new strong { color: #1f2937; }
.sdf-bump-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #16a34a;
  padding: 8px 0;
  font-weight: 600;
}
.sdf-summary-divider {
  height: 1px;
  background: var(--c-border);
  margin: 12px 0;
}
.sdf-summary-total-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 800;
  color: #1f2937;
}
.sdf-total-amount { color: var(--c-purple2); font-size: 20px; }

/* ---- Pay Button ---- */
.sdf-pay-btn-new {
  width: 100%;
  background: var(--c-purple2);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
  transition: all 0.2s;
  margin-bottom: 16px;
}
.sdf-pay-btn-new:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5); }
.sdf-pay-btn-new:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

.sdf-trust-row-new {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 24px;
}
.sdf-trust-row-new span { display: flex; align-items: center; gap: 6px; }
.sdf-dot { color: #d1d5db; }

/* ---- Payment Methods Box ---- */
.sdf-payment-methods-box {
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}
.sdf-pm-header {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-bg);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
}
.sdf-pm-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
.sdf-pm-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
}
.sdf-pm-footer svg { color: #6b7280; }

/* ---- Footer ---- */
.sdf-footer-support-new {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.sdf-support-item {
  flex: 1;
  background: #f5f3ff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sdf-support-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.sdf-support-icon.whatsapp { background: #25D366; }
.sdf-support-icon.email { background: var(--c-purple2); }
.sdf-support-text { display: flex; flex-direction: column; }
.sdf-support-text strong { font-size: 13px; font-weight: 700; color: #1f2937; margin-bottom: 2px; }
.sdf-support-text span { font-size: 12px; color: #6b7280; }

.sdf-footer-links-new {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}
.sdf-footer-links-new a { color: #6b7280; text-decoration: none; }
.sdf-footer-links-new p { margin-top: 12px; }

/* Error box */
.sdf-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.sdf-pay-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sdfSpin .8s linear infinite;
}
@keyframes sdfSpin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  .sdf-product-card-new { flex-direction: column; }
  .sdf-product-image-wrap { width: 100%; border-right: none; border-bottom: 1px solid var(--c-border); padding: 16px; }
  .sdf-product-details-new { width: 100%; }
  .sdf-footer-support-new { flex-direction: column; }
}

/* ==========================================================================
   Thank You Page Styles (Modern Premium UI)
   ========================================================================== */
.sdf-thankyou-body {
  background: #f9fafb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 16px;
}

.sdf-ty-wrapper {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sdf-ty-icon-wrap { animation: sdfPopIn .6s cubic-bezier(0.22, 1, 0.36, 1) both; margin-bottom: 24px; }
.sdf-ty-icon { width: 72px; height: 72px; background: #dcfce7; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 8px rgba(220, 252, 231, 0.4); }
.sdf-ty-icon svg { width: 36px; height: 36px; color: #16a34a; }
@keyframes sdfPopIn { 0% { transform: scale(0); opacity: 0; } 80% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

.sdf-ty-card {
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.06);
  border: 1px solid var(--c-border);
  overflow: hidden;
  animation: sdfSlideUp .5s ease .2s both;
  text-align: center;
}
@keyframes sdfSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sdf-ty-header {
  padding: 40px 32px 24px;
}
.sdf-ty-header h1 { font-size: 28px; font-weight: 800; color: #111827; margin-bottom: 8px; letter-spacing: -0.02em; }
.sdf-ty-header p  { font-size: 15px; color: #6b7280; line-height: 1.5; }
.sdf-ty-header strong { color: #111827; }

.sdf-ty-summary {
  margin: 0 32px 32px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  border: 1px dashed #d1d5db;
}
.sdf-ty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}
.sdf-ty-row:last-child { border-bottom: none; padding-bottom: 0; }
.sdf-ty-row:first-child { padding-top: 0; }
.sdf-ty-row span { color: #6b7280; font-weight: 500; }
.sdf-ty-row strong { color: #111827; font-weight: 700; text-align: right; }

.sdf-ty-download {
  padding: 0 32px 32px;
}
.sdf-ty-download-label { font-size: 14px; color: #374151; margin-bottom: 16px; font-weight: 600; }
.sdf-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #111827;
  color: #fff;
  text-decoration: none;
  padding: 18px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.2);
  transition: all .2s;
  width: 100%;
}
.sdf-download-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(17, 24, 39, 0.3); color: #fff; }
.sdf-download-btn.orange { background: #ea580c; box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2); }
.sdf-download-btn.orange:hover { box-shadow: 0 8px 20px rgba(234, 88, 12, 0.3); }

.sdf-download-hint { font-size: 13px; color: #6b7280; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }

.sdf-ty-next { padding: 32px; background: #fdfdfd; border-top: 1px solid var(--c-border); text-align: left; }
.sdf-ty-next h3 { font-size: 16px; font-weight: 700; color: #111827; margin-bottom: 20px; }
.sdf-steps-list { display: flex; flex-direction: column; gap: 20px; }
.sdf-step-item { display: flex; gap: 16px; align-items: flex-start; }
.sdf-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.sdf-step-done   { background: #dcfce7; color: #16a34a; }
.sdf-step-active { background: #f3f4f6; color: #374151; }
.sdf-step-item strong { display: block; font-size: 14px; color: #111827; margin-bottom: 4px; }
.sdf-step-item p      { font-size: 13px; color: #6b7280; margin: 0; line-height: 1.5; }

.sdf-ty-support {
  padding: 20px 32px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
  border-top: 1px solid var(--c-border);
}
.sdf-ty-support a { color: var(--c-purple2); text-decoration: none; font-weight: 600; }

.sdf-ty-error { text-align: center; padding: 60px 32px; }
.sdf-error-icon { font-size: 56px; margin-bottom: 20px; }
.sdf-ty-error h2 { margin-bottom: 12px; color: #111827; font-weight: 800; }
.sdf-ty-error p { color: #6b7280; font-size: 15px; line-height: 1.6; }

/* ---- Confetti ---- */
.sdf-confetti {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.sdf-confetti-dot {
  position: absolute;
  top: -20px;
  animation: sdfConfettiFall linear forwards;
}
@keyframes sdfConfettiFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

@media (max-width: 560px) {
  .sdf-ty-header { padding: 20px; }
  .sdf-ty-summary, .sdf-ty-download, .sdf-ty-next, .sdf-ty-support { padding-left: 20px; padding-right: 20px; }
}

/* ---- Comprehensive Mobile Fixes for Checkout ---- */
.sdf-bump-flex {
  display: flex;
  gap: 16px;
  align-items: center;
}
.sdf-bump-text-wrap {
  flex: 1;
}
.sdf-bump-image-wrap {
  width: 80px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  /* Prevent any horizontal overflow */
  .sdf-checkout-body { overflow-x: hidden; }
  .sdf-checkout-container { padding: 16px; width: 100%; max-width: 100vw; overflow-x: hidden; box-sizing: border-box; }
  
  /* Topbar fixed layout */
  .sdf-topbar-new {
    flex-direction: column !important;
    gap: 0 !important;
    align-items: stretch !important;
    padding: 0 !important;
  }
  .sdf-topbar-item {
    justify-content: flex-start !important;
    padding: 12px 16px !important;
    border-bottom: 1px solid var(--c-border) !important;
    width: 100% !important;
  }
  .sdf-topbar-item:last-child { border-bottom: none !important; }
  
  /* Product Card adjustments */
  .sdf-product-title-new { font-size: 22px; }
  
  /* Payment Icons */
  .sdf-pm-icons { gap: 12px !important; }
  .sdf-pm-icons img { height: 24px !important; }
  
  /* Bump Offer Mobile Layout */
  .sdf-bump-header-new { flex-wrap: wrap; }
  .sdf-bump-badge { margin-top: 6px; }
  .sdf-bump-flex { flex-direction: row; align-items: center; gap: 12px; }
  .sdf-bump-image-wrap { width: 70px; margin-bottom: 0; }
  .sdf-bump-prod-name { font-size: 14px; }
  .sdf-bump-dynamic-desc { font-size: 12px; }
}
