/* Winter Theme: seasonal CSS decorations (issue #463, Figma by Ivi) */

/* ============================================
   PAGE: keep decorations from causing h-scroll
   ============================================ */

main {
    overflow: clip;
}

/* ============================================
   HEADER: snowy fir garland over the wordmark
   ============================================ */

/* NOTE: .header__logo is already `position: absolute; left: 50%` in the header
   styles (that is what centres it), so it must not be re-positioned here.
   In the 1440 mockup the wordmark sits at 640,29 and measures 144x20, the
   same as the live logo, so the offsets below are the mockup's own numbers. */

/* Fir garland with berries over "SIS" */
.header__logo::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -12px;
    width: 59px;
    height: 21px;
    background: url('img/logo-garland.svg') no-repeat left top;
    background-size: contain;
    pointer-events: none;
}

/* Icicle ornament between "E" and "R" and a snow cap on the last "S" */
.header__logo::after {
    content: '';
    position: absolute;
    left: 95px;
    top: -7px;
    width: 50px;
    height: 24px;
    background: url('img/logo-ornament.svg') no-repeat left top;
    background-size: contain;
    pointer-events: none;
}

/* ============================================
   FOOTER: berry sprig by the wordmark, fir branch on the right
   ============================================ */

/* From the 1440 product-page mockup (the home mockup leaves the footer bare,
   but the footer is shared, so it gets the same look everywhere). The footer
   wordmark sits at 80,6490 there; the sprig at 3,6408 and the branch at
   1256,6689. `.footer > .container` is full-width and starts level with the
   wordmark (the Instagram block above it is optional). */
.footer {
    overflow-x: clip;
}

.footer > .container {
    position: relative;
}

.footer > .container::before,
.footer > .container::after {
    content: '';
    position: absolute;
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

.footer > .container::before {
    top: -82px;
    left: 3px;
    width: 105px;
    height: 113px;
    background-image: url('img/p-footer-logo-berry.svg');
}

/* The branch hangs off the SCREEN edge, as in the mockup, not off the
   container: on screens wider than the capped container it would otherwise
   float in the middle of the footer. (100% - 100vw) / 2 is the gap between
   the container and the viewport edge. */
.footer > .container::after {
    top: 199px;
    right: calc((100% - 100vw) / 2 - 17px);
    width: 201px;
    height: 122px;
    background-image: url('img/p-footer-branch.svg');
}

/* ============================================
   "ADD TO CART": frosted fir texture + berry corners
   ============================================ */

/* Mockup (product card, 1440): button 305x42, texture over #008484 and two
   berry sprigs at the edges. The sprigs are anchored to the button's own
   edges, so they survive any button width. Out-of-stock "notify" buttons keep
   their regular outline look. */
@media (min-width: 1024px) {
    .product-card__button:not(.product-card__button--notify),
    .product-card__button:not(.product-card__button--notify):hover {
        background:
            url('img/btn-left.svg') left 0 top -1px / 46px 46px no-repeat,
            url('img/btn-right.svg') right 0 top -1px / 31px 46px no-repeat,
            url('img/btn-texture.webp') center / cover no-repeat,
            #008484;
    }

    .product-card__button:not(.product-card__button--notify):hover {
        background-color: #006b6b;
    }
}

/* Same look for the product page and the two cart buttons ("Оформити
   замовлення", "Продовжити покупки"), at every width. */
/* `:not(:disabled)` on the hover states: the checkout submit stays disabled
   until the agreement box is ticked, and its grey `:disabled` look must not
   turn back into the active teal one under the cursor. */
.product-buttons__add-to-cart,
.product-buttons__add-to-cart:hover:not(:disabled),
.order-summary-footer__submit,
.order-summary-footer__submit:hover:not(:disabled),
.cart-empty__button,
.cart-empty__button:hover {
    background:
        url('img/btn-left.svg') left 0 center / auto 110% no-repeat,
        url('img/btn-right.svg') right 0 center / auto 110% no-repeat,
        url('img/btn-texture.webp') center / cover no-repeat,
        #008484;
}

.product-buttons__add-to-cart:hover:not(:disabled),
.order-summary-footer__submit:hover:not(:disabled),
.cart-empty__button:hover {
    background-color: #006b6b;
}

/* ============================================
   JS-inserted decorations: base styles
   ============================================ */

.winter-decoration {
    position: absolute;
    pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    /* The 375px mockup draws the logo pieces a little smaller relative to
       the wordmark (live logo there is 102x14 at mockup 135,19). */
    .header__logo::before {
        left: 2px;
        top: -5px;
        width: 33px;
        height: 12px;
    }

    .header__logo::after {
        left: 68px;
        top: -4px;
        width: 36px;
        height: 17px;
    }

    /* Footer: berry sprig by the wordmark and a large fir branch further
       down, both on the RIGHT (mockup footer wordmark at 16,7093; sprig at
       313,7058, branch at 264,7632). The container is full-width here and
       starts level with the wordmark. */
    .footer > .container::before {
        top: -35px;
        left: auto;
        right: -5px;
        width: 67px;
        height: 102px;
        background-image: url('img/m-footer-berry.svg');
    }

    /* Category heading: snowflakes sit at 35..79px and the ornaments at
       317..365px, so long titles wrap between them instead of running under. */
    .catalog-heading__title {
        padding-left: 56px;
        padding-right: 56px;
    }

    /* The big fir branch hangs off the contacts block, not the container:
       the live menus above it are longer than the mockup's, and a fixed
       offset from the wordmark landed it between the menu columns. Mockup:
       "КОНТАКТИ" at 7475, branch at 264,7632 (157px lower, 34px off the
       right edge); the block itself is inset 20px from the screen edge.
       Nudged 20px lower so it starts at the second phone, as in the mockup. */
    .footer > .container::after {
        content: none;
    }

    .footer__columns-group--secondary {
        position: relative;
    }

    .footer__columns-group--secondary::after {
        content: '';
        position: absolute;
        top: 223px;
        right: -54px;
        width: 145px;
        height: 206px;
        background: url('img/m-footer-fir.svg') no-repeat left top;
        background-size: contain;
        pointer-events: none;
        z-index: 0;
    }
}

/* Accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .winter-decoration {
        animation: none !important;
        transition: none !important;
    }
}
