/* ---------- Services (خدمات) ---------- */

.services {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 100px;
}

.services__head {
  text-align: start;
  margin-bottom: 40px;
  max-width: 640px;
}

.services__title {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 800;
  margin: 0 0 12px;
}

.services__desc {
  color: color-mix(in srgb, var(--accent) 55%, var(--text-muted));
  font-size: 0.95rem;
  line-height: 1.9;
  margin: 0;
}

.services__panel {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 28px;
  align-items: stretch;
}

/* ----- Left: interactive row list ----- */

.services__list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-soft);
}

.service-row {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.2s ease;
}
.services__list .service-row:last-child { border-bottom: none; }

.service-row::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: transparent;
  transition: background 0.2s ease;
}

.service-row:hover { background: rgba(255, 255, 255, 0.02); }

.service-row.is-active {
  background: var(--accent-soft);
}
.service-row.is-active::before { background: var(--accent); }

.service-row__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.service-row.is-active .service-row__icon {
  color: var(--accent);
  border-color: var(--accent);
}

.service-row__title {
  font-weight: 700;
  font-size: 0.98rem;
  flex-grow: 1;
}

.service-row__chev {
  color: var(--text-muted);
  flex-shrink: 0;
  transform: rotate(180deg);
  transition: transform 0.2s ease, color 0.2s ease;
}
html[dir="ltr"] .service-row__chev {
  transform: rotate(0deg);
}
.service-row.is-active .service-row__chev,
html[dir="ltr"] .service-row.is-active .service-row__chev {
  color: var(--accent);
  transform: rotate(90deg);
}

.service-row__desc {
  display: none;
}

/* ----- Right: detail showcase ----- */

.services__detail {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-soft);
  overflow: hidden;
}

.service-detail {
  display: none;
  padding: 40px;
  height: 100%;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.service-detail.is-active {
  display: grid;
  animation: fadein 0.35s ease both;
}

.service-detail__title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.service-detail__desc {
  color: var(--text-muted);
  line-height: 1.9;
  margin: 0 0 22px;
  max-width: 46ch;
}

.service-detail__bullets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.service-detail__bullets li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.service-detail__bullets li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.service-detail__visual {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background-color: #0e1b1f;
  background-image:
    linear-gradient(rgba(51, 195, 236, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 195, 236, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 60% 40%, rgba(51, 195, 236, 0.28), transparent 65%);
  background-size: 20px 20px, 20px 20px, 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .service-detail.is-active { animation: none; }
}

/* ---------- Responsive: collapse to accordion ---------- */

@media (max-width: 860px) {
  .services__panel {
    grid-template-columns: 1fr;
  }
  .services__detail { display: none; }

  .service-row { align-items: flex-start; flex-wrap: wrap; }
  .service-row__desc {
    display: block;
    flex-basis: 100%;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.8;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
    margin-top: 0;
    padding-inline-start: 52px;
  }
  .service-row.is-active .service-row__desc {
    max-height: 120px;
    opacity: 1;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .services { padding: 32px 18px 72px; }
  .service-detail { padding: 28px; grid-template-columns: 1fr; }
  .service-detail__visual { width: 100%; height: 140px; order: -1; }
}
