/*
 * ShopperWorld Business Flyer
 * ------------------------------------------------------------
 * Flying paper -> scroll -> permanent static tab.
 */

#sw-business-flyer {
    --sw-flyer-blue: #0056b3;
    --sw-flyer-green: #28a745;
    --sw-flyer-red: #d40000;
    --sw-flyer-paper: #fffdf3;
    --sw-flyer-shadow: 0 14px 40px rgba(0,0,0,.22);

    position: fixed;
    z-index: 99990;
    inset: 0;
    pointer-events: none;
    font-family: Arial, Helvetica, sans-serif;
}

#sw-business-flyer *,
#sw-business-flyer *::before,
#sw-business-flyer *::after {
    box-sizing: border-box;
}

.sw-flyer-moving,
.sw-flyer-static,
.sw-flyer-close,
.sw-flyer-cta {
    font: inherit;
}

.sw-flyer-moving {
    position: fixed;
    top: 18%;
    left: -180px;
    width: 145px;
    min-height: 88px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transform: rotate(-8deg);
}

.sw-business-flyer.sw-flyer-start .sw-flyer-moving {
    animation: swFlyAcross 16s cubic-bezier(.2,.72,.25,1) forwards;
}

.sw-flyer-moving:hover {
    animation-play-state: paused;
    transform: scale(1.08) rotate(-2deg) !important;
}

.sw-flyer-mini-paper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 145px;
    min-height: 88px;
    padding: 13px 12px;
    color: #111;
    background:
        linear-gradient(135deg, transparent 0 11px, var(--sw-flyer-paper) 11px),
        var(--sw-flyer-paper);
    border: 2px solid #333;
    border-radius: 3px 12px 3px 12px;
    box-shadow: var(--sw-flyer-shadow);
    position: relative;
}

.sw-flyer-mini-paper::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    border-style: solid;
    border-width: 0 0 18px 18px;
    border-color: transparent transparent #dedbcf transparent;
}

.sw-flyer-mini-line {
    font-weight: 900;
    font-size: 15px;
    line-height: 1.05;
    letter-spacing: .4px;
}

.sw-flyer-mini-line:first-child {
    color: var(--sw-flyer-red);
}

.sw-flyer-scroll {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(520px, calc(100vw - 28px));
    max-height: min(82vh, 760px);
    overflow-y: auto;
    padding: 12px;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -48%) scale(.82) rotate(-2deg);
    transition: opacity .28s ease, transform .35s cubic-bezier(.2,.8,.2,1), visibility .28s;
    pointer-events: none;
}

.sw-business-flyer.sw-flyer-open .sw-flyer-scroll {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    pointer-events: auto;
}

.sw-flyer-scroll-inner {
    position: relative;
    padding: 30px 32px 26px;
    color: #202020;
    background:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 31px,
            rgba(50,90,130,.07) 32px
        ),
        var(--sw-flyer-paper);
    border: 2px solid #333;
    border-radius: 5px 18px 5px 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.sw-flyer-scroll-inner::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px dashed rgba(0,0,0,.22);
    border-radius: 3px 13px 3px 13px;
    pointer-events: none;
}

.sw-flyer-kicker {
    position: relative;
    margin-bottom: 10px;
    color: var(--sw-flyer-blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.sw-flyer-scroll h2 {
    position: relative;
    margin: 0 35px 15px 0;
    color: #111;
    font-size: clamp(24px, 5vw, 34px);
    line-height: 1.05;
    font-weight: 900;
}

.sw-flyer-main,
.sw-flyer-benefit,
.sw-flyer-small,
.sw-flyer-note,
.sw-flyer-creation-note {
    position: relative;
}

.sw-flyer-main {
    margin: 0 0 14px;
    font-size: 19px;
    line-height: 1.45;
}

.sw-flyer-benefit {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.55;
}

.sw-flyer-cta {
    display: inline-block;
    margin: 0 0 12px;
    padding: 12px 18px;
    color: #fff !important;
    background: var(--sw-flyer-green);
    border: 2px solid #19752e;
    border-radius: 9px;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.2;
    box-shadow: 0 4px 10px rgba(0,0,0,.16);
    transition: transform .15s ease, box-shadow .15s ease;
}

.sw-flyer-cta:hover,
.sw-flyer-cta:focus {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(0,0,0,.2);
}

.sw-flyer-small {
    margin: 0 0 15px;
    font-size: 14px;
    font-weight: 700;
}

.sw-flyer-note {
    margin: 0 0 14px;
    padding: 10px 12px;
    color: var(--sw-flyer-red);
    background: #fff0f0;
    border: 1px solid #efb0b0;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.4;
}

.sw-flyer-creation-note {
    margin: 0;
    color: #555;
    font-size: 11px;
    line-height: 1.4;
}

.sw-flyer-close {
    position: absolute;
    top: 14px;
    right: 18px;
    z-index: 3;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #222;
    background: #fff;
    font-size: 26px;
    line-height: 30px;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
}

.sw-flyer-static {
    position: fixed;
    top: 0;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 6px 15px;
    border: 0;
    border-radius: 0 0 9px 9px;
    color: #fff;
    background: var(--sw-flyer-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
    transform: translateX(-50%) translateY(-120%);
    transition: transform .3s ease, background .15s ease;
    cursor: pointer;
    pointer-events: auto;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .2px;
}

.sw-business-flyer.sw-flyer-static-mode .sw-flyer-static {
    transform: translateX(-50%) translateY(0);
}

.sw-flyer-static:hover,
.sw-flyer-static:focus {
    background: #003f82;
}

.sw-static-icon {
    font-size: 14px;
    line-height: 1;
}

@keyframes swFlyAcross {
    0% {
        left: -180px;
        top: 14%;
        opacity: 0;
        transform: rotate(-12deg) scale(.9);
    }
    8% {
        opacity: 1;
    }
    35% {
        top: 19%;
        transform: rotate(8deg) scale(1);
    }
    65% {
        top: 13%;
        transform: rotate(-5deg) scale(1);
    }
    88% {
        left: calc(100vw - 130px);
        top: 17%;
        opacity: 1;
    }
    100% {
        left: calc(100vw + 30px);
        top: 15%;
        opacity: 0;
        transform: rotate(10deg) scale(.92);
    }
}

@media (max-width: 600px) {
    .sw-flyer-moving {
        top: 16%;
        width: 125px;
        min-height: 76px;
    }

    .sw-flyer-mini-paper {
        width: 125px;
        min-height: 76px;
        padding: 10px;
    }

    .sw-flyer-mini-line {
        font-size: 13px;
    }

    .sw-flyer-scroll {
        width: calc(100vw - 18px);
        max-height: 88vh;
    }

    .sw-flyer-scroll-inner {
        padding: 27px 22px 22px;
    }

    .sw-flyer-scroll h2 {
        font-size: 25px;
    }

    .sw-flyer-main {
        font-size: 17px;
    }

    .sw-flyer-benefit {
        font-size: 15px;
    }

    .sw-flyer-cta {
        width: 100%;
        text-align: center;
    }

    .sw-flyer-static {
        max-width: calc(100vw - 20px);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sw-flyer-moving {
        animation: none !important;
        opacity: 1;
        left: 15px;
        transform: none;
    }

    .sw-business-flyer.sw-flyer-start .sw-flyer-moving {
        animation: none !important;
    }

    .sw-flyer-scroll {
        transition: none;
    }
}
