/* صفحة معاينة العروض — نفس تخطيط شاشة العروض في التطبيق، بثيم فاتح */
:root {
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F0F3F9;
  --text: #0F172A;
  --text-2: #5B6478;
  --muted: #94A3B8;
  --cyan: #00B8D4;
  --cyan-ink: #0284A8;      /* سماوي أغمق ليُقرأ على الأبيض */
  --violet: #7C4DFF;
  --border: rgba(15, 23, 42, 0.08);
  --grad: linear-gradient(135deg, var(--cyan), var(--violet));
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
  --radius: 20px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* خلفية "Cyber" فاتحة: شبكة خفيفة وتوهجات */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 400px at 85% -5%, rgba(0, 184, 212, 0.14), transparent 70%),
    radial-gradient(500px 380px at 0% 30%, rgba(124, 77, 255, 0.10), transparent 70%),
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
}

.glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.top { max-width: 1100px; margin: 0 auto; padding: 20px 16px 8px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.logo {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: var(--surface); border: 1.5px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}
h1 {
  margin: 0; font-size: 24px; font-weight: 900; line-height: 1.2;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 14px;
  transition: all .2s;
}
@media (max-width: 420px) { .tab { font-size: 13px; padding: 9px 6px; line-height: 1.3; } }
.tab.active { color: #fff; background: var(--grad); border-color: transparent; box-shadow: 0 6px 18px rgba(124, 77, 255, 0.25); }

.search { display: flex; align-items: center; gap: 10px; border-radius: 15px; padding: 0 14px; }
.search svg { width: 22px; height: 22px; fill: var(--cyan-ink); flex: none; }
.search input {
  flex: 1; border: 0; outline: 0; background: transparent; padding: 14px 0; font: inherit; font-size: 15px; color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.search:focus-within { border-color: var(--cyan); }

.chips {
  max-width: 1100px; margin: 0 auto; display: flex; gap: 10px; overflow-x: auto; padding: 10px 16px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: var(--surface); color: var(--text-2); border: 1.5px solid var(--border); transition: all .2s;
}
.chip.active {
  color: var(--cyan-ink); border-color: transparent;
  background-image: linear-gradient(#fff, #fff), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}

main { max-width: 1100px; margin: 0 auto; padding: 10px 16px 60px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1.5px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(135deg, rgba(0,184,212,.35), rgba(124,77,255,.12));
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  aspect-ratio: 3 / 4;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12); }
.card:active { transform: scale(.98); }
.card .thumb { position: relative; flex: 3; background: var(--surface-2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: var(--muted); }
.card .cat {
  position: absolute; top: 8px; right: 8px; max-width: 80%;
  padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700;
  color: var(--cyan-ink); background: rgba(255,255,255,.9); border: 1px solid rgba(0,184,212,.35);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .info { flex: 2; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 12px 12px; min-height: 0; }
.card .title {
  margin: 0; font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.card .sdg { font-size: 14px; font-weight: 900; color: var(--cyan-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .usd { font-size: 11px; color: var(--muted); }
.card .view {
  flex: none; padding: 6px 12px; border-radius: 10px; font-size: 11px; font-weight: 800; color: var(--cyan-ink);
  border: 1.5px solid transparent;
  background-image: linear-gradient(#fff, #fff), var(--grad);
  background-origin: border-box; background-clip: padding-box, border-box;
}

.skeleton { aspect-ratio: 3 / 4; border-radius: var(--radius); background: linear-gradient(100deg, #eef1f6 30%, #f8f9fc 50%, #eef1f6 70%) 0 0 / 300% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -150% 0; } }

.empty, .more { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 0; }

/* البطاقة السفلية للتفاصيل (مثل OfferDetailBottomSheet) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); backdrop-filter: blur(4px); z-index: 20; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 21;
  width: min(640px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(15,23,42,.18);
  animation: up .25s ease;
}
@keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } }
.handle { width: 44px; height: 5px; border-radius: 3px; background: #dfe4ee; margin: 10px auto; }
.close { position: absolute; top: 14px; left: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); box-shadow: var(--shadow); z-index: 2; }
.banner { margin: 0 16px; border-radius: 18px; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.sheet-body { padding: 16px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--violet); background: rgba(124,77,255,.08); }
.sheet h2 { margin: 10px 0 12px; font-size: 19px; line-height: 1.5; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.price { font-size: 22px; font-weight: 900; color: var(--cyan-ink); }
.sheet .usd { font-size: 13px; color: var(--text-2); }
.eta { font-size: 13px; font-weight: 700; color: var(--text-2); text-align: left; }
.fields { margin-top: 12px; display: grid; gap: 6px; }
.fields .f { font-size: 13px; color: var(--text-2); padding: 8px 12px; border-radius: 12px; border: 1px dashed var(--border); }
.desc { color: var(--text-2); font-size: 13px; line-height: 1.8; white-space: pre-line; max-height: 160px; overflow: auto; direction: auto; }
.cta { display: grid; gap: 10px; margin-top: 14px; }
.btn {
  display: block; text-align: center; text-decoration: none; padding: 13px; border-radius: 14px; font-weight: 800; font-size: 15px;
  color: var(--cyan-ink); background: var(--surface); border: 1.5px solid rgba(0,184,212,.45);
}
.btn.primary { color: #fff; border: 0; background: var(--grad); box-shadow: 0 8px 20px rgba(124,77,255,.25); }
.btn.ghost { border-color: var(--border); color: var(--text-2); }
.btn[hidden] { display: none; }
.hint { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.7; }
