/**
 * Carrusel de Imágenes para Tarjetas
 * Estilos modulares reutilizables para carruseles Bootstrap en tarjetas
 * Usado en: habitaciones, piscinas, propiedades, reservas
 */

/* ========================================
   CONTENEDOR BASE DEL CARRUSEL
   ======================================== */
.tarjeta-carousel {
    height: 100%;
    position: relative;
}

.tarjeta-carousel .carousel-inner {
    height: 100%;
    border-radius: inherit;
}

.tarjeta-carousel .carousel-item {
    height: 160px;
}

.tarjeta-carousel .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* ========================================
   CONTROLES DE NAVEGACIÓN
   ======================================== */
.tarjeta-carousel-control {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

/* Mostrar controles al hover del contenedor padre */
.tarjeta-carousel:hover .tarjeta-carousel-control,
.th-img-container:hover .tarjeta-carousel-control,
.tp-img-container:hover .tarjeta-carousel-control {
    opacity: 0.8;
}

.tarjeta-carousel-control:hover {
    opacity: 1 !important;
}

.tarjeta-carousel-control .carousel-control-prev-icon,
.tarjeta-carousel-control .carousel-control-next-icon {
    width: 22px;
    height: 22px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    padding: 5px;
    background-size: 50%;
}

/* ========================================
   CONTADOR DE IMÁGENES
   ======================================== */
.tarjeta-carousel-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

/* Contador específico para tarjetas de piscina - más arriba por las dimensiones */
.tp-carousel .tarjeta-carousel-counter,
.tp-img-container .tarjeta-carousel-counter {
    bottom: 45px;
    right: 8px;
}

.tarjeta-carousel-counter::before {
    content: "📸";
    font-size: 11px;
}

/* ========================================
   INDICADORES (PUNTOS)
   ======================================== */
.tarjeta-carousel .carousel-indicators {
    margin-bottom: 5px;
    gap: 4px;
}

.tarjeta-carousel .carousel-indicators [data-bs-target] {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.tarjeta-carousel .carousel-indicators .active {
    background-color: #fff;
    opacity: 1;
    transform: scale(1.2);
}

/* ========================================
   VARIANTES POR TIPO DE TARJETA
   ======================================== */

/* Habitaciones */
.th-carousel .carousel-item {
    height: 180px;
}

/* Piscinas */
.tp-carousel .carousel-item {
    height: 160px;
}

/* Reservas - más compacto */
.reserva-carousel .carousel-item {
    height: 120px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .tarjeta-carousel .carousel-item {
        height: 140px;
    }
    
    .th-carousel .carousel-item {
        height: 150px;
    }
    
    .tp-carousel .carousel-item {
        height: 140px;
    }
    
    .tarjeta-carousel-control .carousel-control-prev-icon,
    .tarjeta-carousel-control .carousel-control-next-icon {
        width: 18px;
        height: 18px;
    }
    
    .tarjeta-carousel-counter {
        font-size: 0.6rem;
        padding: 2px 7px;
    }
}

@media (max-width: 576px) {
    .tarjeta-carousel .carousel-item {
        height: 120px;
    }
    
    .th-carousel .carousel-item,
    .tp-carousel .carousel-item {
        height: 130px;
    }
}
