/* ==========================================================================
   السلايدر الرئيسي v2 — assets/slider.css
   الترميز (slider_layout.php):
     section.hs.hs--{slide|fade|kenburns}[.is-paused][.is-dragging] > .hs-viewport > .hs-track > article.hs-slide[.is-active]
       .hs-cover (رابط يغطي السلايد كله)  .hs-media (picture/img أو video)  .hs-overlay  .hs-content--{right|center|left} > .hs-box | .hs-product
     .hs-arrow--prev/--next  .hs-progress > i  .hs-dots > button[.is-active]
   يُستخدم نفس الملف في معاينة الإدارة (manage_slider.php) لضمان تطابق الشكل.
   ========================================================================== */
.hs { --hs-h: 450px; --hs-int: 7s; --hs-radius: 14px; position: relative; margin: 18px 15px 36px; border-radius: var(--hs-radius); background: #0b0f19; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28); -webkit-user-select: none; user-select: none; }
@media (min-width: 1230px) { .hs { max-width: 1200px; margin-left: auto; margin-right: auto; } }
.hs-viewport { position: relative; overflow: hidden; border-radius: var(--hs-radius); height: var(--hs-h); touch-action: pan-y; outline: none; isolation: isolate; }
.hs-viewport:focus-visible { box-shadow: 0 0 0 3px var(--accent, #ffcc00); }
@media (max-width: 767px) { .hs { margin: 12px 10px 26px; --hs-radius: 12px; } .hs-viewport { height: auto; aspect-ratio: 16 / 9; } }

/* المسار */
.hs-track { display: flex; height: 100%; will-change: transform; }
.hs--slide .hs-track { transition: transform .62s cubic-bezier(.22, .61, .36, 1); }
.hs.is-dragging .hs-track, .hs.no-anim .hs-track { transition: none !important; }
.hs-slide { position: relative; flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden; background: #0b0f19; }
/* التلاشي: الشرائح فوق بعضها */
.hs--fade .hs-track, .hs--kenburns .hs-track { display: block; position: relative; }
.hs--fade .hs-slide, .hs--kenburns .hs-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.hs--fade .hs-slide.is-active, .hs--kenburns .hs-slide.is-active { opacity: 1; z-index: 1; pointer-events: auto; }
.hs--kenburns .hs-slide.is-active .hs-media img { animation: hsKenBurns calc(var(--hs-int) + 1.5s) ease-out forwards; }
@keyframes hsKenBurns { from { transform: scale(1); } to { transform: scale(1.08); } }

/* الوسائط */
.hs-media { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hs-media img, video.hs-media { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; pointer-events: none; }
.hs-cover { position: absolute; inset: 0; z-index: 2; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.hs-overlay { position: absolute; inset: 0; z-index: 1; background: rgba(0, 0, 0, var(--hs-ov, .1)); pointer-events: none; }
/* تدرّج خفيف أسفل الصورة حتى تُقرأ النقاط دائماً */
.hs-overlay::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26%; background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent); }

/* المحتوى */
.hs-content { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; padding: 20px 64px; pointer-events: none; box-sizing: border-box; }
.hs-content--center { justify-content: center; text-align: center; }
.hs-content--right { justify-content: flex-start; text-align: right; }
.hs-content--left { justify-content: flex-end; text-align: left; }
@media (max-width: 767px) { .hs-content { padding: 14px 16px 30px; } }
.hs-box { pointer-events: none; max-width: min(88%, 580px); background: rgba(11, 15, 25, 0.34); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 16px; padding: 22px 30px; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); }
.hs-content--center .hs-box { margin: 0 auto; }
.hs-slide.is-active .hs-box, .hs-slide.is-active .hs-product { animation: hsUp .7s cubic-bezier(.25, .8, .25, 1) both; }
@keyframes hsUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.hs-title { color: #fff; font-size: clamp(20px, 3.6vw, 34px); font-weight: 900; line-height: 1.3; margin: 0 0 8px; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.hs-sub { color: #e2e8f0; font-size: clamp(13px, 1.8vw, 16px); line-height: 1.7; margin: 0; max-width: 560px; }
.hs-content--center .hs-sub { margin-inline: auto; }
@media (max-width: 767px) { .hs-box { padding: 14px 16px; max-width: 92%; border-radius: 12px; } .hs-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }

/* الأزرار */
.hs-btn { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; padding: 10px 24px; border-radius: 999px; font-weight: 800; font-size: 14px; text-decoration: none; border: 2px solid transparent; transition: transform .2s, box-shadow .2s, background .2s; cursor: pointer; font-family: inherit; }
.hs-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.hs-btn--yellow { background: var(--accent, #ffcc00); color: #000 !important; }
.hs-btn--white { background: #fff; color: #000 !important; }
.hs-btn--outline { background: transparent; border-color: #fff; color: #fff !important; }
.hs-btn--dark { background: #0b0f19; color: #fff !important; border-color: rgba(255, 255, 255, .25); }
.hs-btn--red { background: #ef4444; color: #fff !important; }
.hs-btn--green { background: #10b981; color: #fff !important; }
@media (max-width: 767px) { .hs-btn { padding: 8px 18px; font-size: 13px; margin-top: 10px; } }

/* العدّاد التنازلي */
.hs-count { display: inline-flex; gap: 6px; direction: ltr; margin: 12px 0 0; pointer-events: none; }
.hs-count__u { min-width: 50px; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; padding: 5px 4px; text-align: center; }
.hs-count__u b { display: block; color: var(--accent, #ffcc00); font-size: 20px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hs-count__u small { display: block; color: #cbd5e1; font-size: 10px; margin-top: 2px; }
.hs-count.is-over { display: inline-block; background: rgba(239, 68, 68, .2); border: 1px solid rgba(239, 68, 68, .5); color: #fecaca; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 800; }
@media (max-width: 767px) { .hs-count__u { min-width: 42px; padding: 4px 2px; } .hs-count__u b { font-size: 16px; } }

/* سلايد المنتج */
.hs-product { pointer-events: auto; display: flex; align-items: center; gap: 16px; max-width: 540px; background: rgba(11, 15, 25, 0.74); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 18px; padding: 16px 18px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); text-align: right; }
.hs-content--center .hs-product { margin: 0 auto; }
.hs-product__img { flex: 0 0 118px; width: 118px; height: 118px; border-radius: 14px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hs-product__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hs-product__info { min-width: 0; flex: 1; }
.hs-product__tag { display: inline-flex; align-items: center; gap: 5px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.hs-product__tag--out { background: #64748b; }
.hs-product__title { color: #fff; font-size: clamp(15px, 2.2vw, 20px); font-weight: 900; margin: 0 0 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hs-product__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hs-price__now { color: var(--accent, #ffcc00); font-size: clamp(17px, 2.4vw, 22px); font-weight: 900; }
.hs-price__old { color: #94a3b8; text-decoration: line-through; font-size: 13px; }
.hs-product__unit { color: #94a3b8; font-size: 12px; }
.hs-product__login { color: #cbd5e1; font-size: 13px; }
.hs-product__login a { color: var(--accent, #ffcc00); font-weight: 800; }
.hs-product__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.hs-product__actions .hs-btn { margin-top: 0; padding: 8px 18px; font-size: 13px; }
.hs-product__actions form { display: inline-flex; margin: 0; }
@media (max-width: 767px) {
    .hs-product { gap: 10px; padding: 8px 10px; border-radius: 12px; max-width: 94%; }
    .hs-product__img { flex-basis: 68px; width: 68px; height: 68px; border-radius: 10px; }
    .hs-product__tag { font-size: 10px; padding: 1px 8px; margin-bottom: 3px; }
    .hs-product__title { font-size: 13.5px; -webkit-line-clamp: 1; margin-bottom: 2px; }
    .hs-price__now { font-size: 15px; } .hs-price__old { font-size: 11px; } .hs-product__unit { font-size: 11px; }
    .hs-product .hs-sub, .hs-product .hs-count { display: none; }
    .hs-product__actions { margin-top: 5px; flex-wrap: nowrap; }
    .hs-product__actions .hs-btn { padding: 5px 11px; font-size: 11.5px; white-space: nowrap; }
    .hs-product__actions .hs-btn--outline { padding-inline: 9px; }
}

/* الأسهم */
.hs-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .12); background: rgba(11, 15, 25, .72); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; transition: background .25s, color .25s, transform .25s, opacity .25s; box-shadow: 0 5px 15px rgba(0, 0, 0, .25); -webkit-tap-highlight-color: transparent; }
.hs-arrow:hover { background: var(--accent, #ffcc00); color: #000; transform: translateY(-50%) scale(1.08); }
.hs-arrow--prev { right: 14px; }
.hs-arrow--next { left: 14px; }
@media (max-width: 767px) { .hs-arrow { width: 34px; height: 34px; font-size: 12px; opacity: .85; } .hs-arrow--prev { right: 8px; } .hs-arrow--next { left: 8px; } }
@media (max-width: 480px) { .hs-arrow { display: none; } }

/* النقاط وشريط التقدّم */
.hs-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 6; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.hs-dots button { pointer-events: auto; width: 8px; height: 8px; padding: 0; border-radius: 999px; border: none; background: rgba(255, 255, 255, .45); cursor: pointer; transition: width .3s, background .3s; -webkit-tap-highlight-color: transparent; }
.hs-dots button.is-active { width: 24px; background: var(--accent, #ffcc00); }
.hs-dots button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.hs-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 6; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hs-progress i { display: block; height: 100%; width: 0; background: var(--accent, #ffcc00); }
.hs-progress.is-run i { animation: hsProgress var(--hs-int) linear forwards; }
.hs.is-paused .hs-progress i { animation-play-state: paused; }
@keyframes hsProgress { from { width: 0; } to { width: 100%; } }

/* سلايد واحد فقط: لا أسهم ولا نقاط */
.hs--single .hs-arrow, .hs--single .hs-dots, .hs--single .hs-progress { display: none; }

@media (prefers-reduced-motion: reduce) {
    .hs--slide .hs-track { transition: none; }
    .hs-slide.is-active .hs-box, .hs-slide.is-active .hs-product, .hs--kenburns .hs-slide.is-active .hs-media img { animation: none; }
    .hs-progress { display: none; }
}
