/* Seasonal campaign badges: coupons.coupon_badge = key from
   FrontendHelper::seasonBadges(). Markup comes from FrontendHelper::seasonBadge():
   <span class="season-badge season-badge--KEY"><svg/><span class="season-badge-text">Label</span></span>
   New badge = new key in the helper + one .season-badge--KEY block below.

   Placement: the badge sits ABOVE the brand name but takes no space
   (absolutely positioned), so badged and plain cards keep the brand name,
   date etc. at exactly the same height. */

.season-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 15px;
    padding: 0 5px 0 4px;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    vertical-align: middle;
    margin: 0;
    flex: none
}

.season-badge svg {
    width: 8px;
    height: 8px;
    flex: none
}

/* --- Above the brand name, out of the flow ---------------------------------
   Brand page cards, category cards, the JS-sorted lists (same classes). The
   name containers clip overflow for long names, so they (and the category
   card's right section) let the badge show when one is present. */
.brand-coupon-brand-name:has(> .season-badge),
.cc-brand-name:has(> .season-badge) {
    position: relative;
    overflow: visible
}

.cc-brand-section-right:has(.season-badge) {
    overflow: visible
}

.brand-coupon-brand-name > .season-badge,
.cc-brand-name > .season-badge {
    position: absolute;
    left: 0;
    bottom: calc(100% + 4px)
}

/* Brand page cards have only 1rem top padding under 992px: make room there */
@media (max-width: 991.98px) {
    .brand-coupon-card:has(.brand-coupon-brand-name > .season-badge) {
        padding-top: calc(1rem + 14px)
    }
}

/* Slim home row cards (Zadnja priložnost, popular sections): a slightly
   smaller badge above the brand name, centred between the card's top edge and
   the name. On badged cards the content column becomes
   [elastic space + badge][name/expiry/title][elastic space] spanning the full
   card height; equal elastic spaces keep the text centred exactly like on plain
   cards (same 95px / 87px minimum card height, logo stays centred). The top
   space is at least badge + 4px above and below, so long titles only grow the
   card by a few px instead of touching the badge. */
.ccrw-card:not(.ccrw-card-featured):has(.ccrw-content > .ccrw-season) .ccrw-card-left {
    padding-top: 0;
    padding-bottom: 0
}

.ccrw-card:not(.ccrw-card-featured) .ccrw-content:has(> .ccrw-season) {
    flex-direction: column;
    align-items: stretch;
    min-height: 95px
}

/* padding-top nudges the badge ~2px down: the name's letters start ~4px below
   its line box, so a box-centred badge looked too high. */
.ccrw-content > .ccrw-season {
    flex: 1 1 0;
    min-height: 23px;
    padding-top: 4px;
    display: flex;
    align-items: center
}

.ccrw-content:has(> .ccrw-season) > .ccrw-content-inner {
    flex: none
}

.ccrw-content:has(> .ccrw-season)::after {
    content: "";
    flex: 1 1 0;
    min-height: 16px
}

@media (max-width: 768px) {
    .ccrw-card:not(.ccrw-card-featured) .ccrw-content:has(> .ccrw-season) {
        min-height: 87px
    }

    .ccrw-content:has(> .ccrw-season)::after {
        min-height: 12px
    }
}

.ccrw-content > .ccrw-season .season-badge {
    height: 13px;
    gap: 2px;
    padding: 0 4px 0 3px;
    font-size: .47rem
}

.ccrw-content > .ccrw-season .season-badge svg {
    width: 7px;
    height: 7px
}

/* Home "Priporočamo" hero cards: own line between the label and the name */
.ccrw-card-featured .ccrw-season {
    display: flex;
    margin-bottom: 4px
}

/* Home "Novi kuponi" cards: the name column is too narrow on phones, so the
   badge hangs from the card's top edge above the logo (no layout shift). */
.ccr-season {
    position: absolute;
    top: 0;
    left: 1.25rem;
    z-index: 1;
    display: flex;
    pointer-events: none
}

.ccr-season .season-badge {
    height: 16px;
    border-radius: 0 0 5px 5px
}

/* Coupon popup: above the brand name, out of the flow */
.modern-brand-name-row {
    position: relative
}

.modern-season-badge {
    position: absolute;
    left: 0;
    bottom: calc(100% + 4px);
    display: inline-flex
}

/* --- Colours ---------------------------------------------------------------- */

/* Black Friday: black chip, gold gradient border and text */
.season-badge--black-friday {
    background: linear-gradient(180deg, #1b1b1f, #050505) padding-box,
                linear-gradient(120deg, #FFF3A3, #FFC83D 45%, #FF9F1C) border-box;
    color: #FFD23F;
    box-shadow: 0 3px 10px -4px rgba(255, 190, 40, .5), inset 0 1px 0 rgba(255, 255, 255, .08)
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .season-badge--black-friday .season-badge-text {
        background-image: linear-gradient(90deg, #FFF1A1, #FFC83D 55%, #FFA22E);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent
    }
}

/* Singles Day (11.11): filled crimson -> rose -> pink gradient, white text */
.season-badge--singles-day {
    background: linear-gradient(120deg, #9F1239 0%, #E11D48 45%, #FB7185 100%);
    color: #fff;
    box-shadow: 0 3px 12px -4px rgba(225, 29, 72, .7), inset 0 1px 0 rgba(255, 255, 255, .35)
}

/* Cyber Monday: filled navy -> blue -> cyan gradient, white text */
.season-badge--cyber-monday {
    background: linear-gradient(120deg, #1E3A8A 0%, #2563EB 45%, #22D3EE 100%);
    color: #fff;
    box-shadow: 0 3px 12px -4px rgba(37, 99, 235, .7), inset 0 1px 0 rgba(255, 255, 255, .35)
}
