/* Explain: Styles for a playful, animated cookie-shaped consent banner. */
/* ==========================================================================
   Privola za kolačiće — razigrani kolačić (središte ekrana)
   Šareni kolačić s kapljicama čokolade, posipom u bojama portala, očima koje
   trepću i osmijehom. Naslov, tekst, gumbi i poveznica nalaze se unutar
   samog kolačića. Stanje se uključuje klasom .is-open (js/cookie-consent.js).
   ========================================================================== */

/* ---------- Zatamnjeni zastor preko cijelog ekrana + centriranje ---------- */
#cc-banner.cc-pop {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 1.5rem);
    border: none;
    box-shadow: none;
    overflow: hidden;
    transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background-color: rgba(12, 7, 3, 0.84);
    background-image:
        radial-gradient(circle at 50% 45%, rgba(250, 204, 21, 0.20), transparent 58%),
        radial-gradient(circle at 16% 18%, rgba(242, 104, 18, 0.22), transparent 46%),
        radial-gradient(circle at 85% 23%, rgba(14, 165, 233, 0.18), transparent 44%),
        radial-gradient(circle at 18% 85%, rgba(16, 185, 129, 0.16), transparent 44%),
        radial-gradient(circle at 84% 82%, rgba(168, 85, 247, 0.18), transparent 44%),
        linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
    background-size: auto, auto, auto, auto, auto, 46px 46px, 46px 46px;
    -webkit-backdrop-filter: blur(7px) saturate(1.2);
    backdrop-filter: blur(7px) saturate(1.2);
    transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
#cc-banner.cc-pop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: opacity 0.4s ease, visibility 0s;
}

/* ---------- Scena (kolačić lagano lebdi) ---------- */
.cc-pop-stage {
    position: relative;
    width: min(94vw, 600px, 84vh);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ccPlayFloat 7.5s ease-in-out infinite;
    animation-play-state: paused;
}
#cc-banner.is-open .cc-pop-stage { animation-play-state: running; }

/* Isprekidani prsten koji se polako okreće oko kolačića */
.cc-pop-stage::before {
    content: "";
    position: absolute;
    inset: 1%;
    border-radius: 50%;
    border: 2px dashed rgba(250, 204, 21, 0.30);
    animation: ccPlaySpin 42s linear infinite;
    pointer-events: none;
}

/* Topli sjaj u bojama posipa */
.cc-pop-stage::after {
    content: "";
    position: absolute;
    inset: 13%;
    border-radius: 50%;
    box-shadow:
        0 0 88px 14px rgba(250, 204, 21, 0.20),
        0 0 130px 34px rgba(242, 104, 18, 0.16);
    pointer-events: none;
}

/* ---------- Sam kolačić ---------- */
.cc-pop-cookie {
    --chip: clamp(5px, 1.9vw, 10px);
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #E89A44;
    background-image:
        /* kapljice čokolade */
        radial-gradient(circle at 20% 26%, #3E2312 0 var(--chip), transparent calc(var(--chip) + 1.5px)),
        radial-gradient(circle at 73% 20%, #4A2A15 0 calc(var(--chip) * 0.8), transparent calc(var(--chip) * 0.8 + 1.5px)),
        radial-gradient(circle at 86% 47%, #3E2312 0 calc(var(--chip) * 0.9), transparent calc(var(--chip) * 0.9 + 1.5px)),
        radial-gradient(circle at 14% 61%, #4A2A15 0 calc(var(--chip) * 0.75), transparent calc(var(--chip) * 0.75 + 1.5px)),
        radial-gradient(circle at 79% 79%, #3E2312 0 var(--chip), transparent calc(var(--chip) + 1.5px)),
        radial-gradient(circle at 30% 89%, #4A2A15 0 calc(var(--chip) * 0.7), transparent calc(var(--chip) * 0.7 + 1.5px)),
        radial-gradient(circle at 50% 8%, #4A2A15 0 calc(var(--chip) * 0.6), transparent calc(var(--chip) * 0.6 + 1.5px)),
        /* tekstura tijesta */
        radial-gradient(circle at 29% 53%, rgba(120, 63, 15, 0.18) 0 3px, transparent 4px),
        radial-gradient(circle at 63% 65%, rgba(120, 63, 15, 0.16) 0 2px, transparent 3px),
        radial-gradient(circle at 45% 33%, rgba(120, 63, 15, 0.14) 0 2px, transparent 3px),
        /* tijesto */
        radial-gradient(circle at 34% 24%, #F9C97C 0%, #ED9F46 42%, #D4802F 76%, #AF6120 100%);
    box-shadow:
        0 34px 78px rgba(0, 0, 0, 0.60),
        inset 0 0 0 1px rgba(255, 255, 255, 0.16),
        inset 0 18px 40px rgba(255, 255, 255, 0.14),
        inset 0 -26px 48px rgba(94, 45, 8, 0.40);
    transform: scale(0.84) rotate(-8deg);
    opacity: 0;
    transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.45s ease;
}
#cc-banner.is-open .cc-pop-cookie {
    transform: scale(1) rotate(0deg);
    opacity: 1;
    animation: ccPlayWobble 6s ease-in-out 0.8s infinite;
}

/* Šareni prsten u bojama posipa koji kruži uz rub kolačića */
.cc-pop-cookie::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(250, 204, 21, 0.95) 0deg 56deg,
        rgba(242, 104, 18, 0.90) 82deg 138deg,
        rgba(16, 185, 129, 0.80) 164deg 220deg,
        rgba(14, 165, 233, 0.85) 246deg 302deg,
        rgba(168, 85, 247, 0.80) 328deg 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 100%);
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 100%);
    animation: ccPlaySpin 12s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Blagi odsjaj koji prijeđe preko kolačića */
.cc-pop-cookie::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.55) 50%, transparent 62%);
    background-size: 260% 260%;
    background-position: 135% 0;
    mix-blend-mode: soft-light;
    animation: ccPlayShine 6.5s ease-in-out 1.6s infinite;
    pointer-events: none;
    z-index: 2;
}

/* ---------- Posip u bojama portala ---------- */
.cc-pop-sprinkle-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}
.cc-pop-sprinkle {
    position: absolute;
    left: var(--sx, 50%);
    top: var(--sy, 50%);
    width: clamp(3px, 1vw, 4px);
    height: clamp(8px, 2.6vw, 12px);
    border-radius: 999px;
    background: var(--sc, #FACC15);
    box-shadow: 0 0 7px color-mix(in srgb, var(--sc, #FACC15) 55%, transparent);
    transform: translate(-50%, -50%) rotate(var(--sr, 0deg));
    animation: ccPlaySprinkle 3.8s ease-in-out infinite;
}
.cc-pop-sprinkle:nth-child(2n) { animation-delay: 0.35s; }
.cc-pop-sprinkle:nth-child(3n) { animation-delay: 0.85s; }

/* ---------- Sadržaj unutar kolačića ---------- */
.cc-pop-inner {
    position: relative;
    z-index: 4;
    width: 66%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(0.3rem, 1.1vw, 0.6rem);
}

/* Razigrano lice kolačića */
.cc-pop-face {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1px, 0.6vw, 3px);
    margin-bottom: clamp(0.1rem, 0.6vw, 0.35rem);
}
.cc-pop-eyes {
    display: flex;
    gap: clamp(16px, 6vw, 30px);
}
.cc-pop-eye {
    width: clamp(7px, 2.6vw, 12px);
    height: clamp(9px, 3.4vw, 16px);
    border-radius: 50%;
    background: #3A2010;
    box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.30);
    transform-origin: center;
    animation: ccPlayBlink 4.6s ease-in-out infinite;
}
.cc-pop-eye:last-child { animation-delay: 0.14s; }
.cc-pop-smile {
    width: clamp(14px, 5vw, 22px);
    height: clamp(7px, 2.6vw, 11px);
    border: 2px solid #3A2010;
    border-top: none;
    border-radius: 0 0 999px 999px;
    animation: ccPlaySmile 4.6s ease-in-out infinite;
}
.cc-pop-blush {
    position: absolute;
    top: clamp(6px, 2.4vw, 12px);
    width: clamp(10px, 3.6vw, 16px);
    height: clamp(6px, 2vw, 9px);
    border-radius: 50%;
    background: rgba(233, 84, 84, 0.50);
    filter: blur(1px);
}
.cc-pop-blush-l { left: calc(50% - clamp(26px, 10vw, 46px)); }
.cc-pop-blush-r { right: calc(50% - clamp(26px, 10vw, 46px)); }

/* Oznaka kategorije */
.cc-pop-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(58, 32, 16, 0.16);
    font-family: var(--font-mono);
    font-size: clamp(8px, 2.4vw, 10px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: #4B2A11;
}
.cc-pop-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F26812;
    animation: ccPlayDot 2.2s ease-out infinite;
}

.cc-pop-title {
    margin: 0;
    font-size: clamp(1.05rem, 4.2vw, 1.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.02;
    color: #3A2010;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
}
.cc-pop-text {
    margin: 0;
    font-size: clamp(10.5px, 2.9vw, 12.5px);
    font-weight: 400;
    line-height: 1.45;
    color: #46260F;
}

/* ---------- Gumbi ---------- */
.cc-pop-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.25rem;
}
.cc-pop-row {
    display: flex;
    gap: 0.45rem;
}
.cc-pop-row .cpop-btn { flex: 1 1 0; min-width: 0; }

.cpop-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    min-height: 46px;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: clamp(9.5px, 2.6vw, 11px);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cpop-btn i { font-size: 0.85rem; }

.cpop-primary {
    background: #3A2010;
    color: #FFF3D6;
    box-shadow: 0 8px 18px rgba(58, 32, 16, 0.35);
}
.cpop-primary i { color: #FACC15; }
.cpop-primary:hover,
.cpop-primary:focus-visible {
    background: #241207;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px rgba(58, 32, 16, 0.42);
}
.cpop-primary::after {
    content: "";
    position: absolute;
    top: 0;
    left: -130%;
    width: 50%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 243, 214, 0.28), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s ease;
}
.cpop-primary:hover::after,
.cpop-primary:focus-visible::after { left: 140%; }

.cpop-ghost {
    background: rgba(255, 248, 232, 0.55);
    border-color: rgba(58, 32, 16, 0.35);
    color: #3A2010;
}
.cpop-ghost i { color: #6B3B16; transition: color 0.2s ease; }
.cpop-ghost:hover,
.cpop-ghost:focus-visible {
    background: #FFF8E8;
    border-color: #3A2010;
    transform: translateY(-2px) scale(1.02);
}
.cpop-btn:focus-visible {
    outline: 2px solid #FFF8E8;
    outline-offset: 3px;
}

.cc-pop-link {
    margin-top: 0.1rem;
    font-family: var(--font-mono);
    font-size: clamp(8px, 2.3vw, 10px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #53300F;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: color 0.2s ease;
}
.cc-pop-link:hover { color: #241207; }

/* ---------- Mrvice koje lebde oko kolačića ---------- */
.cc-pop-crumb {
    position: absolute;
    border-radius: 50% 50% 50% 15%;
    background: currentColor;
    box-shadow: 0 0 14px 1px currentColor;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s ease 0.25s;
    animation: ccPlayDrift 5.6s ease-in-out infinite;
}
#cc-banner.is-open .cc-pop-crumb { opacity: 0.95; }
.cc-pop-crumb-1 { width: 13px; height: 13px; color: #FACC15; top: 4%; left: 16%; }
.cc-pop-crumb-2 { width: 9px; height: 9px; color: #0EA5E9; top: 22%; right: 7%; animation-delay: 0.7s; }
.cc-pop-crumb-3 { width: 15px; height: 15px; color: #F26812; bottom: 9%; left: 8%; animation-delay: 1.3s; }
.cc-pop-crumb-4 { width: 10px; height: 10px; color: #10B981; bottom: 18%; right: 10%; animation-delay: 1.9s; }

/* ---------- Animacije ---------- */
@keyframes ccPlayFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes ccPlayWobble {
    0%, 100% { transform: rotate(-1.6deg); }
    50% { transform: rotate(1.6deg); }
}
@keyframes ccPlaySpin {
    to { transform: rotate(360deg); }
}
@keyframes ccPlayShine {
    0%, 100% { background-position: 135% 0; }
    50% { background-position: -35% 0; }
}
@keyframes ccPlayBlink {
    0%, 91%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.12); }
}
@keyframes ccPlaySmile {
    0%, 88%, 100% { transform: scaleX(1); }
    94% { transform: scaleX(0.86); }
}
@keyframes ccPlaySprinkle {
    0%, 100% { transform: translate(-50%, -50%) rotate(var(--sr, 0deg)) scale(1); }
    50% { transform: translate(-50%, -58%) rotate(calc(var(--sr, 0deg) + 22deg)) scale(1.12); }
}
@keyframes ccPlayDrift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(26deg); }
}
@keyframes ccPlayDot {
    0% { box-shadow: 0 0 0 0 rgba(242, 104, 18, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(242, 104, 18, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 104, 18, 0); }
}

/* ---------- Smanjeno kretanje ---------- */
@media (prefers-reduced-motion: reduce) {
    .cc-pop-stage,
    .cc-pop-stage::before,
    .cc-pop-cookie,
    .cc-pop-cookie::before,
    .cc-pop-cookie::after,
    .cc-pop-sprinkle,
    .cc-pop-crumb,
    .cc-pop-dot,
    .cc-pop-eye,
    .cc-pop-smile { animation: none !important; }
    #cc-banner.cc-pop { transition: opacity 0.25s ease; }
    #cc-banner.is-open .cc-pop-cookie { transform: none; }
}

/* ---------- Manji ekrani: kolačić ostaje čitljiv i sav sadržaj stane u krug ---------- */
@media (max-width: 640px) {
    .cc-pop-stage { width: min(94vw, 600px, 82dvh); }
    .cc-pop-cookie { inset: 4%; }
    .cc-pop-inner {
        width: 70%;
        gap: 0.24rem;
    }
    .cc-pop-face { margin-bottom: 0; }
    .cc-pop-eyes { gap: clamp(14px, 5vw, 22px); }
    .cc-pop-eye { width: clamp(6px, 2.4vw, 10px); height: clamp(8px, 3vw, 13px); }
    .cc-pop-smile { width: clamp(12px, 4.4vw, 18px); height: clamp(6px, 2.2vw, 9px); }
    .cc-pop-title { font-size: clamp(0.98rem, 4.4vw, 1.25rem); }
    .cc-pop-text { font-size: clamp(10px, 2.8vw, 11.5px); line-height: 1.38; }
    .cc-pop-actions { gap: 0.32rem; margin-top: 0.1rem; }
    .cc-pop-row { gap: 0.32rem; }
    .cpop-btn { min-height: 44px; padding: 0.5rem 0.7rem; font-size: 10px; letter-spacing: 0.04em; gap: 0.3rem; }
    .cpop-btn i { font-size: 0.8rem; }
    .cc-pop-crumb-1, .cc-pop-crumb-3 { display: none; }
}

/* Niski ekrani (mobitel u vodoravnom položaju, mali telefoni): lice se sklanja,
   a kolačić se prilagođava visini kako bi sav sadržaj ostao unutar kruga. */
@media (max-height: 700px) {
    .cc-pop-face { display: none; }
    .cc-pop-stage { width: min(88vw, 600px, 78dvh); }
    .cc-pop-inner { gap: 0.2rem; }
    .cc-pop-crumb-1, .cc-pop-crumb-3 { display: none; }
}