/* ==========================================================
   Offer page (/offer/{slug}): colourful hero + countdown + product grid.
   Colours come from the theme class (cp-theme-*). No inline styles (CSP).
   ========================================================== */
.cp { padding: 4px 0 28px; }
.cp-theme-fire   { --cp-a: #ef2b2d; --cp-b: #ff9a1f; --cp-c: #8f0d17; --cp-ink: #fff; --cp-soft: rgba(255, 255, 255, .86); --cp-glass: rgba(255, 255, 255, .16); --cp-glow: rgba(255, 154, 31, .55); }
.cp-theme-ocean  { --cp-a: #1d4ed8; --cp-b: #14b8d4; --cp-c: #0a1f6b; --cp-ink: #fff; --cp-soft: rgba(255, 255, 255, .86); --cp-glass: rgba(255, 255, 255, .16); --cp-glow: rgba(20, 184, 212, .55); }
.cp-theme-forest { --cp-a: #059669; --cp-b: #8bd32a; --cp-c: #064e3b; --cp-ink: #fff; --cp-soft: rgba(255, 255, 255, .88); --cp-glass: rgba(255, 255, 255, .16); --cp-glow: rgba(139, 211, 42, .55); }
.cp-theme-berry  { --cp-a: #c026d3; --cp-b: #fb4f7c; --cp-c: #4a044e; --cp-ink: #fff; --cp-soft: rgba(255, 255, 255, .88); --cp-glass: rgba(255, 255, 255, .16); --cp-glow: rgba(251, 79, 124, .55); }
.cp-theme-gold   { --cp-a: #f59e0b; --cp-b: #fde047; --cp-c: #b45309; --cp-ink: #3a1d00; --cp-soft: rgba(58, 29, 0, .82); --cp-glass: rgba(255, 255, 255, .42); --cp-glow: rgba(253, 224, 71, .7); }
.cp-theme-night  { --cp-a: #1e1b4b; --cp-b: #6366f1; --cp-c: #020617; --cp-ink: #fff; --cp-soft: rgba(255, 255, 255, .84); --cp-glass: rgba(255, 255, 255, .12); --cp-glow: rgba(99, 102, 241, .6); }

/* ---------- hero ---------- */
.cp-hero {
    position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; color: var(--cp-ink);
    background: linear-gradient(120deg, var(--cp-c) 0%, var(--cp-a) 42%, var(--cp-b) 100%);
    background-size: 220% 220%; animation: cp-flow 16s ease-in-out infinite alternate;
    box-shadow: 0 22px 50px -18px var(--cp-glow), 0 8px 22px rgba(15, 23, 42, .18);
}
.cp-hero-inner { position: relative; z-index: 2; display: grid; gap: 18px; padding: 30px 22px 28px; }
.cp-hero-inner.has-art { grid-template-columns: minmax(0, 1fr); }
.cp-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }

.cp-chip {
    display: inline-flex; align-items: center; padding: 6px 16px; font-size: .95rem; font-weight: 800;
    border-radius: 999px; color: var(--cp-ink); background: var(--cp-glass);
    border: 1px solid rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    animation: cp-glow 2.6s ease-in-out infinite;
}
.cp-title { margin: 0; font-size: clamp(1.9rem, 7vw, 3.5rem); line-height: 1.2; font-weight: 800; letter-spacing: 0; text-wrap: balance; text-shadow: 0 2px 14px rgba(0, 0, 0, .18); }
.cp-sub { margin: 0; max-width: 34rem; font-size: 1.02rem; line-height: 1.65; color: var(--cp-soft); }

/* entrance: one orchestrated sequence */
.cp-chip, .cp-title, .cp-sub, .cp-count { animation-fill-mode: both; }
.cp-chip  { animation-name: cp-rise, cp-glow; animation-duration: .6s, 2.6s; animation-delay: .05s, .8s; animation-iteration-count: 1, infinite; }
.cp-title { animation: cp-rise .75s cubic-bezier(.22, 1, .36, 1) .15s both; }
.cp-sub   { animation: cp-rise .75s cubic-bezier(.22, 1, .36, 1) .3s both; }
.cp-count { animation: cp-rise .75s cubic-bezier(.22, 1, .36, 1) .45s both; }

/* ---------- countdown ---------- */
.cp-count { margin-top: 6px; }
.cp-count-label { margin: 0 0 8px; font-size: .88rem; font-weight: 700; color: var(--cp-soft); }
.cp-count-row { display: flex; gap: 8px; }
.cp-unit {
    display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 62px; padding: 8px 6px 7px;
    border-radius: 16px; background: var(--cp-glass); border: 1px solid rgba(255, 255, 255, .38);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cp-unit b { font-size: 1.55rem; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.cp-unit b.is-tick { animation: cp-tick .35s ease; }
.cp-unit small { font-size: .74rem; font-weight: 700; color: var(--cp-soft); }
.cp-count.is-ended .cp-count-row { display: none; }
.cp-count.is-ended .cp-count-label { display: inline-block; margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--cp-glass); border: 1px solid rgba(255, 255, 255, .4); }

/* ---------- picture / big badge ---------- */
.cp-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 190px; }
.cp-ring {
    position: absolute; width: min(250px, 68vw); aspect-ratio: 1 / 1; border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .5); animation: cp-spin 26s linear infinite;
}
.cp-ring::after { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 70%); }
.cp-img {
    position: relative; display: block; width: min(230px, 62vw); max-height: 250px; object-fit: contain;
    filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .3));
    animation: cp-pop .8s cubic-bezier(.34, 1.45, .64, 1) .35s both, cp-float 4.2s ease-in-out 1.2s infinite;
}
.cp-big {
    position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
    width: min(210px, 56vw); aspect-ratio: 1 / 1; padding: 18px; border-radius: 50%;
    font-size: clamp(1.6rem, 6.5vw, 2.4rem); font-weight: 800; line-height: 1.15; color: var(--cp-ink);
    background: var(--cp-glass); border: 2px solid rgba(255, 255, 255, .55);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
    animation: cp-pop .8s cubic-bezier(.34, 1.45, .64, 1) .35s both, cp-float 4.2s ease-in-out 1.2s infinite;
}

/* ---------- decoration ---------- */
.cp-dot { position: absolute; z-index: 1; border-radius: 50%; background: rgba(255, 255, 255, .22); animation: cp-drift 7s ease-in-out infinite; }
.cp-dot-1 { width: 90px; height: 90px; top: -28px; left: 8%; }
.cp-dot-2 { width: 46px; height: 46px; bottom: 16%; left: 44%; animation-delay: -2s; }
.cp-dot-3 { width: 130px; height: 130px; bottom: -48px; right: 6%; animation-delay: -4s; background: rgba(255, 255, 255, .16); }
.cp-dot-4 { width: 24px; height: 24px; top: 18%; right: 34%; animation-delay: -1s; }
.cp-shine {
    position: absolute; z-index: 1; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0));
    transform: skewX(-18deg); animation: cp-sweep 1.6s ease-out .7s 1 both;
}

/* ---------- products ---------- */
.cp-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 14px; }
.cp-bar-title { margin: 0; font-size: 1.3rem; font-weight: 800; }
.cp-bar-count { padding: 4px 12px; font-size: .86rem; font-weight: 700; border-radius: 999px; color: var(--primary); background: rgba(79, 70, 229, .12); }
.cp-more { margin: 22px 0 0; text-align: center; }
.cp-empty { margin-top: 22px; text-align: center; }

@media (min-width: 99999px) {
    .cp-hero { border-radius: 34px; }
    .cp-hero-inner { padding: 44px 44px 42px; }
    .cp-hero-inner.has-art { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 30px; }
    .cp-unit { min-width: 76px; padding: 10px 8px 9px; }
    .cp-unit b { font-size: 1.9rem; }
    .cp-art { min-height: 280px; }
    .cp-ring { width: 300px; }
    .cp-img { width: 270px; max-height: 300px; }
    .cp-big { width: 250px; }
}

/* ---------- motion ---------- */
@keyframes cp-flow  { from { background-position: 0% 40%; } to { background-position: 100% 60%; } }
@keyframes cp-rise  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cp-pop   { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes cp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cp-spin  { to { transform: rotate(360deg); } }
@keyframes cp-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(10px, -14px); } }
@keyframes cp-sweep { from { left: -60%; } to { left: 130%; } }
@keyframes cp-tick  { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes cp-glow  { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .0); } 50% { box-shadow: 0 0 0 8px rgba(255, 255, 255, .16); } }

@media (prefers-reduced-motion: reduce) {
    .cp-hero, .cp-chip, .cp-title, .cp-sub, .cp-count, .cp-img, .cp-big, .cp-ring, .cp-dot, .cp-shine, .cp-unit b { animation: none !important; }
    .cp-shine { display: none; }
}
