/* ============================================
   CC Tilbud Sticker – Styling
   ============================================ */

/*
 * Forælder-elementet SKAL have position: relative.
 * Pluginets JS sørger for dette automatisk,
 * men det kan også sættes manuelt.
 */

/* Cover-blokke med stickers: hold indhold i toppen */
.wp-block-cover:has(.cc-sticker-parent) {
    align-items: start !important;
}

/* --- Sticker --- */
.cc-tilbud-sticker {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sticker-bg, var(--wp--preset--color--custom-knap-farve));
    color: var(--sticker-color, var(--wp--preset--color--base));
    text-align: center;
    line-height: 1.1;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    transform: rotate(var(--sticker-rotation, -12deg));
}

/* --- Inner wrapper --- */
.cc-sticker__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 4px;
    position: relative;
    z-index: 1;
}

/* --- Label (e.g. "TILBUD") --- */
.cc-sticker__label {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    font-size: var(--sticker-font-label, 11px);
}

/* --- Value row --- */
.cc-sticker__rabat {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1px;
    font-size: var(--sticker-font-value, 20px);
}

.cc-sticker__value {
    font-weight: 800;
    line-height: 1;
}

.cc-sticker__suffix {
    font-weight: 600;
    font-size: var(--sticker-font-suffix, 10px);
}

/* --- Dates row --- */
.cc-sticker__dates {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.9;
    letter-spacing: 0.02em;
    margin-top: 1px;
    line-height: 1.1;
}

/* ===========================================
   Former
   =========================================== */

/* --- Cirkel --- */
.cc-sticker--cirkel {
    border-radius: 50%;
}

/* --- Pille (aflangt afrundet) --- */
.cc-sticker--pille {
    border-radius: 9999px;
}

/* --- Organisk (blob-former) --- */
.cc-sticker--organisk {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
.cc-sticker--organisk[data-variation="1"] {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
.cc-sticker--organisk[data-variation="2"] {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}
.cc-sticker--organisk[data-variation="3"] {
    border-radius: 50% 50% 20% 80% / 25% 80% 20% 75%;
}
.cc-sticker--organisk[data-variation="4"] {
    border-radius: 80% 20% 50% 50% / 75% 25% 80% 20%;
}
.cc-sticker--organisk[data-variation="5"] {
    border-radius: 67% 33% 50% 50% / 50% 62% 38% 50%;
}
.cc-sticker--organisk[data-variation="6"] {
    border-radius: 33% 67% 50% 50% / 50% 38% 62% 50%;
}
.cc-sticker--organisk[data-variation="7"] {
    border-radius: 40% 60% 30% 70% / 60% 30% 70% 40%;
}
.cc-sticker--organisk[data-variation="8"] {
    border-radius: 60% 40% 70% 30% / 40% 70% 30% 60%;
}

/* --- Påskeæg --- */
.cc-sticker--paaskeaeg {
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background-color: transparent !important;
    box-shadow: none;
}

/* Det store æg (baggrund) */
.cc-sticker--paaskeaeg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--sticker-bg, var(--wp--preset--color--custom-knap-farve));
    border-radius: inherit;
    z-index: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* Det lille æg (bag det store) – samme proportioner som det store */
.cc-sticker--paaskeaeg::before {
    content: '';
    position: absolute;
    width: 55%;
    height: 55%;
    bottom: 0%;
    right: -18%;
    background-color: var(--sticker-bg, var(--wp--preset--color--custom-knap-farve));
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: -1;
    filter: brightness(0.82);
    transform: rotate(28deg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* ===========================================
   Hover-effekt – trigger på forælder-element
   =========================================== */
.cc-sticker-parent:hover .cc-tilbud-sticker,
.cc-sticker-parent:focus-within .cc-tilbud-sticker {
    transform: rotate(var(--sticker-rotation, -12deg)) scale(1.1);
    filter: brightness(1.15);
    box-shadow:
        0 0 12px 4px var(--wp--preset--color--custom-hover),
        0 4px 14px rgba(0, 0, 0, 0.22);
}

/* ===========================================
   Inline æg-ikon til menuer [tilbud_aeg]
   =========================================== */
.cc-tilbud-aeg {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    top: 4px;
    margin-left: 6px;
    margin-right: 10px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    transform: rotate(var(--sticker-rotation, -12deg));
}

/* Knap-variant: tættere på baseline */
.cc-tilbud-aeg--knap {
    top: -2px;
    margin-right: 0px;
}

/* Det store æg */
.cc-tilbud-aeg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--sticker-bg, var(--wp--preset--color--custom-knap-farve));
    border-radius: inherit;
    z-index: 0;
}

/* Det lille æg bag ved */
.cc-tilbud-aeg::before {
    content: '';
    position: absolute;
    width: 55%;
    height: 55%;
    bottom: 0%;
    right: -18%;
    background-color: var(--sticker-bg, var(--wp--preset--color--custom-knap-farve));
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    z-index: -1;
    filter: brightness(0.82);
    transform: rotate(28deg);
}

/* ===========================================
   Menu-klasse: Tilføj "cc-aeg" på et menupunkt.
   JS indsætter automatisk æg-ikonet.
   =========================================== */
