/* AryanBet site additions - loaded after styles.css.
   Back-to-top button (injected by /assets/js/main.js, initScrollTop). */

.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60; /* above content and the sticky header (50), below the skip link (100) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--color-brand, #22b33a);
  border-radius: 50%;
  background: var(--color-surface, #1c1c1c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s,
    background-color 0.15s ease, color 0.15s ease;
}

/* RTL pages: mirror to the bottom-left (inline end) */
html[dir="rtl"] .scroll-top {
  right: auto;
  left: 20px;
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0s,
    background-color 0.15s ease, color 0.15s ease;
}

.scroll-top svg {
  display: block;
  width: 24px;
  height: 24px;
  max-width: none;
  pointer-events: none;
}

.scroll-top:hover,
.scroll-top:focus-visible {
  background: var(--color-brand, #22b33a);
  color: var(--color-surface, #1c1c1c);
}

.scroll-top:focus-visible {
  outline: 3px solid var(--color-accent, #f2c12e);
  outline-offset: 3px;
}

@media (max-width: 767px) {
  .scroll-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
  html[dir="rtl"] .scroll-top {
    right: auto;
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-top,
  .scroll-top.is-visible {
    transition: none;
    transform: none;
  }
}

@media print {
  .scroll-top { display: none; }
}

/* ---------- Header: wider container ---------- */
.site-header .container { max-width: 90rem; }

/* ---------- Header CTA ---------- */
.header-cta.btn {
  min-height: 2.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---------- Language dropdown (flag + EN/AR) ---------- */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }

.lang-menu__toggle,
.lang-menu__list a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-latin);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--color-text);
  text-decoration: none;
}
.lang-menu__toggle {
  min-height: 2.5rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
}
.lang-menu__toggle:hover,
.lang-menu[open] > .lang-menu__toggle { border-color: var(--color-brand); }
.lang-menu__toggle::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}
.lang-menu[open] > .lang-menu__toggle::after { transform: translateY(2px) rotate(225deg); }

.lang-flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.lang-menu__list {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 70;
  min-width: 100%;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.lang-menu__list a {
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius) - 2px);
}
.lang-menu__list a:hover,
.lang-menu__list a:focus-visible { background: var(--color-surface); color: var(--color-brand-strong); }
.lang-menu__list a[aria-current="true"] { color: var(--color-brand-strong); }

/* ---------- Small screens: keep logo + tools on one row ---------- */
@media (max-width: 30rem) {
  .logo-link img { width: 7rem; }
  .header-tools { gap: 0.375rem; }
  .header-cta.btn { padding: 0.35rem 0.7rem; font-size: 0.85rem; }
  .lang-menu__toggle { padding: 0.25rem 0.45rem; gap: 0.3rem; }
  .lang-menu__toggle .lang-code { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-toggle { padding: var(--space-2) 0.6rem; }
}

/* ---------- Promotions panel (injected by main.js, initPromo) ---------- */
.promo {
  --promo-w: min(20rem, calc(100vw - 3.5rem));
  position: fixed;
  top: var(--promo-top, 76px);
  right: 0;
  z-index: 45; /* below the sticky header (50) so the menu and language list overlay it */
  width: var(--promo-w);
  transition: transform 0.3s ease;
  font-size: 1rem;
}
.promo.is-collapsed { transform: translateX(100%); }

.promo__box {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-right: 0;
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 0.875rem;
}

.promo__title {
  margin: 0 0 0.625rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}
html[lang="ar"] .promo__title { letter-spacing: 0; font-size: 0.9rem; }

/* Tabs */
.promo__tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.promo__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-height: 3.5rem;
  padding: 0.4rem 0.15rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}
.promo__tab:hover { color: var(--color-text); border-color: var(--color-brand); }
.promo__tab[aria-selected="true"] {
  color: var(--color-brand-strong);
  border-color: var(--color-brand);
  background: rgba(34, 179, 58, 0.12);
}

/* Panel content */
.promo__panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  align-items: start;
}
.promo__panel[hidden] { display: none; }
.promo__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(34, 179, 58, 0.15);
  color: var(--color-brand-strong);
}
.promo__icon:hover { background: var(--color-brand); color: #0b1a0f; }
.promo__body { min-width: 0; }
.promo__name {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}
.promo__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}
.promo__cta.btn {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.25rem;
  font-size: 1rem;
}
.promo__terms {
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}
.promo__terms a { color: var(--color-text-muted); }

/* Show/hide handle - stays visible on the panel's left edge */
.promo__handle {
  position: absolute;
  top: 0.75rem;
  right: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 3.5rem;
  padding: 0;
  border: 2px solid var(--color-brand);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--color-surface-2);
  color: var(--color-brand-strong);
  cursor: pointer;
}
.promo__handle svg { transition: transform 0.3s ease; }
.promo.is-collapsed .promo__handle svg { transform: rotate(180deg); }
.promo__handle:hover { background: var(--color-brand); color: #0b1a0f; }
.promo.is-collapsed .promo__handle {
  background: var(--color-brand);
  color: #0b1a0f;
  animation: promo-glow 1.6s ease-in-out infinite;
}
@keyframes promo-glow {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(47, 209, 74, 0.55); }
  50%      { box-shadow: 0 0 20px 6px rgba(47, 209, 74, 0.9); }
}

@media (max-width: 30rem) {
  .promo__box { padding: 0.75rem; }
  .promo__name { font-size: 1rem; }
  .promo__desc { font-size: 0.875rem; }
}

@media (prefers-reduced-motion: reduce) {
  .promo, .promo__handle svg { transition: none; }
  .promo.is-collapsed .promo__handle { animation: none; box-shadow: 0 0 14px 4px rgba(47, 209, 74, 0.8); }
}

@media print { .promo { display: none; } }
