/**
 * Yasmalia Auto Carousel
 * Full-section carousel with background image, progress bar, title,
 * logo/image cards and dot navigation.
 */

/* === Container ===
   Largura total é controlada pelo switcher "Largura total da página" no Elementor.
   Quando ativo, injeta via seletor: width:100vw; margin-left:calc(50% - 50vw). */
.yasmalia-acarousel {
    --yasmalia-acarousel-dot-size: 12px;
    --yasmalia-acarousel-dot-gap: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #111;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    touch-action: pan-y;
}

.yasmalia-acarousel--transparent {
    background: transparent;
}

/* Evita scroll horizontal causado pelo truque 100vw */
body:has(.yasmalia-acarousel) {
    overflow-x: hidden;
}

/* Background image */
.yasmalia-acarousel__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.yasmalia-acarousel__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay */
.yasmalia-acarousel__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.yasmalia-acarousel:not(.yasmalia-acarousel--has-bg) .yasmalia-acarousel__overlay {
    display: none;
}

/* Inner wrapper */
.yasmalia-acarousel__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
    padding: 60px;
}

/* === Progress bar === */
.yasmalia-acarousel__progress-track {
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}
.yasmalia-acarousel__progress-fill {
    height: 100%;
    width: 0;
    background-color: #ffffff;
    border-radius: 2px;
    transition: width 100ms linear;
}

/* === Title === */
.yasmalia-acarousel__title {
    margin: 0;
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.15;
}

/* === Track === */
.yasmalia-acarousel__track-wrap {
    overflow: hidden;
    width: 100%;
    padding: 4px 2px;
    margin: 0 -2px;
    cursor: grab;
    touch-action: pan-y;
}

.yasmalia-acarousel__track-wrap.is-dragging {
    cursor: grabbing;
}

.yasmalia-acarousel__track-wrap.is-dragging,
.yasmalia-acarousel__track-wrap.is-dragging * {
    user-select: none;
    -webkit-user-select: none;
}

.yasmalia-acarousel__track {
    display: flex;
    gap: 16px;
    transition: transform 0.8s ease-in-out;
    will-change: transform;
}

/* === Cards === */
.yasmalia-acarousel__card {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    height: 160px;
    text-decoration: none;
    cursor: default;
    box-sizing: border-box;
    min-width: 0;
}
a.yasmalia-acarousel__card {
    cursor: pointer;
}
.yasmalia-acarousel__card img,
.yasmalia-acarousel__card picture,
.yasmalia-acarousel__card figure {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
    object-position: center center;
    padding: 0;
    margin: 0;
    border: 0;
    flex: 1 1 100%;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* === Dots === */
.yasmalia-acarousel__dots-viewport {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.yasmalia-acarousel__dots-viewport::-webkit-scrollbar {
    display: none;
}

.yasmalia-acarousel__dots-viewport.is-scrollable {
    width: min(100%, calc((var(--yasmalia-acarousel-dot-size) * 10) + (var(--yasmalia-acarousel-dot-gap) * 9) + 8px));
    cursor: grab;
}

.yasmalia-acarousel__dots-viewport.is-scrollable.is-dragging {
    cursor: grabbing;
}

.yasmalia-acarousel__dots {
    display: flex;
    gap: var(--yasmalia-acarousel-dot-gap);
    justify-content: flex-start;
    padding-top: 8px;
    flex-wrap: nowrap;
    width: max-content;
}
.yasmalia-acarousel__dot {
    width: var(--yasmalia-acarousel-dot-size);
    height: var(--yasmalia-acarousel-dot-size);
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.6);
    transition: background-color 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.yasmalia-acarousel__dot:hover {
    transform: scale(1.15);
}
.yasmalia-acarousel__dot.is-active {
    background-color: #dc2626;
}
.yasmalia-acarousel__dot.is-active::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: inherit;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 100ms linear;
}

/* === Responsive: Tablet === */
@media (max-width: 1024px) {
    .yasmalia-acarousel__inner {
        padding: 40px;
        gap: 20px;
    }
    .yasmalia-acarousel__title {
        font-size: 28px;
    }
}

/* === Responsive: Mobile === */
@media (max-width: 767px) {
    .yasmalia-acarousel__inner {
        padding: 28px 20px;
        gap: 16px;
    }
    .yasmalia-acarousel__title {
        font-size: 20px;
    }
    .yasmalia-acarousel__dots {
        gap: 7px;
    }
    .yasmalia-acarousel__dots-viewport.is-scrollable {
        width: min(100%, calc((var(--yasmalia-acarousel-dot-size) * 10) + (7px * 9) + 8px));
    }
    .yasmalia-acarousel__dot {
        width: 10px;
        height: 10px;
    }
}
