/* Approved shared physical labels: frontend AND editor. Only --fmo-badge-fill
   controls the interior. Metallic borders never inherit the chosen colors. */
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical] {
    --tag-shape:polygon(0 0,100% 0,100% 83%,50% 100%,0 83%);
    --tag-inset:2px; --tag-metal:linear-gradient(145deg,#fff1a0,#bd7806 34%,#ffe27a 58%,#865000);
    --tag-width:88px; --tag-height:138px;
    position:absolute!important; top:var(--fmo-card-tag-top,18px)!important; left:16px!important; right:auto!important;
    width:var(--tag-width)!important; min-width:var(--tag-width)!important; max-width:var(--tag-width)!important;
    min-height:var(--tag-height)!important; box-sizing:border-box!important;
    display:flex!important; flex-direction:column!important; align-items:center!important;
    justify-content:flex-start!important; gap:5px!important; padding:30px 5px 22px!important;
    background:transparent!important; border:0!important; border-radius:0!important;
    overflow:visible!important; clip-path:none!important; box-shadow:none!important;
    color:#fff!important; text-align:center!important; z-index:8!important;
    filter:drop-shadow(0 3px 4px #0006)!important; animation:none!important;
    font-family:Arial,sans-serif!important; line-height:1.1!important;
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical]::before { content:none!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical][data-discount-tier=standard] {
    --tag-shape:polygon(19% 0,81% 0,100% 15%,100% 96%,96% 100%,4% 100%,0 96%,0 15%);
    --tag-inset:1px; --tag-metal:#e9eef0; --tag-width:78px; --tag-height:124px;
    padding-top:30px!important; padding-bottom:14px!important;
}
:is(body,#fmo-badge-theme) [data-fmo-physical][data-discount-tier=high] {
    --tag-shape:polygon(17% 0,83% 0,100% 12%,100% 91%,50% 100%,0 91%,0 12%);
    --tag-metal:linear-gradient(125deg,#707b85 0%,#fff 16%,#b4bec7 30%,#f5f8fb 43%,#78838d 58%,#fff 75%,#a0aab2 90%,#eaf0f5);
    --tag-inset:3px; --tag-width:90px; --tag-height:138px;
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical] > .fmo-tag-face {
    display:block!important; position:absolute!important; inset:0!important; z-index:0!important;
    background:var(--tag-metal)!important; clip-path:var(--tag-shape)!important;
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical] > .fmo-tag-face::before {
    content:""!important; display:block!important; position:absolute!important; inset:var(--tag-inset)!important;
    background:var(--fmo-badge-fill,#030507)!important; clip-path:var(--tag-shape)!important;
    box-shadow:none!important; z-index:1!important;
}
/* A moving reflection masked to the perimeter: never shades the interior. */
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical] > .fmo-tag-face::after {
    content:""!important; display:block!important; position:absolute!important; inset:0!important;
    z-index:2!important; padding:var(--tag-inset)!important; box-sizing:border-box!important;
    background:linear-gradient(115deg,transparent 38%,#ffffffdd 49%,transparent 60%)!important;
    background-size:300% 100%!important; clip-path:var(--tag-shape)!important;
    -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0)!important;
    -webkit-mask-composite:xor!important; mask-composite:exclude!important;
    animation:fmo-tag-metal-reflection 5s ease-in-out infinite!important;
}
:is(body,#fmo-badge-theme) [data-fmo-physical][data-discount-tier=standard] > .fmo-tag-face::after { content:none!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical]:not([data-discount-tier=best])::after {
    content:""!important; position:absolute!important; top:8px!important; left:calc(50% - 4px)!important;
    width:8px!important; height:8px!important; border-radius:50%!important; background:#29343d!important;
    border:1px solid #e9eef0!important; z-index:4!important; box-shadow:inset 0 1px 2px #0008!important;
}
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__kicker { position:relative!important; z-index:3!important; font-size:9px!important; color:#fff!important; letter-spacing:.08em!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__value { position:relative!important; z-index:3!important; font-size:23px!important; letter-spacing:-1px!important; color:#fff!important; white-space:nowrap!important; line-height:1.1!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__text { position:relative!important; z-index:3!important; font-size:9px!important; font-weight:800!important; color:#fff!important; line-height:1.2!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical][data-discount-tier=standard] .fmo-campaign-discount-badge__text::after { content:"★"; display:block; margin-top:7px; font-size:14px; line-height:1; color:#d99b65; text-shadow:0 1px 1px #55321b; }
:is(body,#fmo-badge-theme) [data-fmo-physical][data-discount-tier=high] .fmo-campaign-discount-badge__text::after { content:"★★★"; display:block; margin-top:7px; font-size:14px; line-height:1; color:#e3e9ee; text-shadow:0 1px 1px #56616d; letter-spacing:1px; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-crown { position:absolute!important; display:block!important; top:8px!important; left:calc(50% - 10px)!important; width:20px!important; height:17px!important; z-index:4!important; background:url('../images/campaign-top-crown.svg') center/contain no-repeat!important; transform:none!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-label { position:relative!important; z-index:4!important; display:block!important; font-size:9px!important; color:#fff!important; line-height:1.3!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-label::before { content:none!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-label::after { content:"★★★★★"!important; display:block!important; position:static!important; margin:5px 0 0!important; font-size:11px!important; color:#ffd96a!important; background:none!important; width:100%!important; height:auto!important; left:auto!important; right:auto!important; transform:none!important; text-align:center!important; letter-spacing:0!important; }
:is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-top { color:#ffd96a!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+[data-fmo-physical]) { position:absolute!important; top:calc(var(--fmo-card-tag-top,18px) + 124px)!important; left:38px!important; display:block!important; width:44px!important; height:52px!important; z-index:7!important; background:linear-gradient(90deg,#a90d09,#ed3b31 48%,#b3120d)!important; border:1px solid #e5b53d!important; clip-path:polygon(0 0,100% 0,100% 100%,50% 76%,0 100%)!important; transform:none!important; }
#fmo-campaign-results { --fmo-card-tag-top:29px; }
/* TOP has a 1px card border; compensate that origin on the other cards. */
#fmo-campaign-results .car-card:not(:has(.fmo-campaign-discount-badge--best)) { --fmo-card-tag-top:30px; }
#filtered-results { --fmo-card-tag-top:35px; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] { --tag-width:132px; --tag-height:176px; top:80px!important; left:24px!important; padding:42px 9px 28px!important; gap:7px!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__kicker { font-size:12px!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__value { font-size:34px!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__text,
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__best-label { font-size:12px!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__best-crown { top:12px!important; width:24px!important; height:21px!important; left:calc(50% - 12px)!important; }
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+.fmo-campaign-discount-badge--detail[data-fmo-physical]) { top:238px!important; left:58px!important; width:64px!important; height:64px!important; }
@keyframes fmo-tag-metal-reflection { 0%,25% { background-position:100% 0; } 65%,100% { background-position:0 0; } }
@media(max-width:600px) {
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge[data-fmo-physical] { --tag-width:70px; --tag-height:110px; top:var(--fmo-card-tag-top,12px)!important; left:12px!important; padding:25px 4px 17px!important; gap:4px!important; }
    :is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__value { font-size:19px!important; }
    :is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__text,
    :is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-campaign-discount-badge__best-label { font-size:8px!important; }
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+[data-fmo-physical]) { top:calc(var(--fmo-card-tag-top,12px) + 94px)!important; left:29px!important; width:36px!important; height:42px!important; }
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] { --tag-width:96px; --tag-height:138px; top:54px!important; left:18px!important; padding:34px 5px 22px!important; }
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__value { font-size:25px!important; }
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__text,
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical] .fmo-campaign-discount-badge__best-label { font-size:10px!important; }
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+.fmo-campaign-discount-badge--detail[data-fmo-physical]) { top:176px!important; left:42px!important; width:48px!important; height:48px!important; }
}
@media(prefers-reduced-motion:reduce) { :is(body,#fmo-badge-theme) [data-fmo-physical] .fmo-tag-face::after { animation:none!important; } }
/* Search cards only: scale the COMPLETE tag, including type, stars and metal.
   TOP keeps its header clearance and original search-card dimensions. */
#filtered-results .fmo-campaign-discount-badge[data-fmo-physical]:not([data-discount-tier=best]),
#fmo-badge-editor [data-preview-surface=search] .fmo-campaign-discount-badge[data-fmo-physical]:not([data-discount-tier=best]) {
    top:14px!important;
    transform:scale(.78)!important;
    transform-origin:top left!important;
}
@media(max-width:600px) {
    #filtered-results .fmo-campaign-discount-badge[data-fmo-physical]:not([data-discount-tier=best]),
    #fmo-badge-editor [data-preview-surface=search] .fmo-campaign-discount-badge[data-fmo-physical]:not([data-discount-tier=best]) { top:12px!important; transform:scale(.9)!important; }
}
/* Detail TOP: genuine gold perimeter around both the shield and red ribbons.
   The chosen interior stays on ::before, untouched by the metallic reflection. */
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best] {
    --tag-inset:4px;
    --tag-metal:linear-gradient(120deg,#875007 0%,#d99d28 18%,#fff0a6 32%,#c78a17 47%,#ffe481 62%,#fff9da 70%,#b9750c 84%,#efd077 100%);
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best] > .fmo-tag-face {
    background-size:250% 150%!important;
    animation:fmo-detail-gold-reflection 6s ease-in-out infinite!important;
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+.fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best]) {
    border:0!important;
    background:linear-gradient(120deg,#875007 0%,#d99d28 18%,#fff0a6 32%,#c78a17 47%,#ffe481 62%,#fff9da 70%,#b9750c 84%,#efd077 100%)!important;
    background-size:250% 150%!important;
    animation:fmo-detail-gold-reflection 6s ease-in-out infinite!important;
}
:is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+.fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best])::before {
    content:""!important; display:block!important; position:absolute!important; inset:3px!important;
    background:linear-gradient(90deg,#a90d09,#ed3b31 48%,#b3120d)!important;
    clip-path:polygon(0 0,100% 0,100% 100%,50% 73%,0 100%)!important;
}
@keyframes fmo-detail-gold-reflection { 0%,15%,100% { background-position:0% 50%; } 55%,70% { background-position:100% 50%; } }
@media(prefers-reduced-motion:reduce) {
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best] > .fmo-tag-face,
    :is(body,#fmo-badge-theme) .fmo-campaign-discount-badge__tail:has(+.fmo-campaign-discount-badge--detail[data-fmo-physical][data-discount-tier=best]) { animation:none!important; }
}
