/* ====== قسم أعمالنا: هواتف مكدّسة تفاعلية + قائمة تطبيقات بحالة نشطة ====== */
.appshow {
  padding-block: var(--space-7);
  background: var(--color-white);
  overflow: hidden;
}

.appshow-layout {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-top: var(--space-5);
}

/* ====== كومة الهواتف ====== */
.appshow-stack {
  order: 2;
  position: relative;
  flex: 0 0 300px;
  height: 470px;
  padding-top: 30px;
  perspective: 1400px;
}

.appshow-phone {
  all: unset;
  position: absolute;
  right: 50%;
  top: 0;
  display: block;
  width: 180px;
  height: 390px;
  cursor: pointer;
  transform-style: preserve-3d;
  transform-origin: 50% 50%;
  isolation: isolate;
  will-change: transform, opacity;
  z-index: var(--z, 1);
  opacity: var(--op, 1);
  transition: transform 550ms cubic-bezier(0.19, 1, 0.22, 1), opacity var(--duration-base) var(--ease-standard);
}
.appshow-phone:nth-child(1) { --tx: 0px;   --ty: 0px;   --scale: 1;    --rot: 0deg;   --z: 60; --op: 1; }
.appshow-phone:nth-child(2) { --tx: -20px; --ty: 20px;  --scale: .94;  --rot: -2.5deg; --z: 50; --op: .82; }
.appshow-phone:nth-child(3) { --tx: -36px; --ty: 40px;  --scale: .89;  --rot: 2.5deg;  --z: 40; --op: .68; }
.appshow-phone:nth-child(4) { --tx: -50px; --ty: 60px;  --scale: .85;  --rot: -3.5deg; --z: 30; --op: .56; }
.appshow-phone:nth-child(5) { --tx: -62px; --ty: 80px;  --scale: .81;  --rot: 3.5deg;  --z: 20; --op: .46; }
.appshow-phone:nth-child(6) { --tx: -72px; --ty: 100px; --scale: .78;  --rot: -4.5deg; --z: 10; --op: .38; }
.appshow-phone {
  transform: translate(calc(50% + var(--tx)), var(--ty)) scale(var(--scale)) rotate(var(--rot));
}

.appshow-phone.is-active {
  --ty: -14px;
  --scale: 1.07;
  --rot: 0deg;
  --z: 100;
  --op: 1;
}

@media (hover: hover) and (pointer: fine) {
  .appshow-phone:not(.is-active):hover {
    --op: 1;
    --scale: calc(var(--scale) + 0.03);
    --rot: 0deg;
    transition: transform 320ms var(--ease-out), opacity var(--duration-base) var(--ease-standard);
  }
}
.appshow-phone:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 4px;
  border-radius: 40px;
}

.appshow-phone-body {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  background: linear-gradient(155deg, #2a2f2e, var(--color-black) 45%);
  padding: 6px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.appshow-phone-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--color-black);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-inline-end: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.appshow-phone-island .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 5px 1px rgba(60, 220, 180, 0.75);
}
.appshow-phone-screen {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
  background: var(--color-gray-100);
  transform: translateZ(0);
}
.appshow-phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

/* ====== قائمة التطبيقات ====== */
.appshow-list {
  order: 1;
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.appshow-item { border-bottom: 1px solid var(--color-gray-200); }
.appshow-item:first-child { border-top: 1px solid var(--color-gray-200); }

.item-toggle {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 16px 6px;
}

.item-connector {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-gray-200);
  transition: background var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard), transform var(--duration-base) var(--ease-standard);
}
.appshow-item.is-active .item-connector {
  background: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-light);
  transform: scale(1.2);
}

.item-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-base) var(--ease-standard);
}
.item-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.appshow-item.is-active .item-icon { transform: scale(1.06); }

.item-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
}
.item-name {
  font-family: var(--font-serif-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-name em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--color-gray-500);
  margin-inline-start: 6px;
}
.item-desc {
  font-size: 12.5px;
  color: var(--color-gray-500);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-type {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.item-toggle:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ====== تفاصيل التطبيق النشط (أكورديون) ====== */
.item-detail {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding-inline-start: 87px;
  margin-top: 0;
  transition: max-height var(--duration-slow) var(--ease-standard), opacity var(--duration-base) var(--ease-standard), margin-top var(--duration-slow) var(--ease-standard);
}
.appshow-item.is-active .item-detail {
  max-height: 200px;
  opacity: 1;
  margin-top: 4px;
}
.item-detail p {
  margin: 0 0 12px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--color-gray-700);
  max-width: 480px;
}
.item-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-white);
  background: var(--color-black);
  padding: 10px 18px 10px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  transition: background var(--duration-base) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.item-link svg { width: 16px; height: 16px; }
.item-link:hover { background: var(--color-primary-dark); transform: translateY(-1px); }
.item-link:focus-visible { outline: 2px solid var(--color-primary-dark); outline-offset: 3px; }

/* ====== استجابة الموبايل: الكومة تتحول لشريط أفقي، القائمة أسفلها ====== */
@media (max-width: 860px) {
  .appshow-layout { flex-direction: column; gap: var(--space-4); }
  .appshow-stack {
    order: 1;
    position: static;
    height: auto;
    flex: none;
    width: 100%;
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 14px 4px 22px;
    scrollbar-width: none;
  }
  .appshow-stack::-webkit-scrollbar { display: none; }
  .appshow-phone {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
    flex: 0 0 136px;
    height: 295px;
    scroll-snap-align: center;
    opacity: 0.55;
    transform: translateY(6px) scale(0.9);
    transition: opacity 450ms var(--ease-standard), transform 450ms cubic-bezier(0.19, 1, 0.22, 1);
  }
  .appshow-phone.is-active { opacity: 1; transform: translateY(0) scale(1); }
  .appshow-list { order: 2; }
  .item-desc { white-space: normal; }
  .item-detail { padding-inline-start: 0; }
  .item-detail p { max-width: none; }
}

@media (max-width: 480px) {
  .appshow { padding-block: var(--space-6); }
  .item-toggle { gap: 10px; padding: 14px 2px; }
  .item-icon { width: 38px; height: 38px; }
  .item-name { font-size: 15.5px; }
  .item-type { display: none; }
}
