/* --- ESTILOS DE COMENTARIOS Y BADGE --- */

.comentarios-contenedor {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    transition: 
        max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease-out,
        padding 0.3s ease-out;
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
    background-color: #f9f9f9;
    border-radius: 0 0 8px 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.comentarios-contenedor.abierto {
    max-height: 5000px;
    opacity: 1;
    padding: 20px 15px;
}

.toggle-comentarios-btn {
    background: linear-gradient(to right, #6c757d, #5a6268);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-comentarios-btn:hover {
    background: linear-gradient(to right, #5a6268, #495057);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.toggle-comentarios-btn .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    margin-right: 8px;
}

.toggle-comentarios-btn .toggle-icon.abierto {
    transform: rotate(90deg);
}

/* BADGE DE COMENTARIOS ANIMADO */
.comentario-count-badge {
    background-color: #007bff;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.82rem;
    margin-left: 8px;
    display: inline-block;
    min-width: 22px;
    text-align: center;
    font-weight: bold;
    transition: transform 0.2s cubic-bezier(.68,-0.55,.27,1.55), background 0.3s;
}
.comentario-count-badge.animado {
    background: linear-gradient(to right, #007bff 60%, #17a2b8 100%);
    transform: scale(1.28) rotate(-3deg);
    box-shadow: 0 0 8px #007bff66;
}

/* --- RESPONSIVE PARA MÓVILES --- */
@media (max-width: 600px) {
    .container {
        padding: 7px;
        border-radius: 0;
        box-shadow: none;
    }

    form,
    .secreto {
        padding: 10px 4px;
        border-radius: 0;
    }

    .form-comentario-principal textarea,
    textarea,
    input[type="number"],
    input[type="password"],
    select {
        width: 100% !important;
        font-size: 1.05em;
        min-height: 38px;
        margin-bottom: 9px;
    }

    .acciones {
        flex-wrap: wrap;
        gap: 4px;
    }

    .acciones button,
    .btn,
    button,
    .toggle-comentarios-btn,
    .follow-btn,
    .del-btn,
    .like-btn,
    .dislike-btn {
        min-width: 44px; /* Recomendado por Google para tocar con el dedo */
        min-height: 44px;
        font-size: 1.13em;
        padding: 10px 0;
        width: 100%;
    }
    .comentario-count-badge {
        font-size: 1em;
    }

    nav a {
        display: block;
        margin: 7px 0;
        width: 100%;
        font-size: 1.09em;
        padding: 10px 0;
    }

    h1, h2 {
        font-size: 1.1em;
    }

    /* Ajusta los formularios de respuesta anidados */
    .form-respuesta .opciones-respuesta {
        flex-direction: column;
        gap: 3px;
    }
}
/* Fin de mobile responsive */