/* =========================================================
   Carousel Slider Pro — Frontend Styles
   Mobile-first, fully responsive
   ========================================================= */

/* ── Carousel root ───────────────────────────────────────── */
.csp-carousel {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

/* ── Viewport: clips the sliding track ──────────────────── */
.csp-viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* ── Track: the flex container that moves ───────────────── */
.csp-track {
    display: flex;
    flex-wrap: nowrap;
    will-change: transform;
    /* transition applied via JS with dynamic duration */
}

.csp-track.csp-animating {
    transition-property: transform;
    transition-timing-function: linear;
    /* transition-duration set inline by JS */
}

/* ── Slide ───────────────────────────────────────────────── */
.csp-slide {
    flex: 0 0 auto;
    box-sizing: border-box;
    /* width set by JS via CSS custom property */
}

/* ── Slide inner: enforces aspect ratio ─────────────────── */
.csp-slide-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* padding-bottom set inline by JS to enforce aspect ratio */
}

.csp-slide-inner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    /* Remove any default border/margin */
    border: 0;
    margin: 0;
    padding: 0;
}

/* ── Navigation arrows ───────────────────────────────────── */
.csp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.csp-arrow:hover,
.csp-arrow:focus-visible {
    background-color: rgba(0, 0, 0, 0.75);
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.csp-arrow svg {
    width: 20px;
    height: 20px;
    display: block;
}

.csp-arrow-prev {
    left: 10px;
}

.csp-arrow-next {
    right: 10px;
}

/* ── Dot navigation (overlaid at the bottom of the viewport) */
.csp-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.csp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    pointer-events: auto;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.csp-dot--active {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.3);
}

.csp-dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

/* ── Slide link (wraps img when a URL is set) ────────────── */
.csp-slide-link {
    position: absolute;
    inset: 0;
    display: block;
    z-index: 1;
}

.csp-slide-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Responsive: mobile always 1 image ──────────────────── */
@media (max-width: 768px) {
    /* JS also enforces perPage = 1; CSS here is a visual safeguard */
    .csp-arrow {
        width: 32px;
        height: 32px;
    }

    .csp-arrow svg {
        width: 16px;
        height: 16px;
    }

    .csp-arrow-prev {
        left: 6px;
    }

    .csp-arrow-next {
        right: 6px;
    }
}
