body {
  direction: rtl;
  text-align: right;
}

:root{
  --bg: #f4faf7;
  --card: #ffffff;
  --text: #0b1f14;
  --muted: #5c6f63;

  --green: #16a34a;           /* الأساسي */
  --green-2: #22c55e;         /* فاتح */
  --mint: #eaf7f0;            /* خلفيات فاتحة */
  --mint-2: #dff3e8;

  --shadow: 0 14px 30px rgba(0,0,0,.08);
  --shadow-soft: 0 8px 20px rgba(0,0,0,.07);

  --radius: 18px;
  --radius-lg: 24px;

  --container: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin:0;
  font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Container */
.container{
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

/* Topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.05);
}
.topbar__inner{
  height: 64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.topbar__nav{
  display:flex;
  gap: 18px;
  align-items:center;
}
.topbar__link{
  display:flex;
  gap: 8px;
  align-items:center;
  text-decoration:none;
  color: #1f2d24;
  font-weight: 700;
  font-size: 14px;
  opacity: .9;
  transition: transform .2s ease, opacity .2s ease;
}
.topbar__link:hover{ transform: translateY(-1px); opacity: 1; }
.icon{ font-size: 14px; opacity: .8; }

.brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mint), #fff);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  text-decoration:none;
}
.brand__mark{ font-size: 20px; }

/* Hero */
.hero{
  position: relative;
  min-height: 520px;
  display:flex;
  align-items:center;
  overflow:hidden;
  background: #06140d;
}
.hero__bg{
  position:absolute;
  inset: 0;
  background:
    radial-gradient(1200px 520px at 50% 0%, rgba(34,197,94,.25), transparent 60%),
    radial-gradient(900px 420px at 15% 20%, rgba(34,197,94,.15), transparent 55%),
    radial-gradient(900px 420px at 85% 20%, rgba(34,197,94,.12), transparent 55%),
    linear-gradient(135deg, rgba(0,0,0,.55), rgba(0,0,0,.25));
  filter: saturate(1.1);
}

/* خطوط “شبه نيون” بالخلفية */
.hero__bg::before{
  content:"";
  position:absolute;
  inset:-80px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700'%3E%3Cg fill='none' stroke='%2322c55e' stroke-opacity='.35' stroke-width='5'%3E%3Cpath d='M60 120 C220 40, 320 240, 520 140 S 860 220, 1040 120'/%3E%3Cpath d='M120 320 C260 220, 360 460, 560 360 S 900 420, 1120 320'/%3E%3Cpath d='M80 520 C260 460, 340 660, 560 560 S 880 640, 1120 520'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  opacity: .45;
  transform: rotate(-6deg);
  filter: blur(0.2px);
}

/* “كرتون” بالأطراف */
.hero__bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(260px 260px at 6% 18%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(260px 260px at 94% 18%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(340px 340px at 8% 70%, rgba(0,0,0,.35), transparent 65%),
    radial-gradient(340px 340px at 92% 70%, rgba(0,0,0,.35), transparent 65%);
}

.hero__content{
  position: relative;
  padding: 64px 0 72px;
  text-align:center;
  color: #fff;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}

.hero__title{
  margin: 18px 0 10px;
  font-size: clamp(34px, 4.4vw, 62px);
  line-height: 1.12;
  font-weight: 900;
  text-shadow: 0 18px 40px rgba(0,0,0,.38);
}
.hero__subtitle{
  margin: 0 auto 26px;
  max-width: 640px;
  color: rgba(255,255,255,.78);
  font-size: 16px;
  font-weight: 600;
}

.hero__actions{
  display:flex;
  justify-content:center;
  gap: 12px;
}

.btn{
  border:0;
  cursor:pointer;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 900;
  font-size: 14px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap: 10px;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  user-select:none;
}
.btn:active{ transform: translateY(1px) scale(.99); }

.btn--ghost{
  color: var(--green);
  background: #fff;
  box-shadow: 0 14px 30px rgba(0,0,0,.20);
}
.btn--ghost:hover{ transform: translateY(-2px); filter: brightness(1.01); }

.btn__arrow{ font-size: 18px; transform: translateY(-1px); }

/* Section */
.section{
  padding: 54px 0 70px;
  background: #f6fbf8;
}
.section__title{
  text-align:center;
  margin: 0;
  font-size: clamp(24px, 2.5vw, 40px);
  font-weight: 900;
  color: #0c2316;
}
.section__hint{
  text-align:center;
  margin: 8px 0 26px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

/* Grid */
.grid{
  display:grid;
  gap: 18px;
}
.coupons{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px){
  .coupons{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .coupons{ grid-template-columns: 1fr; }
}

/* Coupon Card */
.coupon{
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0,0,0,.06);
  overflow:hidden;
  transform: translateY(10px);
  opacity: 0;
  animation: rise .7s ease forwards;
}
.coupon:nth-child(1){ animation-delay: .03s; }
.coupon:nth-child(2){ animation-delay: .08s; }
.coupon:nth-child(3){ animation-delay: .13s; }
.coupon:nth-child(4){ animation-delay: .18s; }
.coupon:nth-child(5){ animation-delay: .23s; }
.coupon:nth-child(6){ animation-delay: .28s; }

@keyframes rise{
  to { transform: translateY(0); opacity: 1; }
}

.coupon:hover{
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.coupon__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding: 16px 16px 10px;
}

.badge{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width: 70px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--mint), #fff);
  border: 1px solid rgba(22,163,74,.18);
}
.badge__num{
  color: var(--green);
  font-weight: 1000;
  font-size: 18px;
  line-height: 1;
}
.badge__lbl{
  margin-top: 3px;
  font-size: 12px;
  font-weight: 900;
  color: #365a45;
  opacity:.9;
}

.coupon__meta{
  text-align:right;
}
.coupon__store{
  font-weight: 1000;
  font-size: 16px;
  margin-bottom: 6px;
}
.tag{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--mint);
  border: 1px solid rgba(22,163,74,.16);
  color: #2a5b3b;
  font-weight: 900;
  font-size: 12px;
}

/* Code box */
.coupon__codeWrap{
  padding: 10px 16px 10px;
}
.codebox{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfffd);
  border: 2px dashed rgba(22,163,74,.25);
}

.codebox__left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.dot{
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--mint), #fff);
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(22,163,74,.22);
}
.dot::before{
  content:"🏷️";
  font-size: 14px;
  transform: translateY(-.5px);
}

.code{
  font-weight: 1000;
  letter-spacing: .9px;
  font-size: 15px;
  color: #0b1f14;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}

.copyHint{
  font-size: 12px;
  font-weight: 800;
  color: #3a5e49;
  opacity: .8;
}

/* Expiry row */
.coupon__foot{
  padding: 0 16px 14px;
}
.expiry{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f2faf6;
  border: 1px solid rgba(0,0,0,.05);
  color: #345746;
  font-weight: 900;
  font-size: 12px;
}
.expiry .cal{ opacity:.85; }

/* Copy button */
.coupon__actions{
  padding: 0 16px 16px;
}
.copyBtn{
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 1000;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), #0f8a3c);
  box-shadow: 0 12px 24px rgba(22,163,74,.22);
  cursor:pointer;
  position: relative;
  overflow:hidden;
  transition: transform .2s ease, filter .2s ease;
}
.copyBtn:hover{ transform: translateY(-2px); filter: brightness(1.02); }
.copyBtn:active{ transform: translateY(0); }

/* Ripple */
.copyBtn::after{
  content:"";
  position:absolute;
  inset:auto;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.35);
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
  pointer-events:none;
}
.copyBtn.ripple::after{
  left: var(--x);
  top: var(--y);
  opacity: 1;
  animation: ripple .55s ease forwards;
}
@keyframes ripple{
  to{ transform: translate(-50%,-50%) scale(32); opacity: 0; }
}

/* Footer */
.footer{
  background: #f6fbf8;
  padding: 18px 0 26px;
  border-top: 1px solid rgba(0,0,0,.05);
}
.footer__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer__link{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  text-decoration:none;
  color: #1f2d24;
  font-weight: 900;
}
.footer__copy{
  color: #4e6357;
  font-weight: 800;
  font-size: 13px;
}

/* Toast */
.toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.12);
  padding: 12px 14px;
  display:flex;
  align-items:center;
  gap: 10px;
  transform: translateY(14px);
  opacity: 0;
  pointer-events:none;
  transition: transform .25s ease, opacity .25s ease;
}
.toast.show{
  transform: translateY(0);
  opacity: 1;
}
.toast__icon{ font-size: 16px; }
.toast__text{ font-weight: 900; color: #163123; }

.logo{
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.topbar__inner{
  flex-direction: row-reverse;
}

.topbar__nav{
  flex-direction: row-reverse;
}

.privacy-box{
  background: white;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  margin-top: 20px;
}

.privacy-box h3{
  margin-top: 20px;
  font-size: 18px;
  color: #16a34a;
}

.privacy-box p{
  line-height: 1.8;
  color: #444;
  font-weight: 600;
}
.pwa-box {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #20a487;
  color: white;
  padding: 15px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  font-family: sans-serif;
  z-index: 9999;
}

.pwa-box button {
  background: white;
  color: #20a487;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
