
  /* ===================== PDX Loader ===================== */
  #pdx-loader {
    --pdx-blue: #3b5bff;
    --pdx-gold: #ffcf7a;
    --pdx-bg: #05060a;
  }
  

  #pdx-loader {
    position: fixed; inset: 0; z-index: 99999;
    background: var(--pdx-bg);
    overflow: hidden;
    display: grid; place-items: center;
    transition: opacity .9s ease, visibility .9s ease;
  }
  #pdx-loader.is-done { opacity: 0; visibility: hidden; }

  /* المسرح بنفس نسبة الصورة، ويغطي الشاشة كاملة مثل object-fit: cover
     حتى تبقى إحداثيات المناطق (clip-path) مطابقة للصورة */
  .pdx-stage {
    position: absolute; left: 50%; top: 50%;
    width: max(100vw, 177.7vh);
    aspect-ratio: 1672 / 941;
    transform: translate(-50%, -50%) scale(1.04);
    animation: pdx-zoom 6.5s cubic-bezier(.2,.6,.2,1) forwards;
  }
  @keyframes pdx-zoom { to { transform: translate(-50%, -50%) scale(1); } }

  .pdx-layer {
    position: absolute; inset: 0;
    background: url("../images/loader/storefront.webp") center / 100% 100% no-repeat;
  }
  /* fallback للمتصفحات القديمة */
  @supports not (background-image: url("x.webp")) {
    .pdx-layer { background-image: url("../images/loader/storefront.jpg"); }
  }

  /* الطبقة المطفية */
  .pdx-off {
    filter: brightness(.13) saturate(.35) contrast(1.1);
  }

  /* الطبقات المضاءة — كل وحدة جزء من الواجهة */
  .pdx-on { opacity: 0; }

  .pdx-spots  { clip-path: polygon(0 0, 100% 0, 100% 16%, 0 16%); }
  .pdx-led-l  { clip-path: inset(9% 64.9% 15% 33.4%); }
  .pdx-led-r  { clip-path: inset(9% 33.6% 15% 64.6%); }
  .pdx-sign   { clip-path: inset(8.5% 38.3% 58.6% 38.3%); }
  .pdx-left   { clip-path: inset(15.5% 69.8% 19% 5.4%); }
  .pdx-door   { clip-path: inset(41.5% 38.6% 19% 38.6%); }
  .pdx-right  { clip-path: inset(15% 4.6% 19% 69.6%); }
  .pdx-full   { }

  /* التسلسل الزمني */
  .pdx-spots { animation: pdx-flicker-soft .7s ease-out .6s forwards; }
  .pdx-led-l { animation: pdx-flicker-soft .8s ease-out 1.3s forwards; }
  .pdx-led-r { animation: pdx-flicker-soft .8s ease-out 1.5s forwards; }
  .pdx-sign  { animation: pdx-neon 1.2s linear 2.0s forwards; }
  .pdx-left  { animation: pdx-fade .7s ease-out 3.1s forwards; }
  .pdx-door  { animation: pdx-fade .7s ease-out 3.55s forwards; }
  .pdx-right { animation: pdx-fade .7s ease-out 4.0s forwards; }
  .pdx-full  { animation: pdx-fade 1.1s ease-out 4.6s forwards; }

  @keyframes pdx-fade { to { opacity: 1; } }
  @keyframes pdx-flicker-soft {
    0% { opacity: 0 } 20% { opacity: .8 } 30% { opacity: .2 }
    45% { opacity: .9 } 55% { opacity: .5 } 100% { opacity: 1 }
  }
  /* رجفة نيون للافتة */
  @keyframes pdx-neon {
    0%   { opacity: 0 }
    8%   { opacity: 1 }  10% { opacity: 0 }
    22%  { opacity: 0 }  24% { opacity: 1 } 27% { opacity: .1 }
    40%  { opacity: .1 } 42% { opacity: 1 } 46% { opacity: .4 }
    52%  { opacity: 1 }  100% { opacity: 1 }
  }

  /* توهج أزرق خلف اللافتة لحظة الإضاءة */
  .pdx-glow {
    position: absolute; left: 38%; top: 6%; width: 24%; height: 38%;
    background: radial-gradient(ellipse at center, rgba(59,91,255,.45), transparent 65%);
    filter: blur(20px); opacity: 0; mix-blend-mode: screen;
    animation: pdx-glow 2.4s ease-out 2.6s forwards;
  }
  @keyframes pdx-glow { 0% { opacity: 0 } 30% { opacity: 1 } 100% { opacity: .35 } }

  /* تظليل الأطراف */
  .pdx-vignette {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65) 100%);
  }

  /* شريط التحميل */
  .pdx-ui {
    position: absolute; bottom: clamp(24px, 6vh, 56px); left: 50%;
    transform: translateX(-50%);
    width: min(320px, 70vw);
    text-align: center;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: rgba(255,255,255,.75);
    letter-spacing: .25em; font-size: 11px;
    z-index: 2;
  }
  .pdx-bar {
    height: 2px; margin-top: 10px; border-radius: 2px;
    background: rgba(255,255,255,.12); overflow: hidden;
  }
  .pdx-bar > i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--pdx-blue), var(--pdx-gold));
    box-shadow: 0 0 10px var(--pdx-blue);
    transition: width .3s ease;
  }

  @media (prefers-reduced-motion: reduce) {
    .pdx-on, .pdx-glow, .pdx-stage { animation-duration: .01s !important; animation-delay: 0s !important; }
  }

#pdx-loader { display:none; }
html.pdx-loading #pdx-loader { display:grid; }
html.pdx-loading { overflow:hidden; }
html.pdx-loading #storefront-content { visibility:hidden; }
@media(prefers-reduced-motion:reduce){#pdx-loader{transition:none}}
