/*
 * Polecamy — frontend
 * Slider oraz responsywna tablica plakatów.
 * Slider celowo nie narzuca tła, ramek, nagłówków ani dekoracji obrazów.
 */

.mp-polecamy-slider {
    position: relative;
    width: min(100%, 254px);
    aspect-ratio: 1 / 1;
    margin-inline: auto;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.mp-polecamy-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 620ms ease;
    will-change: transform;
}

.mp-polecamy-slider.is-resetting .mp-polecamy-track {
    transition: none;
}

.mp-polecamy-slider.is-dragging .mp-polecamy-track {
    transition: none;
}

.mp-polecamy-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-polecamy-slide img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    -webkit-user-drag: none;
    user-select: none;
}

.mp-polecamy-lightbox {
    cursor: zoom-in;
}

.mp-polecamy-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: rgba(36, 36, 36, 0.78);
    color: rgba(255, 255, 255, 0.8);
    box-shadow: none;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 160ms ease;
}

.mp-polecamy-arrow:hover,
.mp-polecamy-arrow:focus-visible {
    outline: none;
    background: #ff8a36;
}

.mp-polecamy-arrow:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 138, 54, 0.28);
}

.mp-polecamy-arrow-prev {
    left: 0;
}

.mp-polecamy-arrow-next {
    right: 0;
}

.mp-polecamy-arrow svg {
    display: block;
    width: 32px;
    height: 32px;
    fill: currentColor;
    pointer-events: none;
}

.mp-polecamy-slider.is-single-slide .mp-polecamy-arrow {
    display: none;
}

.mp-polecamy-board {
    --mp-polecamy-board-gap: clamp(14px, 1.8vw, 20px);

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    align-items: start;
    gap: var(--mp-polecamy-board-gap);
    width: 100%;
    max-width: 1080px;
    margin-inline: auto;
}

.mp-polecamy-board.is-justified {
    display: flex;
    flex-direction: column;
}

.mp-polecamy-board-row {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--mp-polecamy-board-gap);
    width: 100%;
}

.mp-polecamy-board-item {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 100%;
    min-width: 0;
    padding: 6px;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(36, 36, 36, 0.1);
    border-radius: 4px;
    background: #f6f6f4;
    box-shadow: 0 2px 10px rgba(36, 36, 36, 0.08);
    color: inherit;
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.mp-polecamy-board:not(.is-justified) .mp-polecamy-board-item {
    max-width: 330px;
}

a.mp-polecamy-board-item:hover {
    border-color: rgba(255, 138, 54, 0.65);
    box-shadow: 0 8px 22px rgba(36, 36, 36, 0.14);
    transform: translateY(-3px);
}

a.mp-polecamy-board-item:focus-visible {
    outline: 3px solid rgba(255, 138, 54, 0.45);
    outline-offset: 3px;
}

.mp-polecamy-board .mp-polecamy-board-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
    -webkit-user-drag: none;
    user-select: none;
}

.mp-polecamy-board:not(.is-justified) .mp-polecamy-board-image {
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    .mp-polecamy-track {
        transition: none;
    }

    .mp-polecamy-board-item {
        transition: none;
    }
}
