/* ============================================
   Black Friday Theme CSS
   --------------------------------------------
   Only loaded while config('seasonal.black_friday.enabled') is true
   (BLACK_FRIDAY_THEME_ENABLED in .env). Activated by <body class="black-friday-theme">,
   applied by the seasonal-theme script in resources/views/layouts/app.blade.php
   inside the offer window from config/seasonal.php (localStorage "blackFridayTheme" =
   enabled/disabled overrides the date window).
   Everything in this file is scoped to .black-friday-theme so the default
   look is untouched the rest of the year.

   The look: lights out (ink-black canvas), discounts as price tags hanging from a
   string. Yellow marks the discount, pink the action, white the headline.
   ============================================ */
/* Anton (OFL), self-hosted so the page never waits on an external request */
@font-face {
    font-family: "Anton";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/anton-latin.woff2") format("woff2");
}

:root {
    --bf-ink-900: #050508;
    --bf-ink-800: #0a0a10;
    --bf-ink-700: #12121a;
    --bf-ink-600: #1d1d28;
    --bf-line: rgba(255, 255, 255, 0.1);
    --bf-yellow: #ffe03a;
    --bf-yellow-deep: #f2b90d;
    --bf-pink: #ff2e7e;
    /* Button fill: dark enough for white text at 4.5:1, which --bf-pink is not */
    --bf-pink-button: #e0186a;
    --bf-pink-deep: #b80f57;
    --bf-muted: #b4b4c6;
    --bf-font-display: "Anton", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
    /* Heart used as a mask (ticker separators), so it takes the text colour */
    --bf-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21.5 10.5 20.2C5.4 15.5 2 12.4 2 8.6 2 5.5 4.4 3.1 7.5 3.1c1.7 0 3.4.8 4.5 2.1 1.1-1.3 2.8-2.1 4.5-2.1 3.1 0 5.5 2.4 5.5 5.5 0 3.8-3.4 6.9-8.5 11.6z'/%3E%3C/svg%3E");
}

/* ============================================
   Page canvas
   ============================================ */
html:has(> body.black-friday-theme) {
    background: var(--bf-ink-800);
}

body.black-friday-theme {
    background: var(--bf-ink-800);
}

/* ============================================
   Header / navigation
   ============================================ */
.black-friday-theme .header-section {
    background: rgba(5, 5, 8, 0.78);
    border-bottom: 1px solid rgba(255, 224, 58, 0.22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.black-friday-theme .header-section.header-active {
    background: var(--bf-ink-900);
    box-shadow: 0 2px 0 var(--bf-yellow), 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* A small price tag swinging next to the logo */
.black-friday-theme .navbar-logo-wrapper::after {
    content: "%";
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.34em 0.44em 0.28em;
    border-radius: 0.55em 0.55em 0.2em 0.2em;
    background: var(--bf-yellow);
    color: var(--bf-ink-900);
    font-family: var(--bf-font-display);
    font-size: 0.62em;
    font-weight: 400;
    line-height: 1;
    transform-origin: 50% 0;
    animation: bf-swing 4s ease-in-out infinite;
}

/* Shared by everything that hangs: the range comes from --bf-from / --bf-to.
   "rotate" is animated on its own so any transform on the element is kept. */
@keyframes bf-swing {
    0%,
    100% {
        rotate: var(--bf-from, -5deg);
    }
    50% {
        rotate: var(--bf-to, 5deg);
    }
}

/* ============================================
   Breadcrumb hero: a string of price tags under the header
   ============================================ */
.black-friday-theme .breadcrumb-area {
    position: relative;
    overflow: hidden;
    background:
        /* 72px: the fixed header covers the top of the hero */
        url("../images/banner/black-friday-garland.svg") repeat-x 50% 72px / auto 110px,
        radial-gradient(60% 130% at 82% 0%, rgba(255, 46, 126, 0.22), transparent 70%),
        linear-gradient(180deg, var(--bf-ink-900) 0%, var(--bf-ink-800) 100%);
}

/* The tags are covered behind the page title (it starts at the left edge of the centred
   1140px container) and fade in to its right */
.black-friday-theme .breadcrumb-area::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(
        90deg,
        var(--bf-ink-900) 0,
        var(--bf-ink-900) calc(50% - 170px),
        rgba(5, 5, 8, 0) calc(50% + 90px)
    );
}

.black-friday-theme .breadcrumb-area .container {
    position: relative;
    z-index: 2;
}

.black-friday-theme .breadcrumb-area .content .title {
    font-family: var(--bf-font-display);
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 3px 3px 0 var(--bf-pink);
}

/* ============================================
   Footer: caution-tape edge
   ============================================ */
.black-friday-theme .footer-section {
    background: var(--bf-ink-900);
}

.black-friday-theme .footer-section .shape2,
.black-friday-theme .footer-section .shape3 {
    display: none;
}

.black-friday-theme .footer-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    pointer-events: none;
    background: repeating-linear-gradient(-45deg, var(--bf-yellow) 0 16px, var(--bf-ink-900) 16px 32px);
}

.black-friday-theme .footer-section .footer-links .link-wrapper .f-l-title {
    color: var(--bf-yellow);
}

/* ============================================
   Promo banner (resources/views/user/black-friday-banner.blade.php)
   Rendered on the page but only displayed while the theme is active.
   ============================================ */
.bf-banner-wrap {
    display: none;
    margin: 0 0 32px;
}

body.black-friday-theme .bf-banner-wrap {
    display: block;
}

.bf-banner {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "content tags"
        "ticker ticker";
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(55% 85% at 84% 6%, rgba(255, 46, 126, 0.28), transparent 70%),
        linear-gradient(135deg, var(--bf-ink-700) 0%, var(--bf-ink-900) 100%);
    box-shadow:
        0 0 0 1px var(--bf-line),
        0 18px 50px rgba(0, 0, 0, 0.55);
}

/* Ghost percent sign behind the tags */
.bf-banner::before {
    content: "%";
    position: absolute;
    top: -64px;
    right: 36px;
    font-family: var(--bf-font-display);
    font-size: 400px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.bf-banner-content {
    grid-area: content;
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 30px 12px 28px 40px;
    text-align: left;
}

.bf-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bf-yellow);
}

/* "Live" dot in front of the deadline */
.bf-kicker::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bf-pink);
    animation: bf-pulse 2s ease-out infinite;
}

@keyframes bf-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 46, 126, 0.7);
    }
    70%,
    100% {
        box-shadow: 0 0 0 10px rgba(255, 46, 126, 0);
    }
}

.bf-title {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.22em;
    margin: 8px 0 12px;
    font-family: var(--bf-font-display);
    font-weight: 400;
    font-size: 5.2rem;
    line-height: 1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #fff;
}

.bf-title-word {
    color: #fff;
}

/* "BLACK" is drawn hollow: black letters with a white outline */
.bf-title-word:first-child {
    color: transparent;
    -webkit-text-stroke: 2px #fff;
}

.bf-subtitle {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    color: #fff;
}

.bf-message {
    max-width: 520px;
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--bf-muted);
}

.bf-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px 30px;
}

/* Countdown */
.bf-countdown-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--bf-muted);
}

.bf-countdown-boxes {
    display: flex;
    gap: 18px;
}

.bf-time-box {
    position: relative;
    min-width: 62px;
    text-align: center;
}

/* Colon centred in the gap between two tiles */
.bf-time-box + .bf-time-box::before {
    content: ":";
    position: absolute;
    top: 11px;
    left: -18px;
    width: 18px;
    font-family: var(--bf-font-display);
    font-size: 1.7rem;
    line-height: 1;
    color: var(--bf-yellow);
}

/* Split-flap tile: the dark line across the middle is the hinge */
.bf-time-value {
    display: block;
    padding: 10px 6px 8px;
    border-radius: 10px;
    font-family: var(--bf-font-display);
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: #fff;
    background: linear-gradient(180deg, #20202c 0 49%, #000 49% 51%, #16161f 51% 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 6px 16px rgba(0, 0, 0, 0.45);
}

.bf-time-label {
    display: block;
    margin-top: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bf-muted);
}

/* CTA */
.bf-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    /* Lines the button up with the countdown tiles, which have their labels underneath */
    margin-bottom: 17px;
    padding: 16px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--bf-pink-button) 0%, var(--bf-pink-deep) 100%);
    color: #fff !important;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 8px 24px rgba(255, 46, 126, 0.4);
    transition-property: transform, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.bf-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 12px 32px rgba(255, 46, 126, 0.6);
}

.bf-cta:active {
    transform: scale(0.96);
}

.bf-cta:focus-visible {
    outline: 2px solid var(--bf-yellow);
    outline-offset: 3px;
}

.bf-cta i {
    font-size: 0.9em;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.bf-cta:hover i {
    transform: translateX(3px);
}

/* Hang tags: one per discount, each on its own string from the top edge of the card.
   --bf-string is the string length; the last tag (the biggest discount) is the solid yellow one. */
.bf-tags {
    grid-area: tags;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 28px;
    margin: 0;
    padding: 0 48px 0 24px;
    list-style: none;
}

.bf-tag {
    --bf-string: 26px;
    --bf-hole: 20px; /* tag top to the centre of its hole */
    position: relative;
    padding-top: var(--bf-string);
    transform-origin: 50% 0;
    filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.55));
    animation: bf-swing 5s ease-in-out infinite;
}

/* The string, drawn over the tag down to its hole */
.bf-tag::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 50%;
    width: 2px;
    height: calc(var(--bf-string) + var(--bf-hole));
    margin-left: -1px;
    border-radius: 1px;
    background: linear-gradient(180deg, #6c6c80 0%, #d2d2de 100%);
}

.bf-tag-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 122px;
    padding-top: 24px;
    border: 2px solid var(--bf-yellow);
    border-radius: 32px 32px 12px 12px;
    background: var(--bf-ink-600);
    color: var(--bf-yellow);
    font-family: var(--bf-font-display);
    font-size: 2.2rem;
    line-height: 1;
    letter-spacing: 0.02em;
}

/* The hole the string goes through */
.bf-tag-label::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--bf-ink-900);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.bf-tag-1 {
    --bf-string: 24px;
    --bf-from: -4deg;
    --bf-to: 2deg;
}

.bf-tag-2 {
    --bf-string: 78px;
    --bf-from: 3deg;
    --bf-to: -2deg;
    animation-duration: 6s;
    animation-delay: -2s;
}

.bf-tag-hero {
    --bf-string: 44px;
    --bf-hole: 24px;
    --bf-from: -2.5deg;
    --bf-to: 2.5deg;
    animation-duration: 7s;
    animation-delay: -4s;
}

.bf-tag-hero .bf-tag-label {
    width: 128px;
    height: 162px;
    padding-top: 30px;
    border-color: transparent;
    border-radius: 42px 42px 14px 14px;
    background: linear-gradient(160deg, #fff27a 0%, var(--bf-yellow) 42%, var(--bf-yellow-deep) 100%);
    color: var(--bf-ink-900);
    font-size: 3.2rem;
}

.bf-tag-hero .bf-tag-label::before {
    top: 14px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.28);
}

/* Ticker tape along the bottom edge */
.bf-ticker {
    grid-area: ticker;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background: var(--bf-yellow);
    color: var(--bf-ink-900);
}

.bf-ticker-track {
    display: flex;
    width: max-content;
    animation: bf-ticker 60s linear infinite;
}

.bf-ticker-track span {
    display: inline-flex;
    align-items: center;
    padding: 10px 0 9px;
    /* Set here, not inherited: dark.css gives every <span> a light colour */
    color: var(--bf-ink-900);
    font-family: var(--bf-font-display);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bf-ticker-track span::after {
    content: "";
    width: 13px;
    height: 12px;
    margin: 0 18px;
    background: currentColor;
    -webkit-mask: var(--bf-heart) center / contain no-repeat;
    mask: var(--bf-heart) center / contain no-repeat;
}

/* The track holds the same phrases twice over, so -50% lands on an identical frame */
@keyframes bf-ticker {
    to {
        transform: translateX(-50%);
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1199px) {
    .bf-title {
        font-size: 4.4rem;
    }

    .bf-tags {
        gap: 20px;
        padding: 0 32px 0 16px;
    }

    .bf-tag-2 {
        --bf-string: 60px;
    }

    .bf-tag-hero {
        --bf-string: 34px;
    }

    .bf-tag-label {
        width: 76px;
        height: 98px;
        padding-top: 20px;
        border-radius: 26px 26px 10px 10px;
        font-size: 1.7rem;
    }

    .bf-tag-hero .bf-tag-label {
        width: 100px;
        height: 128px;
        padding-top: 24px;
        border-radius: 34px 34px 12px 12px;
        font-size: 2.45rem;
    }
}

/* Below desktop there is no room beside the text: the tags hang in a row above it */
@media (max-width: 991px) {
    .bf-banner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "tags"
            "content"
            "ticker";
    }

    .bf-banner::before {
        top: -40px;
        right: -30px;
        font-size: 300px;
    }

    .bf-tags {
        justify-content: center;
        gap: 18px;
        padding: 0 20px;
    }

    .bf-tag-1 {
        --bf-string: 14px;
    }

    .bf-tag-2 {
        --bf-string: 40px;
    }

    .bf-tag-hero {
        --bf-string: 22px;
    }

    .bf-banner-content {
        padding: 22px 24px 28px;
        text-align: center;
    }

    .bf-title {
        justify-content: center;
    }

    .bf-message {
        margin-left: auto;
        margin-right: auto;
    }

    .bf-actions {
        flex-direction: column;
        align-items: center;
        gap: 22px;
    }

    .bf-countdown-boxes {
        justify-content: center;
    }

    .bf-cta {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    .black-friday-theme .breadcrumb-area {
        background-position: 50% 62px, 0 0, 0 0;
        background-size: auto 84px, auto, auto;
    }

    /* Narrow screens: the title takes the left half, the tags show on the right */
    .black-friday-theme .breadcrumb-area::before {
        background: linear-gradient(90deg, var(--bf-ink-900) 0, var(--bf-ink-900) 48%, rgba(5, 5, 8, 0) 80%);
    }

    .bf-banner {
        border-radius: 16px;
    }

    .bf-tags {
        gap: 18px;
        padding: 0 12px;
    }

    .bf-tag-label {
        width: 64px;
        height: 82px;
        padding-top: 18px;
        border-radius: 22px 22px 9px 9px;
        font-size: 1.4rem;
    }

    .bf-tag-label::before {
        top: 8px;
        width: 12px;
        height: 12px;
        margin-left: -6px;
    }

    .bf-tag {
        --bf-hole: 16px;
    }

    .bf-tag-hero {
        --bf-hole: 18px;
    }

    .bf-tag-hero .bf-tag-label {
        width: 84px;
        height: 106px;
        padding-top: 20px;
        border-radius: 28px 28px 11px 11px;
        font-size: 2rem;
    }

    .bf-tag-hero .bf-tag-label::before {
        top: 10px;
        width: 12px;
        height: 12px;
        margin-left: -6px;
    }

    .bf-banner-content {
        padding: 18px 16px 24px;
    }

    .bf-kicker {
        font-size: 0.74rem;
    }

    .bf-title {
        font-size: 3.3rem;
    }

    .bf-subtitle {
        font-size: 1.12rem;
    }

    .bf-message {
        font-size: 0.92rem;
    }

    .bf-countdown-boxes {
        gap: 16px;
    }

    .bf-time-box {
        min-width: 56px;
    }

    .bf-time-box + .bf-time-box::before {
        left: -16px;
        width: 16px;
    }

    .bf-cta {
        width: 100%;
        max-width: 320px;
        justify-content: center;
    }

    .bf-ticker-track span {
        padding: 8px 0 7px;
        font-size: 0.88rem;
    }
}

/* ============================================
   Packages page (only while the theme is on): the discount badge becomes a hang tag
   tied to the line under the package name, "Buy now" becomes "Get offer"
   ============================================ */
.black-friday-theme .bf-discount-wrap {
    top: -27px; /* up to the line under the package name */
    right: -20px;
    padding-top: 12px;
    transform-origin: 50% 0;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.45));
    --bf-from: 3deg;
    --bf-to: 9deg;
    animation: bf-swing 5s ease-in-out infinite;
}

/* String from the line down to the hole */
.black-friday-theme .bf-discount-wrap::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: 0;
    left: 50%;
    width: 2px;
    height: 26px;
    margin-left: -1px;
    border-radius: 1px;
    background: linear-gradient(180deg, #6c6c80 0%, #d2d2de 100%);
}

/* The tag look beats Bootstrap's !important utilities on the badge (.p-2, .rounded-pill,
   .bg-danger), its inline font-size and the pulse animation from the packages page */
.black-friday-theme .bf-discount {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 82px;
    padding: 18px 0 0 !important;
    border-radius: 22px 22px 9px 9px !important;
    background: linear-gradient(160deg, #fff27a 0%, var(--bf-yellow) 42%, var(--bf-yellow-deep) 100%) !important;
    color: var(--bf-ink-900);
    font-family: var(--bf-font-display);
    font-size: 1.4rem !important;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
    box-shadow: none;
    animation: none;
}

.black-friday-theme .bf-discount::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 12px;
    height: 12px;
    margin-left: -6px;
    border-radius: 50%;
    background: #262950; /* the package card shows through */
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.28);
}

.black-friday-theme .bf-off {
    display: none;
}

/* Both labels are in the markup; the theme class picks one */
.bf-only {
    display: none;
}

.black-friday-theme .bf-only {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.black-friday-theme .bf-hide {
    display: none;
}

/* ============================================
   Accessibility: respect reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .black-friday-theme .navbar-logo-wrapper::after,
    .bf-kicker::before,
    .bf-tag,
    .bf-ticker-track,
    .black-friday-theme .bf-discount-wrap {
        animation: none;
    }

    .bf-cta,
    .bf-cta i {
        transition: none;
    }
}
