/*
| "Current offer" card (Step 47) — replaces the big .offer-popup box.
| Small, appears after a delay (or after the visitor scrolls), hides itself after a few
| seconds and leaves a small "Offer" tab. Nothing here touches site-v3.css.
| Positions: the site already has a round "back to top" button bottom-left (48 px, left 20 px) and the chat
| button bottom-right, so the offer sits NEXT to the back-to-top button (left 80 px) and on phones the slim
| bar floats above both corner buttons - it never covers one of them.
*/
.offer-card { position: fixed; left: 80px; bottom: 20px; width: 0; height: 0; z-index: 118; }
.offer-card[hidden] { display: none; }

/* ---------- the card ---------- */
.offer-card-panel {
  position: absolute; left: 0; bottom: 0;
  width: min(330px, calc(100vw - 40px));
  box-sizing: border-box; padding: 18px 18px 21px 22px; overflow: hidden;
  color: #fff; border: 1px solid rgba(219, 170, 62, .42); border-radius: 18px;
  background: linear-gradient(160deg, #0d2238, #081626);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.97); transform-origin: left bottom;
  transition: opacity .28s ease, transform .28s ease, visibility 0s linear .28s;
}
.offer-card-panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, #f5dc97, #c8952c); }
.offer-card[data-state="open"] .offer-card-panel { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.offer-card-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 30px 9px 0; font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: .16em; text-transform: uppercase; color: #dbaa3e; }
.offer-card-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #dbaa3e; box-shadow: 0 0 0 0 rgba(219, 170, 62, .55); animation: offerCardPulse 2.4s ease-out infinite; }
.offer-card .offer-card-title { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 19px; font-weight: 700; line-height: 1.25; color: #fff; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.offer-card .offer-card-text { margin: 0 0 15px; font-size: 13px; line-height: 1.55; color: #b5c1cd; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.offer-card-actions { display: flex; }
.offer-card a.offer-card-cta {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 800; line-height: 1.2; text-decoration: none;
  color: #1b2736 !important; background: linear-gradient(135deg, #f5dc97, #d5a13a);
  box-shadow: 0 8px 20px rgba(213, 161, 58, .28); transition: transform .18s ease, box-shadow .18s ease;
}
.offer-card a.offer-card-cta::after { content: "→"; font-weight: 900; transition: transform .18s ease; }
.offer-card a.offer-card-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(213, 161, 58, .38); }
.offer-card a.offer-card-cta:hover::after { transform: translateX(3px); }

.offer-card-close {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; color: #cfd8e2; background: rgba(255, 255, 255, .08); cursor: pointer; transition: background .18s ease;
}
.offer-card-close:hover { background: rgba(255, 255, 255, .18); }

/* the time bar: shrinks while the card is open; hover / focus pauses it */
.offer-card-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .07); display: none; }
.offer-card.is-timed .offer-card-timer { display: block; }
.offer-card-timer::after { content: ""; display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #f5dc97, #d5a13a); transform-origin: left center; }
.offer-card.is-timed .offer-card-timer::after { animation: offerCardTimer var(--offer-duration, 12s) linear forwards; }
.offer-card.is-paused .offer-card-timer::after { animation-play-state: paused; }

/* ---------- the small tab that stays behind ---------- */
.offer-card-tab {
  position: absolute; left: 0; bottom: 4px; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 17px 0 13px;
  border: 0; border-radius: 999px; font-family: inherit; font-size: 13px; font-weight: 800; line-height: 1; white-space: nowrap;
  color: #1b2736; background: linear-gradient(135deg, #f5dc97, #d5a13a); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease, visibility 0s linear .25s;
}
.offer-card[data-state="tab"] .offer-card-tab { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.offer-card[data-state="tab"] .offer-card-tab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0, 0, 0, .34); }
.offer-card-tab svg { flex: none; }

.offer-card-close:focus-visible, .offer-card-tab:focus-visible, .offer-card a.offer-card-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@keyframes offerCardTimer { to { transform: scaleX(0); } }
@keyframes offerCardPulse { 0% { box-shadow: 0 0 0 0 rgba(219, 170, 62, .55); } 70% { box-shadow: 0 0 0 8px rgba(219, 170, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(219, 170, 62, 0); } }

/* ---------- phones: a slim bar ABOVE the two corner buttons (back-to-top 44 px left, chat right) ---------- */
@media (max-width: 640px) {
  .offer-card { left: 0; bottom: 0; }
  .offer-card-panel {
    left: 12px; bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 24px); padding: 11px 10px 14px 18px; border-radius: 16px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "title cta close"; align-items: center; column-gap: 10px;
  }
  .offer-card-eyebrow, .offer-card .offer-card-text { display: none; }
  .offer-card .offer-card-title { grid-area: title; margin: 0; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .offer-card-actions { grid-area: cta; }
  .offer-card a.offer-card-cta { padding: 9px 13px; font-size: 12.5px; border-radius: 10px; }
  .offer-card a.offer-card-cta::after { display: none; }
  .offer-card-close { grid-area: close; position: static; width: 26px; height: 26px; font-size: 16px; }
  .offer-card-tab { left: 68px; bottom: calc(17px + env(safe-area-inset-bottom, 0px)); height: 38px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .offer-card-panel, .offer-card-tab, .offer-card a.offer-card-cta, .offer-card a.offer-card-cta::after { transition-duration: .01ms; transform: none !important; }
  .offer-card-eyebrow::before { animation: none; }
}
@media print { .offer-card { display: none !important; } }
