/* css/promo-banner.css — Promo Banner styles (P2 #74)
 *
 * 3 theme variants via the .promo-banner--<theme> class:
 *   -primary   (default)  : red gradient, white text
 *   -accent              : gold/amber gradient
 *   -info                : blue gradient
 *
 * The slot div is rendered by js/promo-banner.js and placed
 * by the page at #promo-banner-slot.
 *
 * Tap target: close button is min 44x44 (HIG/WCAG 2.5.5).
 */

.promo-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 999;
  animation: promo-slide-in 240ms ease-out;
}

@keyframes promo-slide-in {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* theme variants — use the .background value from CMS, default to primary */
.promo-banner--primary,
.promo-banner[data-theme="primary"] {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}
.promo-banner--accent,
.promo-banner[data-theme="accent"] {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #1a1a1a;
}
.promo-banner--info,
.promo-banner[data-theme="info"] {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* body: title + message, flex grows */
.promo-banner__body {
  flex: 1 1 auto;
  min-width: 0;
}
.promo-banner__title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
}
.promo-banner__msg {
  font-size: 13px;
  opacity: 0.92;
  line-height: 1.4;
  margin-top: 2px;
  /* clamp long messages to 2 lines on mobile */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* actions: CTA + close */
.promo-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.promo-banner__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 120ms;
}
.promo-banner__cta:hover { background: rgba(255, 255, 255, 0.3); }

.promo-banner--accent .promo-banner__cta {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.2);
}
.promo-banner--accent .promo-banner__cta:hover {
  background: rgba(0, 0, 0, 0.15);
}

.promo-banner__close {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  /* Visual size is 24x24, hit area is 44x44 via padding */
  padding: 10px;
  margin: -10px;
  cursor: pointer;
  opacity: 0.85;
  border-radius: 4px;
  transition: opacity 120ms, background 120ms;
}
.promo-banner__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}
.promo-banner--accent .promo-banner__close:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* small screen: stack vertically, hide msg clamp */
@media (max-width: 600px) {
  .promo-banner {
    flex-wrap: wrap;
    padding: 0.625rem 1rem;
  }
  .promo-banner__body { flex: 1 1 100%; }
  .promo-banner__actions { width: 100%; justify-content: space-between; }
  .promo-banner__msg { -webkit-line-clamp: 3; }
}

/* respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .promo-banner { animation: none; }
}
