/* Sladka Pohotovost — cookie consent brand overrides (Shoptet-like bottom bar) */

:root {
    --cc-bg: #ffffff;
    --cc-primary-color: #333333;
    --cc-secondary-color: #666666;
    --cc-btn-primary-bg: #d61652;
    --cc-btn-primary-color: #ffffff;
    --cc-btn-primary-hover-bg: #b81245;
    --cc-btn-primary-border-color: #d61652;
    --cc-btn-secondary-bg: #ffffff;
    --cc-btn-secondary-color: #333333;
    --cc-btn-secondary-border-color: #cccccc;
    --cc-btn-secondary-hover-bg: #f5f5f5;
    --cc-separator-border-color: #eeeeee;
    --cc-toggle-on-bg: #d61652;
    --cc-link-color: #d61652;
    --cc-font-family: inherit;
    --cc-modal-border-radius: 0.5rem;
    --cc-btn-border-radius: 0.35rem;
    /* Default library uses INT_MAX and covered toasts — keep below .sp-toast-container */
    --cc-z-index: 100000;
}

#cc-main .cm {
    max-width: 100%;
    border-top: 1px solid #eeeeee;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
}

#cc-main .cm.cm--bar.cm--inline .cm__body {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1rem;
    padding: 0.65rem 1.25rem;
    box-sizing: border-box;
}

/* Title full width above; cookie + description on one row */
#cc-main .cm.cm--bar.cm--inline .cm__texts {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "title title"
        "mascot desc";
    align-items: start;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    flex: 1;
    min-width: 0;
    padding: 0 !important;
}

#cc-main .cm.cm--bar.cm--inline .cm__texts .cm__title {
    grid-area: title;
    font-weight: 700;
    /* Library pads title ~1.3rem — text would start right of the cookie */
    margin: 0 !important;
    padding: 0 !important;
}

#cc-main .cm.cm--bar.cm--inline .cm__texts .cm__desc {
    grid-area: desc;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

#cc-main .cm.cm--bar.cm--inline .cm__texts .sladka-cookie-mascot {
    grid-area: mascot;
    align-self: start;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

#cc-main .cm__btn--secondary {
    border: 1px solid #cccccc;
}

#cc-main .pm__btn--primary {
    background: #2e7d32;
    border-color: #2e7d32;
}

#cc-main .pm__btn--primary:hover {
    background: #256b29;
    border-color: #256b29;
}

/* Cookie mascot — own flex box (overrides #cc-main div { all: unset }) */
#cc-main .cm__body .sladka-cookie-mascot {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    justify-content: flex-start;
    align-self: start;
    box-sizing: border-box;
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    max-width: 54px;
    max-height: 54px;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: visible;
}

#cc-main .cm__body .sladka-cookie-mascot img {
    display: block;
    width: 54px;
    height: 54px;
    max-width: 54px;
    max-height: 54px;
    margin: 0;
    object-fit: contain;
    object-position: left top;
    transform-origin: center center;
    transition: transform 0.15s ease;
}

/* Bite animation */
@keyframes sladka-cookie-bite {
    0% {
        clip-path: circle(100% at 50% 50%);
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    35% {
        clip-path: polygon(
            0% 0%, 100% 0%, 100% 100%, 0% 100%,
            0% 52%, 18% 48%, 28% 62%, 14% 78%, 0% 68%
        );
        transform: scale(1) rotate(-8deg);
        opacity: 1;
    }

    70% {
        clip-path: polygon(
            0% 0%, 100% 0%, 100% 100%, 0% 100%,
            0% 52%, 18% 48%, 28% 62%, 14% 78%, 0% 68%
        );
        transform: scale(0.85) rotate(-12deg);
        opacity: 0.85;
    }

    100% {
        clip-path: polygon(
            0% 0%, 100% 0%, 100% 100%, 0% 100%,
            0% 52%, 18% 48%, 28% 62%, 14% 78%, 0% 68%
        );
        transform: scale(0.2) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes sladka-cookie-crumbs {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(12px, 18px) scale(0.2);
    }
}

@keyframes sladka-bar-slide-out {
    to {
        transform: translateY(110%);
        opacity: 0;
    }
}

#cc-main .cm.sladka-cookie-bite {
    pointer-events: none;
}

#cc-main .cm.sladka-cookie-bite .sladka-cookie-mascot img {
    animation: sladka-cookie-bite 0.65s ease-in forwards;
}

#cc-main .cm.sladka-cookie-bite .sladka-cookie-mascot::after {
    content: "";
    position: absolute;
    top: 18%;
    right: 8%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #c8955a;
    box-shadow: 14px 8px 0 2px #c8955a, 6px 16px 0 1px #a06830;
    animation: sladka-cookie-crumbs 0.55s ease-out 0.2s forwards;
    opacity: 0;
}

#cc-main .cm.sladka-cookie-bite {
    animation: sladka-bar-slide-out 0.45s ease 0.55s forwards;
}

#cc-main .cm.sladka-cookie-dismiss {
    animation: sladka-bar-slide-out 0.35s ease forwards;
}

@media (max-width: 768px) {
    /* Library mobile sheet uses column!important — override for compact bar layout */
    #cc-main .cm.cm--bar.cm--inline .cm__body {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        text-align: left !important;
        gap: 0.65rem !important;
        padding: 0.75rem 1rem !important;
        max-width: none !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__texts {
        display: grid !important;
        grid-template-columns: auto 1fr !important;
        grid-template-areas: "title title" "mascot desc" !important;
        width: 100% !important;
        flex: 1 0 auto !important;
        min-width: 0 !important;
        text-align: left !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        column-gap: 0.65rem !important;
        row-gap: 0.3rem !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__texts .cm__title {
        grid-area: title !important;
        font-size: 0.95rem !important;
        margin: 0 0 0.15rem !important;
        padding: 0 !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__texts .cm__desc {
        grid-area: desc !important;
        font-size: 0.8rem !important;
        line-height: 1.35 !important;
        padding: 0 !important;
        margin: 0 !important;
        min-width: 0 !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__texts .sladka-cookie-mascot {
        grid-area: mascot !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        align-self: start !important;
        justify-content: flex-start !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__texts .sladka-cookie-mascot img {
        width: 44px !important;
        height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
        margin: 0 !important;
    }

    /* All three actions in one horizontal row */
    #cc-main .cm.cm--bar.cm--inline .cm__btns {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 0.4rem !important;
        width: 100% !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
        padding: 0 !important;
        border-top: none !important;
        border-left: none !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__btn-group {
        display: contents !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__btns .cm__btn {
        display: inline-flex !important;
        flex: 1 1 0 !important;
        align-items: center !important;
        justify-content: center !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0.55rem 0.35rem !important;
        font-size: 0.78rem !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    #cc-main .cm.cm--bar.cm--inline .cm__btn + .cm__btn,
    #cc-main .cm.cm--bar.cm--inline .cm__btn-group + .cm__btn-group {
        margin: 0 !important;
    }
}

/* Footer — change cookie preferences anytime */
.footer-cookie-settings {
    margin-left: 0;
}

.footer-cookie-settings button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.footer-cookie-settings button:hover {
    color: #d61652;
}

.footer-cookie-settings__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    opacity: 0.9;
}
