/* ===========================================================================
   Product stickers  -  https://ocmod.net
   ---------------------------------------------------------------------------
   Structure only. Colours, sizes and offsets of individual stickers live in
   sticker.generated.css, which the module rewrites whenever a sticker is
   saved. Nothing here uses !important, so a theme can still override it.
   =========================================================================== */

/* The overlay needs a positioned ancestor. These are the containers the
   default theme and most themes built on it use around a product photo. */
.product-thumb .image,
.product-layout .image,
.product-thumb > .image,
.thumbnails {
    position: relative;
}

.oc-sticker-layer {
    --oc-sticker-scale: 1;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.oc-sticker-box {
    position: absolute;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    max-width: 100%;
}

.oc-sticker-box--tl {
    top: 0;
    left: 0;
    justify-content: flex-start;
    transform: scale(var(--oc-sticker-scale));
    transform-origin: top left;
}

.oc-sticker-box--tr {
    top: 0;
    right: 0;
    justify-content: flex-end;
    transform: scale(var(--oc-sticker-scale));
    transform-origin: top right;
}

.oc-sticker-box--bl {
    bottom: 0;
    left: 0;
    justify-content: flex-start;
    align-content: flex-end;
    transform: scale(var(--oc-sticker-scale));
    transform-origin: bottom left;
}

.oc-sticker-box--br {
    bottom: 0;
    right: 0;
    justify-content: flex-end;
    align-content: flex-end;
    transform: scale(var(--oc-sticker-scale));
    transform-origin: bottom right;
}

.oc-sticker-box--cc {
    top: 50%;
    left: 50%;
    justify-content: center;
    transform: translate(-50%, -50%) scale(var(--oc-sticker-scale));
}

/* ---------- the sticker itself -------------------------------------------- */

.oc-sticker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    pointer-events: none;
}

.oc-sticker--text {
    padding: 4px 9px;
    background: #e74c3c;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    text-align: center;
}

.oc-sticker--text i {
    margin-right: 5px;
    font-size: 0.95em;
}

.oc-sticker--image {
    display: block;
    width: auto;
    height: auto;
    max-width: 70px;
    background: none;
    border: 0;
}

/* ---------- presets ------------------------------------------------------- */

.oc-sticker--preset-minimal {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 4px;
    font-weight: 600;
}

.oc-sticker--preset-bright {
    background: linear-gradient(135deg, #ff8a00 0%, #e52e71 100%);
    color: #ffffff;
    border: 0;
    border-radius: 6px;
    font-weight: 700;
}

.oc-sticker--preset-acid {
    background: #d4ff00;
    color: #101010;
    border: 2px solid #101010;
    border-radius: 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.oc-sticker--preset-strict {
    background: #111827;
    color: #ffffff;
    border: 0;
    border-radius: 0;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.oc-sticker--preset-soft {
    background: #eef2ff;
    color: #3730a3;
    border: 0;
    border-radius: 999px;
    font-weight: 600;
    padding: 5px 12px;
}

.oc-sticker--preset-outline {
    background: transparent;
    color: #e11d48;
    border: 2px solid currentColor;
    border-radius: 6px;
    font-weight: 700;
}

/* ---------- responsive ----------------------------------------------------
   The whole corner is scaled from its own anchor point, so a sticker shrinks
   towards the edge it sits on and never creeps over the middle of the photo.
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .oc-sticker-layer {
        /*--oc-sticker-scale: .85;*/
    }
}

@media (max-width: 767px) {
    .oc-sticker-layer {
        /*--oc-sticker-scale: .85;*/
    }

    .oc-sticker-box {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .oc-sticker-layer {
        /*--oc-sticker-scale: .85;*/
    }
}

/* The main photo is large enough to carry full size stickers everywhere. */
.oc-sticker-layer--product {
    --oc-sticker-scale: 1;
}

@media (max-width: 767px) {
    .oc-sticker-layer--product {
        /*--oc-sticker-scale: .85;*/
    }
}

@media (prefers-reduced-motion: no-preference) {
    .oc-sticker {
        transition: none;
    }
}
