/* ============================================================
   POPUP PROMO EBOOK / CORSI
   ============================================================ */
.promo-popup {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  transition: transform .35s ease, opacity .35s ease;
  border: 1px solid rgba(0, 0, 0, .06);
}
.promo-popup[hidden] { display: none !important; }
.promo-popup.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.promo-popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #222;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
  transition: background .2s ease, transform .2s ease;
}
.promo-popup-close:hover {
  background: #f3f3f3;
  transform: scale(1.05);
}

.promo-popup-link {
  display: flex;
  gap: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}

.promo-popup-cover {
  flex: 0 0 84px;
  width: 84px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-popup-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.promo-popup-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.promo-popup-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
}

.promo-popup-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  color: #111827;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-popup-desc {
  margin: 2px 0 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.promo-popup-cta {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.promo-popup-cta::after {
  content: "→";
  transition: transform .2s ease;
}
.promo-popup-link:hover .promo-popup-cta::after {
  transform: translateX(3px);
}

/* Varianti colore bordo superiore, per distinguere ebook e corsi */
.promo-popup--ebook { border-top: 4px solid #7c3aed; }
.promo-popup--corso { border-top: 4px solid #f59e0b; }

/* Mobile */
@media (max-width: 480px) {
  .promo-popup {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
  .promo-popup-cover {
    flex-basis: 72px;
    width: 72px;
    height: 104px;
  }
  .promo-popup-title { font-size: 14px; }
  .promo-popup-desc { font-size: 12px; }
}