/* Winter look: loaded only while App\Support\WinterTheme::isActive(). */

/* ---------- winter page background: a misty valley with snowy mountains and fir forests ---------- */
body {
    background-color: #eef3f9;
}

/* Fixed behind the page, so the valley stays at the bottom of the screen while the content
   scrolls over it; the sky fades from a cold blue at the top. */
.winter-scene {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, #d9e5f1 0%, #e8eff7 45%, #eef3f9 100%);
}

/* the valley itself, faded so it stays a quiet backdrop behind the products */
.winter-scene::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .45;
    background: url("/assets/extra-assets/winter/landscape.svg?v=2") center bottom / max(100%, 1100px, 200vh) auto no-repeat; /* about 55% of the screen high */
}

/* ---------- falling snow ---------- */
.winter-snow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999; /* above the page and header, below Bootstrap modals (1050) and the cookie banner */
}

body.winter-snow-off .winter-snow {
    display: none;
}

/* ---------- New Year baubles hanging under the category bar ---------- */
.categories {
    position: relative;
    z-index: 90; /* the baubles hang over the banner below */
}

.winter-ornaments {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0;
    pointer-events: none;
}

.winter-ornament {
    position: absolute;
    top: 0;
    transform-origin: 50% 0;
    animation: winter-ornament-sway var(--sway, 3.5s) ease-in-out var(--delay, 0s) infinite alternate;
}

.winter-ornament svg {
    display: block;
    overflow: visible;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .22));
}

.winter-ornament-ball {
    pointer-events: visiblePainted;
    cursor: pointer;
}

/* hovered or clicked: a harder swing that dies down (winter.js) */
.winter-ornament.is-swinging {
    animation: winter-ornament-swing 1.8s cubic-bezier(.3, .6, .4, 1);
}

@keyframes winter-ornament-sway {
    from { transform: rotate(-3.5deg); }
    to { transform: rotate(3.5deg); }
}

@keyframes winter-ornament-swing {
    0% { transform: rotate(0deg); }
    12% { transform: rotate(20deg); }
    32% { transform: rotate(-14deg); }
    52% { transform: rotate(8deg); }
    72% { transform: rotate(-4deg); }
    100% { transform: rotate(0deg); }
}

/* phones: the baubles would hang over the products */
@media (max-width: 767px) {
    .winter-ornaments {
        display: none;
    }
}

/* ---------- snow on the logos ---------- */
.logo,
.logo-mobile,
.footer-logo-img {
    position: relative;
}

/* The snow follows the top of each letter of logo.svg (126 x 45): the overlay spans the logo's
   own box, from x -2 to 128 and y -6 to 10 in the logo's coordinates, so it scales with the logo. */
.logo::before,
.logo-mobile::before,
.footer-logo-img::before {
    content: "";
    position: absolute;
    left: -1.587%;
    width: 103.175%;
    top: -13.333%;
    height: 35.556%;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 -6 130 16'%3E%3Cdefs%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='.62' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23dbe7f2'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23s)'%3E%3Cpath d='M2 1.1 C1.4 -0.72 2.4 -2.7 3.2 -2.52 Q5.03 -3.97 6.85 -1.75 Q9.27 -4.79 11.1 -2.11 Q13.52 -4.63 15.35 -2.22 Q17.48 -3.81 19 -2.52 C20 -2.16 20.8 -0.36 20.1 1.1 L16.85 1.1 C16.25 1.1 16.25 2.5 15.5 2.5 C14.75 2.5 14.75 1.1 14.15 1.1 L8.85 1.1 C8.25 1.1 8.25 3.3 7.5 3.3 C6.75 3.3 6.75 1.1 6.15 1.1 Z'/%3E%3Cpath d='M20.4 1.1 C19.8 -0.6 20.8 -2.25 21.6 -2.1 Q22.7 -3.73 23.8 -1.62 Q25.2 -3.58 26 -2.1 C27 -1.8 27.8 -0.3 27.1 1.1 L25.35 1.1 C24.75 1.1 24.75 2.7 24 2.7 C23.25 2.7 23.25 1.1 22.65 1.1 Z'/%3E%3Cpath d='M29.4 6.6 C28.8 5.1 29.8 4 30.6 4.1 Q32.38 3.29 34.17 4.5 Q36.55 2.79 38.33 3.99 Q40.42 3.31 41.9 4.1 C42.9 4.3 43.7 5.3 43 6.6 L37.85 6.6 C37.25 6.6 37.25 7.8 36.5 7.8 C35.75 7.8 35.75 6.6 35.15 6.6 Z'/%3E%3Cpath d='M45.6 7.1 C45 5.56 46 4.35 46.8 4.46 Q48.35 3.6 49.9 4.79 Q52.05 2.96 53.6 4.52 Q55.75 3.22 57.3 4.43 Q59.15 3.68 60.4 4.46 C61.4 4.68 62.2 5.78 61.5 7.1 L58.85 7.1 C58.25 7.1 58.25 8.1 57.5 8.1 C56.75 8.1 56.75 7.1 56.15 7.1 L51.85 7.1 C51.25 7.1 51.25 8.5 50.5 8.5 C49.75 8.5 49.75 7.1 49.15 7.1 Z'/%3E%3Cpath d='M65 1.9 C64.4 0.16 65.4 -1.6 66.2 -1.44 Q68.15 -3.3 70.1 -1.02 Q72.35 -2.89 74 -1.44 C75 -1.12 75.8 0.48 75.1 1.9 L70.85 1.9 C70.25 1.9 70.25 3.9 69.5 3.9 C68.75 3.9 68.75 1.9 68.15 1.9 Z'/%3E%3Cpath d='M80.6 1.9 C80 0.16 81 -1.6 81.8 -1.44 Q83.65 -2.96 85.5 -1.04 Q87.65 -3.19 89.2 -1.44 C90.2 -1.12 91 0.48 90.3 1.9 L87.35 1.9 C86.75 1.9 86.75 3.5 86 3.5 C85.25 3.5 85.25 1.9 84.65 1.9 Z'/%3E%3Cpath d='M93 7.1 C92.4 5.6 93.4 4.5 94.2 4.6 Q95.97 3.76 97.73 4.86 Q100.1 3.22 101.87 4.65 Q103.93 3.7 105.4 4.6 C106.4 4.8 107.2 5.8 106.5 7.1 L100.35 7.1 C99.75 7.1 99.75 8.4 99 8.4 C98.25 8.4 98.25 7.1 97.65 7.1 Z'/%3E%3Cpath d='M109.4 7.4 C108.8 5.86 109.8 4.65 110.6 4.76 Q112.17 3.94 113.75 5.26 Q115.92 3.52 117.5 4.79 Q119.67 3.51 121.25 4.96 Q123.12 3.83 124.4 4.76 C125.4 4.98 126.2 6.08 125.5 7.4 L122.85 7.4 C122.25 7.4 122.25 8.9 121.5 8.9 C120.75 8.9 120.75 7.4 120.15 7.4 L116.85 7.4 C116.25 7.4 116.25 8.4 115.5 8.4 C114.75 8.4 114.75 7.4 114.15 7.4 Z'/%3E%3C/g%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
    filter: drop-shadow(0 .5px .6px rgba(0, 30, 60, .35));
}

/* ---------- snowdrift on top of the footer ---------- */
footer {
    position: relative;
}

footer::before,
.benefits::before,
.subscription-container::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 70px; /* footer has 70px padding-top: the snow lies on the dark block and hangs over its edge */
    height: 26px;
    z-index: 1;
    pointer-events: none;
    background: url("/assets/extra-assets/winter/snow-hang.svg?v=1") repeat-x left top / 400px 26px;
}

/* ---------- the dark blocks carry the same hanging snow as the footer ---------- */
.benefits,
.subscription-container {
    position: relative;
}

.benefits::before,
.subscription-container::before {
    top: 0;
}

/* ---------- snow lying on the cards ---------- */
.product-card::before,
.category-slide::before,
.brand-slide::before,
.interest-category::before,
.interest-category-v2::before,
.review-content::before,
.banner-swiper::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: -15px; /* the card's top edge is at y=15 of the 32px-tall drawing */
    height: 32px;
    z-index: 3;
    pointer-events: none;
    background: url("/assets/extra-assets/winter/snow-card.svg?v=2") no-repeat 0 0 / 100% 100%;
}

.category-slide,
.brand-slide,
.interest-category,
.review-content,
.banner-swiper {
    position: relative;
}

/* carousels clip what sticks out of them: give the snow on top of their cards room, without
   moving the cards */
.swiperPopular,
.swiperViewed,
.swiperRelated,
.swiperTopCategories,
.swiperBrands,
.swiperReviews {
    padding-top: 16px;
    margin-top: -16px;
}

/* the big banner gets its own, wider drawing so the drifts are not stretched */
.banner-swiper::before {
    left: 12px;
    right: 12px;
    top: -17px; /* edge at y=17 of 40 */
    height: 40px;
    background-image: url("/assets/extra-assets/winter/snow-banner.svg?v=2");
}

/* ---------- a little snow on the red cart buttons ---------- */
.add-to-cart {
    position: relative;
}

.add-to-cart::before {
    content: "";
    position: absolute;
    left: 1px;
    right: 1px;
    top: -8px; /* edge at y=8 of 16 */
    height: 16px;
    pointer-events: none;
    background: url("/assets/extra-assets/winter/snow-button.svg?v=2") no-repeat 0 0 / 100% 100%;
}

/* ---------- Santa at the right edge, watching the cursor (winter.js) ---------- */
.winter-santa {
    position: fixed;
    right: 14px;
    bottom: 92px; /* above the chat button in the bottom-right corner */
    z-index: 998;
    width: 130px;
    pointer-events: none;
    animation: winter-santa-in .9s cubic-bezier(.2, .9, .3, 1.2) .6s both;
}

.winter-santa svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .18));
}

.winter-santa-head {
    transform-box: view-box;
    transform-origin: 60px 82px; /* the neck */
    transition: transform .25s ease-out;
}

.winter-santa-pupil {
    transition: transform .12s linear;
}

.winter-santa-eyes {
    transform-box: view-box;
    transform-origin: 60px 50px;
}

.winter-santa.is-blinking .winter-santa-eyes {
    animation: winter-santa-blink .18s ease-in-out;
}

.winter-santa-wave {
    transform-box: view-box;
    transform-origin: 76px 84px; /* the shoulder */
    animation: winter-santa-wave 2.6s ease-in-out infinite;
}

@keyframes winter-santa-in {
    from { transform: translateX(130%); }
    to { transform: translateX(0); }
}

@keyframes winter-santa-blink {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(.1); }
}

@keyframes winter-santa-wave {
    0%, 60%, 100% { transform: rotate(0deg); }
    70% { transform: rotate(-14deg); }
    80% { transform: rotate(6deg); }
    90% { transform: rotate(-10deg); }
}

/* ---------- a click tickles Santa: he laughs for about two seconds (winter.js) ---------- */
.winter-santa-figure {
    pointer-events: visiblePainted; /* only Santa himself is clickable, not his empty box */
    cursor: pointer;
    transform-box: view-box;
    transform-origin: 60px 170px; /* his feet */
}

.winter-santa-belly,
.winter-santa-head-inner,
.winter-santa-mouth-open,
.winter-santa-eyes-happy {
    transform-box: view-box;
}

.winter-santa-belly { transform-origin: 60px 140px; }
.winter-santa-head-inner { transform-origin: 60px 82px; }
.winter-santa-mouth-open { transform-origin: 60px 65px; }

.winter-santa-eyes-happy,
.winter-santa-mouth-open {
    opacity: 0;
}

.winter-santa.is-laughing .winter-santa-figure {
    animation: winter-santa-shake .2s ease-in-out 9;
}

.winter-santa.is-laughing .winter-santa-belly {
    animation: winter-santa-jiggle .2s ease-in-out 9;
}

.winter-santa.is-laughing .winter-santa-head-inner {
    animation: winter-santa-throw-back 1.8s ease-in-out;
}

.winter-santa.is-laughing .winter-santa-eyes {
    opacity: 0;
}

.winter-santa.is-laughing .winter-santa-eyes-happy {
    opacity: 1;
}

.winter-santa.is-laughing .winter-santa-mouth {
    opacity: 0;
}

.winter-santa.is-laughing .winter-santa-mouth-open {
    opacity: 1;
    animation: winter-santa-ha .2s ease-in-out 9;
}

.winter-santa.is-laughing .winter-santa-cheek {
    opacity: 1;
}

.winter-santa.is-laughing .winter-santa-wave {
    animation: winter-santa-flap .3s ease-in-out 6;
}

/* "Ho! Ho! Ho!" rising above his hat */
.winter-santa-hohoho {
    position: absolute;
    left: -10px;
    right: 0;
    top: -6px;
    height: 0;
    pointer-events: none;
}

.winter-santa-hohoho span {
    position: absolute;
    font: 800 15px/1 "Roboto Flex", sans-serif;
    color: #d62828;
    text-shadow: 0 0 3px #fff, 0 0 6px #fff;
    opacity: 0;
    white-space: nowrap;
}

.winter-santa-hohoho span:nth-child(1) { left: 6%; }
.winter-santa-hohoho span:nth-child(2) { left: 38%; font-size: 18px; }
.winter-santa-hohoho span:nth-child(3) { left: 70%; }

.winter-santa.is-laughing .winter-santa-hohoho span {
    animation: winter-santa-ho 1.1s ease-out both;
}

.winter-santa.is-laughing .winter-santa-hohoho span:nth-child(2) { animation-delay: .3s; }
.winter-santa.is-laughing .winter-santa-hohoho span:nth-child(3) { animation-delay: .6s; }

@keyframes winter-santa-shake {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-2.5px) rotate(-2.5deg); }
    75% { transform: translateY(-1px) rotate(2.5deg); }
}

@keyframes winter-santa-jiggle {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.05, .95); }
}

@keyframes winter-santa-throw-back {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    15%, 80% { transform: rotate(-7deg) translateY(-2px); }
    45% { transform: rotate(-4deg) translateY(-1px); }
}

@keyframes winter-santa-ha {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(.55); }
}

@keyframes winter-santa-flap {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-22deg); }
}

@keyframes winter-santa-ho {
    0% { opacity: 0; transform: translateY(6px) scale(.6) rotate(-8deg); }
    25% { opacity: 1; transform: translateY(-8px) scale(1.1) rotate(4deg); }
    100% { opacity: 0; transform: translateY(-34px) scale(1) rotate(-4deg); }
}

/* phones: no cursor to follow and no room beside the products */
@media (max-width: 991px) {
    .winter-santa {
        width: 104px;
    }
}

@media (max-width: 767px) {
    .winter-santa {
        display: none;
    }
}

/* ---------- snow on / off button ---------- */
.winter-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 50%;
    background: #3b3f43;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    transition: background-color .2s, opacity .2s;
}

.winter-toggle:hover {
    background: #2a2d30;
}

.winter-toggle svg {
    width: 22px;
    height: 22px;
}

/* crossed out while the snow is off */
.winter-toggle::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 2px;
    background: #ff5a5a;
    transform: rotate(-45deg);
    opacity: 0;
    transition: opacity .2s;
}

body.winter-snow-off .winter-toggle::after {
    opacity: 1;
}

body.winter-snow-off .winter-toggle {
    opacity: .7;
}

@media (max-width: 991px) {
    .winter-toggle {
        width: 36px;
        height: 36px;
        left: 10px;
        bottom: 10px;
    }

    .winter-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* phones and tablets have the floating action bar at the bottom (site.bundle.css, max-width 768px) */
@media (max-width: 768px) {
    .winter-toggle {
        bottom: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .winter-ornament,
    .winter-ornament.is-swinging,
    .winter-santa,
    .winter-santa-wave,
    .winter-santa.is-blinking .winter-santa-eyes,
    .winter-santa.is-laughing .winter-santa-figure,
    .winter-santa.is-laughing .winter-santa-belly,
    .winter-santa.is-laughing .winter-santa-head-inner,
    .winter-santa.is-laughing .winter-santa-mouth-open,
    .winter-santa.is-laughing .winter-santa-wave {
        animation: none;
    }
}
