:root {
    color-scheme: dark;
    --bg: #07070a;
    --surface: #101015;
    --surface-2: #17171e;
    --text: #ececf1;
    --muted: #9a9aa8;
    --red: #b3122a;
    --red-deep: #6e0010;
    --silver: #a7adb8;
    --border: #2a2a33;
}

body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 0;
    direction: rtl;
}

header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: bold; }

.brand-logo {
    height: 40px;
    width: auto;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: var(--text);
    text-decoration: none;
}

#menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

#menu {
    display: flex;
}

@media (max-width: 720px) {
    #menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    #menu.open {
        display: flex;
    }

    #menu-btn {
        display: block;
    }
}

#hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: none;
    padding: 50px 20px;
    background: radial-gradient(circle at 70% 50%, var(--red-deep), var(--bg) 65%);
    color: var(--text);
}
@media (min-width: 900px) {
    #hero { flex-direction: row; justify-content: center; gap: 40px; }
    .hero-text { text-align: right; }
    .hero-image { flex: 0 0 48%; margin-top: 0; }
}

.hero-text {
    text-align: center;
}

.hero-text h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.hero-text p {
    margin-bottom: 30px;
}

.hero-image {
    margin-top: 30px;
    text-align: center;
}

.hero-mascot {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 24px rgba(179, 18, 42, 0.45));
}

section { max-width: 1100px; margin: 0 auto; }
section h2 { text-align: center; font-size: 2em; margin: 0 0 30px; }
#products { padding: 50px 20px; }
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.card-icon { font-size: 2.4em; margin: 20px 20px 0; }
.card { padding-bottom: 10px; }

.card {
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
}

.card img {
    width: 100%;
    height: auto;
}

.card h3 {
    font-size: 1.2em;
    margin: 10px 20px;
}

.card p {
    margin: 10px 20px;
    color: var(--muted);
}

.card a {
    display: block;
    text-align: center;
    padding: 10px 20px;
    margin: 10px 20px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    color: var(--text);
    transition: background-color 0.2s, color 0.2s;
}

.btn-primary {
    background-color: var(--red);
    color: white;
}

.btn-primary:hover {
    background-color: var(--red-deep);
}

.btn-ghost {
    border: 2px solid var(--border);
    background-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--surface-2);
}

.faq-item {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.faq-q {
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-radius: 5px;
    padding: 10px 20px;
    width: 100%;
    text-align: right;
    font-size: 1em;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.2s;
}

.faq-q:hover {
    background-color: var(--surface-2);
}

.faq-a {
    display: none;
    padding: 10px 20px;
    background-color: var(--surface);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 5px 5px;
    color: var(--muted);
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.faq-item.open .faq-a {
    display: block;
    max-height: 1000px;
}

footer {
    padding: 20px;
    text-align: center;
    background-color: var(--surface);
    color: var(--text);
}

footer nav {
    margin-top: 10px;
}

footer nav a {
    color: var(--text);
    text-decoration: none;
    margin: 0 10px;
}

.featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 30px; align-items: center; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 30px; }
.featured-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-body { padding: 24px 28px; }
.featured-body h3 { font-size: 2em; margin: 10px 0; }
.featured-body p { color: var(--muted); line-height: 1.8; }
.badge { display: inline-block; background: var(--red-deep); color: var(--text); border: 1px solid var(--red); border-radius: 20px; padding: 2px 12px; font-size: 0.85em; }
.features { padding: 0 20px 0 0; margin: 14px 0 22px; line-height: 2; color: var(--text); }
@media (max-width: 720px) { .featured { grid-template-columns: 1fr; } .featured-body { padding: 18px; } }
.cards .card { display: flex; flex-direction: column; }
.cards .card p { flex: 1; }

#hero {
    background:
        linear-gradient(90deg, rgba(7,7,10,0.55) 0%, rgba(7,7,10,0.1) 55%, rgba(7,7,10,0.5) 100%),
        radial-gradient(circle at 70% 50%, rgba(110,0,16,0.55), rgba(7,7,10,0) 65%),
        linear-gradient(180deg, rgba(7,7,10,0) 80%, rgba(7,7,10,0.9) 100%);
}

.card-img { width: 100%; height: auto; display: block; }
.card-lite .badge { margin: 14px 20px 0; }
.badge-free { background: #0b3d91; border-color: #3b82f6; }
.card-lite .btn-ghost { border-color: #3b82f6; }
.card-lite .badge { align-self: flex-start; }

#utility { padding: 50px 20px; }
.utility-card { background: linear-gradient(135deg, var(--red-deep) -40%, var(--surface) 55%); border: 2px solid var(--border); border-radius: 14px; padding: 28px; max-width: 760px; margin: 0 auto; }
.utility-body h3 { font-size: 1.6em; margin: 12px 0; }
.utility-body p { color: var(--muted); line-height: 1.8; }
.utility-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 14px; }
.utility-version { color: var(--silver); }
.utility-note { font-size: 0.9em; margin: 0; }
#utility-download[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
#utility-download[aria-disabled="true"]:hover { background-color: var(--red); }
@media (max-width: 720px) { .utility-card { padding: 18px; } }

:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }

/* ===== أقسام جديدة ===== */
#how, #order { padding: 50px 20px; }

.steps { list-style: none; counter-reset: step; max-width: 760px; margin: 0 auto; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; background: var(--surface); border: 2px solid var(--border); border-radius: 10px; padding: 16px 68px 16px 18px; line-height: 1.8; min-width: 0; }
.steps li::before { content: counter(step); position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; background: var(--red-deep); border: 1px solid var(--red); display: grid; place-items: center; font-weight: 700; }
.steps strong { display: block; }
.steps span { color: var(--muted); }

.order-card { max-width: 760px; margin: 0 auto; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; padding: 28px; text-align: center; }
.order-card p { color: var(--muted); line-height: 1.8; margin: 0 0 18px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.order-empty { margin: 18px 0 0 !important; }

.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

footer .legal-nav a { color: var(--silver); font-size: 0.9em; }
footer .disclaimer { color: var(--muted); font-size: 0.8em; margin: 14px 0 0; }

/* ===== الصفحات القانونية ===== */
.legal-page header { justify-content: space-between; }
.legal { max-width: 760px; margin: 0 auto; padding: 40px max(16px, env(safe-area-inset-left, 0px)) 60px max(16px, env(safe-area-inset-right, 0px)); }
.legal h1 { font-size: 2em; margin: 0 0 6px; }
.legal .updated { color: var(--silver); margin: 0 0 28px; font-size: 0.9em; }
.legal h2 { text-align: right; font-size: 1.25em; margin: 28px 0 8px; color: var(--text); }
.legal p, .legal li { color: var(--muted); line-height: 2; }
.legal ul { padding: 0 20px 0 0; margin: 6px 0; }
.legal a { color: var(--silver); }
.legal .draft-note { background: var(--surface); border: 1px solid var(--red-deep); border-radius: 8px; padding: 10px 14px; color: var(--muted); font-size: 0.9em; }

body { padding-left: 0; padding-right: 0; }


/* ===== الخلفية المتحركة ===== */
#bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
section, footer { position: relative; z-index: 1; }
.card, .steps li, .order-card, .utility-card, .faq-q, .faq-a { backdrop-filter: blur(6px); }
.card, .steps li, .order-card, .faq-q, .faq-a { background-color: rgba(16, 16, 21, 0.86); }
footer { background-color: rgba(16, 16, 21, 0.92); }

.hero-mascot { animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }

/* ===== ظهور تدريجي عند التمرير ===== */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ===== سلايدر المنتجات ===== */
.slider { position: relative; margin-bottom: 36px; }
.track { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 14px 6px 26px; margin: 0 -6px; scrollbar-width: none; overscroll-behavior-x: contain; cursor: grab; -webkit-overflow-scrolling: touch; }
.track::-webkit-scrollbar { display: none; }
.track.dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; user-select: none; }
.track:focus-visible { outline-offset: -2px; }

.p-card { box-sizing: border-box; flex: 0 0 min(330px, 78%); scroll-snap-align: center; position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px; background: rgba(16, 16, 21, 0.86); backdrop-filter: blur(8px); border: 2px solid var(--border); border-radius: 14px; transition: transform 0.35s ease, border-color 0.35s, box-shadow 0.35s, opacity 0.35s; }
@media (min-width: 900px) { .p-card { flex-basis: calc((100% - 40px) / 3); } .p-card:hover { transform: translateY(-6px); border-color: var(--red); box-shadow: 0 12px 28px rgba(179, 18, 42, 0.28); } }
@media (max-width: 899px) { .p-card { opacity: 0.85; transform: scale(0.97); } .p-card.is-active { opacity: 1; transform: none; border-color: var(--red); } }
.p-card img { -webkit-user-drag: none; user-select: none; }
.p-card h3 { font-size: 1.35em; margin: 10px 0 6px; }
.p-card .badge { align-self: flex-start; }
.p-desc { color: var(--muted); line-height: 1.8; margin: 0 0 10px; flex: 1; }
.p-list { margin: 0 0 12px; padding: 0 18px 0 0; line-height: 1.9; font-size: 0.92em; color: var(--text); }
.p-card .btn { text-align: center; margin-top: auto; }

.p-visual { aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; margin-bottom: 14px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(110, 0, 16, 0.6), var(--surface-2) 72%); }
.p-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-visual svg { width: 42%; height: auto; color: var(--red); filter: drop-shadow(0 0 12px rgba(179, 18, 42, 0.75)); }
.p-visual-combo { display: flex; align-items: center; justify-content: center; gap: 6px; }
.p-visual-combo img { width: 54%; height: 100%; -webkit-mask-image: linear-gradient(to right, transparent, #000 30%); mask-image: linear-gradient(to right, transparent, #000 30%); }
.p-visual-combo svg { width: 26%; }
.plus { font-size: 1.8em; font-weight: 700; color: var(--silver); }

.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; margin: 4px 0 14px; }
.price { font-size: 1.9em; font-weight: 800; color: #fff; line-height: 1.1; }
.price small { font-size: 0.48em; font-weight: 600; color: var(--silver); margin-inline-start: 2px; }
.old { color: var(--muted); font-size: 0.95em; }
.save { background: rgba(179, 18, 42, 0.22); border: 1px solid var(--red); color: #ffa3b0; border-radius: 20px; padding: 1px 10px; font-size: 0.82em; }

.p-combo { border-color: var(--red); box-shadow: 0 0 0 1px rgba(179, 18, 42, 0.35), 0 14px 40px rgba(179, 18, 42, 0.25); animation: glow 3.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 1px rgba(179, 18, 42, 0.6), 0 14px 52px rgba(179, 18, 42, 0.45); } }
.ribbon { position: absolute; top: 12px; left: 12px; z-index: 2; background: linear-gradient(135deg, var(--red), var(--red-deep)); color: #fff; font-size: 0.82em; font-weight: 700; padding: 4px 12px; border-radius: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }

.slider-btn { position: absolute; top: 42%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; padding: 0 0 4px; border-radius: 50%; border: 1px solid var(--red); background: rgba(7, 7, 10, 0.85); color: var(--text); font-size: 28px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); transition: background-color 0.2s, opacity 0.2s; }
.slider-btn.prev { right: -10px; }
.slider-btn.next { left: -10px; }
.slider-btn:hover:not(:disabled) { background: var(--red); }
.slider-btn:disabled { opacity: 0.3; cursor: default; }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots button { position: relative; width: 9px; height: 9px; padding: 0; border: 0; border-radius: 99px; background: var(--border); cursor: pointer; transition: width 0.3s, background-color 0.3s; }
.dots button::after { content: ""; position: absolute; inset: -10px -4px; }
.dots button[aria-current="true"] { width: 26px; background: var(--red); }
.slider.no-scroll .slider-btn, .slider.no-scroll .dots { display: none; }
@media (max-width: 720px) { .slider-btn { display: none; } }

.order-card .order-selected { color: var(--text); background: var(--surface-2); border: 1px solid var(--red); border-radius: 8px; padding: 10px 14px; }

@media (prefers-reduced-motion: reduce) {
    .hero-mascot, .p-combo { animation: none; }
    .track { scroll-behavior: auto; }
}


/* ===== زر التحميل وطرق الدفع ===== */
.p-card .btn-dl { margin-top: 8px; }
.btn-dl[aria-disabled="true"] { border-style: dashed; }
.p-card .btn + .btn { margin-top: 8px; }

#payment { padding: 50px 20px; }
#payment[hidden] { display: none; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 900px; margin: 0 auto; }
.pay-card { background: rgba(16, 16, 21, 0.86); backdrop-filter: blur(6px); border: 2px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: border-color 0.3s, transform 0.3s; }
.pay-card:hover { border-color: var(--red); transform: translateY(-4px); }
.pay-card h3 { margin: 0; font-size: 1.15em; }
.pay-detail { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.pay-detail code { flex: 1; min-width: 0; direction: ltr; text-align: left; overflow-wrap: anywhere; color: var(--text); font-size: 0.95em; }
.pay-copy { background: none; border: 1px solid var(--red); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; font-size: 0.85em; }
.pay-copy:hover { background: var(--red); }
.pay-card p { margin: 0; color: var(--muted); font-size: 0.9em; line-height: 1.7; }
.pay-card .btn { text-align: center; }
.pay-note { text-align: center; color: var(--muted); margin: 22px auto 0; max-width: 640px; line-height: 1.8; }

.btn[hidden] { display: none; }
.p-card .btn-pay { border-color: #3b82f6; text-align: center; }
.p-card .btn-pay:hover { background-color: rgba(59, 130, 246, 0.15); }

/* سعر STC Pay */
.stc-price { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: -6px 0 14px; padding: 8px 12px; border: 1px dashed var(--red); border-radius: 10px; color: #ffa3b0; font-size: 0.9em; }
.stc-price b { color: #fff; font-size: 1.1em; white-space: nowrap; }

.stc-price em { font-style: normal; background: rgba(179,18,42,.25); border: 1px solid var(--red); border-radius: 20px; padding: 0 8px; font-size: .85em; white-space: nowrap; }
.stc-price span { flex: 1; }

/* نافذة اختيار طريقة الدفع */
body.modal-open { overflow: hidden; }
.pay-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: pmFade .2s ease; }
.pay-modal-box { position: relative; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; background: var(--surface); border: 2px solid var(--red); border-radius: 14px; padding: 22px 18px 18px; box-shadow: 0 0 40px rgba(179, 18, 42, 0.35); animation: pmUp .25s ease; }
.pay-modal-x { position: absolute; top: 8px; inset-inline-start: 10px; background: none; border: 0; color: var(--silver); font-size: 1.8em; line-height: 1; cursor: pointer; padding: 4px 10px; }
.pay-modal-title { margin: 0 0 6px; font-size: 1.15em; padding-inline-start: 32px; }
.pay-modal-meta { margin: 0 0 12px; color: var(--muted); font-size: 0.9em; }
.pay-modal-meta b { color: #fff; direction: ltr; unicode-bidi: isolate; }
.pay-modal-ask { margin: 0 0 8px; color: var(--silver); font-size: 0.9em; }
.pm-method { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; background: var(--surface-2); overflow: hidden; transition: border-color .2s; }
.pm-method.is-open { border-color: var(--red); }
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; box-sizing: border-box; padding: 14px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 700; text-align: start; cursor: pointer; text-decoration: none; }
.pm-head:disabled { cursor: not-allowed; opacity: 0.55; }
.pm-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pm-right b { color: #fff; font-size: 1.1em; }
.pm-right em { font-style: normal; background: rgba(179, 18, 42, 0.25); border: 1px solid var(--red); border-radius: 20px; padding: 0 8px; font-size: 0.8em; color: #ffa3b0; }
.pm-soon { color: var(--muted); font-size: 0.85em; font-weight: 600; }
.pm-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.pm-body p { margin: 0; color: var(--silver); font-size: 0.92em; }
.pm-body .btn { text-align: center; }
.pm-ask { display: block; text-align: center; color: var(--silver); font-size: 0.88em; margin-top: 4px; text-decoration: underline; }
@keyframes pmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pmUp { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pay-modal, .pay-modal-box { animation: none; } }
.pm-body .btn.is-locked { opacity: 0.45; cursor: not-allowed; pointer-events: auto; filter: grayscale(0.5); }
.pm-body[hidden] { display: none; }
