/* Repair request bottom sheet + mobile dual CTA */

.mobile-cta-bar {
  position: fixed !important;
  z-index: 1080;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  padding:
    0.5rem
    max(0.65rem, env(safe-area-inset-right, 0px))
    calc(0.5rem + env(safe-area-inset-bottom, 0px))
    max(0.65rem, env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.1);
  /* لایه جدا برای iOS تا با اسکرول جابه‌جا نشود */
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}
.mobile-cta-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 0.5rem;
  border-radius: 14px;
  border: none;
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.mobile-cta-bar__btn i { flex-shrink: 0; }
.mobile-cta-bar__btn span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile-cta-bar__btn:active { transform: scale(0.98); }
.mobile-cta-bar__btn--call {
  background: #fff;
  color: var(--brand);
  border: 1px solid rgba(185, 28, 28, 0.25);
}
.mobile-cta-bar__btn--form {
  background: linear-gradient(135deg, var(--brand), #ef4444);
  color: #fff;
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.28);
}

@media (max-width: 991.98px) {
  body.site-body {
    padding-bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  }
  .article-mobile-bar { display: none !important; }
  .site-body:has(.site-main--article) {
    padding-bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (min-width: 992px) {
  .mobile-cta-bar { display: none !important; }
}

/* FAB قدیمی تماس — دیگر استفاده نمی‌شود (جایگزین: نوار موبایل) */
.fab-cta {
  display: none !important;
}

/* —— Sheet —— */
.repair-sheet {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
}
.repair-sheet[hidden] { display: none !important; }
.repair-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.repair-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  max-height: min(92dvh, 640px);
  padding:
    0.35rem
    max(1rem, env(safe-area-inset-right, 0px))
    calc(1rem + env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.2);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translate3d(0, 110%, 0);
  transition: transform 0.35s var(--ease), max-height 0.2s ease;
}
.repair-sheet.is-open .repair-sheet__panel {
  transform: translate3d(0, 0, 0);
}
.repair-sheet__handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: 0.35rem auto 0.85rem;
}
.repair-sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.repair-sheet__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
}
.repair-sheet__title {
  margin: 0.15rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
}
.repair-sheet__close {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.repair-sheet__form {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.repair-sheet__field {
  margin-bottom: 0.85rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.repair-sheet__field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.repair-sheet__field label span { color: var(--brand); }
.repair-sheet__field label small {
  font-weight: 500;
  color: var(--text-muted);
}
.repair-sheet__field input,
.repair-sheet__field textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  font-size: 16px; /* جلوگیری از زوم iOS */
  background: #fff;
  color: var(--text);
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.repair-sheet__field textarea {
  resize: vertical;
  min-height: 88px;
}
.repair-sheet__field input:focus,
.repair-sheet__field textarea:focus {
  outline: none;
  border-color: rgba(185, 28, 28, 0.45);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.12);
}
.repair-sheet__error {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: #b91c1c;
  font-weight: 600;
}
.repair-sheet__status {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-sizing: border-box;
}
.repair-sheet__status.is-error {
  background: #fef2f2;
  color: #991b1b;
}
.repair-sheet__status.is-ok {
  background: #ecfdf5;
  color: #047857;
}
.repair-sheet__submit {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #ef4444);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(185, 28, 28, 0.28);
}
.repair-sheet__submit:disabled {
  opacity: 0.7;
  cursor: wait;
}
.repair-sheet__spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  margin-left: 0.4rem;
  vertical-align: -2px;
  animation: repairSpin 0.7s linear infinite;
}
@keyframes repairSpin {
  to { transform: rotate(360deg); }
}

.repair-sheet__success {
  text-align: center;
  padding: 1rem 0 0.5rem;
  width: 100%;
  box-sizing: border-box;
}
.repair-sheet__success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}
.repair-sheet__success h3 {
  font-weight: 800;
  margin-bottom: 0.4rem;
}
.repair-sheet__success p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

body.repair-sheet-open {
  overflow: hidden;
  touch-action: none;
}
body.repair-sheet-open .mobile-cta-bar {
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 992px) {
  .repair-sheet {
    align-items: center;
    padding: 1.5rem;
  }
  .repair-sheet__panel {
    width: min(440px, 100%);
    max-width: min(440px, calc(100% - 2rem));
    border-radius: 22px;
    max-height: min(88vh, 620px);
    transform: translate3d(0, 24px, 0) scale(0.98);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
  }
  .repair-sheet.is-open .repair-sheet__panel {
    transform: none;
    opacity: 1;
  }
  .repair-sheet__handle { display: none; }
}

.btn-repair-open,
a.btn-repair-open {
  cursor: pointer;
}
