/*
 * DEV-02 / RD1b-1 (D-053, D-055; the approved design, AP-224, AP-226) — the site's frame: the top bar, the header with its
 * menu (desktop and mobile), the footer, the floating support button, the "how to start" strip and the external-link icon.
 * Every rule is under .fx-* so the pages' own Bootstrap styles are not touched. The design's colours are fixed here (D-055,
 * Q-RD1B-9); the theme colour editor keeps working for the other pages' content.
 */
:root {
  --fx-bg: #FAFAF7;
  --fx-surface: #FFFFFF;
  --fx-ink: #15171A;
  --fx-text: #2B2E33;
  --fx-muted: #4E545B;
  --fx-line: #E6E6E1;
  --fx-line-2: #E3E3DD;
  --fx-line-3: #D9D9D3;
  --fx-green: #1E7A34;
  --fx-green-dark: #15592A;
  --fx-green-soft: #EAF4EC;
  --fx-amber: #E9B44C;
  --fx-font: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --fx-display: 'Readex Pro', 'IBM Plex Sans Arabic', sans-serif;
}

.fx-shell, .fx-shell * { box-sizing: border-box; }
.fx-shell { font-family: var(--fx-font) !important; color: var(--fx-ink); }
.fx-shell a { text-decoration: none; }
.fx-shell ul { list-style: none; margin: 0; padding: 0; }
.fx-shell svg { flex-shrink: 0; }
.fx-wrap { max-width: 1240px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.fx-brand-name { font-family: var(--fx-display) !important; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.fx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; font: 600 15px var(--fx-font); border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.fx-btn-dark { background: var(--fx-ink); color: #FFFFFF !important; }
.fx-btn-dark:hover { background: #2B2E33; color: #FFFFFF !important; }
.fx-btn-light { background: #FFFFFF; color: var(--fx-ink) !important; border-color: var(--fx-line-3); }
.fx-btn-light:hover { border-color: var(--fx-ink); }
.fx-focus:focus-visible, .fx-shell a:focus-visible, .fx-shell button:focus-visible { outline: 2px solid var(--fx-green); outline-offset: 2px; }

/* ---- Top bar (the language switch keeps the classes topbar / topbar-link / data-lang that main.js reads) ---- */
.fx-topbar.topbar { background: var(--fx-ink) !important; color: #E9E9E4 !important; font-size: 13px; padding: 0 !important; height: auto !important; border: 0 !important; }
.fx-topbar .fx-wrap { padding-top: 8px; padding-bottom: 8px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.fx-topbar-risk { display: flex; gap: 6px; align-items: center; }
.fx-topbar-langs { display: flex; gap: 14px; align-items: center; }
.fx-topbar .topbar-link { color: #B9B9B3 !important; font-size: 13px !important; font-weight: 500; padding: 0 !important; background: none !important; }
.fx-topbar .topbar-link.active, .fx-topbar .topbar-link:hover { color: #FFFFFF !important; font-weight: 600; }

/* ---- Header ---- */
.fx-header { background: var(--fx-surface); border-bottom: 1px solid var(--fx-line); position: sticky; top: 0; z-index: 1030; }
.fx-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.fx-logo { display: flex; align-items: center; gap: 10px; color: var(--fx-ink) !important; }
.fx-logo img { width: 48px; height: 48px; object-fit: contain; }
.fx-logo .fx-brand-name { font-size: 20px; color: var(--fx-ink); }
.fx-nav { display: flex; align-items: center; gap: 4px; }
.fx-nav-item { position: relative; }
.fx-nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 10px 8px; color: var(--fx-text) !important; font-size: 15px; font-weight: 500; background: none; border: 0; cursor: pointer; font-family: var(--fx-font); border-radius: 8px; min-height: 44px; }
.fx-nav-link:hover, .fx-nav-item.fx-open > .fx-nav-link { color: var(--fx-green) !important; }
.fx-nav-link.fx-current { color: var(--fx-green) !important; font-weight: 600; }
.fx-nav-link .fx-chev { transition: transform .2s ease; }
.fx-nav-item.fx-open > .fx-nav-link .fx-chev { transform: rotate(180deg); }
.fx-dropdown { display: none; position: absolute; top: 100%; inset-inline-start: 0; min-width: 230px; background: #FFFFFF; border: 1px solid var(--fx-line); border-radius: 12px; box-shadow: 0 18px 40px rgba(21,23,26,.12); padding: 8px; z-index: 1040; }
.fx-nav-item.fx-open > .fx-dropdown { display: block; }
.fx-dropdown a, .fx-dropdown span.fx-soon { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 12px; border-radius: 8px; color: var(--fx-text) !important; font-size: 14px; }
.fx-dropdown a:hover { background: var(--fx-bg); color: var(--fx-green) !important; }
.fx-soon { color: #9A9A94 !important; cursor: not-allowed; }
.fx-soon-tag { font-size: 11px; font-weight: 600; color: #6B7077; background: #F1F1EC; border-radius: 999px; padding: 2px 8px; }
.fx-dropdown-empty { padding: 10px 12px; font-size: 13px; color: #8B9097; }
.fx-actions { display: flex; align-items: center; gap: 8px; }
.fx-icon-btn { position: relative; width: 44px; height: 44px; border: 1px solid var(--fx-line-2); border-radius: 10px; background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; color: var(--fx-ink) !important; cursor: pointer; }
.fx-icon-btn:hover { border-color: var(--fx-ink); }
.fx-icon-btn .cart-counter, .fx-icon-btn .fx-count { position: absolute; top: -6px; inset-inline-end: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: var(--fx-green); color: #FFFFFF; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.fx-logout { display: inline; margin: 0; }
.fx-menu-btn { display: none; }
.fx-mobile-nav { display: none; }

@media (max-width: 1199.98px) {
  .fx-wrap { padding-left: 16px; padding-right: 16px; }
  .fx-nav, .fx-actions .fx-desk-only { display: none !important; }
  .fx-menu-btn { display: inline-flex; }
  .fx-header-row { gap: 10px; }
  .fx-logo img { width: 40px; height: 40px; }
  .fx-logo .fx-brand-name { font-size: 18px; }
  .fx-mobile-nav.fx-open { display: flex; flex-direction: column; padding: 4px 20px 20px; background: #FFFFFF; border-top: 1px solid #EFEFEA; max-height: calc(100vh - 70px); overflow-y: auto; }
  .fx-m-item > .fx-m-link { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 4px; border: 0; border-bottom: 1px solid #EFEFEA; background: none; color: var(--fx-ink) !important; font: 500 16px var(--fx-font); cursor: pointer; text-align: start; }
  .fx-m-item > .fx-m-link.fx-current { color: var(--fx-green) !important; font-weight: 600; }
  .fx-m-sub { display: none; padding: 4px 0 8px; }
  .fx-m-item.fx-open > .fx-m-sub { display: block; }
  .fx-m-item.fx-open > .fx-m-link .fx-chev { transform: rotate(180deg); }
  .fx-m-sub a, .fx-m-sub span.fx-soon { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 16px; color: var(--fx-text) !important; font-size: 15px; }
  .fx-m-buttons { display: flex; gap: 10px; padding-top: 16px; }
  .fx-m-buttons .fx-btn, .fx-m-buttons form { flex: 1 1 0; }
  .fx-m-buttons form .fx-btn { width: 100%; }
}

/* ---- "How to start" strip, above the footer (G-5) ---- */
.fx-start-strip { background: var(--fx-green-soft); border-top: 1px solid #D5E8D9; }
.fx-start-strip .fx-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.fx-start-strip p { margin: 0; font-size: 16px; font-weight: 600; color: var(--fx-ink); }

/* ---- Footer ---- */
.fx-footer { background: var(--fx-ink); color: #C9C9C3; }
.fx-footer .fx-wrap { padding-top: 56px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 32px; }
.fx-footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.fx-footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.fx-footer-col > .fx-footer-title { color: #FFFFFF; font-weight: 600; }
.fx-footer a { color: #C9C9C3 !important; }
.fx-footer a:hover { color: #FFFFFF !important; }
.fx-footer-brand { display: flex; align-items: center; gap: 10px; }
.fx-footer-brand img { width: 44px; height: 44px; object-fit: contain; background: #FFFFFF; border-radius: 8px; }
.fx-footer-brand .fx-brand-name { font-size: 18px; color: #FFFFFF; }
.fx-footer p { margin: 0; line-height: 1.8; }
.fx-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-social { width: 40px; height: 40px; border: 1px solid #3A3D42; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; }
.fx-social:hover { border-color: #FFFFFF; }
.fx-risk { padding: 16px; border: 1px solid #3A3D42; border-radius: 10px; font-size: 13px; color: #D6D6D0; }
.fx-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: #9A9A94; }
.fx-ltr { direction: ltr; unicode-bidi: isolate; }

/* ---- External link icon (D-053/5) ---- */
.fx-ext { display: inline-block; vertical-align: -1px; margin-inline-start: 4px; opacity: .8; }
.fx-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- "How to start" window ---- */
.fx-modal { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(21,23,26,.72); }
.fx-modal.fx-open { display: flex; }
.fx-modal-box { position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 40px); overflow-y: auto; background: #FFFFFF; border-radius: 18px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.fx-modal-close { position: absolute; top: 12px; inset-inline-end: 12px; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--fx-line-2); background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.fx-modal-body { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.fx-modal-body h2 { margin: 0; font: 700 22px var(--fx-display); color: var(--fx-ink) !important; /* over the layout's h2 --heading-color !important (D-055) */ }
.fx-modal-body p { margin: 0; color: var(--fx-muted); line-height: 1.8; }
.fx-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #0E1013; border-radius: 12px; overflow: hidden; }
.fx-video iframe, .fx-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fx-modal-box > img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
@media (max-width: 575.98px) {
  .fx-modal { align-items: flex-end; padding: 0; }
  .fx-modal-box { max-width: none; border-radius: 18px 18px 0 0; max-height: 90vh; }
}
@media (prefers-reduced-motion: reduce) { .fx-shell *, .fx-modal * { animation: none !important; transition: none !important; } }
