/* FlowCraft Offer Countdown — catalogue demo styles (extends site.css)
   Mirrors the buyer-delivered Tailwind widget with the site's own tokens.
   State classes (.is-expired, .is-untimed, .is-ticking, .is-leaving,
   .is-entering) come from the unchanged buyer app.js. */

.cd [hidden] { display: none !important; }
.cdd { display: grid; background: var(--surface); }
@media (min-width: 820px) { .cdd { grid-template-columns: 1fr 1fr; } }
.cdd-media { background: #3b2a8f; }
.cdd-media img { display: block; width: 100%; height: 240px; object-fit: cover; }
@media (min-width: 600px) { .cdd-media img { height: 300px; } }
@media (min-width: 820px) { .cdd-media img { height: 100%; } }
.cdd-body { padding: 24px 18px 28px; }
@media (min-width: 600px) { .cdd-body { padding: 36px 34px; } }

.cdd-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 12px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: #fef3c7; color: #92400e; }
.cdd-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.cdd-pill.is-ended { background: var(--bg-soft); color: var(--ink-muted); }
.cdd-pill.is-ended::before { background: #9aa3c2; }
.cdd-title { margin: 14px 0 0; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 800; letter-spacing: -.02em; }
.cdd-text { margin: 8px 0 0; color: var(--ink-muted); }
.cdd-label { margin: 22px 0 0; font-size: .88rem; font-weight: 700; }

.cdd-clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
@media (min-width: 600px) { .cdd-clock { gap: 12px; } }
.cdd-unit { padding: 12px 4px; border-radius: 16px; background: var(--ink); color: #fff; text-align: center; }
.cdd-unit.is-sec { background: var(--accent); }
.cdd-num { display: inline-block; font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
@media (min-width: 600px) { .cdd-num { font-size: 2.3rem; } }
.cdd-unit small { display: block; margin-top: 4px; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #9aa3c2; }
.cdd-unit.is-sec small { color: #d6ccff; }
@media (min-width: 600px) { .cdd-unit small { font-size: .68rem; letter-spacing: .1em; } }
.cdd-ends { margin: 10px 0 0; font-size: .88rem; color: var(--ink-muted); }
.cdd-ends strong { color: var(--ink); }

.cdd-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; }
.cdd-code { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 2px dashed var(--accent-line); border-radius: 12px; background: var(--accent-soft); }
.cdd-code span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.cdd-code code { font-size: 1.1rem; font-weight: 800; letter-spacing: .08em; color: var(--accent-strong); background: none; padding: 0; }
.cdd-copy { padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; font-size: .88rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.cdd-copy:hover { background: var(--bg); }
.cdd-copy:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-line); }
.cdd-cta { margin-top: 20px; }
.cdd-fine { margin: 10px 0 0; font-size: .78rem; color: var(--ink-muted); }

/* Animations (same as the buyer's style.css) */
@keyframes cd-tick { 0% { transform: translateY(-4px); opacity: .4; } 100% { transform: none; opacity: 1; } }
.cd-digit.is-ticking { animation: cd-tick 280ms ease-out; }
.cd-panel { transition: opacity 300ms ease, transform 300ms ease; }
.cd-panel.is-leaving { opacity: 0; transform: translateY(-6px); }
@keyframes cd-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cd-panel.is-entering { animation: cd-enter 400ms ease-out; }
.cd.is-expired img { filter: grayscale(.6); opacity: .8; transition: filter 400ms ease, opacity 400ms ease; }

/* Demo-only controls (not part of the product) */
.cdd-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px dashed var(--line); background: #fffbeb; font-size: .86rem; }
@media (min-width: 600px) { .cdd-controls { padding: 14px 34px; } }
.cdd-controls strong { color: #7a4b00; }
.cdd-controls button { padding: 7px 12px; border: 1px solid #f2d59b; border-radius: 10px; background: #fff; font: inherit; font-size: .84rem; font-weight: 700; color: #7a4b00; cursor: pointer; }
.cdd-controls button:hover { background: #fff3dc; }
.cdd-controls button:focus-visible { outline: none; box-shadow: 0 0 0 3px #f2d59b; }
.cdd-controls span { flex-basis: 100%; color: var(--ink-muted); font-size: .8rem; }
.cdd-form { padding: 0 18px 28px; }
@media (min-width: 600px) { .cdd-form { padding: 0 34px 34px; } }

/* Catalogue card: compact */
.cdd-compact { border-radius: 16px; overflow: hidden; }
.cdd-compact .cdd { grid-template-columns: 1fr; }
.cdd-compact .cdd-media img { height: 170px; object-position: 50% 58%; }
.cdd-compact .cdd-body { padding: 18px 16px 20px; }
.cdd-compact .cdd-title { font-size: 1.25rem; margin-top: 10px; }
.cdd-compact .cdd-num { font-size: 1.6rem; }
#offer-countdown .product-head > *, #offer-countdown .product-shot, #offer-countdown .live-widget { min-width: 0; }
#offer-countdown .live-badge { z-index: 10; }
@media (max-width: 479px) { #offer-countdown .product-head { padding: 24px 14px; } }

@media (prefers-reduced-motion: reduce) {
  .cd-digit.is-ticking, .cd-panel.is-entering { animation: none; }
  .cd-panel, .cd.is-expired img { transition: none; }
}
