/* =========================================================================
   COMPONENTS — دکمه‌ها، نشانگرها، کارت‌های پایه و ریزتعامل‌ها
   ========================================================================= */

/* ----------------------------------------------------------- دکمه‌ها */
.btn {
  --btn-py: 13px;
  --btn-px: 26px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--btn-py) var(--btn-px);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  isolation: isolate;
  transition:
    color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--sm {
  --btn-py: 9px;
  --btn-px: 18px;
  font-size: var(--fs-xs);
}

/* دکمه‌ی اصلی: طلایی، با درخشش ملایم هنگام hover */
.btn--primary {
  color: var(--ink-950);
  background: linear-gradient(140deg, var(--accent-300), var(--accent-500) 55%, var(--accent-700));
  font-weight: 700;
  box-shadow: 0 10px 30px -14px rgba(240, 163, 46, 0.7);
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(140deg, var(--accent-400), var(--accent-300));
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
}

.btn--primary:hover::after {
  opacity: 1;
}

/* دکمه‌ی ثانویه: خط نازک با پرشدن تدریجی */
.btn--ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.btn--ghost::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(240, 163, 46, 0.1);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease-out);
}

.btn--ghost:hover {
  border-color: var(--border-accent);
  color: var(--accent-bright);
}

.btn--ghost:hover::after {
  transform: scaleX(1);
}

.btn.is-downloading {
  opacity: 0.75;
  pointer-events: none;
  cursor: wait;
}

/* ---------------------------------------------------- پیوند پیکان‌دار */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--accent);
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease-out);
}

.link-arrow svg {
  transition: transform var(--dur) var(--ease-out);
}

.link-arrow:hover {
  border-bottom-color: var(--border-accent);
}

.link-arrow:hover svg {
  transform: translateX(-4px);
}

/* --------------------------------------------------- نشانگر پیشرفت */
.services__progress {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.services__progress li {
  display: flex;
}

/* خط‌تیره‌های کوتاه وسط‌چین — مطابق مرجع؛ دکمه‌اند تا با صفحه‌کلید هم کار کنند */
.services__progress button {
  position: relative;
  display: block;
  width: clamp(22px, 2.4vw, 38px);
  height: 2px;
  padding: 0;
  background: rgba(163, 163, 155, 0.2);
  overflow: hidden;
  cursor: pointer;
}

.services__progress button > span:first-child {
  position: absolute;
  inset: 0;
  transform-origin: right;
  transform: scaleX(var(--p, 0));
  background: var(--accent);
  transition: transform 120ms linear;
}

.services__progress button:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 6px;
}

.services__progress button[aria-current='true'] {
  height: 3px;
  box-shadow: 0 0 12px rgba(240, 163, 46, 0.6);
}

/* ================================================== ویجت شناور تماس تلفنی */
.phone-widget {
  position: fixed;
  right: max(clamp(16px, 2.5vw, 32px), env(safe-area-inset-right, 0px));
  bottom: max(clamp(16px, 2.5vw, 32px), env(safe-area-inset-bottom, 0px));
  z-index: 100;
  direction: rtl;
}

/* دکمه دایره‌ای شناور */
.phone-widget__btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 120, 0.45);
  background: linear-gradient(135deg, #f0a32e 0%, #e08b15 100%);
  color: #03070d;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(240, 163, 46, 0.42),
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.phone-widget__btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow:
    0 12px 32px rgba(240, 163, 46, 0.65),
    0 4px 12px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 235, 180, 0.8);
}

.phone-widget__btn:active {
  transform: scale(0.96) translateY(0);
}

.phone-widget__btn:focus-visible {
  outline: 2px solid var(--accent-300);
  outline-offset: 4px;
}

/* امواج راداری / پالس دور دکمه */
.phone-widget__ripple {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(240, 163, 46, 0.6);
  pointer-events: none;
  animation: phonePulse 2.5s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

.phone-widget__ripple--2 {
  animation-delay: 1.25s;
}

.phone-widget.is-open .phone-widget__ripple {
  animation-play-state: paused;
  opacity: 0;
}

@keyframes phonePulse {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
    border-color: rgba(240, 163, 46, 0.7);
  }
  60% {
    opacity: 0.25;
  }
  100% {
    transform: scale(1.7);
    opacity: 0;
    border-color: rgba(240, 163, 46, 0);
  }
}

/* محفظه آیکون‌ها و انیمیشن زنگ تلفن */
.phone-widget__icon-wrap {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-widget__icon-phone {
  position: absolute;
  stroke: #03070d;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
  animation: phoneRing 4s ease-in-out infinite;
}

.phone-widget__icon-close {
  position: absolute;
  stroke: #03070d;
  opacity: 0;
  transform: scale(0.5) rotate(-90deg);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.25s ease;
}

/* انیمیشن زنگ خوردن تلفن (Ring & Wiggle) */
@keyframes phoneRing {
  0%, 78%, 100% {
    transform: rotate(0deg);
  }
  80% {
    transform: rotate(-16deg) scale(1.08);
  }
  83% {
    transform: rotate(16deg) scale(1.08);
  }
  86% {
    transform: rotate(-12deg) scale(1.08);
  }
  89% {
    transform: rotate(12deg) scale(1.08);
  }
  92% {
    transform: rotate(-6deg);
  }
  95% {
    transform: rotate(6deg);
  }
  98% {
    transform: rotate(0deg);
  }
}

.phone-widget.is-open .phone-widget__icon-phone {
  opacity: 0;
  transform: scale(0.5) rotate(90deg);
  animation-play-state: paused;
}

.phone-widget.is-open .phone-widget__icon-close {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ------------------------------------------------ کارت شماره تماس‌ها */
.phone-widget__card {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  background: rgba(6, 14, 24, 0.95);
  border: 1px solid rgba(240, 163, 46, 0.32);
  border-radius: var(--radius-lg, 14px);
  padding: 16px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 18px 48px -6px rgba(0, 0, 0, 0.85),
    0 0 24px rgba(240, 163, 46, 0.12),
    inset 0 1px 0 rgba(255, 235, 180, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 0.3s var(--ease-out),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.3s ease;
  pointer-events: none;
  max-height: calc(100vh - 120px);
  max-height: calc(100svh - 110px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone-widget.is-open .phone-widget__card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* سربرگ کارت */
.phone-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(240, 163, 46, 0.14);
}

.phone-widget__kicker {
  display: block;
  font-size: 0.65rem;
  color: var(--accent-300, #f0a32e);
  letter-spacing: 0.12em;
}

.phone-widget__title {
  margin: 2px 0 0;
  font-family: var(--font-display, inherit);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.phone-widget__close {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.phone-widget__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* آیتم‌های تماس */
.phone-widget__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.phone-widget__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 10px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(240, 163, 46, 0.12);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s var(--ease-out);
}

.phone-widget__item:hover {
  background: rgba(240, 163, 46, 0.10);
  border-color: rgba(240, 163, 46, 0.38);
  transform: translateX(-3px);
}

/* آیتم اصلی (دفتر مرکزی) */
.phone-widget__item--main {
  background: linear-gradient(135deg, rgba(240, 163, 46, 0.14) 0%, rgba(240, 163, 46, 0.04) 100%);
  border-color: rgba(240, 163, 46, 0.32);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.phone-widget__item--main:hover {
  background: linear-gradient(135deg, rgba(240, 163, 46, 0.22) 0%, rgba(240, 163, 46, 0.08) 100%);
  border-color: rgba(240, 163, 46, 0.55);
}

.phone-widget__item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.phone-widget__name {
  font-family: var(--font-display, inherit);
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.phone-widget__desc {
  font-size: 0.72rem;
  color: var(--text-muted, #94a3b8);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phone-widget__num {
  font-family: var(--font-mono, monospace);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent-300, #f0a32e);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* نشان دکمه تماس */
.phone-widget__call-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--accent-bright, #f0a32e);
  color: #03070d;
  font-family: var(--font-fa, inherit);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(240, 163, 46, 0.35);
}

.phone-widget__action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(240, 163, 46, 0.12);
  color: var(--accent-300, #f0a32e);
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.phone-widget__item:hover .phone-widget__action-icon {
  background: var(--accent-bright, #f0a32e);
  color: #03070d;
  transform: scale(1.08);
}

.phone-widget__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* کاهش حرکت برای دسترس‌پذیری */
@media (prefers-reduced-motion: reduce) {
  .phone-widget__ripple,
  .phone-widget__icon-phone {
    animation: none !important;
  }
  .phone-widget__card {
    transition: opacity 0.1s ease;
    transform: none !important;
  }
}

/* --------------------------------------------------- ??????? ?????? */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 900;
  color: var(--accent-400);
  margin: 0;
  padding: 0.2em 0;
  line-height: 1.4;
  position: relative;
  text-shadow: 0 4px 16px rgba(240, 163, 46, 0.35);
  letter-spacing: normal;
}

.section-kicker::after {
  content: '';
  display: block;
  width: 32px;
  height: 5px;
  background: var(--accent-500);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(240, 163, 46, 0.6);
}

/* ظاهر شدن نرم عنوان */
.js [data-reveal='kicker'] {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  filter: blur(8px);
  transition: 
    opacity 800ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 800ms ease-out;
}

.js [data-reveal='kicker'].is-in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}
