/* ==========================================================================
 * Last seen (recently viewed recipes) — carousel
 * --per-view is set via the inline data attribute -> --wiize-per-view below.
 * ========================================================================== */

.wiize-recent {
    --wiize-per-view: 5;
    --wiize-gap: 16px;
    --wiize-max: 1240px;             /* ширина контента */
    background: #fbf8f5;             /* фон тянется на всю ширину секции */
    box-sizing: border-box;
    padding-block: 40px;            /* отступы сверху/снизу */
    /* левый/правый паддинг = половине «лишней» ширины, но не меньше 16px */
    padding-inline: max(16px, calc((100% - var(--wiize-max)) / 2));
}

.wiize-recent__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 16px;
}

.wiize-recent__title {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 32px;
    color: #8A765C;                   /* warm brown heading */
    line-height: 1.1;
}

.wiize-recent__count {
    font-style: italic;
    color: #8A765C;
}

.wiize-recent__clear {
    appearance: none;
    background: none;
    border: 0;
    padding: 4px 2px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #CE0212;     
    transition: opacity .15s ease;
        font-family: "Work Sans", serif;
}
.wiize-recent__clear:hover { opacity: .7; }
.wiize-recent__clear:disabled { opacity: .4; cursor: default; }

/* ---- Carousel ---- */
.wiize-recent__carousel {
    position: relative;
}

.wiize-recent__track {
    list-style: none;
    margin: 0;
    padding: 4px;                     /* so card shadows are not clipped */
    display: flex;
    gap: var(--wiize-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;           /* Firefox */
}
.wiize-recent__track::-webkit-scrollbar { display: none; } /* WebKit */

.wiize-recent__slide {
    scroll-snap-align: start;
    flex: 0 0 calc(
        (100% - (var(--wiize-per-view) - 1) * var(--wiize-gap)) / var(--wiize-per-view)
    );
    min-width: 0;
}

/* The card inside a slide fills the whole slide width. */
.wiize-recent__slide > .np-focus-grape-card,
.wiize-recent__slide > article {
    height: 100%;
    width: 100%;
    margin: 0;
}

/* ---- Arrows ---- */
.wiize-recent__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #1c5a45;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.wiize-recent__arrow:hover { background: #1c5a45; color: #fff; }
.wiize-recent__arrow[hidden] { display: none; }
.wiize-recent__arrow--prev { left: -12px; }
.wiize-recent__arrow--next { right: -12px; }

/* ---- Responsive: reduce the number of visible cards ---- */
@media (max-width: 1100px) { .wiize-recent { --wiize-per-view: 4; } }
@media (max-width: 900px)  { .wiize-recent { --wiize-per-view: 3; } }
@media (max-width: 680px)  { .wiize-recent { --wiize-per-view: 2; } }
@media (max-width: 460px)  { .wiize-recent { --wiize-per-view: 1; } }


.wiize-recent .np-focus-grape-card-actions.recipe_action .np-focus-grape-card-btn--details {
    padding: 7px 12px;
    font-size: 13px;
    background: #006042;
    border: 1px solid #006042;
}

.wrc-discover:visited { color: #FFF; }