/* ==========================================================================
   Fediya Teaser Pricing Engine — Ultra-Compact Light & Minimal Theme (v3)
   طراحی کاملاً روشن، مینیمال، جمع‌وجور، بدون اسکرول افقی و استاندارد برای همه صفحات
   ========================================================================== */

:root {
  --tc-font: "IRANSansX", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --tc-bg: #ffffff;
  --tc-bg-soft: #f8fafc;
  --tc-border: #e2e8f0;
  --tc-border-hover: #cbd5e1;
  --tc-primary: #059669;
  --tc-primary-hover: #047857;
  --tc-primary-light: #ecfdf5;
  --tc-primary-ring: rgba(5, 150, 105, 0.16);
  --tc-accent: #10b981;
  --tc-text-heading: #0f172a;
  --tc-text-body: #334155;
  --tc-text-muted: #64748b;
  --tc-text-light: #94a3b8;
  --tc-radius-lg: 16px;
  --tc-radius-md: 10px;
  --tc-radius-sm: 6px;
  --tc-radius-pill: 999px;
  --tc-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
}

/* Container */
.teaser-calc-widget,
.tc-compact-widget {
  font-family: var(--tc-font);
  direction: rtl;
  text-align: right;
  width: 100%;
  max-width: 860px;
  margin: 1.5rem auto;
  padding: 1.25rem 1.35rem;
  background: var(--tc-bg);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-lg);
  box-shadow: var(--tc-shadow);
  box-sizing: border-box !important;
  color: var(--tc-text-body);
  position: relative;
  overflow: hidden;
}

/* Ensure no child causes horizontal scroll */
.tc-compact-widget *,
.tc-compact-widget *::before,
.tc-compact-widget *::after {
  box-sizing: border-box !important;
  max-width: 100%;
}

/* Article and service page containment */
.blog-post-body .teaser-calc-widget,
.service-detail .teaser-calc-widget,
.service-teaser-calculator-section .teaser-calc-widget {
  max-width: 100%;
  margin: 1.75rem 0;
}

@media (max-width: 640px) {
  .teaser-calc-widget,
  .tc-compact-widget {
    padding: 1rem 0.85rem;
    border-radius: 12px;
    margin: 1.25rem auto;
  }
}

/* Header */
.tc-head {
  text-align: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.75rem;
}

.tc-head-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--tc-radius-pill);
  background: var(--tc-primary-light);
  border: 1px solid #a7f3d0;
  color: var(--tc-primary-hover);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tc-head-badge svg {
  flex-shrink: 0;
}

.tc-title {
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  font-weight: 800;
  color: var(--tc-text-heading);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.tc-subtitle {
  font-size: 0.8rem;
  color: var(--tc-text-muted);
  margin: 0;
  line-height: 1.4;
}

/* Sections */
.tc-section {
  margin-bottom: 0.9rem;
}

.tc-section:last-child {
  margin-bottom: 0;
}

.tc-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--tc-text-heading);
  margin-bottom: 0.45rem;
}

.tc-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  gap: 0.5rem;
}

.tc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  background: var(--tc-primary);
  color: #ffffff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Step 1: Tiers Grid */
.tc-tiers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .tc-tiers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 380px) {
  .tc-tiers-grid {
    grid-template-columns: 1fr;
  }
}

.tc-tier-card {
  padding: 0.55rem 0.65rem;
  background: #ffffff;
  border: 1.5px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 52px;
  user-select: none;
  min-width: 0;
}

.tc-tier-card:hover {
  border-color: #94a3b8;
  background: var(--tc-bg-soft);
}

.tc-tier-card.is-active {
  border-color: var(--tc-primary);
  background: var(--tc-primary-light);
  box-shadow: 0 0 0 2px var(--tc-primary-ring);
}

.tc-tier-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.2rem;
  min-width: 0;
}

.tc-tier-card__name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--tc-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.tc-tier-card__badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--tc-text-muted);
  flex-shrink: 0;
}

.tc-tier-card.is-active .tc-tier-card__badge {
  background: #d1fae5;
  color: var(--tc-primary-hover);
}

.tc-tier-card__price {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--tc-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Split Row for Duration & Quantity */
.tc-row-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
  background: #f8fafc;
  padding: 0.75rem 0.85rem;
  border-radius: var(--tc-radius-md);
  border: 1px solid #f1f5f9;
}

@media (max-width: 680px) {
  .tc-row-split {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
  }
}

.tc-col {
  margin-bottom: 0;
  min-width: 0;
}

.tc-bubble-val {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--tc-primary);
  background: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--tc-radius-pill);
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Duration pills */
.tc-duration-pills {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}

.tc-dur-btn {
  flex: 1 1 0;
  min-width: 52px;
  padding: 0.28rem 0.35rem;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  color: var(--tc-text-body);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.tc-dur-btn:hover {
  border-color: #cbd5e1;
}

.tc-dur-btn.is-active {
  background: var(--tc-primary);
  border-color: var(--tc-primary);
  color: #ffffff;
  font-weight: 700;
}

/* Slider */
.tc-slider-box {
  width: 100%;
}

.tc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 4px;
  background: #cbd5e1;
  outline: none;
  cursor: pointer;
  margin: 0.35rem 0 0.15rem 0;
}

.tc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tc-primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}

.tc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.tc-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tc-primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.tc-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--tc-text-light);
  margin-top: 0.1rem;
}

.tc-discount-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--tc-radius-sm);
  margin-top: 0.4rem;
  font-weight: 600;
}

/* Stepper */
.tc-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-pill);
  padding: 0.12rem 0.2rem;
  flex-shrink: 0;
}

.tc-step-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tc-text-heading);
  cursor: pointer;
  transition: background 0.15s ease;
}

.tc-step-btn:hover {
  background: #e2e8f0;
}

.tc-qty-num {
  min-width: 30px;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--tc-text-heading);
}

/* Volume pills */
.tc-volume-pills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.3rem;
}

.tc-vol-btn {
  display: block;
  padding: 0.28rem 0.35rem;
  font-size: 0.69rem;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-sm);
  color: var(--tc-text-body);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
  white-space: nowrap;
}

.tc-vol-btn:hover {
  border-color: #cbd5e1;
}

.tc-vol-btn.is-active {
  background: var(--tc-primary-light);
  border-color: var(--tc-primary);
  color: var(--tc-primary-hover);
  font-weight: 700;
}

/* Addons Grid (Chips) */
.tc-addons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tc-addon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  background: #ffffff;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-pill);
  font-size: 0.74rem;
  font-family: inherit;
  color: var(--tc-text-body);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  max-width: 100%;
}

.tc-addon-chip:hover {
  border-color: #94a3b8;
  background: var(--tc-bg-soft);
}

.tc-addon-chip.is-active {
  background: var(--tc-primary-light);
  border-color: var(--tc-primary);
  color: var(--tc-primary-hover);
  box-shadow: 0 0 0 2px var(--tc-primary-ring);
}

.tc-addon-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #ffffff;
  font-size: 0.6rem;
  font-weight: 800;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tc-addon-chip.is-active .tc-addon-check {
  background: var(--tc-primary);
}

.tc-addon-name {
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}

.tc-addon-price {
  font-weight: 700;
  color: var(--tc-primary);
  font-size: 0.69rem;
  background: #f1f5f9;
  padding: 0.08rem 0.3rem;
  border-radius: 4px;
  margin-right: 0.2rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.tc-addon-chip.is-active .tc-addon-price {
  background: #d1fae5;
}

/* Summary Box (Unified & Minimal) */
.tc-summary-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #f0fdf4;
  border: 1.5px solid #a7f3d0;
  border-radius: var(--tc-radius-md);
}

.tc-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border-bottom: 1px dashed #bbf7d0;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}

@media (max-width: 600px) {
  .tc-summary-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.tc-summary-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.tc-summary-tier-badge {
  font-size: 0.84rem;
  font-weight: 800;
  color: #065f46;
}

.tc-summary-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #047857;
}

.tc-summary-addons-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}

.teaser-invoice-addon-item {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.68rem;
  color: #065f46;
}

.tc-summary-total-col {
  text-align: left;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .tc-summary-total-col {
    text-align: right;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
}

.tc-summary-total-label {
  display: block;
  font-size: 0.72rem;
  color: #047857;
  font-weight: 600;
}

.tc-summary-total-amount {
  display: block;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 900;
  color: #065f46;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Actions Grid (Buttons) */
.tc-actions-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

@media (max-width: 520px) {
  .tc-actions-grid {
    grid-template-columns: 1fr;
  }
}

.tc-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  background: var(--tc-primary);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--tc-radius-pill);
  text-decoration: none;
  transition: all 0.18s ease;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.22);
  cursor: pointer;
  white-space: nowrap;
}

.tc-btn-primary:hover {
  background: var(--tc-primary-hover);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.32);
  transform: translateY(-1px);
}

.tc-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  color: #15803d !important;
  border: 1.5px solid #22c55e;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--tc-radius-pill);
  text-decoration: none;
  transition: all 0.18s ease;
  cursor: pointer;
  white-space: nowrap;
}

.tc-btn-whatsapp:hover {
  background: #f0fdf4;
  border-color: #16a34a;
  color: #166534 !important;
  transform: translateY(-1px);
}

/* Footer compact */
.tc-footer-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.72rem;
  padding-top: 0.4rem;
}

.tc-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: #047857;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.tc-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--tc-text-muted);
  text-decoration: none;
  font-weight: 600;
}

.tc-phone-link:hover {
  color: var(--tc-primary);
}

/* Modal */
.teaser-video-modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 720px;
  width: 90%;
  margin: auto;
}

.teaser-video-modal::backdrop {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
}

.teaser-modal-dialog {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.teaser-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
}

.teaser-modal-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.teaser-modal-close {
  background: #f1f5f9;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
}

.teaser-modal-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.teaser-modal-player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
