/* ══════════════════════════════════════════════════════════
   ALTARESH — Offer Engine
   Warm Gold × Deep Black × Rich Amber
   CSS ONLY — no logic touched
══════════════════════════════════════════════════════════ */

:root {
  --gold      : #c9a96e;
  --gold-light: #e2c896;
  --gold-dim  : #a07c45;
  --ink       : #0e0c0a;
  --ink-soft  : #1a1714;
  --warm      : #2a2219;
  --paper     : #f5f0e8;
  --cream     : #ede8dc;
  --border    : #d9d0be;
  --muted     : #8a7e6e;
  --ease      : cubic-bezier(.25,.46,.45,.94);
}

/* ── Base ─────────────────────────────────────────────────── */
.coe-wrap {
  direction  : rtl;
  font-family: 'DM Sans', 'Segoe UI', Tahoma, sans-serif;
  color      : var(--ink);
  background : var(--paper);
  width      : 100%;
}
.coe-wrap *, .coe-wrap *::before, .coe-wrap *::after { box-sizing:border-box; }

/* ── Step entrance ────────────────────────────────────────── */
.coe-step { animation: coe-in .5s var(--ease) both; }
@keyframes coe-in {
  from { opacity:0; transform:translateY(22px); }
  to   { opacity:1; transform:translateY(0);    }
}

/* ══════════════════════════════════════════════════════════
   HERO — درامي وعميق
══════════════════════════════════════════════════════════ */
.coe-hero {
  position  : relative;
  padding   : 60px 48px 52px;
  overflow  : hidden;
  text-align: right;
  /* خلفية متدرجة دافئة وعميقة */
  background: radial-gradient(ellipse at 70% 0%, #2e1f08 0%, #1a1208 40%, var(--ink) 100%);
}

/* نسيج خفي */
.coe-hero::before {
  content   : '';
  position  : absolute;
  inset     : 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a96e' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity   : 1;
  z-index   : 0;
}

/* خط ذهبي علوي */
.coe-hero::after {
  content   : '';
  position  : absolute;
  top:0; left:0; right:0;
  height    : 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, transparent 100%);
  z-index   : 1;
}

/* الموجة السفلية دافئة */
.coe-hero-wave {
  position  : absolute;
  bottom    : -1px; left:0; right:0;
  height    : 50px;
  background: var(--paper);
  clip-path : ellipse(58% 100% at 50% 100%);
  z-index   : 2;
}

.coe-hero > *:not(.coe-hero-wave) { position:relative; z-index:3; }

.coe-eyebrow {
  display       : block;
  font-size     : .62rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color         : var(--gold);
  margin-bottom : 18px;
  font-weight   : 400;
}

.coe-hero-title {
  font-family   : 'Playfair Display', Georgia, serif;
  font-size     : clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight   : 900;
  line-height   : 1.08;
  letter-spacing: -.02em;
  margin        : 0 0 16px;
  color         : #fff;
}

.coe-hero-title em {
  font-style: italic;
  font-weight: 400;
  color      : var(--gold);
}

.coe-hero-sub {
  font-size  : .88rem;
  color      : rgba(201,169,110,.6);
  font-weight: 300;
  margin     : 0;
  line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   PROGRESS BAR
══════════════════════════════════════════════════════════ */
.coe-steps-bar {
  display        : flex;
  align-items    : center;
  justify-content: flex-end;
  padding        : 26px 48px 0;
  direction      : rtl;
}

.coe-bar-step {
  display    : flex;
  align-items: center;
  gap        : 8px;
  font-size  : .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color      : var(--border);
  transition : color .35s var(--ease);
  white-space: nowrap;
}

.coe-bar-step.is-active { color: var(--ink); }
.coe-bar-step.is-done   { color: var(--gold); }

.coe-bar-dot {
  width        : 7px; height:7px;
  border       : 1.5px solid currentColor;
  border-radius: 50%;
  background   : transparent;
  transition   : background .35s, border-color .35s;
  flex-shrink  : 0;
}
.coe-bar-step.is-active .coe-bar-dot { background:var(--ink); }
.coe-bar-step.is-done   .coe-bar-dot { background:var(--gold); border-color:var(--gold); }

.coe-bar-line {
  width     : 36px; height:1px;
  background: var(--border);
  margin    : 0 8px;
  flex-shrink:0;
}

/* ══════════════════════════════════════════════════════════
   BODY
══════════════════════════════════════════════════════════ */
.coe-body {
  padding: 36px 48px 56px;
}

.coe-section-h {
  font-family   : 'Playfair Display', Georgia, serif;
  font-size     : 1.5rem;
  font-weight   : 700;
  margin        : 0 0 5px;
  letter-spacing: -.01em;
  color         : var(--ink);
}

.coe-section-p {
  color      : var(--muted);
  font-size  : .83rem;
  margin     : 0 0 28px;
  font-weight: 300;
}

.coe-back-btn {
  display    : inline-flex;
  align-items: center;
  gap        : 7px;
  background : none;
  border     : none;
  cursor     : pointer;
  color      : var(--muted);
  font-family: inherit;
  font-size  : .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding    : 0;
  margin-bottom: 28px;
  transition : color .2s;
}
.coe-back-btn:hover { color: var(--gold); }

/* ══════════════════════════════════════════════════════════
   PRODUCT GRID
══════════════════════════════════════════════════════════ */
.coe-grid {
  display              : grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap                  : 18px;
}

/* ── Card ─────────────────────────────────────────────────── */
.coe-card {
  border       : 1px solid var(--border);
  border-radius: 2px;
  overflow     : hidden;
  cursor       : pointer;
  background   : #fff;
  position     : relative;
  transition   : border-color .25s var(--ease),
                 box-shadow   .25s var(--ease),
                 transform    .25s var(--ease);
  user-select  : none;
  outline      : none;
}

.coe-card:hover {
  border-color: var(--gold-dim);
  transform   : translateY(-4px);
  box-shadow  : 0 12px 40px rgba(14,12,10,.12),
                0 2px 8px  rgba(201,169,110,.1);
}

.coe-card.selected {
  border-color: var(--gold);
  border-width: 2px;
  box-shadow  : 0 0 0 3px rgba(201,169,110,.18),
                0 8px 28px rgba(14,12,10,.1);
}

.coe-card-check {
  position      : absolute;
  top:10px; left:10px;
  width:28px; height:28px;
  background    : var(--gold);
  color         : #fff;
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 13px;
  font-weight   : 700;
  opacity       : 0;
  transform     : scale(.3);
  transition    : opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
  z-index       : 2;
}
.coe-card.selected .coe-card-check { opacity:1; transform:scale(1); }

.coe-card-img {
  aspect-ratio: 1;
  overflow    : hidden;
  background  : var(--cream);
}
.coe-card-img img {
  width:100%; height:100%;
  object-fit: cover;
  display   : block;
  transition: transform .5s var(--ease);
}
.coe-card:hover .coe-card-img img { transform:scale(1.07); }

.coe-card-info {
  padding   : 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.coe-card-name {
  font-size  : .87rem;
  font-weight: 500;
  line-height: 1.4;
  margin     : 0 0 4px;
  color      : var(--ink);
}
.coe-card-price {
  font-size  : .82rem;
  color      : var(--muted);
  margin     : 0;
}
.coe-card-price .amount {
  color      : var(--ink);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   OFFER TYPE CARDS — قلب الصفحة
══════════════════════════════════════════════════════════ */
.coe-offer-row {
  display  : flex;
  gap      : 20px;
  flex-wrap: wrap;
}

.coe-offer-card {
  flex          : 1;
  min-width     : 190px;
  max-width     : 320px;
  border        : 1px solid var(--border);
  border-radius : 2px;
  padding       : 44px 36px;
  text-align    : center;
  cursor        : pointer;
  background    : #fff;
  display       : flex;
  flex-direction: column;
  align-items   : center;
  gap           : 6px;
  position      : relative;
  overflow      : hidden;
  transition    : border-color .3s var(--ease), box-shadow .3s;
  user-select   : none;
  outline       : none;
}

/* خلفية تتدرج من الأسفل عند الـ hover */
.coe-offer-card::before {
  content         : '';
  position        : absolute;
  inset           : 0;
  background      : linear-gradient(160deg, var(--ink) 0%, var(--ink-soft) 60%, var(--warm) 100%);
  transform       : scaleY(0);
  transform-origin: bottom;
  transition      : transform .38s var(--ease);
  z-index         : 0;
}

/* خط ذهبي سفلي */
.coe-offer-card::after {
  content   : '';
  position  : absolute;
  bottom    : 0; left:20%; right:20%;
  height    : 2px;
  background: var(--gold);
  transform : scaleX(0);
  transition: transform .35s var(--ease) .1s, opacity .3s;
  opacity   : 0;
  z-index   : 1;
}

.coe-offer-card > * { position:relative; z-index:2; transition:color .28s var(--ease); }

.coe-offer-card:hover,
.coe-offer-card.selected {
  border-color: var(--gold);
  box-shadow  : 0 12px 40px rgba(14,12,10,.14),
                0 2px 10px rgba(201,169,110,.15);
}
.coe-offer-card:hover::before,
.coe-offer-card.selected::before { transform:scaleY(1); }
.coe-offer-card:hover::after,
.coe-offer-card.selected::after  { transform:scaleX(1); opacity:1; }

/* color flips */
.coe-offer-card:hover .coe-offer-eyebrow,
.coe-offer-card.selected .coe-offer-eyebrow { color:var(--gold-light); }

.coe-offer-card:hover .coe-offer-num,
.coe-offer-card:hover .coe-offer-currency,
.coe-offer-card:hover .coe-offer-desc,
.coe-offer-card.selected .coe-offer-num,
.coe-offer-card.selected .coe-offer-currency,
.coe-offer-card.selected .coe-offer-desc { color:#fff; }

.coe-offer-eyebrow {
  font-size     : .63rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color         : var(--gold);
  font-weight   : 500;
}

.coe-offer-num {
  font-family   : 'Playfair Display', Georgia, serif;
  font-size     : 4.2rem;
  font-weight   : 900;
  line-height   : 1;
  color         : var(--ink);
  letter-spacing: -.03em;
}

.coe-offer-currency {
  font-size  : .78rem;
  color      : var(--muted);
  font-weight: 300;
  margin-top : 2px;
}

.coe-offer-desc {
  font-size  : .75rem;
  color      : var(--muted);
  font-weight: 300;
  margin-top : 10px;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════
   ACTION BAR
══════════════════════════════════════════════════════════ */
.coe-action {
  margin-top : 40px;
  padding-top: 32px;
  border-top : 1px solid var(--border);
  display    : flex;
  align-items: center;
  gap        : 24px;
  flex-wrap  : wrap;
}

.coe-atc-btn {
  background    : var(--ink);
  color         : #fff;
  border        : 1px solid var(--gold-dim);
  height        : 56px;
  padding       : 0 44px;
  border-radius : 2px;
  cursor        : pointer;
  font-family   : inherit;
  display       : flex;
  flex-direction: column;
  align-items   : center;
  justify-content: center;
  gap           : 3px;
  transition    : background .25s, border-color .25s, transform .15s, box-shadow .25s;
  min-width     : 220px;
  position      : relative;
  overflow      : hidden;
}

.coe-atc-btn::after {
  content   : '';
  position  : absolute;
  inset     : 0;
  background: linear-gradient(105deg, transparent 35%, rgba(201,169,110,.18) 50%, transparent 65%);
  transform : translateX(-130%);
  transition: transform .55s var(--ease);
}

.coe-atc-btn:hover::after  { transform:translateX(130%); }
.coe-atc-btn:hover {
  background  : var(--ink-soft);
  border-color: var(--gold);
  transform   : translateY(-1px);
  box-shadow  : 0 8px 28px rgba(14,12,10,.18), 0 2px 8px rgba(201,169,110,.15);
}
.coe-atc-btn:active  { transform:translateY(0); }
.coe-atc-btn:disabled {
  opacity     : .38;
  cursor      : not-allowed;
  border-color: var(--border);
  transform   : none;
  box-shadow  : none;
}
.coe-atc-btn:disabled::after { display:none; }

.coe-atc-main {
  font-size     : .8rem;
  font-weight   : 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height   : 1;
}
.coe-atc-note {
  font-size  : .68rem;
  color      : var(--gold);
  font-weight: 300;
  letter-spacing:.02em;
}
.coe-atc-btn:disabled .coe-atc-note { color:rgba(255,255,255,.4); }

.coe-summary {
  font-size  : .82rem;
  color      : var(--muted);
  line-height: 1.7;
  margin     : 0;
  font-weight: 300;
}
.coe-summary strong {
  color      : var(--ink);
  font-weight: 600;
  display    : block;
}

/* ══════════════════════════════════════════════════════════
   LOADER
══════════════════════════════════════════════════════════ */
.coe-loader {
  display    : flex;
  align-items: center;
  gap        : 12px;
  padding    : 52px 0;
  color      : var(--muted);
  font-size  : .78rem;
  letter-spacing:.08em;
}

.coe-spinner {
  width        : 26px; height:26px;
  border       : 1.5px solid var(--cream);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation    : coe-spin .75s linear infinite;
  flex-shrink  : 0;
}
@keyframes coe-spin { to { transform:rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   NOTICE
══════════════════════════════════════════════════════════ */
.coe-empty {
  color    : var(--muted);
  font-size: .84rem;
  padding  : 40px 0;
  margin   : 0;
}

.coe-notice {
  padding      : 13px 18px;
  border-radius: 2px;
  font-size    : .83rem;
  font-weight  : 500;
  margin       : 0 0 24px;
}
.coe-notice--error   { background:#fef2f2; color:#991b1b; border:1px solid #fecaca; }
.coe-notice--success { background:#fffbeb; color:#78350f; border:1px solid #fde68a; }

/* ══════════════════════════════════════════════════════════
   SUCCESS SCREEN
══════════════════════════════════════════════════════════ */
.coe-success {
  text-align: center;
  padding   : 80px 48px 88px;
  background: radial-gradient(ellipse at 50% 0%, #2a1e0a 0%, var(--ink) 70%);
  color     : #fff;
  position  : relative;
  overflow  : hidden;
}

.coe-success::before {
  content   : '';
  position  : absolute;
  top:0; left:0; right:0;
  height    : 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.coe-success-icon {
  width         : 68px; height:68px;
  border        : 1.5px solid var(--gold);
  border-radius : 50%;
  display       : flex;
  align-items   : center;
  justify-content: center;
  font-size     : 1.7rem;
  color         : var(--gold);
  margin        : 0 auto 28px;
  animation     : coe-pop .45s var(--ease) both;
  background    : rgba(201,169,110,.08);
}
@keyframes coe-pop {
  from { transform:scale(.3); opacity:0; }
  to   { transform:scale(1);  opacity:1; }
}

.coe-success-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size  : 2.2rem;
  font-weight: 700;
  margin     : 0 0 12px;
  color      : #fff;
}

.coe-success-msg {
  color      : rgba(255,255,255,.55);
  font-size  : .9rem;
  margin     : 0 auto 36px;
  font-weight: 300;
  line-height: 1.7;
  max-width  : 420px;
}

.coe-success-btns {
  display        : flex;
  gap            : 14px;
  justify-content: center;
  flex-wrap      : wrap;
}

.coe-btn-black {
  display       : inline-block;
  background    : var(--gold);
  color         : var(--ink);
  text-decoration: none;
  padding       : 0 36px;
  height        : 50px;
  line-height   : 50px;
  font-size     : .76rem;
  font-weight   : 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius : 2px;
  transition    : background .2s, transform .15s;
}
.coe-btn-black:hover {
  background: var(--gold-light);
  color     : var(--ink);
  transform : translateY(-1px);
}

.coe-btn-outline {
  display       : inline-block;
  background    : none;
  color         : rgba(255,255,255,.75);
  border        : 1px solid rgba(201,169,110,.4);
  padding       : 0 36px;
  height        : 50px;
  line-height   : 48px;
  font-family   : inherit;
  font-size     : .76rem;
  font-weight   : 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  border-radius : 2px;
  cursor        : pointer;
  transition    : border-color .2s, color .2s, transform .15s;
}
.coe-btn-outline:hover {
  border-color: var(--gold);
  color       : #fff;
  transform   : translateY(-1px);
}

/* ── Cart qty locked ──────────────────────────────────────── */
.coe-qty-locked {
  display      : inline-block;
  padding      : 3px 14px;
  background   : var(--cream);
  border-radius: 20px;
  color        : var(--muted);
  font-size    : .82rem;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width:680px) {
  .coe-hero,
  .coe-body      { padding-left:22px; padding-right:22px; }
  .coe-hero      { padding-top:40px; padding-bottom:38px; }
  .coe-body      { padding-top:26px; padding-bottom:44px; }
  .coe-steps-bar { padding-left:22px; padding-right:22px; }

  .coe-grid      { grid-template-columns:repeat(2,1fr); gap:12px; }
  .coe-offer-row { gap:12px; }
  .coe-offer-card{ min-width:140px; padding:30px 18px; }
  .coe-offer-num { font-size:2.8rem; }

  .coe-action    { flex-direction:column; align-items:stretch; }
  .coe-atc-btn   { width:100%; min-width:unset; }
  .coe-success   { padding:56px 22px 64px; }
}
