/* ===========================================================
   SmartLab — Saudi National Day 96 offers (limited time)
   Self-contained: remove this file + js/offers.js + the
   #offers section to retire the campaign. Auto-hides after
   the deadline set in js/offers.js.
   =========================================================== */

:root {
  --nd-green: #0b7a3e;
  --nd-green-deep: #06592c;
  --nd-gold: #b8923a;
  --nd-soft: #eef7f1;
}

.nd-expired .nd-only { display: none !important; }

/* ---------- hero badge ---------- */
.hero-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 20px; }
.hero-badges .welcome { margin-bottom: 0; }
.nd-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--nd-green); color: #fff; font-weight: 800; font-size: .82rem;
  border-radius: 999px; padding: 7px 16px; box-shadow: 0 8px 22px rgba(11,122,62,.35);
  transition: transform .25s var(--ease), background .25s;
}
.nd-pill:hover { background: var(--nd-green-deep); transform: translateY(-2px); }
.nd-pill svg { width: 15px; height: 15px; flex: none; }
html[dir="rtl"] .nd-pill svg { transform: scaleX(-1); }

/* nav link dot */
.nav-links a.nd-nav { display: inline-flex; align-items: center; gap: 7px; }
.nav-links a.nd-nav::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2ee6a0; box-shadow: 0 0 0 3px rgba(46,230,160,.25); flex: none; }

/* ---------- section ---------- */
.offers {
  position: relative; overflow: hidden;
  background:
    radial-gradient(700px 360px at 100% 0%, rgba(11,122,62,.09), transparent 65%),
    radial-gradient(640px 340px at 0% 100%, rgba(84,183,232,.12), transparent 65%),
    linear-gradient(180deg, var(--nd-soft) 0%, #ffffff 80%);
}
.offers .eyebrow { color: var(--nd-green); background: rgba(11,122,62,.1); }
.offers .section-head { margin-bottom: clamp(22px, 3vw, 30px); }
.offers .section-head h2 { color: var(--nd-green-deep); }

/* countdown */
.nd-countdown {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px;
  margin: 0 auto clamp(30px, 4.4vw, 48px);
}
.nd-countdown .lbl { font-weight: 700; color: var(--navy); font-size: clamp(.92rem, 2.4vw, 1rem); }
.nd-timer { display: flex; gap: 8px; }
.nd-timer .u {
  min-width: 66px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 8px 6px 6px; text-align: center; box-shadow: var(--shadow-sm);
}
.nd-timer .n { display: block; font-family: "Montserrat", "Tajawal", sans-serif; font-weight: 800; font-size: clamp(1.25rem, 3.6vw, 1.6rem); line-height: 1.1; color: var(--nd-green); font-variant-numeric: tabular-nums; }
.nd-timer .t { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); margin-top: 2px; }

/* ---------- featured card ---------- */
.offer-featured {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: clamp(20px, 3.4vw, 40px);
  align-items: center; background: #fff; border: 1.5px solid rgba(11,122,62,.28);
  border-radius: calc(var(--radius) + 6px); padding: clamp(14px, 2vw, 22px); box-shadow: var(--shadow);
  margin-bottom: clamp(20px, 3vw, 30px);
}
.offer-featured .offer-poster { border-radius: 18px; }
.of-info { padding: clamp(4px, 1vw, 10px) clamp(2px, 1vw, 14px) clamp(4px, 1vw, 10px) 0; min-width: 0; }
.of-tag {
  display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--nd-gold), #d4b264);
  color: #fff; font-weight: 800; font-size: .78rem; padding: 5px 14px; border-radius: 999px; margin-bottom: 12px;
}
.of-info h3 { font-size: clamp(1.7rem, 4.6vw, 2.6rem); font-weight: 900; color: var(--nd-green-deep); line-height: 1.2; }
.of-info .of-desc { color: var(--muted); margin: 8px 0 18px; font-size: clamp(.96rem, 2.4vw, 1.04rem); }
.of-figures { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin-bottom: 20px; }
.of-fig { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px; }
.of-fig b { display: block; font-family: "Montserrat", "Tajawal", sans-serif; font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 900; line-height: 1.15; }
.of-fig span { font-size: .85rem; font-weight: 700; color: var(--muted); }
.of-fig.count b { color: var(--cobalt); }
.of-fig.price { background: rgba(11,122,62,.07); border-color: rgba(11,122,62,.2); }
.of-fig.price b { color: var(--nd-green); }
.of-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.chip {
  font-size: .82rem; font-weight: 600; color: var(--cobalt); background: rgba(84,183,232,.1);
  border: 1px solid rgba(84,183,232,.22); padding: 4px 11px; border-radius: 999px; line-height: 1.5;
}
.chip.more { background: #fff; border-style: dashed; color: var(--nd-green); border-color: rgba(11,122,62,.4); cursor: pointer; font-weight: 800; }
.chip.more:hover { background: rgba(11,122,62,.06); }
.of-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.of-actions .btn { flex: 1 1 200px; }

/* ---------- regular cards ---------- */
.offers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.4vw, 24px); }
.offer {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
}
.offer:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: transparent; }
.offer-poster {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden;
  background: #eef3f6; cursor: zoom-in;
}
.offer-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.offer-poster:hover img { transform: scale(1.03); }
.offer-aud {
  position: absolute; inset-block-end: 10px; inset-inline-start: 10px; background: rgba(255,255,255,.94);
  color: var(--navy); font-size: .76rem; font-weight: 800; padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.offer-zoom {
  position: absolute; inset-block-end: 10px; inset-inline-end: 10px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.94); color: var(--navy); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.offer-zoom svg { width: 17px; height: 17px; }
.offer-body { padding: 14px 4px 2px; display: flex; flex-direction: column; flex: 1; }
.offer-body h3 { font-size: clamp(1.1rem, 2.6vw, 1.22rem); font-weight: 800; color: var(--navy); line-height: 1.35; margin-bottom: 8px; }
.offer-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.offer-meta .count { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.offer-meta .count svg { width: 16px; height: 16px; color: var(--azure); flex: none; }
.offer-price { color: var(--nd-green); font-weight: 800; font-size: .92rem; background: rgba(11,122,62,.08); padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.offer-price b { font-family: "Montserrat", "Tajawal", sans-serif; font-size: 1.2rem; font-weight: 900; }
.offer-actions { display: grid; gap: 8px; margin-top: auto; }
.offer-actions .btn { width: 100%; min-height: 44px; padding: 11px 16px; font-size: .92rem; }

.offers-note { text-align: center; color: var(--muted); font-size: .88rem; margin-top: clamp(22px, 3vw, 30px); }

/* ---------- tests modal ---------- */
.nd-modal { max-width: 760px; }
.nd-modal .modal-head .cr-sub b { color: var(--nd-green); }
.nd-modal-body { padding: 18px 24px 0; }
.nd-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; counter-reset: t; }
.nd-list li {
  display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; font-weight: 600; font-size: .92rem; line-height: 1.45; color: var(--ink);
}
.nd-list li::before {
  counter-increment: t; content: counter(t); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: .75rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cobalt)); font-family: "Montserrat", sans-serif;
}
.nd-poster-toggle { display: flex; justify-content: center; margin: 18px 0 4px; }
.nd-poster-toggle button { color: var(--cobalt); font-weight: 700; font-size: .92rem; text-decoration: underline; text-underline-offset: 4px; padding: 6px 10px; }
.nd-posters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.nd-posters[hidden] { display: none; }
.nd-posters img { width: 100%; border-radius: 14px; border: 1px solid var(--line); }
.nd-modal-foot {
  position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%);
  padding: 22px 24px 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.nd-modal-foot .offer-price { font-size: 1rem; padding: 6px 16px; }
.nd-modal-foot .btn { flex: 1 1 220px; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 1024px) {
  .offers-grid { grid-template-columns: repeat(2, 1fr); }
  .offer-featured { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .offer-featured { grid-template-columns: 1fr; padding: 12px; }
  .offer-featured .offer-poster { max-width: 460px; margin: 0 auto; }
  .of-info { padding: 4px 4px 6px; }
  .of-actions .btn { flex-basis: 100%; }

  /* swipeable row on phones */
  .offers-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px;
    margin-inline: calc(var(--gutter) * -1); padding: 6px var(--gutter) 14px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
  .offers-grid::-webkit-scrollbar { display: none; }
  .offers-grid .offer { flex: 0 0 min(78vw, 320px); scroll-snap-align: center; }
  .offer:hover { transform: none; }
  .nd-swipe { display: flex; }

  .nd-list { grid-template-columns: 1fr; }
  .nd-modal-body { padding: 16px 18px 0; }
  .nd-modal-foot { padding: 18px 18px calc(16px + env(safe-area-inset-bottom)); }
}

.nd-swipe { display: none; justify-content: center; gap: 6px; margin-top: 4px; }
.nd-swipe span { width: 7px; height: 7px; border-radius: 50%; background: #cfd8de; transition: background .2s, width .2s; }
.nd-swipe span.on { background: var(--nd-green); width: 20px; border-radius: 4px; }

@media (max-width: 420px) {
  .nd-timer .u { min-width: 58px; }
  .nd-countdown .lbl { width: 100%; text-align: center; }
  .nd-posters { grid-template-columns: 1fr; }
}

@media (hover: none) { .offer:hover, .nd-pill:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .offer-poster img { transition: none; } }
