/* ==========================================================
   glass.css — طبقة التصميم الزجاجي ثلاثي الأبعاد (مثل نظام ERP)
   للرجوع للتصميم القديم: احذف سطر glass.css من index.html
   وأزل الكلاس glass من وسم body
   ========================================================== */
body.glass {
  --g-ease: cubic-bezier(.22, .9, .3, 1);
  --g-spring: cubic-bezier(.34, 1.56, .64, 1);
  --g-card: rgba(255, 255, 255, .62);
  --g-card-hi: rgba(255, 255, 255, .86);
  --g-line: rgba(255, 255, 255, .75);
  --g-shadow: 0 18px 40px -18px rgba(70, 30, 110, .35), 0 2px 0 rgba(255, 255, 255, .6) inset;
  --g-deep: linear-gradient(150deg, #3b1a6e 0%, #4a2090 55%, #5b2fb0 100%);
  --g-btn: linear-gradient(135deg, #6b2f9e, #8b4fd0);
  position: relative;
  background: #f4eefb;
  isolation: isolate;
  overflow-x: hidden;
}
body.glass::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 35% at 15% 15%, rgba(168, 120, 255, .38), transparent 70%),
    radial-gradient(35% 30% at 85% 20%, rgba(255, 150, 200, .32), transparent 70%),
    radial-gradient(45% 40% at 70% 85%, rgba(120, 140, 255, .28), transparent 70%),
    radial-gradient(30% 30% at 10% 80%, rgba(255, 190, 220, .3), transparent 70%);
  animation: g-aurora 26s ease-in-out infinite alternate;
}
@keyframes g-aurora { to { transform: translate3d(3%, -2%, 0) rotate(4deg) scale(1.06); } }

/* ---------- الهيدر العائم ---------- */
body.glass .site-header { top: 12px; background: transparent; border: 0; backdrop-filter: none; pointer-events: none; }
body.glass .site-header__inner {
  pointer-events: auto; height: 74px; padding-inline: .8rem 1rem; border-radius: 999px;
  background: var(--g-card); border: 1px solid var(--g-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: var(--g-shadow); transition: box-shadow .3s, background .3s;
}
body.glass .site-header.is-scrolled .site-header__inner { background: var(--g-card-hi); box-shadow: 0 22px 44px -16px rgba(70, 30, 110, .45); }
body.glass .brand img { width: auto; height: 62px; }
body.glass .nav { gap: .25rem; }
body.glass .nav a { padding: .45rem .95rem; border-radius: 999px; transition: background .25s, color .25s, transform .3s var(--g-spring); }
body.glass .nav a:hover { background: rgba(107, 47, 158, .12); color: var(--plum-600); transform: translateY(-1px); }

/* ---------- الأزرار ---------- */
body.glass .btn { position: relative; overflow: hidden; box-shadow: 0 10px 22px -10px rgba(40, 20, 80, .55), 0 1px 0 rgba(255, 255, 255, .4) inset; transition: transform .35s var(--g-spring), box-shadow .3s, background-color .2s, color .2s; }
body.glass .btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 28px -12px rgba(40, 20, 80, .6); }
body.glass .btn:active { transform: translateY(0) scale(.98); }
body.glass .btn--wa { background: linear-gradient(135deg, #12a35a, #0d7f46); }
body.glass .btn--wa:hover { background: linear-gradient(135deg, #14b265, #0e8f4f); }
body.glass .btn--ghost { background: var(--g-card); border-color: rgba(107, 47, 158, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
body.glass .btn--ghost:hover { background: var(--plum-600); }
.g-ripple { position: absolute; border-radius: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: rgba(255, 255, 255, .55); pointer-events: none; animation: g-rip .6s ease-out forwards; }
@keyframes g-rip { to { transform: scale(26); opacity: 0; } }

/* ---------- الهيرو ---------- */
body.glass .hero { background: transparent; padding-block: 1.5rem clamp(1.5rem, 4vw, 3rem); overflow: visible; }
body.glass .hero__grid {
  position: relative; isolation: isolate; overflow: hidden; padding: clamp(1.6rem, 4.5vw, 3.6rem);
  border-radius: 40px; background: var(--g-deep); color: #fff;
  box-shadow: 0 40px 70px -30px rgba(50, 20, 110, .7), 0 1px 0 rgba(255, 255, 255, .25) inset;
}
body.glass .hero__grid::before { content: ""; position: absolute; inset: -40% -10%; z-index: -2; pointer-events: none;
  background: radial-gradient(40% 40% at 80% 20%, rgba(255, 255, 255, .22), transparent 70%), radial-gradient(35% 35% at 10% 90%, rgba(255, 130, 200, .3), transparent 70%); }
body.glass .hero h1 { color: #fff; text-shadow: 0 6px 24px rgba(20, 5, 60, .4); }
body.glass .hero__lead { color: rgba(255, 255, 255, .85); }
body.glass .hero .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .12); }
body.glass .hero .btn--ghost:hover { background: #fff; color: var(--plum-800); }
body.glass .hero__media::before { background: linear-gradient(160deg, rgba(246, 211, 224, .55), rgba(159, 103, 184, .35)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.glass .hero__arch { box-shadow: 0 30px 50px -20px rgba(10, 0, 40, .7); }
body.glass .license-badge { background: var(--g-card-hi); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); color: var(--ink); border-radius: 18px; }
.hero__orbs { position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translate(calc(var(--hx, 0) * 18px), calc(var(--hy, 0) * 14px)); transition: transform .5s var(--g-ease); }
.hero__orbs i { position: absolute; border-radius: 50%; display: block; animation: g-float 9s ease-in-out infinite alternate; }
.hero__orbs i:nth-child(1) { width: 210px; height: 210px; inset-block-start: -70px; inset-inline-start: 38%; background: radial-gradient(circle at 32% 28%, #cbb0ff, #7c3cf0 55%, #3a1790); box-shadow: 0 30px 50px -10px rgba(20, 0, 70, .55); }
.hero__orbs i:nth-child(2) { width: 96px; height: 96px; inset-block-end: -28px; inset-inline-start: 46%; background: radial-gradient(circle at 32% 28%, #ffc2dc, #e0488f 60%, #8a1e5c); animation-duration: 11s; animation-delay: -3s; box-shadow: 0 20px 34px -8px rgba(60, 0, 40, .5); }
.hero__orbs i:nth-child(3) { width: 56px; height: 56px; inset-block-start: 7%; inset-inline-end: 1.5%; background: radial-gradient(circle at 32% 28%, #b9ffe2, #2fd391 60%, #0b7a52); animation-duration: 8s; animation-delay: -5s; }
@keyframes g-float { to { transform: translateY(-16px) rotate(8deg); } }

/* ---------- شريط الثقة ---------- */
body.glass .trust { background: transparent; color: var(--ink); }
body.glass .trust__list { padding-block: .5rem 1rem; gap: 1rem; }
body.glass .trust__list li { padding: 1rem 1.1rem; border-radius: 22px; background: var(--g-card); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--g-shadow); }
body.glass .trust__list svg { padding: .45rem; width: 2.4rem; height: 2.4rem; border-radius: 14px; color: #fff; background: var(--g-btn); box-shadow: 0 8px 14px -6px rgba(90, 40, 150, .6); }

/* ---------- الأقسام ---------- */
body.glass .section--lilac { background: transparent; }
body.glass .section--plum { background: transparent; color: #fff; }
body.glass .section--plum > .container {
  position: relative; padding: clamp(1.6rem, 4vw, 3rem); border-radius: 40px; background: var(--g-deep);
  box-shadow: 0 40px 70px -34px rgba(50, 20, 110, .7), 0 1px 0 rgba(255, 255, 255, .22) inset;
}
body.glass .section-title { background: linear-gradient(120deg, #2b1037, #6b2f9e); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.glass .section--plum .section-title { background: none; color: #fff; }

body.glass .dept__arch { border-radius: var(--radius-arch); box-shadow: 0 34px 50px -24px rgba(50, 20, 110, .6); border: 6px solid rgba(255, 255, 255, .75); }
body.glass .dept__media { perspective: 900px; }

/* ---------- بطاقات الخدمات (3D) ---------- */
body.glass .dept__list { display: grid; gap: .8rem; }
body.glass .service,
body.glass .service:last-child {
  --rx: 0; --ry: 0; --lift: 0px; position: relative; isolation: isolate; padding: 1rem 1.2rem; margin: 0;
  border: 1px solid var(--g-line); border-radius: 22px; background: var(--g-card);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--g-shadow);
  transform: perspective(900px) rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg)) translateY(var(--lift));
  transition: transform .5s var(--g-ease), box-shadow .35s, background .3s; will-change: transform;
}
body.glass .service.is-tilting { transition: transform .08s linear, box-shadow .35s; }
body.glass .service:hover { --lift: -4px; background: var(--g-card-hi); box-shadow: 0 28px 44px -20px rgba(70, 30, 110, .5), 0 2px 0 rgba(255, 255, 255, .7) inset; }
body.glass .service::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; opacity: 0; transition: opacity .3s; background: radial-gradient(220px 120px at calc(50% + var(--ry) * 4%) calc(50% - var(--rx) * 4%), rgba(160, 110, 255, .22), transparent 70%); }
body.glass .service:hover::before { opacity: 1; }
body.glass .service h3 { font-size: 1.15rem; color: var(--plum-900); }
body.glass .service__book { border: 0; color: #fff; padding: .5rem 1.3rem; background: var(--g-btn); box-shadow: 0 10px 18px -8px rgba(90, 40, 150, .7); transition: transform .35s var(--g-spring), box-shadow .3s; }
body.glass .service__book:hover { background: var(--g-btn); transform: translateY(-2px) scale(1.05); }
body.glass .service-group { padding: 1.1rem 1.2rem; border: 1px solid var(--g-line); border-radius: 22px; background: var(--g-card); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--g-shadow); }
body.glass .service-group:last-child { border-bottom: 1px solid var(--g-line); }
body.glass .service-group .service-list { display: grid; gap: .55rem; border-inline-start-color: rgba(159, 103, 184, .5); }
body.glass .service-group .service { background: rgba(255, 255, 255, .55); box-shadow: none; border-radius: 16px; }
body.glass .section--plum .service { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); box-shadow: 0 18px 34px -20px rgba(10, 0, 40, .7); }
body.glass .section--plum .service h3 { color: #fff; }
body.glass .section--plum .service:hover { background: rgba(255, 255, 255, .18); }
body.glass .section--plum .service__book { background: linear-gradient(135deg, #f6d3e0, #e9a9c9); color: var(--plum-900); }

/* ---------- المعرض ---------- */
body.glass .gallery__track { padding: 1rem .4rem 1.6rem; scrollbar-width: thin; }
body.glass .gallery__track figure { padding: .55rem .55rem .2rem; border-radius: 26px; background: var(--g-card); border: 1px solid var(--g-line); box-shadow: var(--g-shadow); transition: transform .5s var(--g-spring), box-shadow .3s; }
body.glass .gallery__track figure:hover { transform: translateY(-8px) rotate(-.6deg) scale(1.02); box-shadow: 0 34px 50px -22px rgba(70, 30, 110, .55); }
body.glass .gallery__track img { border-radius: 20px; }
body.glass .gallery__track figcaption { padding: .3rem .4rem .5rem; font-weight: 500; }

/* ---------- الأطباء ---------- */
body.glass .doctor { padding: 1rem; border-radius: 26px; background: var(--g-card); border: 1px solid var(--g-line); box-shadow: var(--g-shadow); }

/* ---------- قسم الرعاية الطبية المنزلية (hrc.sa) ---------- */
.care__head { max-width: 46rem; }
.care__grid, .why__grid { display: grid; gap: 1rem; margin-top: 2rem; grid-template-columns: repeat(3, 1fr); }
.card { --rx: 0; --ry: 0; --lift: 0px; position: relative; isolation: isolate; padding: 1.4rem 1.3rem; border-radius: 26px; }
.card h3 { font-size: 1.15rem; color: var(--plum-900); }
.card p { margin-top: .35rem; font-size: .97rem; color: var(--muted); line-height: 1.75; }
.card__icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: .9rem; border-radius: 18px; color: #fff; background: var(--g-btn); box-shadow: 0 14px 22px -10px rgba(90, 40, 150, .7), inset 0 2px 0 rgba(255, 255, 255, .45); }
.card__icon svg { width: 26px; height: 26px; }
.care__sub { margin-top: 2.6rem; font-size: 1.4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.chips li { display: contents; }
.chip { display: inline-block; padding: .5rem 1rem; border-radius: 999px; font-size: .97rem; font-weight: 500; }
.why__grid { grid-template-columns: repeat(4, 1fr); }
.why__grid .card { text-align: center; }
.why__grid .card__icon { margin-inline: auto; }
.care__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.company { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 2rem; margin-top: 2.2rem; padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: 30px; }
.company h3 { grid-column: 1 / -1; font-size: 1.35rem; }
.company dl { margin: 0; }
.company dt { font-family: var(--font-display); color: var(--plum-600); font-size: 1rem; }
.company dd { margin: .1rem 0 .9rem; overflow-wrap: anywhere; }
.company a { color: var(--plum-600); }
body.glass .card, body.glass .chip, body.glass .company {
  border: 1px solid var(--g-line); background: var(--g-card); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--g-shadow);
}
body.glass .card { transform: perspective(900px) rotateX(calc(var(--rx) * 1deg)) rotateY(calc(var(--ry) * 1deg)) translateY(var(--lift)); transition: transform .5s var(--g-ease), box-shadow .35s, background .3s; will-change: transform; }
body.glass .card.is-tilting { transition: transform .08s linear, box-shadow .35s; }
body.glass .card:hover { --lift: -5px; background: var(--g-card-hi); box-shadow: 0 30px 46px -20px rgba(70, 30, 110, .5), 0 2px 0 rgba(255, 255, 255, .7) inset; }
body.glass a.chip { text-decoration: none; color: var(--ink); } body.glass .chip { transition: transform .35s var(--g-spring), background .25s, color .25s; }
body.glass .chip:hover { transform: translateY(-3px) scale(1.05); background: var(--g-btn); color: #fff; }

/* ---------- التواصل والفوتر ---------- */
body.glass .contact { background: transparent; }
body.glass .contact__grid { padding: clamp(1.6rem, 4vw, 3rem); border-radius: 40px; background: var(--g-deep); box-shadow: 0 40px 70px -34px rgba(50, 20, 110, .7), 0 1px 0 rgba(255, 255, 255, .22) inset; }
body.glass .site-footer { background: transparent; color: var(--muted); }
body.glass .site-footer__inner { padding: 1rem 1.4rem; border-radius: 28px; background: var(--g-card); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* ---------- الظهور عند التمرير ---------- */
.js-reveal .reveal { opacity: 0; translate: 0 28px; scale: .97; transition: opacity .8s var(--g-ease) var(--d, 0s), translate .9s var(--g-ease) var(--d, 0s), scale .9s var(--g-ease) var(--d, 0s); }
.js-reveal .reveal[data-from="l"] { translate: -40px 10px; }
.js-reveal .reveal[data-from="r"] { translate: 40px 10px; }
.js-reveal .reveal.is-in { opacity: 1; translate: 0 0; scale: 1; }

/* ---------- الشريط السفلي للجوال ---------- */
.dock { display: none; }
body.glass .wa-float { box-shadow: 0 16px 30px -10px rgba(10, 100, 60, .6); animation: g-pulse 3.2s ease-in-out infinite; }
@keyframes g-pulse { 50% { box-shadow: 0 16px 30px -10px rgba(10, 100, 60, .6), 0 0 0 10px rgba(18, 163, 90, .14); } }

@media (max-width: 960px) {
  .care__grid { grid-template-columns: 1fr 1fr; }
  .why__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  body.glass { padding-bottom: 92px; }
  body.glass .site-header__inner { height: 66px; }
  body.glass .brand img { height: 54px; }
  body.glass .nav { top: 82px; inset-inline: .75rem; border-radius: 24px; background: var(--g-card-hi); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: var(--g-shadow); }
  body.glass .nav a { border-radius: 14px; border-bottom: 0; }
  body.glass .menu-toggle { background: var(--g-card); border-radius: 999px; }
  body.glass .wa-float { display: none; }
  body.glass .hero__grid { border-radius: 30px; }
  .company { grid-template-columns: 1fr; }
  .dock {
    position: fixed; z-index: 70; inset-inline: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-around;
    height: 68px; padding-inline: .4rem; border-radius: 34px; background: rgba(255, 255, 255, .7);
    border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(24px) saturate(1.5); backdrop-filter: blur(24px) saturate(1.5); box-shadow: 0 24px 40px -16px rgba(50, 20, 110, .55);
  }
  .dock a { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 56px; padding: .35rem .2rem; font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: transform .35s var(--g-spring), color .25s; }
  .dock a:active { transform: scale(.92); }
  .dock a.is-active { color: var(--plum-600); }
  .dock svg { width: 23px; height: 23px; }
  .dock .dock__wa { margin-top: -26px; width: 62px; height: 62px; padding: 0; place-content: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #14b265, #0d7f46); border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 16px 24px -8px rgba(10, 100, 60, .7); }
  .dock .dock__wa svg { width: 28px; height: 28px; }
}
@media (max-width: 520px) {
  .care__grid, .why__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  body.glass::before, .hero__orbs i, body.glass .wa-float { animation: none !important; }
  .js-reveal .reveal { opacity: 1; translate: none; scale: none; }
}
@media (hover: none) { body.glass .service, body.glass .card { transform: none; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body.glass { --g-card: rgba(255, 255, 255, .92); }
  body.glass .dock { background: rgba(255, 255, 255, .97); }
}
@media print { body.glass::before, .dock, .hero__orbs, .wa-float { display: none !important; } }
@media (max-width: 860px) { .hero__orbs i:nth-child(3) { display: none; } .hero__orbs i:nth-child(1) { width: 150px; height: 150px; } }
