/* Public Styles */
.bas-slider-header {
    text-align: center;
    margin-bottom: 20px;
}

.bas-slider-header .bas-title {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #333;
    font-variant-caps: all-petite-caps;
    font-weight: 700;
}

.bas-slider-header .bas-city {
    margin: 0;
    font-size: 18px;
    color: #666;
    font-weight: normal;
    font-style: italic;
}

.before-after-slider {
    position: relative;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    min-height: 200px; /* Garante uma altura mínima */
}

.bas-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.bas-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
    visibility: hidden;
}

.bas-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    position: relative;
}

/* Ensure images maintain aspect ratio */
.bas-slide {
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.bas-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease-in-out;
}

/* Slide Container */
.bas-slide {
    position: relative;
    width: 100%;
    min-height: 200px; /* Garante uma altura mínima */
    overflow: hidden;
    box-sizing: border-box;
}

/* Container principal do slide */
.bas-slide {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Proporção 16:9 */
    overflow: hidden;
    background: #f5f5f5; /* Cor de fundo para visualização */
}

/* Containers de imagens */
.bas-before,
.bas-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Estilo para imagens */
.bas-before img,
.bas-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

/* Ajuste para imagens de comparação */
.bas-slide[data-slide-type="comparison"] .bas-before {
    width: 50%;
    z-index: 2;
}

/* Ajuste para imagens únicas - garante que ocupem todo o espaço */
.bas-slide[data-slide-type="single"] .bas-before,
.bas-slide[data-slide-type="single"] .bas-after {
    width: 100%;
    height: 100%;
}

.bas-slide[data-slide-type="single"] .bas-before,
.bas-slide[data-slide-type="single"] .bas-after {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    top: 0;
    left: 0;
}

.bas-slide[data-slide-type="single"] img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
}

.bas-single-image img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 0 auto;
}

/* Add hover effect on images */
.bas-slide:hover img {
    transform: scale(1.02);
}

.bas-before,
.bas-after {
    position: absolute;
    top: 0;
    height: 100% !important;
    overflow: hidden;
    pointer-events: none; /* Permite clicar através das imagens */
}

.bas-before img,
.bas-after img {
    pointer-events: auto; /* Permite interação com as imagens */
}

.bas-before {
    left: 0;
    width: 50%;
    z-index: 2;
}

.bas-after {
    right: 0;
    width: 100%;
    z-index: 1;
}

.bas-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: #fff;
    cursor: ew-resize;
    z-index: 4;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.bas-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.bas-handle-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #333;
    font-size: 16px;
    line-height: 1;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

.bas-handle-left {
    right: 8px;
}

.bas-handle-right {
    left: 8px;
}

/* Labels */
.bas-label {
    position: absolute;
    bottom: auto;
    top: 10px;
    padding: 5px 10px;
    background-color: rgb(251, 255, 0);
    color: #000000;
    font-size: 14px;
    z-index: 10;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
    pointer-events: none;
}

.bas-before-label {
    left: 10px;
}

.bas-after-label {
    right: 10px;
}

/* Ajustes para imagens únicas */
.bas-single-image .bas-before .bas-before-label,
.bas-single-image .bas-after .bas-after-label {
    position: absolute;
    top: 10px;
    bottom: auto;
    left: 10px;
    right: auto;
    display: none;
}

/* Garantir que os labels fiquem visíveis */
.bas-before,
.bas-after {
    position: relative;
}

/* Ajuste para garantir que os labels não fiquem atrás das imagens */
.bas-before img,
.bas-after img {
    position: relative;
    z-index: 1;
}

.bas-before .bas-before-label,
.bas-after .bas-after-label {
    z-index: 2;
}

.bas-before-label {
    left: 10px;
    border-left: 5px solid #000000;
    border-right: ;
}

.bas-after-label {
    right: 10px;
    border-right: 5px solid #000000;
}

/* Ensure proper spacing for single image slides */
.bas-slide[data-slide-type="single"] {
    text-align: center;
}

/* Hide comparison handle for single images */
.bas-single-image .bas-handle {
    display: none;
}

/* Slider Navigation */
.bas-slider-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

.bas-slider-dots {
    display: flex;
    margin: 0 15px;
}

.bas-dot {
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.bas-dot.active {
    background: #333;
}

.bas-prev,
.bas-next, bas-prev:hover, bas-next:hover {
    background: none !important;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    color: #000;
}

.bas-prev:hover,
.bas-next:hover {
    color: #0073aa;
}

/* Lightbox Styles */
.bas-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.bas-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10001;
    padding: 0;
    outline: none;
}

.bas-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.bas-lightbox-prev {
    left: 20px;
    background-color: #616163 !important;
}

.bas-lightbox-next {
    right: 20px;
    background-color: #616163 !important;
}

/* Ensure lightbox content doesn't overlap with arrows */
.bas-lightbox-content {
    margin: 0 5px !important;
}

.bas-lightbox.active {
    display: flex;
}

.bas-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #000;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    margin: 0 50px;
}

.bas-lightbox img {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.bas-lightbox-caption {
    padding: 15px 20px;
    color: #fff;
    text-align: center;
    font-size: 16px;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.bas-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.bas-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Slide Description */
.bas-slide-description {
    display: none;
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    border-left: 3px solid #ffeb3b;
    transition: opacity 0.3s ease-in-out;
}

.bas-slide-description.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Make sure the description stays below the slider */
.bas-slider {
    margin-bottom: 0;
}

/* Estilos específicos para dispositivos móveis */
@media (max-width: 768px) {
    .bas-handle {
        background: rgba(255, 255, 255, 0.8) !important;
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5) !important;
        width: 6px !important;
        margin-left: -3px !important;
        pointer-events: none !important;
        cursor: default !important;
        /* Remove qualquer conteúdo dentro do handle */
        content: none !important;
    }
    
    /* Remove os pseudo-elementos que criam as setas */
    .bas-handle::before,
    .bas-handle::after,
    .bas-handle .bas-handle-left,
    .bas-handle .bas-handle-right {
        display: none !important;
        content: none !important;
        background: none !important;
        border: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
    
    .bas-before {
        width: 50% !important;
    }
    
    .bas-slide {
        touch-action: pan-y;
    }
}

/* Responsive Styles */
@media (max-width: 767px) {
    .bas-slide {
        padding-bottom: 75%; /* 4:3 aspect ratio for mobile */
    }
    
    .bas-label {
        font-size: 10px;
        padding: 3px 6px;
    }
}
