/* =================================================================
 * Film is not dead — Vásárlási aktivitás widget
 * CSS — illeszkedik a filmisnotdead.hu arculati elemeihez
 *
 * Színek, fontok, kerekítés ugyanaz, mint a többi oldaladon:
 *   --paper #f5f0e7, --amber #8b0000, --ink #15120F, stb.
 * ================================================================= */

#fnd-activity-widget {
  /* Saját scope-olt változók, hogy ne ütközzön semmivel */
  --fnd-ink: #15120F;
  --fnd-paper: #fbf8f1;        /* cream */
  --fnd-paper-2: #f5f0e7;      /* paper */
  --fnd-amber: #8b0000;        /* mély bordó akcent */
  --fnd-amber-deep: #6b0000;
  --fnd-silver: #7d756a;
  --fnd-line: #d8cdb9;
  --fnd-gold: #c89b3c;
  --fnd-shadow: rgba(22, 19, 15, .14);
  --fnd-shadow-strong: rgba(22, 19, 15, .22);

  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999998;             /* WP toolbar (999999) alatt, minden más fölött */
  pointer-events: none;        /* csak a kártya legyen kattintható */

  font-family: "Poppins", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fnd-ink);
}

/* ---------- A kártya alap ---------------------------------------- */
.fnd-card {
  pointer-events: auto;        /* visszakapcsoljuk a kattinthatóságot */
  display: flex;
  align-items: stretch;
  gap: 14px;

  width: 340px;
  max-width: calc(100vw - 48px);
  padding: 14px 16px 14px 14px;

  background: var(--fnd-paper);
  border: 1px solid var(--fnd-line);
  border-radius: 4px;          /* a brand --r értéke */
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 18px 40px -20px var(--fnd-shadow-strong),
    0 4px 12px -4px var(--fnd-shadow);

  position: relative;
  overflow: hidden;

  /* Belépő animáció: alulról csúszik fel, finoman */
  opacity: 0;
  transform: translateY(20px) scale(.97);
  transition:
    opacity .55s cubic-bezier(.2, .8, .2, 1),
    transform .55s cubic-bezier(.2, .8, .2, 1);
}

.fnd-card.fnd-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.fnd-card.fnd-leaving {
  opacity: 0;
  transform: translateY(20px) scale(.97);
}

/* Bal oldali bordó vonal — finom akcent, a brand színe */
.fnd-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--fnd-amber) 0%, var(--fnd-amber-deep) 100%);
}

/* Finom grain effekt (mint a többi oldaladon) */
.fnd-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(139, 0, 0, .015) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(200, 155, 60, .012) 0%, transparent 50%);
  pointer-events: none;
}

/* ---------- Termékkép bal oldalon -------------------------------- */
.fnd-card__image {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  border-radius: 3px;
  background: var(--fnd-paper-2);
  border: 1px solid var(--fnd-line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.fnd-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Szövegblokk jobbra ----------------------------------- */
.fnd-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.fnd-card__kicker {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fnd-amber);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Pulzáló pötty a kicker mellett — élet-jel */
.fnd-card__pulse {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fnd-amber);
  position: relative;
}

.fnd-card__pulse::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--fnd-amber);
  opacity: .35;
  animation: fnd-pulse 2s ease-out infinite;
}

@keyframes fnd-pulse {
  0%   { transform: scale(1);   opacity: .35; }
  70%  { transform: scale(2.4); opacity: 0;   }
  100% { transform: scale(2.4); opacity: 0;   }
}

.fnd-card__text {
  font-size: 13.5px;
  color: var(--fnd-ink);
  line-height: 1.45;

  /* Két sor maximum, a többi: ... */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fnd-card__name {
  font-weight: 600;
  color: var(--fnd-ink);
}

.fnd-card__product {
  font-weight: 500;
  color: var(--fnd-ink);
}

.fnd-card__time {
  font-family: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 11px;
  color: var(--fnd-silver);
  margin-top: 5px;
  letter-spacing: .02em;
}

/* ---------- Bezáró gomb ----------------------------------------- */
/* A bezáró gombnak MINDEN más fölött kell lennie a kártyán, beleértve
 * a kattintható .fnd-card__link réteget is. Ezért z-index: 4.
 * Az érintési felület legalább 32×32 pixel asztalin és 40×40 mobilon,
 * de a látható ikon csak 22 pixel — a többi átlátszó "padding" a
 * könnyebb eltalálhatóság érdekében.
 */
.fnd-card__close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--fnd-silver);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  border-radius: 3px;
  z-index: 4;                /* a .fnd-card__link (z:3) FÖLÖTT! */
  opacity: 1;                /* mindig látható, asztalin és mobilon is */
  transition: color .2s ease, background .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  /* iOS Safari érintés-finomítás */
  -webkit-tap-highlight-color: rgba(139, 0, 0, 0.15);
  touch-action: manipulation;
}

.fnd-card__close:hover,
.fnd-card__close:focus-visible {
  color: var(--fnd-ink);
  background: var(--fnd-paper-2);
  outline: none;
}

/* ---------- Kattintható egész kártya ---------------------------- */
.fnd-card__link {
  position: absolute;
  inset: 0;
  z-index: 3;
  text-indent: -9999px;
  overflow: hidden;
  cursor: pointer;
}

.fnd-card:hover {
  border-color: var(--fnd-amber);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .8) inset,
    0 22px 48px -20px var(--fnd-shadow-strong),
    0 6px 14px -4px var(--fnd-shadow);
}

.fnd-card:hover .fnd-card__image img {
  transform: scale(1.05);
  transition: transform .4s ease;
}

.fnd-card__image img {
  transition: transform .4s ease;
}

/* =================================================================
 * Mobil verzió — alul középen, kompaktabb
 * ================================================================= */
@media (max-width: 768px) {
  #fnd-activity-widget {
    bottom: 16px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .fnd-card {
    width: calc(100vw - 32px);
    max-width: 360px;
    padding: 12px 14px 12px 12px;
    gap: 12px;
  }

  .fnd-card__image {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
  }

  .fnd-card__text {
    font-size: 13px;
  }

  .fnd-card__kicker {
    font-size: 9px;
  }

  .fnd-card__close {
    /* Mobilon nagyobb érintési felület (40×40) a könnyebb eltalálásért */
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

/* =================================================================
 * Reduced motion: aki kéri, ne legyen animáció
 * ================================================================= */
@media (prefers-reduced-motion: reduce) {
  .fnd-card {
    transition: opacity .2s ease;
    transform: none;
  }
  .fnd-card.fnd-leaving { transform: none; }
  .fnd-card__pulse::before { animation: none; }
}
