/* =====================================================================
   TTF | Digital solutions (/products) — page styles only.
   Tabs on top (schools · business owners · organisations), no JavaScript (radio buttons).
   Under them: the side picture + the product cards of the open tab,
   each card with «جرّب الديمو» on one side and «شراء» on the other.
   Phones ≤600 · tablets ≤1023 · desktop ≥1024
   ===================================================================== */

.svc-in { --c: var(--g-bright); --c-soft: var(--green-soft); }
.svc-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
/* the colour of the open tab (green · orange · yellow) */
.svc-radio:nth-of-type(2):checked ~ * { --c: var(--o-bright); --c-soft: var(--orange-soft); }
.svc-radio:nth-of-type(3):checked ~ * { --c: var(--yellow);   --c-soft: var(--yellow-soft); }

/* ---------- Tabs ---------- */
.svc-tabs {
  display: flex; justify-content: center; gap: 6px; width: fit-content; max-width: 100%; margin: 0 auto 28px;
  padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
}
.svc-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 26px; border-radius: 999px;
  cursor: pointer; color: var(--muted); font-weight: 600; font-size: 16.5px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.svc-tab svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svc-tab:hover { color: var(--text); }
.svc-radio:nth-of-type(1):checked ~ .svc-tabs .svc-tab:nth-child(1),
.svc-radio:nth-of-type(2):checked ~ .svc-tabs .svc-tab:nth-child(2),
.svc-radio:nth-of-type(3):checked ~ .svc-tabs .svc-tab:nth-child(3) {
  color: var(--c); background: var(--c-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent);
}
.svc-radio:nth-of-type(1):focus-visible ~ .svc-tabs .svc-tab:nth-child(1),
.svc-radio:nth-of-type(2):focus-visible ~ .svc-tabs .svc-tab:nth-child(2),
.svc-radio:nth-of-type(3):focus-visible ~ .svc-tabs .svc-tab:nth-child(3) { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- Picture + product cards, the same height ---------- */
.svc-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: stretch; }

.svc-art {
  position: relative; margin: 0; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: var(--bg-2);
}
.svc-art::before { content: ""; display: block; padding-top: 118%; }   /* its smallest height */
.svc-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% center; display: block; }
.svc-art::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--stripe); }

/* only the panel of the open tab is shown */
.svc-panel { display: none; }
.svc-radio:nth-of-type(1):checked ~ .svc-grid .svc-panel:nth-child(1),
.svc-radio:nth-of-type(2):checked ~ .svc-grid .svc-panel:nth-child(2),
.svc-radio:nth-of-type(3):checked ~ .svc-grid .svc-panel:nth-child(3) { display: flex; animation: svcIn .3s ease; }
@keyframes svcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.svc-panels { display: flex; }
.svc-panel { flex: 1; flex-direction: column; gap: 18px; }

/* ---------- Product card ---------- */
.svc-item {
  position: relative; overflow: hidden; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px;
  padding: 24px 26px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015)), var(--bg-2);
  border: 1px solid var(--line); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.svc-item::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--c); }
.svc-item::after {
  content: ""; position: absolute; inset-inline-end: -90px; top: -90px; width: 230px; height: 230px; border-radius: 50%;
  background: var(--c); opacity: .07; filter: blur(34px); pointer-events: none;
}
.svc-item:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: var(--shadow); transform: translateY(-2px); }

.svc-item-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.svc-item-ico {
  flex: none; display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 16px;
  background: var(--c-soft); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); color: var(--c);
}
.svc-item-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svc-item-name { flex: 1; min-width: 0; margin: 0; min-height: 1.4em; font-size: clamp(19px, 1.8vw, 23px); line-height: 1.4; }
.svc-item-name.is-empty { border-bottom: 1px dashed rgba(255, 255, 255, .16); }   /* name not written yet */
.svc-price { flex: none; color: var(--muted); font-size: 13.5px; }
.svc-price strong { color: var(--yellow); font-size: 21px; }

/* demo on one side, buy on the other */
.svc-item-foot {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.svc-item-foot .btn { min-width: 130px; white-space: nowrap; }
.svc .btn:hover .btn-ico { transform: none; }
.svc .is-off { opacity: .5; cursor: default; }
.svc .is-off:hover { transform: none; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); }

/* ---------- Tablets: picture on top, cards under it ---------- */
@media (max-width: 1023px) {
  .svc-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .svc-art { max-width: 760px; width: 100%; margin-inline: auto; }
  .svc-art::before { padding-top: 75%; }
  .svc-art img { object-position: center 62%; }
}
/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .svc-tabs { width: 100%; gap: 4px; padding: 5px; }
  .svc-tab { flex: 1 1 0; flex-direction: column; gap: 4px; padding: 9px 6px; font-size: 13.5px; white-space: normal; text-align: center; line-height: 1.3; border-radius: 18px; }
  .svc-tabs { border-radius: 22px; }
  .svc-tab svg { width: 20px; height: 20px; }
  .svc-art::before { padding-top: 100%; }
  .svc-item { padding: 18px; gap: 16px; }
  .svc-item-ico { width: 48px; height: 48px; border-radius: 14px; }
  .svc-item-ico svg { width: 24px; height: 24px; }
  .svc-item-foot .btn { flex: 1; min-width: 0; }
}
/* Small phones: the price goes under the name (a long name keeps the full width), buttons stay inside the card */
@media (max-width: 480px) {
  .svc-item-top { flex-wrap: wrap; row-gap: 4px; }
  .svc-item-name { flex: 1 1 0; }
  .svc-price { flex: 0 0 100%; padding-inline-start: 64px; }
}
@media (max-width: 380px) {
  .svc-item-foot { flex-wrap: wrap; }
  .svc-item-foot .btn { flex: 1 1 108px; padding-inline: 10px; font-size: 13.5px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .svc-tab, .svc-item { transition: none; }
  .svc-panel { animation: none !important; }
}
