/* ============================================================================
   رِماية — round 3 · «اختر هدفك، والعرض جاهز»
   ----------------------------------------------------------------------------
   The offer library, re-cast as goals: four goal cards on the start side, and a
   stage that holds the goal's type chips plus one live pocket-offer preview
   (light UI, store-teal accent — anatomy from the real widget, never its art).

   Prefix: og- . Tokens come from css/landing.css only; this file adds nothing
   to :root. Motion is transform / opacity / filter / clip-path only.
   ========================================================================== */

.og {
  padding-block: var(--sec-y);
  color: var(--text);
}

/* ------------------------------------------------------------- section head - */
.og__head {
  text-align: center;
  margin-block-end: 56px;
}

.og__title {
  font-size: clamp(32px, 4.2vw, 54px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--white);
  text-wrap: balance;
}

.og__sub {
  margin-block-start: 16px;
  margin-inline: auto;
  max-width: 46ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.8;
  color: var(--text-2);
}

/* --------------------------------------------------------------- the layout - */
.og-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.og__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 32px;
  align-items: center;
}

/* ---------------------------------------------------------- goal tab cards -- */
.og__goals {
  display: grid;
  gap: 12px;
}

.og-goal {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  padding: 18px;
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  color: var(--white);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition:
    background 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.og-goal:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
}

/* Highlighted card: a 1 px electric→violet gradient border (mask technique),
   plus a faint violet fill. No clipped glow. */
.og-goal::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--violet), var(--electric));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
  pointer-events: none;
}

.og-goal.is-on::before {
  opacity: 1;
}

.og-goal.is-on {
  border-color: transparent;
  background: linear-gradient(180deg, rgba(187, 80, 248, 0.11), rgba(92, 23, 253, 0.05));
}

.og-goal__ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--glass);
}

.og-goal__ico svg {
  width: 24px;
  height: 24px;
}

.og-goal__txt {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.og-goal__name {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--white);
}

.og-goal__count {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.og-goal__chev {
  flex: none;
  margin-inline-start: auto;
  width: 20px;
  height: 20px;
  color: var(--violet);
  opacity: 0;
  transform: translateX(5px);
  transition:
    opacity 0.25s var(--ease),
    transform 0.25s var(--ease);
}

.og-goal.is-on .og-goal__chev {
  opacity: 1;
  transform: none;
}

.og-goal:focus-visible,
.og-chip:focus-visible,
.og-panel:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}

/* -------------------------------------------------------------- the stage --- */
.og__stage {
  min-width: 0;
}

.og-panel {
  display: none;
  gap: 24px;
  align-content: center;
  min-height: 500px;
  padding: 28px;
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}

.og-panel.is-on {
  display: grid;
}

.og-panel:focus-visible {
  outline-offset: 6px;
}

/* ---------------------------------------------------------- type chips ------ */
.og-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.og-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--hair-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition:
    color 0.22s var(--ease),
    background 0.22s var(--ease),
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.og-chip:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.26);
}

.og-chip.is-on {
  color: var(--white);
  border-color: transparent;
  background: linear-gradient(135deg, rgba(187, 80, 248, 0.3), rgba(92, 23, 253, 0.3));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* -------------------------------------------------------- dotted backdrop --- */
.og-board {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.og-board__frame {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 460px;
  padding: 26px 20px;
  border-radius: 20px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1.4px);
  background-size: 18px 18px;
  background-position: center;
}

.og-cap {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-3);
}

.og-preview {
  display: none;
  width: 100%;
  justify-items: center;
}

.og-preview.is-on {
  display: grid;
}

/* ====================== THE POCKET OFFER CARD (light UI) ================== */
.og-card {
  display: grid;
  gap: 14px;
  align-content: start;
  width: 100%;
  max-width: 420px;
  min-height: 320px;
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  color: #1b1530;
  box-shadow:
    0 30px 60px -34px rgba(8, 0, 30, 0.7),
    0 0 0 1px #ece9f5;
}

.og-card__store {
  display: flex;
  align-items: center;
  gap: 8px;
}

.og-mono {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #024e5c;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.og-card__store-name {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #6b6680;
}

.og-card__page {
  margin-inline-start: auto;
  font-size: 12.5px;
  line-height: 1.5;
  color: #9a95ad;
}

.og-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.og-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: #024e5c;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.og-badge svg {
  width: 17px;
  height: 17px;
}

.og-card__intro {
  display: grid;
  gap: 6px;
}

.og-card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
  color: #1b1530;
  text-wrap: balance;
}

.og-card__goal {
  font-size: 14px;
  line-height: 1.7;
  color: #6b6680;
}

.og-card__body {
  display: grid;
  gap: 14px;
}

/* ---- progress meter ---- */
.og-meter {
  display: grid;
  gap: 8px;
}

.og-meter__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.og-meter__goal {
  font-weight: 700;
  color: #1b1530;
}

.og-meter__left {
  font-weight: 600;
  color: #024e5c;
  font-variant-numeric: tabular-nums;
}

.og-rail {
  position: relative;
}

.og-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(2, 78, 92, 0.12);
}

.og-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0a7b8f, #024e5c);
  transform-origin: 100% 50%;
  transform: scaleX(var(--p, 0.6));
}

.og-mark {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: calc(var(--m, 0.5) * 100%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  border: 3px solid #024e5c;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(2, 78, 92, 0.3);
}

/* ---- round product slots ---- */
.og-slots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.og-slot {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border: 1.5px dashed rgba(2, 78, 92, 0.32);
  border-radius: 999px;
  background: #f6f5fb;
  color: #a5a0b5;
  font-size: 20px;
  line-height: 1;
}

.og-slot img {
  display: block;
  width: 100%;
  height: 100%;
}

.og-slot--on {
  border-style: solid;
  border-color: #ece9f5;
  background: #ffffff;
}

.og-slot--lg {
  width: 84px;
  height: 84px;
}

/* ---- tier steps ---- */
.og-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.og-tier {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 10px 6px;
  border: 1px solid #ece9f5;
  border-radius: 14px;
  background: #faf9fd;
  text-align: center;
}

.og-tier b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: #8b869c;
  font-variant-numeric: tabular-nums;
}

.og-tier i {
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.4;
  color: #9a95ad;
  font-variant-numeric: tabular-nums;
}

.og-tier.is-hit {
  border-color: rgba(2, 78, 92, 0.28);
  background: rgba(2, 78, 92, 0.07);
}

.og-tier.is-hit b {
  color: #024e5c;
}

.og-tier.is-hit i {
  color: #4e7a83;
}

/* ---- product thumb row + price ---- */
.og-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.og-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid #ece9f5;
  border-radius: 14px;
  background: #f6f5fb;
}

.og-thumb--lg {
  flex: none;
  width: 88px;
  height: 88px;
  aspect-ratio: auto;
}

.og-thumb img {
  display: block;
  width: 100%;
  height: 100%;
}

.og-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.og-price s {
  font-size: 14px;
  color: #9a95ad;
}

.og-price b {
  font-size: 20px;
  font-weight: 700;
  color: #024e5c;
}

/* ---- category row ---- */
.og-cat {
  display: flex;
  align-items: center;
  gap: 14px;
}

.og-cat__txt {
  display: grid;
  gap: 4px;
}

.og-cat__txt b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: #1b1530;
}

.og-cat__txt i {
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
  color: #6b6680;
  font-variant-numeric: tabular-nums;
}

/* ---- upgrade swap ---- */
.og-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.og-swap__ico {
  flex: none;
  width: 24px;
  height: 24px;
  color: #024e5c;
}

/* ---- notes, gift, coupon ---- */
.og-note {
  font-size: 13px;
  line-height: 1.6;
  color: #6b6680;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.og-gift {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.og-gift__tag {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  color: #6b6680;
}

.og-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px dashed rgba(2, 78, 92, 0.4);
  border-radius: 16px;
  background: rgba(2, 78, 92, 0.06);
}

.og-ticket__pct {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #024e5c;
  font-variant-numeric: tabular-nums;
}

.og-ticket__code {
  padding: 6px 10px;
  border: 1px solid #ece9f5;
  border-radius: 8px;
  background: #ffffff;
  color: #1b1530;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  direction: ltr;
}

/* ---- the CTA ---- */
.og-cta {
  margin-block-start: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border-radius: 14px;
  background: #024e5c;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.og-cta svg {
  width: 18px;
  height: 18px;
}

/* ---------------------------------------------------------------- motion ---- */
/* CSS-only entrance: the markup already shows the final state, so no-JS and
   reduced motion need no tween. Switching a chip re-displays a preview, which
   restarts these animations — that is the "replay" the brief asks for. */
@media (prefers-reduced-motion: no-preference) {
  .js .og-preview.is-on {
    animation: og-card-in 260ms var(--ease-out) both;
  }

  .js .og-preview.is-on .og-fill {
    animation: og-fill 760ms var(--ease-out) both;
  }

  .js .og-preview.is-on .og-slot,
  .js .og-preview.is-on .og-thumb,
  .js .og-preview.is-on .og-tier {
    animation: og-pop 420ms var(--ease-out) both;
  }

  .js .og-preview.is-on .og-slot:nth-child(2),
  .js .og-preview.is-on .og-thumb:nth-child(2),
  .js .og-preview.is-on .og-tier:nth-child(2) {
    animation-delay: 70ms;
  }

  .js .og-preview.is-on .og-slot:nth-child(3),
  .js .og-preview.is-on .og-thumb:nth-child(3),
  .js .og-preview.is-on .og-tier:nth-child(3) {
    animation-delay: 140ms;
  }

  .js .og-preview.is-on .og-slot:nth-child(4),
  .js .og-preview.is-on .og-thumb:nth-child(4),
  .js .og-preview.is-on .og-tier:nth-child(4) {
    animation-delay: 210ms;
  }
}

@keyframes og-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes og-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(var(--p, 0.6));
  }
}

@keyframes og-pop {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------ responsive --- */
/* < 1024: the goals become a 2×2 grid of compact buttons above the stage;
   the stage goes full width and the preview is capped at 360 px. */
@media (max-width: 1023px) {
  .og__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .og__goals {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .og-goal {
    gap: 10px;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .og-goal__ico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .og-goal__ico svg {
    width: 20px;
    height: 20px;
  }

  .og-goal__name {
    font-size: 15px;
  }

  .og-goal__count,
  .og-goal__chev {
    display: none;
  }

  .og-panel {
    gap: 20px;
    min-height: 0;
    padding: 20px;
  }

  .og-board__frame {
    max-width: 400px;
    padding: 20px 14px;
  }

  .og-card {
    max-width: 360px;
    min-height: 0;
  }
}

@media (max-width: 759px) {
  .og__head {
    margin-block-end: 36px;
  }

  .og__title {
    line-height: 1.4;
  }
}

@media (max-width: 380px) {
  .og-goal {
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .og-goal__ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .og-goal__name {
    font-size: 14px;
    line-height: 1.45;
  }

  .og-board__frame {
    padding: 16px 10px;
  }

  .og-chip {
    min-height: 38px;
    padding: 0 13px;
    font-size: 14px;
  }

  .og-card {
    padding: 16px;
  }
}
