/* Product carousel: native scroll-snap track; cards come from the theme's shared product card. */
.nonino-product-carousel {
    --nonino-carousel-gap: clamp(.85rem, 1.6vw, 1.5rem);
    --nonino-carousel-inset: 1.25rem;
    width: min(calc(100% - 3rem), 75rem);
    margin: clamp(3rem, 6vw, 5rem) auto;
    color: var(--nc-ink, #1a1a1a);
}

.nonino-product-carousel__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

.nonino-product-carousel__title {
    max-width: 38rem;
    margin: 0;
    font-family: var(--nc-display-font, "Cormorant Garamond", Georgia, serif);
    font-size: var(--nc-text-h2, clamp(2rem, 3.5vw, 3rem));
    font-weight: 500;
    letter-spacing: -.03em;
    line-height: 1.05;
    text-wrap: balance;
}

.nonino-product-carousel__stage { position: relative; }

/* Side arrows straddle the track edges, vertically centered on the photo area (set from JS).
   Same language as the origins carousel: round, hairline border, translucent surface, thin chevron. */
.nonino-product-carousel__arrow {
    position: absolute;
    top: var(--nonino-arrow-center, 9rem);
    z-index: 3;
    display: inline-grid;
    width: 3.25rem;
    height: 3.25rem;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(78, 52, 46, .35);
    border-radius: 50%;
    background: rgba(248, 243, 233, .78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 .4rem 1.1rem rgba(48, 30, 22, .14);
    color: var(--nc-color-action, #4e342e);
    cursor: pointer;
    transform: translateY(-50%);
    touch-action: manipulation;
    transition: background-color var(--nc-motion-base, .25s) ease, border-color var(--nc-motion-base, .25s) ease, color var(--nc-motion-base, .25s) ease, opacity var(--nc-motion-base, .25s) ease;
}

.nonino-product-carousel__arrow svg {
    display: block;
    width: 1.35rem;
    height: 1.35rem;
    stroke-width: 1.25;
}

.nonino-product-carousel__arrow--prev { left: -1.4rem; }
.nonino-product-carousel__arrow--next { right: -1.4rem; }

.nonino-product-carousel__arrow:hover:not(:disabled) {
    border-color: var(--nc-color-action, #4e342e);
    background: var(--nc-color-action, #4e342e);
    color: var(--nc-official-papel, #f4f1ea);
}

.nonino-product-carousel__arrow:active:not(:disabled) { transform: translateY(-50%) scale(.94); }

/* At an edge the arrow has nothing to do: hide it and take it out of the tab order. */
.nonino-product-carousel__arrow:disabled {
    visibility: hidden;
    cursor: default;
    opacity: 0;
}

.nonino-product-carousel__arrow[hidden] { display: none; }

.nonino-product-carousel__arrow:focus-visible,
.nonino-product-carousel__track:focus-visible {
    outline: 3px solid var(--nc-color-focus-light, #4e342e);
    outline-offset: 3px;
}

.nonino-product-carousel__track {
    display: flex;
    gap: var(--nonino-carousel-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: .25rem 0 .5rem;
    scrollbar-width: none;
}

/* Touch keeps native momentum with gentle snapping. Mouse drag is handled in script (1:1 follow, inertia,
   eased alignment), so snapping stays off there: it would fight the drag and re-snap abruptly. */
@media (pointer: coarse) {
    .nonino-product-carousel__track { scroll-snap-type: x proximity; }
}

.nonino-product-carousel__track.is-moving { scroll-snap-type: none; }
.nonino-product-carousel__track.is-dragging { user-select: none; }

.nonino-product-carousel__track :is(a, img) { -webkit-user-drag: none; }

.nonino-product-carousel__track::-webkit-scrollbar { display: none; }

.nonino-product-carousel__item {
    display: flex;
    min-width: 0;
    flex: 0 0 max(15rem, calc((100% - 3 * var(--nonino-carousel-gap)) / 4));
    scroll-snap-align: start;
}

.nonino-product-carousel__item > * { flex: 1; }

.nonino-product-carousel__fallback { padding: 1rem; border: 1px solid var(--nc-line-light, #d9cebf); }

@media (max-width: 700px) {
    .nonino-product-carousel {
        width: calc(100% - 2.5rem);
        margin-block: 2.75rem;
    }

    .nonino-product-carousel__title { font-size: clamp(1.9rem, 8vw, 2.4rem); }

    /* Bleed the track to the viewport edge so the next card peeks in and invites a swipe. */
    .nonino-product-carousel__track {
        margin-inline: -1.25rem;
        padding-inline: 1.25rem;
        scroll-padding-inline: 1.25rem;
    }

    .nonino-product-carousel__item { flex-basis: min(78%, 17rem); }

    /* No room outside the track on phones: arrows sit over the photo edges. */
    .nonino-product-carousel__arrow { width: 2.75rem; height: 2.75rem; }
    .nonino-product-carousel__arrow--prev { left: .5rem; }
    .nonino-product-carousel__arrow--next { right: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nonino-product-carousel__arrow { transition: none; }
}

/* Block editor preview. */
.nonino-product-carousel-editor {
    padding: 1rem;
    border: 1px solid #dcdcde;
    background: #fff;
}

.nonino-product-carousel-editor .nonino-product-carousel__track { scroll-snap-type: none; }

.nonino-product-carousel-editor .nonino-product-carousel__card {
    display: flex;
    flex: 0 0 12rem;
    flex-direction: column;
    gap: .4rem;
    padding: .5rem;
    border: 1px solid #dcdcde;
}

.nonino-product-carousel-editor .nonino-product-carousel__image {
    display: block;
    aspect-ratio: 1 / 1;
    background: #f0f0f1;
}

.nonino-product-carousel-editor .nonino-product-carousel__image img { width: 100%; height: 100%; object-fit: contain; }
.nonino-product-carousel-editor .nonino-product-carousel__name { font-size: .88rem; font-weight: 600; }

.nonino-product-carousel__editor-order {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .75rem;
}

.nonino-product-carousel-editor__note {
    margin-bottom: 0;
    color: #50575e;
    font-size: .875rem;
}
