/* Zdrowotka Nowa 1.9.74 — półki przewijane świadomie przez kupującą. */
body.zdn-theme #zd-home-v2 .zdn-recent-section[hidden] { display: none !important; }
body.zdn-theme #zd-home-v2 .zdn-shelf { min-width: 0; }
body.zdn-theme #zd-home-v2 .zdn-shelf-window { min-width: 0; }
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 18px !important;
    margin: 0 !important;
    padding: 2px 2px 8px !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    /* Swiping should follow the finger. Only arrow-button JS animates movement. */
    scroll-behavior: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products::-webkit-scrollbar { display: none; }
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products::before,
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products::after { display: none !important; }
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products > li.product {
    float: none !important;
    clear: none !important;
    flex: 0 0 calc((100% - 54px) / 4) !important;
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
    scroll-snap-align: start;
}
body.zdn-theme #zd-home-v2 .zdn-shelf-footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 10px;
}
body.zdn-theme #zd-home-v2 .zdn-shelf.is-scrollable .zdn-shelf-footer { display: flex; }
body.zdn-theme #zd-home-v2 .zdn-shelf-progress {
    width: min(160px, 42%);
    height: 3px;
    overflow: hidden;
    border-radius: 10px;
    background: #e1e9dd;
}
body.zdn-theme #zd-home-v2 .zdn-shelf-progress > span {
    display: block;
    width: 25%;
    height: 100%;
    border-radius: inherit;
    background: #2f7c35;
    transform-origin: left center;
}
body.zdn-theme #zd-home-v2 .zdn-shelf-controls { display: flex; gap: 8px; }
body.zdn-theme #zd-home-v2 .zdn-shelf-controls button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #cddbc9;
    border-radius: 50%;
    background: #fff;
    color: #245f27;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
body.zdn-theme #zd-home-v2 .zdn-shelf-controls button:hover:not(:disabled) { border-color: #2f7c35; background: #f0f6ed; }
body.zdn-theme #zd-home-v2 .zdn-shelf-controls button:disabled { opacity: .38; cursor: default; }
body.zdn-theme #zd-home-v2 .zdn-shelf-controls button:focus-visible,
body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products:focus-visible { outline: 3px solid #2f7c35; outline-offset: 3px; }

@media (max-width: 760px) {
    body.zdn-theme #zd-home-v2 .zdn-shelf-window { margin-inline: -16px; }
    /* 1.9.84: następna karta wystaje ok. 36 px (było 15 px), a po przesunięciu nie zostaje
       4-pikselowy pasek poprzedniej karty: przyciąganie liczy się od odstępu (12 px), nie od marginesu (16 px). */
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products {
        gap: 12px !important;
        padding: 2px 16px 8px !important;
        scroll-padding-inline: 12px;
    }
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products > li.product {
        flex-basis: min(calc((100% - 44px) / 2), 190px) !important;
    }
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products > li.product:first-child { scroll-margin-inline-start: 4px; }
    body.zdn-theme #zd-home-v2 .zdn-shelf-controls { display: none; }
    body.zdn-theme #zd-home-v2 .zdn-shelf-footer { margin-top: 8px; }
}
@media (max-width: 350px) {
    body.zdn-theme #zd-home-v2 .zdn-shelf-window { margin-inline: -12px; }
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products { padding-inline: 12px !important; scroll-padding-inline: 12px; }
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products > li.product { flex-basis: calc((100% - 44px) / 2) !important; }
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products > li.product:first-child { scroll-margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
    body.zdn-theme #zd-home-v2 .zdn-shelf-window ul.products { scroll-behavior: auto !important; }
}

/* 1.9.84: podczas ładowania zakładki — szkielet kart tej samej wysokości zamiast przygaszonych starych produktów. */
body.zdn-theme #zd-home-v2 .zdn-best-content { position: relative; }
body.zdn-theme #zd-home-v2 .zdn-best-skeleton {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    gap: 18px;
    overflow: hidden;
    box-sizing: border-box;
    padding: 2px 2px 8px;
    background: #fff;
    pointer-events: none;
}
body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #edf1ea;
    border-radius: 10px;
}
body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card > span { display: block; height: 14px; border-radius: 6px; background: #eef2eb; }
body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card > span:first-child { height: auto; flex: 1 1 auto; min-height: 90px; }
body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card > span:nth-child(3) { width: 60%; }
body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card > span:last-child { height: 40px; }
@media (prefers-reduced-motion: no-preference) {
    body.zdn-theme #zd-home-v2 .zdn-best-skeleton-card > span { animation: zdn-best-pulse 1.1s ease-in-out infinite alternate; }
    @keyframes zdn-best-pulse { from { opacity: 1; } to { opacity: .55; } }
}
@media (prefers-reduced-motion: no-preference) {
    body.zdn-theme #zd-home-v2 .zdn-best-content { transition: opacity 180ms ease; }
    body.zdn-theme #zd-home-v2 .zdn-best-content.is-refreshed { animation: zdn-best-refreshed 220ms ease both; }
    @keyframes zdn-best-refreshed { from { opacity: .6; } to { opacity: 1; } }
}

/* Nagłówki pojawiają się tylko raz, gdy kupująca do nich dochodzi. */
@media (prefers-reduced-motion: no-preference) {
    body.zdn-theme #zd-home-v2 .zdn-reveal-pending {
        opacity: 0;
        transform: translateY(8px);
    }
    body.zdn-theme #zd-home-v2 .zdn-reveal-ready {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 280ms ease, transform 280ms ease;
    }
}
