/* ==========================================================================
   SamiLink - تصميم عالمي حديث، يبدأ من شاشات الجوال
   ========================================================================== */

/* ---------- Fonts: El Messiri ---------- */
@font-face {
    font-family: 'El Messiri';
    src: url("/static/fonts/ElMessiri-Regular.69c3a9e2727c.ttf") format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'El Messiri';
    src: url("/static/fonts/ElMessiri-Medium.2469d84958e4.ttf") format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'El Messiri';
    src: url("/static/fonts/ElMessiri-SemiBold.39d2d21e4ce5.ttf") format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'El Messiri';
    src: url("/static/fonts/ElMessiri-Bold.865a8ff50162.ttf") format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root,
html {
    color-scheme: only light;
}

:root {
    --brand: #7042F4;
    --brand-700: #4B28B8;
    --brand-50: #F2EDFF;
    --accent: var(--brand);

    --ink: #0B1220;
    --ink-2: #1F2937;
    --muted: #6B7280;
    --line: #E5E7EB;
    --text: var(--ink);
    --text-muted: var(--muted);
    --border: var(--line);

    --bg: #FAFAF7;
    --surface: #FFFFFF;
    --surface-2: #F5F5F0;
    --surface-soft: var(--surface-2);

    --success: #047857;
    --success-50: #ECFDF5;
    --danger: #B91C1C;
    --danger-50: #FEF2F2;

    --primary: var(--brand);
    --primary-light: var(--brand-50);

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;

    --shadow-1: 0 1px 2px rgba(11, 18, 32, .04), 0 2px 8px rgba(11, 18, 32, .04);
    --shadow-2: 0 4px 14px rgba(11, 18, 32, .08), 0 2px 6px rgba(11, 18, 32, .04);
    --shadow-3: 0 24px 50px rgba(11, 18, 32, .14);

    --container: min(1200px, calc(100% - 32px));
    --bottom-nav-h: 72px;
    --top-nav-h: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --fixed-viewport-nudge: 0px;

    --easing: cubic-bezier(.2, .8, .2, 1);
}

/* iOS/WKWebView can retain a keyboard-sized bottom inset after the keyboard
   closes. Keep the real home-indicator allowance, but never let that browser
   bug turn it into hundreds of pixels of empty space. */
@supports (-webkit-touch-callout: none) {
    :root {
        --safe-area-bottom: min(env(safe-area-inset-bottom, 0px), 36px);
    }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: 'El Messiri', 'Segoe UI', Tahoma, sans-serif;
    font-weight: 500;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.7;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-area-bottom));
    overflow-x: clip;
}

img,
video,
svg {
    max-width: 100%;
    display: block;
}

iframe,
canvas {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5 {
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    margin: 0;
}

p {
    margin: 0;
}

.container {
    width: var(--container);
    margin-inline: auto;
}

main {
    width: 100%;
    overflow-x: clip;
}

main :where(pre) {
    max-width: 100%;
    overflow-x: auto;
}

main :where(img, video, svg, iframe, canvas) {
    max-width: 100%;
    height: auto;
}

main :where(p, li, dd, dt, span, strong, small, h1, h2, h3, h4, h5, a) {
    overflow-wrap: anywhere;
}

main :where(.course-room, .watch-room, .library, .catalog, .orders-page, .dp, .status-page, .order-page, .course-page, .legal-page, .status) {
    width: min(100%, var(--container));
    max-width: 100%;
}

/* ---------- Top nav (desktop only) ---------- */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
    height: var(--top-nav-h);
    display: none;
    align-items: center;
}

.site-nav .nav-shell {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--ink);
    font-size: 1.05rem;
}

.nav-brand .nav-logo-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand), var(--brand-700));
    color: #fff;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 6px 16px rgba(112, 66, 244, .35);
}

.nav-logo-img {
    height: 44px;
    width: 150px;
    display: block;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.site-nav .nav-brand,
.drawer .nav-brand {
    padding: 6px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #201354, #4B28B8);
    box-shadow: 0 8px 20px rgba(32, 19, 84, .18);
}

.nav-brand:hover .nav-logo-img {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(112, 66, 244, .25);
}

.drawer .nav-logo-img {
    height: 40px;
    width: 138px;
    border-radius: 0;
}

.footer-logo-img {
    height: 48px;
    width: 258px;
    display: block;
    margin-bottom: 14px;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.footer-logo-img:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .42);
}

@media (max-width: 600px) {
    .nav-logo-img {
        height: 40px;
        width: 136px;
        border-radius: 0;
    }

    .site-nav .nav-brand,
    .drawer .nav-brand {
        padding: 5px 8px;
        border-radius: 10px;
    }

    .footer-logo-img {
        height: 42px;
        width: 226px;
        border-radius: 0;
    }
}

.nav-brand small {
    display: block;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 500;
    margin-top: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .92rem;
    color: var(--ink-2);
    transition: background .15s ease, color .15s ease;
}

.nav-logout-form,
.drawer-logout-form {
    margin: 0;
}

.nav-logout-form button {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.drawer-logout-form button {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: start;
}

.nav-links a:hover {
    background: var(--surface-2);
    color: var(--brand-700);
}

.nav-links .nav-cta {
    background: var(--brand-700);
    color: #fff;
    padding: 9px 18px;
}

.nav-links .nav-cta:hover {
    background: var(--brand);
    color: #fff;
}

@media (min-width: 880px) {
    .site-nav {
        display: flex;
    }

    body {
        padding-bottom: 0;
    }
}

/* ---------- Mobile bottom nav ---------- */
.bottom-nav {
    position: fixed;
    inset-inline: 0;
    top: auto;
    bottom: var(--fixed-viewport-nudge);
    z-index: 60;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(160%) blur(16px);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--line);
    height: calc(var(--bottom-nav-h) + var(--safe-area-bottom));
    padding: 0 max(4px, env(safe-area-inset-right)) var(--safe-area-bottom) max(4px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 100%;
    max-width: 100vw;
    isolation: isolate;
    overscroll-behavior: contain;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    contain: layout paint;
    will-change: transform;
}

.bottom-nav a,
.bottom-nav button {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    display: grid;
    grid-template-rows: 24px 18px;
    align-content: center;
    justify-items: center;
    gap: 4px;
    min-width: 0;
    min-height: var(--bottom-nav-h);
    padding: 7px 3px;
    color: var(--muted);
    font: inherit;
    font-weight: 800;
    font-size: .68rem;
    line-height: 1;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease, background-color .15s ease;
}

.bottom-nav i {
    font-size: 1.12rem;
    line-height: 24px;
}

.bottom-nav span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-nav a.is-active,
.bottom-nav a:hover,
.bottom-nav button.is-active,
.bottom-nav button:hover {
    color: var(--brand-700);
}

.bottom-nav a.is-active,
.bottom-nav button.is-active {
    background: var(--brand-50);
}

.bottom-nav a:focus-visible,
.bottom-nav button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -3px;
}

.bottom-nav .pill {
    position: relative;
}

.bottom-nav .pill .badge {
    position: absolute;
    top: 2px;
    inset-inline-end: calc(50% - 22px);
    background: var(--brand);
    color: #fff;
    font-size: .62rem;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    font-weight: 700;
}

@media (min-width: 880px) {
    .bottom-nav {
        display: none;
    }
}

@media (max-width: 879px) {
    body {
        padding-bottom: calc(var(--bottom-nav-h) + 12px + var(--safe-area-bottom));
    }

    .hero-inner,
    .dp,
    .course-room,
    .watch-room,
    .library,
    .catalog,
    .orders-page {
        width: min(100%, var(--container));
    }
}

/* ---------- Drawer (More) ---------- */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, .42);
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s var(--easing);
}

.drawer-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(380px, 86vw);
    background: var(--surface);
    z-index: 80;
    transform: translateX(-100%);
    transition: transform .28s var(--easing);
    display: flex;
    flex-direction: column;
    box-shadow: 12px 0 36px rgba(11, 18, 32, .18);
}

.drawer.is-open {
    transform: translateX(0);
}

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--line);
}

.drawer-head .nav-brand {
    font-size: .95rem;
}

.drawer-close {
    appearance: none;
    border: 0;
    background: var(--surface-2);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 28px;
    display: grid;
    gap: 5px;
}

.drawer-account {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #fff 0%, #F5F1FF 100%);
    margin-bottom: 4px;
}

.drawer-account-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
}

.drawer-account strong,
.drawer-account small {
    display: block;
    min-width: 0;
}

.drawer-account strong {
    color: var(--ink);
    font-size: .94rem;
    font-weight: 900;
}

.drawer-account small {
    margin-top: 2px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.45;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 800;
    font-size: .9rem;
    transition: background .15s ease;
}

.drawer-link i {
    color: var(--brand);
    font-size: .96rem;
    width: 20px;
    text-align: center;
}

.drawer-link--primary {
    background: var(--ink);
    color: #fff;
}

.drawer-link--primary i {
    color: #fff;
}

.drawer-link:hover {
    background: var(--surface-2);
}

.drawer-link--primary:hover {
    background: var(--brand);
    color: #fff;
}

.drawer-section {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 900;
    padding: 12px 12px 4px;
    letter-spacing: 0;
}

.drawer-divider {
    height: 1px;
    background: var(--line);
    margin: 8px 4px;
}

@media (min-width: 880px) {

    .drawer,
    .drawer-overlay {
        display: none;
    }
}

/* ---------- Buttons (Global, Professional, Responsive) ---------- */
/* All button variants share the same base layout, so they look consistent
   whether used as `.btn .btn-primary` or simply `.btn-primary`. */
.btn,
.btn-primary,
.btn-secondary,
.btn-dark,
.btn-ghost,
.btn-outline,
.btn-success,
.btn-danger {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    font-size: .95rem;
    line-height: 1.15;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    user-select: none;
    min-height: 48px;
    box-sizing: border-box;
    transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease, color .15s ease;
    will-change: transform;
}

.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-dark:focus-visible,
.btn-ghost:focus-visible,
.btn-outline:focus-visible,
.btn-success:focus-visible,
.btn-danger:focus-visible {
    outline: 3px solid rgba(112, 66, 244, .35);
    outline-offset: 2px;
}

.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-dark:active,
.btn-ghost:active,
.btn-outline:active,
.btn-success:active,
.btn-danger:active {
    transform: translateY(1px);
}

.btn[disabled],
.btn:disabled,
.btn-primary[disabled],
.btn-primary:disabled,
.btn-secondary[disabled],
.btn-secondary:disabled,
.btn-ghost[disabled],
.btn-ghost:disabled,
.btn-outline[disabled],
.btn-outline:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Primary brand CTA (e.g. شراء / تسجيل / تعديل البيانات) */
.btn-primary {
    background: linear-gradient(180deg, #815BFA 0%, var(--brand) 55%, var(--brand-700) 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(112, 66, 244, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.btn-primary:hover {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-700) 100%);
    color: #fff;
    box-shadow: 0 14px 30px rgba(112, 66, 244, .34), inset 0 1px 0 rgba(255, 255, 255, .22);
    transform: translateY(-1px);
}

/* Secondary – neutral filled CTA */
.btn-secondary {
    background: #f1f5f9;
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--ink);
}

/* Dark – inverse CTA */
.btn-dark {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 8px 20px rgba(11, 18, 32, .25);
}

.btn-dark:hover {
    background: var(--ink-2);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(11, 18, 32, .3);
}

/* Ghost / Outline – tonal secondary used widely in side panels */
.btn-ghost,
.btn-outline {
    background: var(--surface);
    color: var(--ink);
    border: 1.5px solid var(--line);
}

.btn-ghost:hover,
.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand-700);
    background: var(--brand-50);
}

/* Success / Danger semantic variants */
.btn-success {
    background: #16a34a;
    color: #fff;
    box-shadow: 0 8px 20px rgba(22, 163, 74, .25);
}

.btn-success:hover {
    background: #15803d;
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 8px 20px rgba(220, 38, 38, .25);
}

.btn-danger:hover {
    background: #b91c1c;
    color: #fff;
    transform: translateY(-1px);
}

/* Tertiary text-style link button */
.btn-link {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--brand);
    font: inherit;
    font-weight: 800;
    font-size: .9rem;
    cursor: pointer;
    padding: 6px 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
}

.btn-link:hover {
    color: var(--brand-700);
    background: var(--brand-50);
}

.btn-link:focus-visible {
    outline: 2px solid rgba(112, 66, 244, .4);
    outline-offset: 2px;
}

.btn-link:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Modifiers */
.btn-block {
    width: 100%;
    display: flex;
}

.btn-lg {
    min-height: 56px;
    padding: 16px 30px;
    font-size: 1.02rem;
    border-radius: 14px;
}

.btn-sm {
    min-height: 36px;
    padding: 8px 14px;
    font-size: .82rem;
    border-radius: 9px;
    gap: 6px;
}

/* Responsive: comfortable touch targets on phones, full-width single buttons
   only when explicitly opted in via .btn-block. Buttons inside dedicated
   action rows already collapse to one column where needed. */
@media (max-width: 600px) {

    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-dark,
    .btn-ghost,
    .btn-outline,
    .btn-success,
    .btn-danger {
        padding: 12px 20px;
        font-size: .92rem;
        min-height: 48px;
        border-radius: 11px;
    }

    .btn-lg {
        min-height: 54px;
        padding: 15px 24px;
        font-size: 1rem;
    }
}

/* ---------- Section headings ---------- */
.section {
    padding: 56px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 600px) {
    .section {
        padding: 32px 0;
    }

    .section-head {
        align-items: center;
        gap: 8px;
        margin-bottom: 14px;
    }

    .section-head>div {
        min-width: 0;
        flex: 1 1 auto;
    }

    .section-head .eyebrow {
        font-size: .68rem;
        padding: 4px 10px;
        gap: 5px;
    }

    .section h2 {
        font-size: 1.05rem;
        margin: 6px 0 2px;
        line-height: 1.25;
    }

    .section .lede {
        font-size: .8rem;
        line-height: 1.45;
    }

    .see-all {
        font-size: .78rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-50);
    color: var(--brand-700);
    padding: 6px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
}

.section h2 {
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin: 10px 0 6px;
}

.section .lede {
    color: var(--muted);
    font-size: .98rem;
    max-width: 640px;
}

.see-all {
    color: var(--brand-700);
    font-weight: 700;
    font-size: .9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Hero (image) ---------- */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: #fff;
    min-height: clamp(220px, 38vh, 360px);
    display: grid;
    align-items: center;
}

@media (min-width: 768px) {
    .hero {
        min-height: clamp(320px, 50vh, 480px);
    }
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.hero-bg picture,
.hero-bg video,
.hero-bg img {
    width: 100%;
    height: 100%;
}

.hero-bg picture {
    display: block;
}

.hero-bg video,
.hero-bg img {
    object-fit: cover;
    object-position: center;
}

.hero-veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(11, 18, 32, .25) 0%, rgba(11, 18, 32, .45) 100%);
}

.hero-inner {
    width: min(var(--container), calc(100% - 32px));
    margin-inline: auto;
    padding: 32px 0 28px;
    display: grid;
    gap: 14px;
    max-width: 760px;
    text-align: center;
    justify-items: center;
}

@media (min-width: 768px) {
    .hero-inner {
        padding: 48px 0 40px;
        gap: 18px;
    }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 7px 14px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    width: max-content;
    backdrop-filter: blur(8px);
}

.hero-tag i {
    color: var(--brand);
}

.hero h1 {
    color: #fff;
    font-size: clamp(1.6rem, 5vw, 2.8rem);
    line-height: 1.25;
    font-weight: 700;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .35);
    margin: 0;
}

.hero p {
    font-size: clamp(.95rem, 2.2vw, 1.1rem);
    color: rgba(255, 255, 255, .92);
    max-width: 620px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
    justify-content: center;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 22px;
    max-width: 560px;
}

.hero-stat {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    padding: 12px 14px;
    backdrop-filter: blur(6px);
}

.hero-stat strong {
    display: block;
    font-size: 1.25rem;
    color: #fff;
    font-weight: 700;
}

.hero-stat span {
    font-size: .78rem;
    color: rgba(255, 255, 255, .78);
}

/* ---------- Features ---------- */
.features {
    padding: 40px 0 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: grid;
    gap: 10px;
    transition: transform .2s var(--easing), box-shadow .2s var(--easing);
}

.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.feature .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--brand-50);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.feature strong {
    font-size: 1.02rem;
}

.feature span {
    color: var(--muted);
    font-size: .9rem;
}

/* ---------- Cards grid ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s var(--easing), box-shadow .2s var(--easing), border-color .2s var(--easing);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: transparent;
}

.card-cover {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--surface-2), var(--brand-50));
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s var(--easing);
}

.card:hover .card-cover img {
    transform: scale(1.04);
}

.card-cover-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 2.6rem;
    color: var(--brand);
    background: linear-gradient(135deg, var(--brand-50), #fff);
}

.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 2px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f8fafc;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: .72rem;
    font-weight: 600;
}

.chip.featured {
    background: var(--brand-50);
    color: var(--brand-700);
    border-color: rgba(112, 66, 244, .22);
}

.chip.success {
    background: var(--success-50);
    color: var(--success);
    border-color: rgba(4, 120, 87, .18);
}

.card-body {
    padding: 16px 16px 18px;
    display: grid;
    gap: 10px;
    flex: 1;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
}

.card-sub {
    color: var(--muted);
    font-size: .88rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 600;
}

.card-meta i {
    color: var(--brand);
    margin-inline-end: 4px;
}

.card-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.price .now {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
}

.price .now small {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
    margin-inline-start: 2px;
}

.price .was {
    text-decoration: line-through;
    color: var(--muted);
    font-size: .82rem;
    white-space: nowrap;
}

.price.free .now {
    color: var(--success);
}

.card-cta {
    color: var(--brand-700);
    font-size: .85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Mobile tweaks for cards ---------- */
@media (max-width: 600px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card-body {
        padding: 14px 14px 16px;
        gap: 8px;
    }

    .card-title {
        font-size: .98rem;
        line-height: 1.45;
    }

    .card-sub {
        font-size: .82rem;
    }

    .card-meta {
        font-size: .76rem;
        gap: 10px;
    }

    .card-badges .chip {
        font-size: .68rem;
        padding: 3px 8px;
    }

    .card-foot {
        flex-wrap: wrap;
        gap: 6px 10px;
        padding-top: 10px;
    }

    .price {
        flex-wrap: wrap;
        row-gap: 0;
        column-gap: 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .price .now {
        font-size: 1.05rem;
    }

    .price .now small {
        font-size: .68rem;
    }

    .price .was {
        font-size: .76rem;
        flex-basis: 100%;
        order: -1;
        margin-bottom: 1px;
    }

    .card-cta {
        font-size: .8rem;
        margin-inline-start: auto;
    }
}

/* ---------- Categories chips ---------- */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.category {
    display: grid;
    place-items: center;
    gap: 10px;
    padding: 22px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-align: center;
    color: var(--ink);
    font-weight: 600;
    transition: transform .2s var(--easing), box-shadow .2s var(--easing);
}

.category i {
    font-size: 1.5rem;
    color: var(--brand);
}

.category:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
}

/* ---------- Testimonials ---------- */
.testimonials {
    background: var(--surface);
    border-block: 1px solid var(--line);
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.testimonial {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    display: grid;
    gap: 14px;
}

.testimonial p {
    color: var(--ink-2);
    font-size: .98rem;
    line-height: 1.9;
}

.testimonial .who {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial .who .avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.testimonial .who strong {
    display: block;
    color: var(--ink);
}

.testimonial .who span {
    color: var(--muted);
    font-size: .82rem;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 40px;
    background: var(--ink);
    color: rgba(255, 255, 255, .84);
    padding: 50px 0 100px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
}

@media (max-width: 760px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-brand h3 {
    color: #fff;
    margin-bottom: 8px;
}

.footer-brand p {
    color: rgba(255, 255, 255, .64);
    font-size: .92rem;
}

.footer-brand .footer-legal {
    margin-top: 10px;
    color: rgba(255, 255, 255, .72);
    font-size: .84rem;
    line-height: 1.9;
}

.footer-tax-link {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .07);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: .82rem;
    font-weight: 900;
}

.footer-tax-link:hover {
    border-color: rgba(112, 66, 244, .45);
    color: #fff;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 14px;
    font-size: 1rem;
}

.footer-col a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    color: rgba(255, 255, 255, .76);
    font-size: .92rem;
    transition: color .15s ease;
}

.footer-col a:hover {
    color: var(--brand);
}

.footer-col i {
    color: var(--brand);
    width: 18px;
}

.social-row {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.social-row a {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    display: grid;
    place-items: center;
    color: #fff;
    transition: background .15s ease, color .15s ease;
}

.social-row a:hover {
    background: var(--brand);
    color: #fff;
}

.payments-strip {
    border-top: 1px solid rgba(255, 255, 255, .08);
    margin-top: 30px;
    padding-top: 22px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.payments-strip img {
    height: 22px;
    display: block;
}

.trust-docs-strip {
    border-top: 1px solid rgba(255, 255, 255, .08);
    margin-top: 30px;
    padding-top: 22px;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.trust-doc-chip {
    min-height: 58px;
    max-width: min(100%, 360px);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .86);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.trust-doc-chip:hover {
    border-color: rgba(112, 66, 244, .42);
    background: rgba(255, 255, 255, .09);
    color: #fff;
}

.trust-doc-chip img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 5px;
    flex: 0 0 auto;
}

.trust-doc-chip span {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.trust-doc-chip strong {
    font-size: .9rem;
    line-height: 1.35;
}

.trust-doc-chip small {
    color: rgba(255, 255, 255, .62);
    font-size: .76rem;
    line-height: 1.45;
}

.drawer-tax-note {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.vat-inclusive-note,
.summary-tax-note {
    margin-top: 10px;
    padding: 9px 11px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.65;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.payment-tax-note {
    display: block;
    margin-top: 3px;
    color: #166534;
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.45;
}

/* Branded payment chips */
.pay-chip {
    height: 40px;
    min-width: 64px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    transition: transform .15s var(--easing);
}

.pay-chip:hover {
    transform: translateY(-2px);
}

.pay-chip img {
    height: 20px;
    max-width: 100%;
    object-fit: contain;
}

/* Mada — colored logo on white */
.pay-chip.pay--mada {
    background: #fff;
}

/* Visa — official navy */
.pay-chip.pay--visa {
    background: #1A1F71;
}

.pay-chip.pay--visa img {
    filter: brightness(0) invert(1);
}

/* Mastercard — black background, keeps red/yellow circles */
.pay-chip.pay--mastercard {
    background: #0a0a0a;
}

/* Apple Pay — official mark on black background per Apple Pay Marketing Guidelines.
   The mark is provided by Apple in white with a built-in outline rule.
   DO NOT alter the artwork (no filters, no recolor, no rotation). */
.pay-chip.pay--applepay {
    background: #000;
}

.pay-chip.pay--applepay img {
    height: 22px;
    /* official asset — unaltered per Apple guidelines */
}

/* Tabby — official mint gradient + official white logo (no recoloring per Tabby brand guidelines) */
.pay-chip.pay--tabby {
    background: linear-gradient(135deg, #3DDC97 0%, #2BBE7E 100%);
}

.pay-chip.pay--tabby img {
    height: 18px;
    /* official white logo asset — DO NOT alter per Tabby guidelines */
}

/* Tamara — official refreshed branding: gradient logo on light lavender chip */
.pay-chip.pay--tamara {
    background: #F4EEFB;
    border: 1px solid #E5D6F4;
}

.pay-chip.pay--tamara img {
    height: 22px;
    /* keep original gradient — do NOT recolor per Tamara brand guidelines */
}

.footer-bottom {
    margin-top: 26px;
    text-align: center;
    color: rgba(255, 255, 255, .55);
    font-size: .85rem;
}

/* ---------- Messages ---------- */
.flash-stack {
    width: min(var(--container), calc(100% - 32px));
    margin: 16px auto 0;
    display: grid;
    gap: 8px;
}

.flash {
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid;
    background: var(--surface);
}

.flash.success {
    border-color: #A7F3D0;
    background: var(--success-50);
    color: var(--success);
}

.flash.error {
    border-color: #FECACA;
    background: var(--danger-50);
    color: var(--danger);
}

.flash.info {
    border-color: #BFDBFE;
    background: #EFF6FF;
    color: #1D4ED8;
}

/* ---------- Empty state ---------- */
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 60px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: var(--brand);
    margin-bottom: 14px;
    display: block;
}

/* ---------- Forms ---------- */
.input,
.textarea,
.select {
    width: 100%;
    min-height: 48px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--surface);
    font-family: inherit;
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(112, 66, 244, .12);
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    color: var(--ink);
    font-size: .85rem;
    font-weight: 700;
}

.field .help {
    color: var(--muted);
    font-size: .8rem;
}

.field .error {
    color: var(--danger);
    font-size: .82rem;
    font-weight: 600;
}

/* ---------- Panels (page surfaces) ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-1);
}

.page {
    padding: 28px 0 60px;
}

.page-head {
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: clamp(1.4rem, 4vw, 1.9rem);
}

.page-head p {
    color: var(--muted);
    margin-top: 6px;
}

/* ---------- Utilities ---------- */
.hide-on-mobile {
    display: initial;
}

@media (max-width: 879px) {
    .hide-on-mobile {
        display: none !important;
    }

    .show-on-mobile {
        display: initial !important;
    }
}

@media (min-width: 880px) {
    .show-on-mobile {
        display: none !important;
    }
}

.text-muted {
    color: var(--muted);
}

.flex {
    display: flex;
}

.flex.between {
    justify-content: space-between;
    align-items: center;
}

.gap-8 {
    gap: 8px;
}

.gap-12 {
    gap: 12px;
}

.gap-16 {
    gap: 16px;
}

.mt-12 {
    margin-top: 12px;
}

.mt-24 {
    margin-top: 24px;
}

.mt-40 {
    margin-top: 40px;
}

/* ---------- Hero banner with translucent overlay ---------- */
.hero--banner {
    position: relative;
    min-height: clamp(220px, 38vh, 320px);
    overflow: hidden;
}

.hero--banner .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero--banner .hero-bg picture,
.hero--banner .hero-bg img {
    width: 100%;
    height: 100%;
}

.hero--banner .hero-bg picture {
    display: block;
}

.hero--banner .hero-bg img {
    object-fit: cover;
    display: block;
}

.hero--banner .hero-inner {
    display: none;
}

/* Soft gradient veil so text stays readable */
.hero-veil--soft {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(8, 12, 28, 0.20) 0%, rgba(8, 12, 28, 0.55) 70%, rgba(8, 12, 28, 0.70) 100%);
    pointer-events: none;
}

/* White fade-in at the bottom 15% of the banner (smooth blend into page) */
.hero--banner::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 15%;
    z-index: 3;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 55%, #ffffff 100%);
    pointer-events: none;
}

/* Marketing overlay content */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 24px 18px;
    color: #fff;
    text-align: center;
}

.hero-overlay-inner {
    max-width: 760px;
    display: grid;
    gap: 14px;
    justify-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.hero-eyebrow i {
    color: #D8CCFF;
}

.hero-overlay h1 {
    margin: 0;
    font-size: clamp(26px, 4.4vw, 48px);
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.hero-overlay h1 .brand-mark {
    color: #D8CCFF;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.hero-overlay strong {
    color: #D8CCFF;
    font-weight: 800;
}

.hero-overlay p {
    margin: 0;
    max-width: 640px;
    font-size: clamp(14px, 1.6vw, 18px);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.hero-trust {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 6px;
}

.hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.hero-trust span i {
    color: #7ee3c0;
}

/* Spacious banner on desktop */
@media (min-width: 880px) {
    .hero--banner {
        min-height: clamp(440px, 62vh, 640px);
    }
}

/* Mobile: keep overlay visible but compact */
@media (max-width: 879px) {
    .hero--banner {
        min-height: clamp(200px, 36vh, 280px);
    }

    .hero-overlay {
        padding: 14px 12px;
    }

    .hero-overlay-inner {
        gap: 8px;
    }

    .hero-eyebrow {
        font-size: 11px;
        padding: 4px 10px;
        gap: 5px;
    }

    .hero-overlay h1 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .hero-overlay p {
        font-size: .82rem;
        line-height: 1.5;
        max-width: 92%;
    }

    .hero-trust {
        gap: 6px;
        margin-top: 2px;
    }

    .hero-trust span {
        font-size: 11px;
        padding: 5px 10px;
        gap: 5px;
    }

    .hero-veil--soft {
        background: linear-gradient(180deg, rgba(8, 12, 28, .30) 0%, rgba(8, 12, 28, .65) 100%);
    }
}

/* ---------- Marketing strip (mobile-friendly stats) ---------- */
.marketing-strip {
    background: linear-gradient(135deg, #F8F5FF 0%, #EEE8FF 100%);
    border-block: 1px solid #D8CCFF;
    padding: 18px 0;
    margin-top: -1px;
}

.marketing-strip-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.ms-item {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 8px 4px;
}

.ms-item i {
    font-size: 1.3rem;
    color: var(--brand);
}

.ms-item strong {
    font-size: clamp(1.1rem, 4vw, 1.6rem);
    color: var(--ink);
    font-weight: 700;
    line-height: 1;
}

.ms-item span {
    font-size: clamp(.72rem, 2.5vw, .88rem);
    color: var(--text-muted);
    line-height: 1.3;
}

/* ---------- News ticker (mobile only, very top of every page) ---------- */
.news-ticker {
    display: none;
}

@media (max-width: 879px) {

    /* Show ticker on mobile at the very top */
    .news-ticker {
        display: block;
        background: #ffffff;
        border-bottom: 2px solid var(--brand);
        box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
        overflow: hidden;
        position: relative;
        height: 34px;
        line-height: 34px;
        z-index: 50;
        /* force LTR so the marquee track starts at the left edge and fills the row */
        direction: ltr;
    }

    .marketing-strip {
        display: none;
    }
}

.news-ticker-track {
    display: flex;
    width: max-content;
    direction: ltr;
    /* fixed flex order so the duplicated copies sit side by side */
    align-items: center;
    gap: 22px;
    /* equal padding on both sides so the seam between the two copies is invisible */
    padding: 0 11px;
    white-space: nowrap;
    /* RTL marquee: content enters from right, exits to the left */
    animation: news-ticker-scroll 30s linear infinite;
    will-change: transform;
}

.news-ticker:hover .news-ticker-track,
.news-ticker:focus-within .news-ticker-track {
    animation-play-state: paused;
}

.nt-item {
    font-size: .82rem;
    font-weight: 700;
    color: var(--brand-700);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* keep Arabic shaping correct inside the LTR track */
    direction: rtl;
    unicode-bidi: isolate;
}

.nt-item i {
    color: var(--brand);
    font-size: .9rem;
}

.nt-sep {
    color: #BDAAFF;
    font-size: 1rem;
    opacity: .8;
}

@keyframes news-ticker-scroll {
    from {
        transform: translateX(0);
    }

    to {
        /* duplicated content => -50% moves exactly one full copy for a seamless loop */
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-ticker-track {
        animation: none;
        transform: none;
        padding: 0 12px;
    }
}

/* ===========================================================
   Detail page system (mobile-first; product/course/order/etc)
   =========================================================== */
.dp {
    width: min(1120px, calc(100% - 24px));
    margin: 18px auto 80px;
}

.dp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--brand-700);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.dp-back:hover {
    color: var(--brand);
}

.dp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.dp-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.dp-cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #EEE8FF 0%, #D0C1FF 100%);
    display: block;
    overflow: hidden;
}

.dp-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.dp-cover-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
}

.dp-body {
    padding: 18px;
    display: grid;
    gap: 14px;
}

.dp-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: .72rem;
    font-weight: 800;
    border: 1px solid #D8CCFF;
}

.dp-title {
    margin: 0;
    color: #0f172a;
    font-size: clamp(1.35rem, 4.4vw, 2rem);
    font-weight: 900;
    line-height: 1.3;
}

.dp-subtitle {
    margin: 0;
    color: #64748b;
    font-size: .92rem;
    line-height: 1.7;
}

.dp-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.dp-price .now {
    color: var(--brand);
    font-size: 1.5rem;
    font-weight: 900;
}

.dp-price .now small {
    font-size: .8rem;
    font-weight: 700;
    color: var(--brand-700);
}

.dp-price .was {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: .9rem;
    font-weight: 700;
}

.dp-price .free {
    color: #15803d;
    font-size: 1.4rem;
    font-weight: 900;
}

.installment-widgets {
    display: grid;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.installment-official-widget {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
}

.installment-official-widget+.installment-official-widget {
    margin-top: 0;
}

.installment-official-widget>*,
.installment-official-widget iframe {
    max-width: 100%;
}

.payment-selector {
    display: grid;
    gap: 14px;
    margin-top: 2px;
}

.payment-selector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.payment-selector-head strong,
.payment-selector-head span {
    display: block;
}

.payment-selector-head strong {
    color: #0f172a;
    font-size: .98rem;
    font-weight: 950;
}

.payment-selector-head span {
    margin-top: 2px;
    color: #64748b;
    font-size: .78rem;
    line-height: 1.6;
}

.payment-selector-head i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #059669;
    flex: 0 0 auto;
}

.payment-choice {
    position: relative;
    min-height: 94px;
    padding: 15px 44px 15px 15px !important;
    border: 1.5px solid #dbe4ee !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .04);
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
}

.payment-choice:hover,
.payment-choice.is-selected {
    border-color: var(--brand) !important;
    background: var(--brand-50) !important;
    box-shadow: 0 14px 28px rgba(112, 66, 244, .12);
}

.payment-choice:active {
    transform: scale(.99);
}

.payment-choice.is-preview-gateway {
    border-style: dashed !important;
}

.payment-check {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    color: transparent;
    background: #fff;
}

.payment-choice.is-selected .payment-check {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.payment-check i {
    font-size: .7rem;
}

.payment-choice-head {
    display: flex;
    align-items: flex-start;
    gap: 0;
}

.payment-choice-head input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-choice-head strong,
.payment-choice-head small {
    display: block;
}

.payment-choice-head strong {
    color: #0f172a;
    font-size: .96rem;
    font-weight: 950;
    line-height: 1.5;
}

.payment-choice-head small {
    margin-top: 5px;
    color: #64748b;
    font-size: .82rem;
    line-height: 1.7;
}

.payment-preview-note {
    color: #4B28B8 !important;
    font-weight: 800;
}

.payment-method-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.payment-method-badges em {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-style: normal;
    font-size: .68rem;
    font-weight: 900;
}

.payment-provider-widget {
    display: none;
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    overflow: hidden;
}

.payment-choice.is-selected .payment-provider-widget {
    display: block;
}

.payment-submit-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .05);
}

.payment-submit-bar span,
.payment-submit-bar strong {
    display: block;
}

.payment-submit-bar span {
    color: #94a3b8;
    font-size: .7rem;
    font-weight: 900;
}

.payment-submit-bar strong {
    margin-top: 2px;
    color: #0f172a;
    font-size: .9rem;
    font-weight: 950;
}

.payment-submit {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: .94rem;
    font-weight: 900;
    cursor: pointer;
    padding: 0 18px;
    white-space: nowrap;
}

.payment-submit:hover {
    background: var(--brand-700);
}

.payment-submit:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.payment-help {
    color: #64748b;
    font-size: .78rem;
    line-height: 1.6;
}

.payment-preview-result {
    padding: 11px 12px;
    border: 1px solid #D9CDFF;
    border-radius: 10px;
    background: #F5F1FF;
    color: #4B28B8;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.7;
}

@media (max-width: 520px) {
    .payment-submit-bar {
        grid-template-columns: 1fr;
    }

    .payment-submit {
        width: 100%;
    }
}

.dp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dp-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: .76rem;
    font-weight: 700;
}

.dp-meta span i {
    color: var(--brand);
}

.dp-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-family: inherit;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, transform .1s;
}

.dp-cta:hover {
    background: var(--brand-700);
}

.dp-cta:active {
    transform: scale(.98);
}

.dp-cta--ghost {
    background: #fff;
    color: var(--brand-700);
    border: 1.5px solid var(--brand);
}

.dp-cta--ghost:hover {
    background: var(--brand-50);
    color: var(--brand-700);
}

.dp-section {
    border-top: 1px solid #e5e7eb;
    padding: 16px 18px;
}

.dp-section h3 {
    margin: 0 0 10px;
    color: #0f172a;
    font-size: .98rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dp-section h3 i {
    color: var(--brand);
}

/* ── Collapsible product description ─────────────────────── */
.dp-collapse[open] .dp-collapse-head h3,
.dp-collapse .dp-collapse-head h3 {
    margin: 0;
}

.dp-collapse-head {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 24px;
    user-select: none;
    padding: 0;
}

.dp-collapse-head::-webkit-details-marker {
    display: none;
}

.dp-collapse-hint {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #b0b6bf;
    font-size: .72rem;
    font-weight: 500;
    flex-shrink: 0;
    transition: color .15s ease;
}

.dp-collapse-hint i {
    font-size: .62rem;
    transition: transform .25s ease;
}

.dp-collapse:not([open]) .dp-hint-less {
    display: none;
}

.dp-collapse[open] .dp-hint-more {
    display: none;
}

.dp-collapse[open] .dp-collapse-hint i {
    transform: rotate(-180deg);
}

.dp-collapse:hover .dp-collapse-hint {
    color: #6b7280;
}

.dp-collapse .dp-desc {
    margin-top: 12px;
    animation: dp-collapse-slide .25s ease;
}

@keyframes dp-collapse-slide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dp-section p,
.dp-desc {
    color: #475569;
    font-size: .88rem;
    line-height: 1.85;
    margin: 0;
    white-space: pre-wrap;
}

.dp-video {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #0f172a;
}

.dp-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.dp-video-message {
    padding: 14px 16px;
    border-radius: 12px;
    background: #F5F1FF;
    color: #4B28B8;
}

.dp-variants {
    display: grid;
    gap: 8px;
}

.dp-variant {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.dp-variant:has(input:checked),
.dp-variant:hover {
    border-color: var(--brand);
    background: var(--brand-50);
}

.dp-variant.is-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.dp-variant input {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    margin: 0;
}

.dp-variant-name {
    display: block;
    color: #0f172a;
    font-size: .9rem;
    font-weight: 800;
}

.dp-variant-meta {
    display: block;
    color: #64748b;
    font-size: .75rem;
    margin-top: 2px;
}

.dp-variant-price {
    color: var(--brand);
    font-size: 1rem;
    font-weight: 900;
    white-space: nowrap;
}

.dp-variant-price small {
    font-size: .7rem;
    color: var(--brand-700);
}

.dp-empty {
    padding: 16px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: .88rem;
    line-height: 1.7;
    text-align: center;
}

.dp-note {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--brand-50);
    border: 1px solid #D8CCFF;
    color: var(--brand-700);
    font-size: .8rem;
    line-height: 1.7;
}

/* Tablet & desktop: two-column layout */
@media (min-width: 880px) {
    .dp {
        margin: 28px auto 100px;
    }

    .dp-grid {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
        gap: 24px;
    }

    .dp-cover {
        aspect-ratio: 16 / 9;
    }

    .dp-body {
        padding: 24px;
    }

    .dp-section {
        padding: 20px 24px;
    }
}
