/**
 * Carrossel de imagens nos cards do catálogo
 * Setas direcionais visíveis apenas quando há mais de 1 imagem
 */

.card-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    /* Evita largura mínima “somando” slides/imagens em contexto flex (ex.: DaisyUI .card figure) */
    min-width: 0;
    /* overflow no __track: evita cortar tooltips (DaisyUI) nas setas fora do track */
    overflow: visible;
}

/* DaisyUI: figure do card é display:flex; o carrossel precisa ocupar a faixa inteira */
.card figure .card-carousel {
    flex: 1 1 auto;
    align-self: stretch;
}

.card-carousel__track {
    display: flex;
    height: 100%;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* Barra de rolagem oculta: navegação pelas setas (e gesto no mobile) */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.card-carousel__track::-webkit-scrollbar {
    display: none;
}

.card-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 16rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.card-carousel__slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.card-carousel__slide-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 16rem;
    color: oklch(var(--bc) / 0.4);
}

.card-carousel__slide-placeholder svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.5rem;
}

.card-carousel__slide-placeholder p {
    font-size: 0.875rem;
}

/* Setas - estilo referência: círculo branco semi-transparente, seta azul */
.card-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, opacity 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.card-carousel__arrow:hover {
    background: rgba(255, 255, 255, 0.95);
}

.card-carousel__arrow:active {
    transform: translateY(-50%) scale(0.96);
}

.card-carousel__arrow--prev {
    left: 0.5rem;
}

.card-carousel__arrow--next {
    right: 0.5rem;
}

.card-carousel__arrow svg {
    width: 1.25rem;
    height: 1.25rem;
    color: oklch(var(--p));
}

/* Esconder setas quando só há 1 imagem */
.card-carousel--single .card-carousel__arrow {
    display: none;
}
