/* ════════════════════════════════════════════════════════════════════════
 * 🟣 [Hubs+RX 2026-06-30] — تجربة الطلب الجديدة بالصور (طبقة 103)
 * ────────────────────────────────────────────────────────────────────────
 * الغرض:
 *   تنسيق سينمائي بنفسجي/ذهبي لشاشة «الطلب» الجديدة: هيرو بصورة، بطاقتا
 *   اختيار كبيرتان بصور غلاف، وورقة تأكيد/دفع سفلية (Bottom Sheet) أنيقة.
 *
 * مبادئ:
 *   • تدرّج آمن: كل صورة لها fallback (تدرّج بنفسجي + أيقونة) عبر .rx-noimg.
 *   • تجربة موحّدة 360→1024: dvh/svh + safe-area + أهداف لمس ≥44px.
 *   • سرعة: حركات دخول خفيفة فقط (≤200ms) + احترام prefers-reduced-motion.
 *
 * تُحمَّل بعد 102 لتغلب بنظافة. للإزالة: احذف <link> هذا + الملف.
 * ════════════════════════════════════════════════════════════════════════ */

/* متغيّرات محليّة (هوية بنفسجي/ذهبي) */
:root {
  --rx-gold: #fbbf24;
  --rx-gold-deep: #d97706;
  --rx-violet: #a855f7;
  --rx-violet-deep: #4c1d95;
}

/* ════════ (1) الهيرو ════════ */
.rx-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 150px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #2a1259 0%, var(--rx-violet-deep) 55%, #1a0d33 100%);
  isolation: isolate;
}
.rx-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: .92;
}
.rx-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* RTL: تعتيم أقوى من جهة البداية (يمين) لقراءة النص */
  background:
    linear-gradient(to left, rgba(15,8,30,0) 30%, rgba(20,8,40,.62) 100%),
    linear-gradient(to top, rgba(12,6,26,.70) 0%, rgba(12,6,26,0) 60%);
}
.rx-hero-content {
  position: relative;
  z-index: 2;
  padding: 26px 22px;
  text-align: right;
}
.rx-hero-title {
  margin: 0 0 6px;
  font-size: clamp(1.3rem, 1rem + 1.8vw, 1.8rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.rx-hero-desc {
  margin: 0;
  font-size: clamp(.85rem, .78rem + .5vw, 1rem);
  color: #ecdcff;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

/* ════════ (2) المربعان الكبيران ════════ */
.rx-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 560px) {
  .rx-choice-grid { grid-template-columns: 1fr; }
}
.rx-choice-card {
  position: relative;
  display: block;
  width: 100%;
  min-height: 168px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: right;
  background: linear-gradient(135deg, #241046 0%, var(--rx-violet-deep) 100%);
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
}
.rx-choice-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* fallback: تدرّج بنفسجي يظهر تحت الصورة وعند فشلها */
  background: linear-gradient(135deg, #2a1259 0%, var(--rx-violet-deep) 60%, #1a0d33 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rx-choice-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.rx-choice-fallback {
  position: relative;
  z-index: 0;
  font-size: 3rem;
  color: rgba(251,191,36,.85);
  opacity: 0;            /* مخفي افتراضياً — يظهر فقط عند .rx-noimg */
}
.rx-choice-media.rx-noimg .rx-choice-fallback { opacity: 1; }
.rx-choice-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top, rgba(10,5,22,.85) 0%, rgba(10,5,22,.15) 55%, rgba(10,5,22,.05) 100%),
    linear-gradient(to left, rgba(10,5,22,0) 45%, rgba(10,5,22,.45) 100%);
}
.rx-choice-body {
  position: absolute;
  z-index: 3;
  right: 16px;
  left: 16px;
  bottom: 14px;
  text-align: right;
}
.rx-choice-title {
  margin: 0 0 4px;
  font-size: clamp(1.05rem, .95rem + .6vw, 1.25rem);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.rx-choice-desc {
  margin: 0;
  font-size: .8rem;
  line-height: 1.5;
  color: #e7d8ff;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.rx-choice-arrow {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;          /* RTL: الزاوية الخلفية */
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(251,191,36,.18);
  border: 1px solid rgba(251,191,36,.45);
  color: var(--rx-gold);
  font-size: .85rem;
}
.rx-choice-card:hover { border-color: rgba(168,85,247,.55); }
.rx-choice-card:active { transform: scale(.985); }

/* ════════ (3) ورقة التأكيد/الدفع السفلية ════════ */
.rx-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(8,4,18,.55);
  opacity: 0;
  transition: opacity .16s ease;
}
.rx-confirm-overlay.rx-open { opacity: 1; }
.rx-confirm-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  transform: translateY(12px);
  transition: transform .18s ease;
  text-align: center;
  max-height: 88svh;
  overflow-y: auto;
}
.rx-confirm-overlay.rx-open .rx-confirm-sheet { transform: translateY(0); }
.rx-confirm-grip {
  width: 42px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-color);
  margin: 0 auto 14px;
}
.rx-confirm-illus {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 4px auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rx-confirm-illus img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}
.rx-illus-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: var(--rx-gold);
  opacity: 0;
}
.rx-confirm-illus.rx-noimg .rx-illus-fallback { opacity: 1; }
.rx-confirm-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}
.rx-confirm-sub {
  margin: 0 0 6px;
  font-size: .9rem;
  color: var(--text-secondary);
}
.rx-confirm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 10px 0 18px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
}
.rx-confirm-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.rx-confirm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rx-confirm-item-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}
.rx-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rx-btn {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: .98rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.rx-btn-primary {
  color: #1a0d33;
  background: linear-gradient(135deg, var(--rx-gold) 0%, var(--rx-gold-deep) 100%);
  box-shadow: 0 6px 18px rgba(217,119,6,.28);
}
.rx-btn-primary:active { transform: scale(.985); }
.rx-btn-secondary {
  color: var(--text-primary);
  background: transparent;
  border-color: var(--primary);
}
.rx-btn-secondary:active { transform: scale(.985); }
.rx-btn-ghost {
  color: var(--text-secondary);
  background: transparent;
  border-color: transparent;
  min-height: 44px;
}
.rx-confirm-success { padding: 6px 0 4px; }

/* ════════ (4) تنقّل الهيدر: الرئيسية الداخلية + الواجهة الأساسية ════════ */
.rx-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rx-nav-home,
.rx-nav-landing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
  background: rgba(168,85,247,.10);
  border: 1px solid rgba(168,85,247,.22);
  -webkit-tap-highlight-color: transparent;
}
.rx-nav-home {
  width: 36px;
  justify-content: center;
  padding: 0;
  font-size: .85rem;
}
.rx-nav-landing { padding: 0 12px; }
.rx-nav-home:active,
.rx-nav-landing:active { transform: scale(.94); }
.rx-nav-home:hover,
.rx-nav-landing:hover { border-color: var(--primary); }

/* الثيم الفاتح: لمسة بنفسجية واضحة */
:root[data-theme="light"] .rx-nav-home,
:root[data-theme="light"] .rx-nav-landing {
  background: rgba(124,58,237,.08);
  border-color: rgba(124,58,237,.28);
  color: #7c3aed;
}

/* تجاوب: على الشاشات الضيّقة نطوي نص «الواجهة الأساسية» إلى أيقونة فقط */
@media (max-width: 480px) {
  .rx-nav-landing span { display: none; }
  .rx-nav-landing { width: 36px; justify-content: center; padding: 0; }
}

/* ════════ احترام تقليل الحركة ════════ */
@media (prefers-reduced-motion: reduce) {
  .rx-confirm-overlay,
  .rx-confirm-sheet { transition: none !important; }
  .rx-choice-card:active,
  .rx-btn:active,
  .rx-nav-home:active,
  .rx-nav-landing:active { transform: none !important; }
}
