/*!
 * Ofoq — offers slider (homepage hero) and full-screen offers page.
 * Colors and fonts come from the theme variables (--c-primary, --c-accent…).
 * Logical properties only, so RTL Arabic and LTR English share every rule.
 */

/* ------------------------------------------------------------------
   1. Compact slider (hero)
   ------------------------------------------------------------------ */
.offers-slider { --os-interval: 6500ms; position: relative; }
.offers-slider:not(.st-slider) {
  background: #fff;
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: calc(var(--radius-lg) + 6px);
  padding: 14px;
  box-shadow: 0 24px 60px -28px rgba(16, 32, 44, .35);
}
.offers-slider.on-dark {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .16);
  color: #fff;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .55);
}

.os-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2px 6px 12px; }
.os-label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: .95rem; color: var(--c-accent-strong); }
.on-dark .os-label { color: var(--c-accent); }
.os-all { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 600; text-decoration: none; color: inherit; opacity: .85; }
.os-all:hover { opacity: 1; color: inherit; text-decoration: underline; }

/* Without JavaScript: a swipeable row. */
.os-viewport { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; scrollbar-width: thin; }
.os-slide { flex: 0 0 100%; scroll-snap-align: start; min-inline-size: 0; }

/* Enhanced: slides stacked, the tallest sets the height. */
.os-ready .os-viewport { display: grid; overflow: hidden; overflow: clip; }
.os-ready .os-slide {
  grid-area: 1 / 1;
  opacity: 0; visibility: hidden;
  transform: translateX(var(--os-shift, 18px));
  transition: opacity .55s var(--ease, ease), transform .55s var(--ease, ease), visibility 0s linear .55s;
}
[dir="rtl"] .os-ready .os-slide { --os-shift: -18px; }
.os-ready .os-slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; z-index: 1; }

.os-media {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-lg);
  background: var(--c-primary);
  display: grid; place-items: center;
}
.os-backdrop { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; filter: blur(18px) brightness(.7); transform: scale(1.18); z-index: -1; }
.os-img { inline-size: 100%; block-size: 100%; object-fit: contain; transition: transform 7s linear; }
.os-ready .is-active .os-img { transform: scale(1.04); }
.os-media.no-image { background: linear-gradient(135deg, var(--c-primary), var(--c-secondary)); }
.os-media.no-image i { font-size: 4rem; color: var(--c-accent); opacity: .9; }

.os-badge {
  position: absolute; inset-block-start: 12px; inset-inline-start: 12px;
  background: var(--c-accent-btn, var(--c-accent)); color: var(--c-on-accent, #111);
  font-weight: 800; font-size: .85rem; line-height: 1;
  padding: .5rem .85rem; border-radius: 999px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
}

.os-body { padding: 14px 6px 4px; }
.os-title { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); margin: 0 0 .35rem; color: inherit; }
.os-text { margin: 0 0 .65rem; font-size: .98rem; line-height: 1.7; opacity: .82; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.os-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; }
.os-until { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; opacity: .8; }
.os-cta { display: inline-flex; align-items: center; gap: .15rem; font-weight: 800; text-decoration: none; color: var(--c-accent-strong); }
.on-dark .os-cta { color: var(--c-accent); }
.os-cta:hover { text-decoration: underline; color: inherit; }
.os-cta i { font-size: 1.4em; }

/* Controls */
.os-controls { display: flex; align-items: center; gap: .5rem; padding: 12px 6px 2px; }
.os-dots { display: flex; align-items: center; gap: 6px; flex: 1; }
.os-dot {
  all: unset; cursor: pointer; box-sizing: border-box;
  block-size: 24px; inline-size: 22px; display: grid; align-items: center;
  transition: inline-size .3s var(--ease, ease);
}
.os-dot span { display: block; block-size: 4px; border-radius: 4px; background: currentColor; opacity: .25; position: relative; overflow: hidden; }
.os-dot[aria-current="true"] { inline-size: 54px; }
.os-dot[aria-current="true"] span { opacity: 1; background: rgba(127, 127, 127, .3); }
.on-dark .os-dot[aria-current="true"] span, .st-slider .os-dot[aria-current="true"] span { background: rgba(255, 255, 255, .25); }
.os-dot span::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 100%;
  background: var(--c-accent); border-radius: inherit;
  transform: scaleX(0); transform-origin: left center;
}
[dir="rtl"] .os-dot span::after { transform-origin: right center; }
.os-dot[aria-current="true"] span::after { transform: scaleX(1); }
.is-playing .os-dot[aria-current="true"] span::after { animation: os-fill var(--os-interval) linear forwards; }
.is-playing.is-held .os-dot[aria-current="true"] span::after { animation-play-state: paused; }
@keyframes os-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.os-dot:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

.os-btn {
  all: unset; cursor: pointer; box-sizing: border-box;
  inline-size: 38px; block-size: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid currentColor; opacity: .75;
  transition: opacity .2s, background-color .2s, color .2s;
}
.os-btn:hover, .os-btn:focus-visible { opacity: 1; background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent, #111); }
.os-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
[dir="ltr"] .os-btn i, [dir="ltr"] .os-cta i, [dir="ltr"] .st-cta i { transform: scaleX(-1); }
.offers-slider:not(.os-ready) .os-controls,
.offers-slider:not(.os-ready) .st-nav,
.offers-slider:not(.os-ready) .st-progress { display: none; }

/* Hero placement */
.hero-cover.has-offers h1 { max-inline-size: none; }
.hero-offers-centered { max-inline-size: 640px; margin: 2.5rem auto 0; text-align: start; }
@media (max-width: 991.98px) {
  .hero-cover.has-offers { padding-block-end: 8rem; }
}

/* ------------------------------------------------------------------
   2. Full-screen page
   ------------------------------------------------------------------ */
.offers-stage {
  --st-bg: var(--c-primary-strong, #0B2B3C);
  margin: 0; min-block-size: 100vh; min-block-size: 100dvh;
  background: radial-gradient(120% 90% at 85% 10%, rgba(255, 255, 255, .08), transparent 60%), var(--st-bg);
  color: #fff;
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.offers-stage *, .offers-stage *::before, .offers-stage *::after { box-sizing: border-box; }
.offers-stage h1, .offers-stage h2 { font-family: var(--font-heading); }
.offers-stage a { color: inherit; }
.visually-hidden { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.offers-stage .skip-link { position: absolute; inset-inline-start: 1rem; inset-block-start: -100px; z-index: 50; background: var(--c-accent); color: var(--c-on-accent, #111); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; }
.offers-stage .skip-link:focus { inset-block-start: 1rem; }
.offers-stage :focus-visible { outline: 3px solid var(--c-accent); outline-offset: 3px; }

/* Top bar */
.st-bar {
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  padding: clamp(12px, 2vh, 22px) clamp(16px, 3.5vw, 48px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .35), transparent);
  transition: opacity .5s, transform .5s;
}
.st-brand { display: inline-flex; align-items: center; text-decoration: none; }
.st-logo { display: inline-flex; background: #fff; border-radius: 12px; padding: 6px 12px; }
.st-logo img { display: block; block-size: clamp(30px, 4.2vh, 44px); inline-size: auto; }
.st-name { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; }
.st-heading { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; opacity: .9; padding-inline-start: 1rem; border-inline-start: 1px solid rgba(255, 255, 255, .25); }
.st-heading i { color: var(--c-accent); }
.st-actions { margin-inline-start: auto; display: flex; align-items: center; gap: .5rem; }
.st-chip {
  all: unset; cursor: pointer; box-sizing: border-box;
  display: inline-flex; align-items: center; gap: .4rem;
  min-block-size: 40px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28); font-weight: 600; font-size: .92rem;
  transition: background-color .2s;
}
.st-chip:hover { background: rgba(255, 255, 255, .12); }
.st-icon { inline-size: 40px; padding: 0; justify-content: center; }
.st-chip[hidden] { display: none; }

/* Slides */
.st-slider { block-size: 100vh; block-size: 100dvh; --os-interval: 8000ms; }
.st-slider .os-viewport { block-size: 100%; gap: 0; }
.st-slide { position: relative; overflow: hidden; isolation: isolate; block-size: 100%; }
.st-backdrop { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; filter: blur(42px) saturate(1.2); transform: scale(1.25); opacity: .45; z-index: -2; }
.st-slide::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to left, rgba(var(--c-primary-rgb), .96) 0%, rgba(var(--c-primary-rgb), .82) 45%, rgba(var(--c-primary-rgb), .55) 100%);
}
[dir="ltr"] .st-slide::before { background: linear-gradient(to right, rgba(var(--c-primary-rgb), .96) 0%, rgba(var(--c-primary-rgb), .82) 45%, rgba(var(--c-primary-rgb), .55) 100%); }

.st-inner {
  block-size: 100%; max-inline-size: 1500px; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); align-items: center;
  gap: clamp(24px, 4.5vw, 80px);
  padding: clamp(84px, 13vh, 130px) clamp(16px, 4.5vw, 64px) clamp(120px, 17vh, 170px);
}
.st-copy { display: flex; flex-direction: column; align-items: flex-start; min-inline-size: 0; }
.st-num {
  font-family: var(--font-heading); font-weight: 900; line-height: .9;
  font-size: clamp(3.5rem, 2rem + 6vw, 8.5rem);
  color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .22);
  margin-block-end: .25rem; font-variant-numeric: tabular-nums;
}
.st-badge { position: static; display: inline-block; font-size: clamp(.9rem, .8rem + .35vw, 1.15rem); padding: .6rem 1.1rem; margin-block-end: 1rem; }
.st-title { font-size: clamp(2rem, 1.1rem + 3.6vw, 5rem); line-height: 1.15; font-weight: 800; margin: 0 0 1rem; color: #fff; text-wrap: balance; }
.st-text { font-size: clamp(1.05rem, .9rem + .7vw, 1.6rem); line-height: 1.8; margin: 0 0 1.75rem; color: rgba(255, 255, 255, .88); max-inline-size: 46ch; }
:lang(en) .st-text { line-height: 1.6; }
.st-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem; }
.st-cta {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--c-accent-btn, var(--c-accent)); color: var(--c-on-accent, #111) !important;
  font-weight: 800; font-size: clamp(1rem, .9rem + .4vw, 1.25rem); text-decoration: none;
  padding: .95rem 1.8rem; border-radius: 999px;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5);
  transition: transform .2s, background-color .2s;
}
.st-cta:hover { transform: translateY(-2px); background: var(--c-accent-btn-hover, var(--c-accent)); }
.st-until { display: inline-flex; align-items: center; gap: .5rem; font-size: clamp(.95rem, .85rem + .3vw, 1.15rem); color: rgba(255, 255, 255, .85); }
.st-until i { color: var(--c-accent); }

.st-media { position: relative; display: grid; place-items: center; min-inline-size: 0; block-size: 100%; max-block-size: 66vh; }
.st-media img {
  display: block; max-inline-size: 100%; max-block-size: 66vh; inline-size: auto; block-size: auto;
  object-fit: contain; border-radius: 22px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .65);
  outline: 1px solid rgba(255, 255, 255, .18); outline-offset: 10px;
}
.st-media.no-image { aspect-ratio: 4 / 3; block-size: auto; inline-size: 100%; border-radius: 22px; border: 2px dashed rgba(255, 255, 255, .25); }
.st-media.no-image i { font-size: clamp(5rem, 10vw, 9rem); color: var(--c-accent); }

/* Entrance of the active slide */
.os-ready .st-slide.is-active .st-copy > * { animation: st-up .8s var(--ease, ease) both; }
.os-ready .st-slide.is-active .st-copy > :nth-child(2) { animation-delay: .08s; }
.os-ready .st-slide.is-active .st-copy > :nth-child(3) { animation-delay: .16s; }
.os-ready .st-slide.is-active .st-copy > :nth-child(4) { animation-delay: .24s; }
.os-ready .st-slide.is-active .st-copy > :nth-child(5) { animation-delay: .32s; }
.os-ready .st-slide.is-active .st-media { animation: st-in 1s var(--ease, ease) both; }
@keyframes st-up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes st-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* Bottom controls */
.st-controls {
  position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 20;
  padding: 0 clamp(16px, 4.5vw, 64px) clamp(14px, 3vh, 30px);
  background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent);
  transition: opacity .5s;
}
.st-progress { gap: 8px; margin-block-end: clamp(10px, 1.8vh, 18px); }
.st-progress .os-dot { flex: 1; inline-size: auto; block-size: 22px; }
.st-progress .os-dot span { block-size: 4px; background: rgba(255, 255, 255, .3); opacity: 1; }
.st-progress .os-dot.is-done span::after { transform: scaleX(1); }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.st-contact { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.st-contact a { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; font-weight: 700; font-size: clamp(.95rem, .85rem + .35vw, 1.2rem); }
.st-contact i { color: var(--c-accent); font-size: 1.15em; }
.st-nav { display: flex; align-items: center; gap: .6rem; }
.st-counter { font-variant-numeric: tabular-nums; margin-inline-end: .5rem; opacity: .85; font-size: 1.05rem; }
.st-counter strong { font-size: 1.5rem; color: var(--c-accent); }
.st-slider .os-btn { inline-size: 46px; block-size: 46px; border-color: rgba(255, 255, 255, .45); opacity: 1; font-size: 1.15rem; }

/* Idle (office screen): bars fade away and the cursor hides. */
.offers-stage.is-idle { cursor: none; }
.offers-stage.is-idle .st-bar { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.offers-stage.is-idle .st-nav, .offers-stage.is-idle .st-progress .os-dot:not([aria-current]) { opacity: .35; }
.offers-stage.is-kiosk .st-bar { display: none; }
.offers-stage.is-kiosk .st-inner { padding-block-start: clamp(40px, 7vh, 80px); }

/* Empty state */
.st-empty { min-block-size: 100vh; min-block-size: 100dvh; display: grid; place-content: center; justify-items: center; text-align: center; padding: 2rem; }
.st-empty > i { font-size: 4rem; color: var(--c-accent); }
.st-empty h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem); margin: 1rem 0 .5rem; }
.st-empty p { opacity: .85; margin: 0 0 1.75rem; }

/* Tablets and phones */
@media (max-width: 900px) {
  .offers-stage { overflow: auto; }
  .st-heading, .st-hide-sm { display: none; }
  .st-slider .os-viewport { block-size: auto; min-block-size: 100%; }
  .st-inner { grid-template-columns: 1fr; align-content: start; gap: 22px; padding-block: 86px 150px; }
  .st-media { order: -1; max-block-size: 42vh; }
  .st-media img { max-block-size: 42vh; outline-offset: 6px; border-radius: 16px; }
  .st-num { display: none; }
  .st-badge { margin-block-end: .75rem; }
  .st-text { margin-block-end: 1.25rem; }
  .st-counter { display: none; }
  .st-slider .os-btn { inline-size: 42px; block-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .os-ready .os-slide, .os-img, .st-bar, .st-controls, .os-dot { transition: none !important; }
  .os-ready .is-active .os-img { transform: none; }
  .os-ready .st-slide.is-active .st-copy > *, .os-ready .st-slide.is-active .st-media { animation: none; }
}
