/* Estilos para o frontend do Carrossel de Acesso */

.custom-carousel-wrapper {
    position: relative;
    width: 100%;
}

.custom-carousel {
    display: flex;
    /* Removemos scroll-snap-type para evitar travas */
    /* scroll-snap-type: x mandatory; */

    /* Deixe overflow-x como auto ou scroll */
    overflow-x: auto;

    /* -webkit-overflow-scrolling: touch possibilita "momentum" em iOS */
    -webkit-overflow-scrolling: touch;

    /* Se quiser manter animação suave padrão do navegador
       para eventos de "scroll to anchor" ou setas, pode deixar.
       Se achar que conflita, remova. */
    /* scroll-behavior: smooth; */

    gap: 10px;
    padding: 10px 0;
}

.custom-carousel .carousel-item {
    flex: 0 0 calc(25% - 10px); /* 4 banners por linha */
    text-align: center;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background-color: #f9f9f9; /* Opcional: Fundo para as imagens */

    /* Caso queira remover o snap completamente, comente também: */
    /* scroll-snap-align: center; */

    transition: transform 0.3s, filter 0.3s;
}

.custom-carousel .carousel-item:hover {
    transform: scale(1.05);
}

.custom-carousel .carousel-item img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}

/* Modos de tamanho da imagem (container + imagem) */
.custom-carousel-wrapper.size-square .carousel-item { aspect-ratio: 1 / 1; }
.custom-carousel-wrapper.size-square .carousel-item img { width: 100%; height: 100%; object-fit: cover; }

.custom-carousel-wrapper.size-horizontal .carousel-item { aspect-ratio: 16 / 9; }
.custom-carousel-wrapper.size-horizontal .carousel-item img { width: 100%; height: 100%; object-fit: cover; }

.custom-carousel-wrapper.size-original .carousel-item { aspect-ratio: auto; }
.custom-carousel-wrapper.size-original .carousel-item img { width: 100%; height: auto; object-fit: contain; }

.custom-carousel .carousel-item:hover img {
    filter: brightness(0.8);
    transform: scale(1.05);
}

.custom-carousel .carousel-item.grayscale img {
    filter: grayscale(100%);
}

/* Exibir setas somente quando houver overflow */
.custom-carousel-wrapper .arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 1;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, color 0.3s;
}
.custom-carousel-wrapper.has-overflow .arrow { display: flex; }

.custom-carousel-wrapper .arrow.left {
    left: -20px;
}

.custom-carousel-wrapper .arrow.right {
    right: -20px;
}

.custom-carousel-wrapper .arrow i {
    font-size: 20px;
}

.custom-carousel-wrapper .arrow:hover {
    background-color: rgba(255, 255, 255, 0.295);
    color: black;
}

/* Evitar cor persistente após clique: neutraliza focus/active */
.custom-carousel-wrapper .arrow:focus,
.custom-carousel-wrapper .arrow:active {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    outline: none;
    box-shadow: none;
}

.custom-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-item .lock-icon,
.carousel-item .hourglass-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #4a4a4a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* Breakpoints responsivos */
@media (max-width: 1280px) {
    .custom-carousel .carousel-item {
        flex: 0 0 calc(33.333% - 10px); /* 3 por linha */
    }
}

@media (max-width: 1024px) {
    .custom-carousel .carousel-item {
        flex: 0 0 calc(50% - 10px); /* 2 por linha */
    }
}

@media (max-width: 768px) {
    .custom-carousel .carousel-item {
        flex: 0 0 calc(66.666% - 10px); /* 1.5 por tela p/ swipe */
    }

    .custom-carousel-wrapper .arrow.left {
        left: -15px;
    }

    .custom-carousel-wrapper .arrow.right {
        right: -15px;
    }
}

@media (max-width: 480px) {
    .custom-carousel .carousel-item {
        flex: 0 0 calc(100% - 10px); /* 1 por linha */
    }
}

/* Orientação: ajuste setas em landscape estreito */
@media (orientation: landscape) and (max-height: 480px) {
    .custom-carousel-wrapper .arrow {
        top: 45%;
    }
}

/* Fallback: quando JavaScript estiver desabilitado (WordPress adiciona no-js em <html>) */
html.no-js .custom-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    overflow: visible; /* sem scroll horizontal */
}

@media (max-width: 600px) {
    html.no-js .custom-carousel {
        grid-template-columns: 1fr;
    }
}