/* סבבה דיל — קטלוג "מבצעי השבוע". ערכת צבעים קבועה בהשראת הלוגו (כהה, ניאון טורקיז→סגול, אש כתום→אדום).
   בכוונה לא עוקבת אחרי ערכת הנושא של טלגרם: המותג כהה תמיד (החלטת משתמש 26.9.2026). */

:root {
  --bg: #0a0f1e;
  --bg-2: #0f1629;
  --card: #131c32;
  --card-2: #182340;
  --line: rgba(120, 160, 255, .16);
  --text: #eef2ff;
  --hint: #93a0c0;
  --cyan: #38d3ff;
  --blue: #4f8cff;
  --purple: #9b5cff;
  --orange: #ff8a2a;
  --red: #ff4b3e;

  --grad-neon: linear-gradient(90deg, #38d3ff 0%, #6f7dff 45%, #b25cff 75%, #ff6a3d 100%);
  --grad-fire: linear-gradient(135deg, #ffc02e 0%, #ff6a2a 55%, #e8264f 100%);
  --grad-silver: linear-gradient(180deg, #ffffff 0%, #cfdcf5 55%, #9fb3d9 100%);
  --grad-btn: linear-gradient(90deg, #2fb8ff 0%, #7a5cff 100%);

  --radius: 16px;
  --gutter: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(60vmax 40vmax at 100% -10%, rgba(155, 92, 255, .18), transparent 60%),
    radial-gradient(60vmax 40vmax at 0% 0%, rgba(56, 211, 255, .14), transparent 60%),
    radial-gradient(50vmax 40vmax at 50% 110%, rgba(255, 106, 42, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body.locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
button { font: inherit; color: inherit; }

.app { max-width: 1120px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ── כותרת ─────────────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 14px; padding: 18px var(--gutter) 10px; }
.hero-logo {
  flex: none;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(56, 211, 255, .55), 0 0 0 4px rgba(155, 92, 255, .25), 0 0 26px rgba(120, 110, 255, .45);
}
.hero-text { min-width: 0; }
.brand { margin: 0; font-size: 30px; line-height: 1.05; font-weight: 900; letter-spacing: -.01em; }
.brand-a, .brand-b { -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-a { background-image: var(--grad-silver); }
.brand-b { background-image: var(--grad-fire); }
.tagline { margin: 4px 0 0; font-size: 14px; color: #c8d3ee; }
.meta { margin: 4px 0 0; color: var(--hint); font-size: 12.5px; }

/* ── לשוניות ───────────────────────────────────────────── */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px var(--gutter);
  background: linear-gradient(180deg, var(--bg) 70%, rgba(10, 15, 30, 0));
}
.tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 8px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--bg-2);
  color: var(--hint);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s ease, box-shadow .15s ease;
}
.tab[aria-selected="true"] {
  color: var(--text);
  border-color: transparent;
  background: linear-gradient(var(--card-2), var(--card-2)) padding-box, var(--grad-neon) border-box;
  box-shadow: 0 0 18px rgba(111, 125, 255, .35);
}
.count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 700;
  color: var(--hint);
}
.count:empty { display: none; }
.tab[aria-selected="true"] .count { background: var(--grad-fire); color: #fff; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* ── רשת וכרטיסים ─────────────────────────────────────── */
main { flex: 1; padding: 4px var(--gutter) 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: start;
  cursor: pointer;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
@media (hover: hover) {
  .card:hover { transform: translateY(-2px); border-color: rgba(56, 211, 255, .45); box-shadow: 0 8px 24px rgba(0, 0, 0, .35), 0 0 16px rgba(56, 211, 255, .18); }
}
.card-media { position: relative; display: block; aspect-ratio: 1 / 1; background: #0d1426; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 11px 11px; flex: 1; min-width: 0; }
.card-title {
  font-size: 14px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.price { font-weight: 900; font-size: 18px; color: #fff; }
.orig { color: var(--hint); text-decoration: line-through; font-size: 12.5px; }
.stats { color: var(--hint); font-size: 12px; display: flex; flex-direction: column; }
.posted { color: #7282a6; font-size: 11.5px; margin-top: auto; padding-top: 3px; }
.expiry { font-size: 12.5px; color: var(--hint); }

.badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  padding: 3px 8px;
  border-radius: 9px;
  background: var(--grad-fire);
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  direction: ltr;
  box-shadow: 0 2px 10px rgba(255, 90, 42, .45);
}
.badge-soon {
  inset-inline-start: auto;
  inset-inline-end: 8px;
  direction: rtl;
  font-size: 12px;
  font-weight: 800;
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 75, 62, .6);
}

/* אריח קופון: דמות המותג + אחוז ההנחה (עד שיהיו תמונות מותג לכל מקור) */
.coupon-tile { position: absolute; inset: 0; display: block; overflow: hidden; }
.coupon-tile img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(1.1); }
.coupon-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 15, 30, 0) 25%, rgba(10, 15, 30, .55) 55%, rgba(10, 15, 30, .95) 100%);
}
.coupon-tile .ct-text {
  position: absolute;
  z-index: 1;
  inset-inline: 0;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.coupon-tile .ct-pct {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  direction: ltr;
  background-image: var(--grad-fire);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
}
.coupon-tile .ct-src { font-size: 12.5px; font-weight: 700; color: #dbe6ff; direction: ltr; }

.code {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 9px;
  border: 1.5px dashed var(--cyan);
  border-radius: 9px;
  background: rgba(56, 211, 255, .08);
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 800;
  letter-spacing: .05em;
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}

/* ── skeleton ─────────────────────────────────────────── */
.skeleton {
  aspect-ratio: 3 / 4.6;
  cursor: default;
  background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── מצב ריק / שגיאה ───────────────────────────────────── */
.state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 16px; text-align: center; color: var(--hint); }
.state img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; opacity: .9; box-shadow: 0 0 22px rgba(120, 110, 255, .35); }
.state strong { color: var(--text); font-size: 17px; }

/* ── כפתורים ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 16px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15.5px;
  cursor: pointer;
}
.btn-primary { background: var(--grad-btn); color: #fff; box-shadow: 0 4px 18px rgba(79, 140, 255, .4); }
.btn-fire { background: var(--grad-fire); color: #fff; box-shadow: 0 4px 18px rgba(255, 90, 42, .35); }
.btn-secondary { background: transparent; color: var(--cyan); border: 1.5px solid rgba(56, 211, 255, .45); }
.btn-small { padding: 8px 14px; font-size: 14px; border-radius: 11px; }

.disclaimer {
  padding: 14px var(--gutter) calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: #7282a6;
  font-size: 12px;
  text-align: center;
}

/* ── חלונית (bottom sheet בנייד, חלון מרכזי ברוחב) ─────── */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(3, 6, 15, .7); opacity: 0; transition: opacity .2s ease; }
.backdrop.open { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 21;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #151f3a 0%, var(--bg-2) 40%);
  border-radius: 22px 22px 0 0;
  border-top: 1.5px solid transparent;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .5), 0 -1px 0 rgba(56, 211, 255, .5);
  transform: translateY(100%);
  transition: transform .22s ease;
}
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-grip { flex: none; width: 42px; height: 5px; margin: 9px auto 0; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.sheet-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 15, 30, .75);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 10px 18px 12px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(120, 160, 255, .35) transparent; }
.sheet-actions {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.sheet-media {
  position: relative;
  width: min(100%, 44vh);
  aspect-ratio: 1 / 1;
  margin: 10px auto 14px;
  overflow: hidden;
  border-radius: 18px;
  background: #0d1426;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .4);
}
.sheet-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-media .coupon-tile .ct-pct { font-size: 64px; }
.sheet-media .coupon-tile .ct-src { font-size: 16px; }
.sheet-sub { margin: 0; color: var(--hint); font-size: 13px; }
.sheet h2 { margin: 4px 0 10px; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.sheet .price { font-size: 26px; }
.sheet .orig { font-size: 15px; }
.inline-badge { padding: 2px 8px; border-radius: 9px; background: var(--grad-fire); color: #fff; font-weight: 900; font-size: 14px; direction: ltr; }
.sheet .stats { margin: 8px 0; gap: 3px; font-size: 14px; }
.coupon-pct { font-size: 24px; font-weight: 900; background-image: var(--grad-fire); -webkit-background-clip: text; background-clip: text; color: transparent; }
.coupon-box { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.coupon-box .code { font-size: 20px; padding: 7px 14px; }
.copy-hint { flex-basis: 100%; color: var(--hint); font-size: 12.5px; }
.copy-hint:empty { display: none; }
.soon-text { color: #ff8a7a; font-weight: 700; }
.desc { margin: 12px 0 0; color: #d3dbef; white-space: pre-line; overflow-wrap: anywhere; }

@media (min-width: 720px) {
  .sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: min(540px, 92vw);
    max-height: 88vh;
    border-radius: 22px;
    border: 1.5px solid transparent;
    background: linear-gradient(180deg, #151f3a, var(--bg-2)) padding-box, var(--grad-neon) border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6), 0 0 30px rgba(111, 125, 255, .25);
    transform: translate(-50%, -46%);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
  }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grip { display: none; }
  .sheet-actions { flex-direction: row; }
  .sheet-actions .btn { flex: 1; }
}

@media (max-width: 360px) {
  .brand { font-size: 26px; }
  .hero-logo { width: 70px; height: 70px; }
  .tab { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet, .backdrop, .card, .tab { transition: none; }
  .skeleton { animation: none; }
}
