/* ═══════════════════════════════════════════════════════════════════════════
   Amzly Plugin – Werbe-Widget für ipv64.net
   Optik 1:1 abgeleitet vom echten Plugin-Widget auf amazon.de (content.css).
   Alles unter .amzly-promo gescoped – kollidiert nicht mit ipv64-Styles.
   ═══════════════════════════════════════════════════════════════════════════ */

.amzly-promo {
  /* Light Mode */
  --ap-bg:         #ffffff;
  --ap-surface:    #f9fafb;
  --ap-border:     #e0e3ea;
  --ap-text:       #111827;
  --ap-text-sec:   #6b7280;
  --ap-text-muted: #9ca3af;
  --ap-orange:     #d97706;
  --ap-orange-end: #b45309;
  --ap-great-bg:     #f0fdf4;
  --ap-great-border: #86efac;
  --ap-great-text:   #15803d;
  --ap-shadow: 0 16px 48px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1);
}

/* Dark Mode – greift automatisch bei dunkler Systemeinstellung */
@media (prefers-color-scheme: dark) {
  .amzly-promo:not([data-theme="light"]) {
    --ap-bg:         #18181f;
    --ap-surface:    #1e1e28;
    --ap-border:     #252530;
    --ap-text:       #e8e8f0;
    --ap-text-sec:   #9ca3af;
    --ap-text-muted: #6b7280;
    --ap-orange:     #fbbf24;
    --ap-orange-end: #f59e0b;
    --ap-great-bg:     #052e16;
    --ap-great-border: #166534;
    --ap-great-text:   #4ade80;
    --ap-shadow: 0 16px 48px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
  }
}

/* Erzwungenes Theme: <aside class="amzly-promo" data-theme="dark"> */
.amzly-promo[data-theme="dark"] {
  --ap-bg:         #18181f;
  --ap-surface:    #1e1e28;
  --ap-border:     #252530;
  --ap-text:       #e8e8f0;
  --ap-text-sec:   #9ca3af;
  --ap-text-muted: #6b7280;
  --ap-orange:     #fbbf24;
  --ap-orange-end: #f59e0b;
  --ap-great-bg:     #052e16;
  --ap-great-border: #166534;
  --ap-great-text:   #4ade80;
  --ap-shadow: 0 16px 48px rgba(0,0,0,.6), 0 4px 12px rgba(0,0,0,.4);
}

/* ── Container ───────────────────────────────────────────────────────────── */
.amzly-promo {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  width: 350px;
  max-width: calc(100vw - 32px);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  animation: ap-slide-in .4s cubic-bezier(.34, 1.56, .64, 1);
}
.amzly-promo[hidden] { display: none; }

/* Variante links unten – exakt dort, wo das Widget auf Amazon sitzt */
.amzly-promo--left { right: auto; left: 20px; }

.amzly-promo *,
.amzly-promo *::before,
.amzly-promo *::after { box-sizing: border-box; }

@keyframes ap-slide-in {
  from { opacity: 0; transform: translateY(28px) scale(.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .amzly-promo { animation: none; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.amzly-promo__card {
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  border-radius: 16px;
  overflow: hidden;
  color: var(--ap-text);
  box-shadow: var(--ap-shadow);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.amzly-promo__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 11px 16px;
  background: #111827;
}

.amzly-promo__logo {
  height: 19px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.amzly-promo__subtitle {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amzly-promo__close {
  flex-shrink: 0;
  margin-left: auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.75);
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.amzly-promo__close:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Verdict-Zeile ───────────────────────────────────────────────────────── */
.amzly-promo__verdict {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  background: var(--ap-great-bg);
  border-bottom: 1px solid var(--ap-great-border);
}

.amzly-promo__emoji {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.amzly-promo__verdict-label {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: var(--ap-great-text);
}

.amzly-promo__verdict-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--ap-great-text);
  opacity: .65;
}

/* ── Stats (3 Spalten, 1px-Raster wie im Plugin) ─────────────────────────── */
.amzly-promo__stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1px;
  background: var(--ap-border);
  border-bottom: 1px solid var(--ap-border);
}

.amzly-promo__stat {
  background: var(--ap-surface);
  padding: 11px 13px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.amzly-promo__stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ap-text-sec);
  white-space: nowrap;
}

.amzly-promo__stat-value {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--ap-text);
  white-space: nowrap;
}
.amzly-promo__stat-value--low { color: var(--ap-great-text); }

/* ── 90-Tage-Preisverlauf (Beispielgraf, Geometrie wie in content.js) ────── */
.amzly-promo__chart {
  padding: 13px 16px 0;
}

.amzly-promo__chart-title {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ap-text-sec);
}

.amzly-promo__chart svg {
  display: block;
  width: 100%;
  height: 80px;
  overflow: visible;
}

/* Farben über CSS – SVG-Präsentationsattribute können kein var() */
.amzly-promo__chart .ap-area      { fill: url(#amzly-promo-cg); }
.amzly-promo__chart .ap-stop-1    { stop-color: var(--ap-orange); stop-opacity: .28; }
.amzly-promo__chart .ap-stop-2    { stop-color: var(--ap-orange); stop-opacity: .02; }
.amzly-promo__chart .ap-line      { fill: none; stroke: var(--ap-orange); }
.amzly-promo__chart .ap-atl-line  { stroke: var(--ap-great-text); opacity: .65; }
.amzly-promo__chart .ap-atl-label { fill: var(--ap-great-text); opacity: .85; }
.amzly-promo__chart .ap-dot-deal   { fill: #ef4444; opacity: .9; }
.amzly-promo__chart .ap-dot-coupon { fill: #f59e0b; opacity: .9; }
.amzly-promo__chart .ap-dot-now    { fill: var(--ap-orange); stroke: var(--ap-bg); }
.amzly-promo__chart .ap-price      { fill: var(--ap-orange); font-weight: 700; }
.amzly-promo__chart .ap-axis       { fill: var(--ap-text-sec); }

.amzly-promo__lastcheap {
  margin: 6px 0 0;
  padding: 4px 8px;
  background: var(--ap-surface);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--ap-great-text);
}

.amzly-promo__legend {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 3px;
  font-size: 10px;
}
.amzly-promo__legend .ap-legend-deal   { color: #ef4444; }
.amzly-promo__legend .ap-legend-coupon { color: #f59e0b; }

/* ── Nutzen-Stichpunkte ──────────────────────────────────────────────────── */
.amzly-promo__benefits {
  list-style: none;
  margin: 0;
  padding: 13px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.amzly-promo__benefits li {
  position: relative;
  padding-left: 21px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ap-text-sec);
}
.amzly-promo__benefits li::before {
  content: '\2713';               /* Haken */
  position: absolute;
  left: 0;
  top: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ap-orange);
}
.amzly-promo__benefits strong {
  color: var(--ap-text);
  font-weight: 700;
}

/* ── Urheber-Hinweis (gleicher Entwickler wie IPv64) ─────────────────────── */
.amzly-promo__author {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 13px 16px 0;
  padding: 10px 12px;
  background: var(--ap-surface);
  border: 1px solid var(--ap-border);
  border-left: 3px solid var(--ap-orange);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ap-text-sec);
}
.amzly-promo__author-icon {
  font-size: 14px;
  line-height: 1.3;
  flex-shrink: 0;
}
.amzly-promo__author strong { color: var(--ap-text); font-weight: 700; }

/* ── CTA ─────────────────────────────────────────────────────────────────── */
.amzly-promo__body {
  padding: 14px 16px 15px;
}

.amzly-promo__cta {
  display: block;
  padding: 13px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ap-orange), var(--ap-orange-end));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1px;
  text-align: center;
  text-decoration: none;
  transition: filter .15s;
}
.amzly-promo__cta:hover,
.amzly-promo__cta:focus { filter: brightness(1.12); color: #fff; text-decoration: none; }

/* ── Mobil: gar nicht anzeigen ───────────────────────────────────────────── */
/* Das JS blendet unterhalb data-ap-minwidth schon gar nicht erst ein.
   Diese Regel fängt zusätzlich den Fall ab, dass das Fenster nach dem
   Laden verkleinert oder das Gerät gedreht wird. */
@media (max-width: 767px) {
  .amzly-promo { display: none !important; }
}
