/* ============================================
   BLOQUES INTERACTIVOS - FRONTEND STYLES
   ============================================ */

.bloque-interactivo {
    padding: 0;
    margin-bottom: 3rem;
    overflow: visible;
}

.bloque-interactivo-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.bloque-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.bloque-descripcion {
    font-size: 0.9rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Carrusel Horizontal 3D */
.bloque-elementos-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.bloque-elementos-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 1rem 1.5rem 2rem 1.5rem;
    perspective: 1200px;
    perspective-origin: center center;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    
    /* Deshabilitar selección de texto */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Prevenir rebote en iOS */
    overscroll-behavior-x: contain;
    
    /* Scroll suave y natural */
    scroll-padding: 0 1.5rem;
}

.bloque-elementos-carousel::-webkit-scrollbar {
    display: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .bloque-elementos-carousel {
        scroll-padding: 0 1rem;
        gap: 0.75rem;
        padding: 1rem 1rem 1.5rem 1rem;
        scroll-snap-type: none;
    }
    
    .elemento-interactivo-card {
        scroll-snap-align: none;
    }
}

.elemento-interactivo-card {
    min-width: 260px;
    max-width: 260px;
    flex-shrink: 0;
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
    transform-style: preserve-3d;
    position: relative;
    
    /* Deshabilitar selección de texto */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Prevenir arrastre de imagen */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

.elemento-interactivo-card * {
    /* Deshabilitar selección en todos los hijos */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.elemento-card-inner {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
}

.elemento-interactivo-card:hover .elemento-card-inner {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.elemento-imagen-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

.elemento-imagen {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    
    /* Prevenir arrastre de imagen */
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.elemento-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.elemento-interactivo-card:hover .elemento-imagen {
    transform: scale(1.1);
}

.elemento-interactivo-card:hover .elemento-overlay {
    opacity: 1;
}

.elemento-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.elemento-info {
    padding: 1rem;
    flex: 1;
}

.elemento-nombre {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.elemento-descripcion {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Interacciones */
.elemento-interacciones {
    padding: 0.75rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.btn-interaccion {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9rem;
}

.btn-interaccion i {
    font-size: 1.1rem;
}

.btn-interaccion .count {
    font-size: 0.9rem;
    min-width: 18px;
    text-align: center;
}

.btn-interaccion:hover {
    transform: scale(1.05);
}

.btn-interaccion:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Like Button */
.btn-interaccion.like {
    color: #4caf50;
    border-color: #4caf50;
}

.btn-interaccion.like:hover,
.btn-interaccion.like.active {
    background: #4caf50;
    color: white;
}

/* Dislike Button */
.btn-interaccion.dislike {
    color: #f44336;
    border-color: #f44336;
}

.btn-interaccion.dislike:hover,
.btn-interaccion.dislike.active {
    background: #f44336;
    color: white;
}

/* Heart Button */
.btn-interaccion.heart {
    color: #e91e63;
    border-color: #e91e63;
}

.btn-interaccion.heart:hover,
.btn-interaccion.heart.active {
    background: #e91e63;
    color: white;
}

.btn-interaccion.heart.active i {
    animation: heartBeat 0.5s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

/* Reactions */
.reactions-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-reaction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.4rem;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 45px;
}

.btn-reaction:hover {
    transform: scale(1.1);
    border-color: #667eea;
    background: #f8f9ff;
}

.btn-reaction.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.btn-reaction .emoji {
    font-size: 1.3rem;
}

.btn-reaction .count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.btn-reaction:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Botones de navegación - solo desktop */
.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.carousel-nav-btn i {
    font-size: 1.5rem;
    color: #333;
}

.carousel-nav-btn:hover {
    background: #667eea;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav-btn:hover i {
    color: white;
}

.carousel-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav-btn.prev {
    left: 10px;
}

.carousel-nav-btn.next {
    right: 10px;
}

.carousel-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mostrar botones solo en desktop y cuando hay scroll disponible */
@media (min-width: 769px) {
    .carousel-nav-btn {
        display: flex;
    }
    
    .bloque-elementos-carousel-wrapper:hover .carousel-nav-btn {
        opacity: 1;
        pointer-events: all;
    }
    
    .bloque-elementos-carousel-wrapper .carousel-nav-btn.visible {
        opacity: 0.7;
    }
    
    .bloque-elementos-carousel-wrapper .carousel-nav-btn.visible:hover {
        opacity: 1;
    }
}

/* Ocultar completamente en mobile */
@media (max-width: 768px) {
    .carousel-nav-btn {
        display: none !important;
    }
}

/* Responsive */
@media (min-width: 769px) {
    .bloque-elementos-carousel {
        padding: 1.5rem 2rem 2rem 2rem;
    }
    
    .elemento-interactivo-card {
        min-width: 280px;
        max-width: 280px;
    }
}

@media (max-width: 768px) {
    .bloque-interactivo {
        padding: 0;
        margin-bottom: 2rem;
    }

    .bloque-interactivo-header {
        padding: 0 1rem;
        margin-bottom: 1rem;
    }

    .bloque-titulo {
        font-size: 1.35rem;
    }

    .elemento-interactivo-card {
        min-width: 240px;
        max-width: 240px;
    }

    .elemento-imagen-wrapper {
        height: 160px;
    }

    .elemento-interacciones {
        flex-wrap: wrap;
        padding: 0.6rem;
    }

    .btn-interaccion {
        padding: 0.5rem 0.85rem;
        font-size: 0.85rem;
    }

    .reactions-container {
        gap: 0.35rem;
    }

    .btn-reaction {
        min-width: 42px;
        padding: 0.35rem;
    }

    .btn-reaction .emoji {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .bloque-titulo {
        font-size: 1.25rem;
    }

    .bloque-descripcion {
        font-size: 0.85rem;
    }

    .elemento-interactivo-card {
        min-width: 220px;
        max-width: 220px;
    }

    .elemento-imagen-wrapper {
        height: 150px;
    }

    .elemento-info {
        padding: 0.85rem;
    }

    .elemento-nombre {
        font-size: 1rem;
    }
    
    .elemento-descripcion {
        font-size: 0.8rem;
    }
}
