/* Widget iç stilleri — ortak render motorunun (widget-render.js) görünümü.
   Tema renkleri site.css'teki data-theme değişkenlerinden gelir. */

.zw-kanvas { font-family: "Plus Jakarta Sans", system-ui, sans-serif; }

.zw-oge { box-sizing: border-box; user-select: none; }
.zw-oge * { box-sizing: border-box; }

/* ── Arka plan katmanları ── */
.zw-arka { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.zw-arka-katman { position: absolute; inset: 0; }
.zw-filigran {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  height: auto; max-width: none;
}

/* ── Arka plan animasyonları ── */
@keyframes zwAkis {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.zw-akis { animation: zwAkis 18s ease-in-out infinite; }

@keyframes zwKenburns {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.12) translate(1.5%, -1.5%); }
  100% { transform: scale(1) translate(0, 0); }
}
.zw-kenburns { animation: zwKenburns 45s ease-in-out infinite; }

/* Filigran animasyonları (hız --zw-sure ile) */
@keyframes zwFilSuzul {
  0% { transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
  25% { transform: translate(-50%, -50%) translate(3%, -4%) rotate(1.2deg); }
  50% { transform: translate(-50%, -50%) translate(-2%, 3%) rotate(-1deg); }
  75% { transform: translate(-50%, -50%) translate(-4%, -2%) rotate(0.8deg); }
  100% { transform: translate(-50%, -50%) translate(0, 0) rotate(0deg); }
}
.zw-fil-suzul { animation: zwFilSuzul var(--zw-sure, 26s) ease-in-out infinite; }

@keyframes zwFilDon {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.zw-fil-don { animation: zwFilDon calc(var(--zw-sure, 26s) * 3) linear infinite; }

@keyframes zwFilNefes {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.07); }
}
.zw-fil-nefes { animation: zwFilNefes var(--zw-sure, 26s) ease-in-out infinite; }

/* ── Öğe giriş animasyonları ── */
@keyframes zwBelir { from { opacity: 0; } to { opacity: 1; } }
@keyframes zwSoldan { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@keyframes zwSagdan { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes zwAlttan { from { opacity: 0; transform: translateY(42px); } to { opacity: 1; transform: none; } }
@keyframes zwBuyu { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
.zw-giris-belir { animation: zwBelir 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.zw-giris-soldan { animation: zwSoldan 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.zw-giris-sagdan { animation: zwSagdan 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.zw-giris-alttan { animation: zwAlttan 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.zw-giris-buyu { animation: zwBuyu 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ── Öğe sürekli animasyonları ── */
@keyframes zwNefes { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
.zw-anim-nefes { animation: zwNefes var(--zw-sure, 4.5s) ease-in-out infinite; }

@keyframes zwSuzulme { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.zw-anim-suzul { animation: zwSuzulme var(--zw-sure, 4.5s) ease-in-out infinite; }

@keyframes zwDonme { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.zw-anim-don { animation: zwDonme calc(var(--zw-sure, 4.5s) * 4) linear infinite; }

@keyframes zwParla {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(217, 168, 45, 0.15)); }
  50% { filter: drop-shadow(0 0 14px rgba(217, 168, 45, 0.65)); }
}
.zw-anim-parilti { animation: zwParla var(--zw-sure, 4.5s) ease-in-out infinite; }

@keyframes zwKayan {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}
.zw-anim-kayan .zw-ic { overflow: hidden; }
.zw-anim-kayan .zw-metin, .zw-anim-kayan .zw-duyuru-metin {
  white-space: nowrap; will-change: transform;
  animation: zwKayan calc(var(--zw-sure, 4.5s) * 3) linear infinite;
}

/* ── Altın degrade metin ── */
.zw-metin-degrade .zw-ic {
  background: linear-gradient(100deg, #8F6B1F, #E8C877 38%, #FFF2C9 50%, #E8C877 62%, #8F6B1F);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .zw-akis, .zw-kenburns, .zw-fil-suzul, .zw-fil-don, .zw-fil-nefes,
  .zw-anim-nefes, .zw-anim-suzul, .zw-anim-don, .zw-anim-parilti,
  .zw-anim-kayan .zw-metin, .zw-anim-kayan .zw-duyuru-metin,
  [class*="zw-giris-"] { animation: none !important; }
}

.zw-ic {
  width: 100%; height: 100%;
  display: flex; align-items: center;
  overflow: hidden; line-height: 1.25;
  white-space: pre-wrap; word-break: break-word;
}

.zw-bos-resim {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px dashed var(--cizgi-koyu, #99a);
  border-radius: 8px; color: var(--metin-soluk, #789);
  font-size: 12px; font-weight: 600;
}

.zw-cizgi { width: 100%; height: 100%; border-radius: inherit; }

/* ── Saat / Tarih ── */
.zw-saat .zw-ic, .zw-tarih .zw-ic { font-variant-numeric: tabular-nums; }

/* ── Ticker ── */
.zw-ticker-ic {
  width: 100%; height: 100%;
  display: flex; align-items: center; gap: 1.6em;
  overflow: hidden; white-space: nowrap; padding: 0 0.8em;
}
.zw-ticker-kalem b { font-weight: 600; opacity: 0.65; font-size: 0.72em; letter-spacing: 0.08em; }
.zw-ticker-kalem i { font-style: normal; font-size: 0.7em; }
.zw-ticker-kalem i.artis { color: #34C77B; }
.zw-ticker-kalem i.dusus { color: #F2616B; }
.zw-ticker-kalem i.notr { opacity: 0.5; }

/* ── Ürün tablosu ── */
.zw-tablo-ic { width: 100%; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.zw-tablo-baslik {
  display: grid; gap: 8px; padding: 0.45em 0.9em;
  font-size: 0.62em; font-weight: 700; letter-spacing: 0.09em; opacity: 0.6;
}
.zw-tablo-baslik span { text-align: right; }
.zw-tablo-baslik span:first-child { text-align: left; }
.zw-tablo-satir {
  display: grid; gap: 8px; align-items: center; padding: 0.3em 0.9em;
  border-top: 1px solid var(--cizgi-ic, rgba(128,128,128,0.15));
  transition: background 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  font-variant-numeric: tabular-nums;
}
.zw-tablo-satir span { text-align: right; white-space: nowrap; overflow: hidden; }
.zw-tablo-satir .zw-urun-ad { text-align: left; font-weight: 600; }
.zw-tablo-satir .zw-urun-ad small {
  display: block; font-size: 0.62em; font-weight: 500; opacity: 0.55; letter-spacing: 0.05em;
}
.zw-tablo-satir .zw-alis { opacity: 0.78; }
.zw-tablo-satir .zw-satis { font-weight: 700; }
.zw-fark { font-size: 0.68em; font-weight: 600; }
.zw-fark.artis { color: #12A150; }
.zw-fark.dusus { color: #E0444E; }
.zw-fark.notr { opacity: 0.5; }

.zw-flash-artis { background: rgba(18, 161, 80, 0.16) !important; }
.zw-flash-dusus { background: rgba(224, 68, 78, 0.14) !important; }

/* ── Ürün kartı ── */
.zw-kart-ic {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  gap: 0.35em; padding: 0.7em 1em; overflow: hidden;
}
.zw-kart-ad { font-weight: 700; }
.zw-kart-ad small { font-weight: 500; opacity: 0.55; font-size: 0.62em; letter-spacing: 0.06em; }
.zw-kart-fiyatlar { display: flex; gap: 1.4em; font-variant-numeric: tabular-nums; }
.zw-kart-fiyatlar small { display: block; font-size: 0.5em; font-weight: 700; letter-spacing: 0.1em; opacity: 0.55; }
.zw-kart-fiyatlar b { font-size: 1.15em; }

/* ── QR kod ── */
.zw-qr-ic {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4em; padding: 0.4em;
}
.zw-qr-ic img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 6px; }
.zw-qr-etiket { font-size: 0.6em; font-weight: 600; letter-spacing: 0.04em; opacity: 0.75; text-align: center; }

/* ── Geri sayım ── */
.zw-sayac { font-variant-numeric: tabular-nums; }
.zw-sayac-baslik { font-weight: 600; opacity: 0.8; margin-right: 0.35em; }
.zw-sayac-kalan { font-weight: 700; }

/* ── Açık/Kapalı rozeti ── */
.zw-rozet {
  display: inline-flex; align-items: center; gap: 0.45em;
  padding: 0.35em 0.8em; border-radius: 999px;
  background: rgba(224, 68, 78, 0.12);
}
.zw-rozet.acik { background: rgba(18, 161, 80, 0.12); }
.zw-rozet-nokta {
  width: 0.55em; height: 0.55em; border-radius: 999px; background: #E0444E; flex: 0 0 auto;
}
.zw-rozet.acik .zw-rozet-nokta { background: #12A150; animation: nabiz 1.8s ease-in-out infinite; }
.zw-rozet-durum { font-weight: 800; letter-spacing: 0.06em; }
.zw-rozet .zw-rozet-durum { color: #E0444E; }
.zw-rozet.acik .zw-rozet-durum { color: #12A150; }
.zw-rozet-saat { opacity: 0.7; font-size: 0.85em; }
@keyframes nabiz { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── Grafik ── */
.zw-grafik-ic { width: 100%; height: 100%; display: flex; flex-direction: column; padding: 0.6em 0.8em; }
.zw-grafik-baslik { font-size: 0.68em; font-weight: 700; letter-spacing: 0.06em; opacity: 0.7; margin-bottom: 0.4em; }
.zw-grafik-ic svg { flex: 1; width: 100%; min-height: 0; }
