* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

.ficha-contenedor {
    max-width: 550px;
    margin: 0 auto;
    padding: 25px;
    color: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    width: 550px;
}

.ficha-titulo-principal {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
    color: #222;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.ficha-titulo-principal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #3d6e6e;
    transition: all 0.4s ease;
}

.ficha-titulo-principal:hover::after {
    width: 200px;
    background: #2a4e4e;
}

.ficha-lista {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.ficha-item {
    border-bottom: 1px solid #eaeaea;
    transition: all 0.3s ease;
}

.ficha-item:last-child {
    border-bottom: none;
}

.ficha-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ficha-cabecera:hover {
    background-color: #f5f5f5;
}

.ficha-cabecera span {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.1px;
    line-height: 1.5;
    color: #333;
    flex: 1;
    margin-right: 20px;
    transition: all 0.3s ease;
}

.ficha-icono {
    color: #3d6e6e;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    min-width: 20px;
    text-align: center;
}

.ficha-respuesta {
    padding: 15px 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #fafafa;
}

.ficha-respuesta p {
    padding: 20px 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.1px;
    color: #555;
}

.ficha-item.activo .ficha-cabecera {
    background-color: #f1f1f1;
}

.ficha-item.activo .ficha-cabecera span {
    color: #000;
    font-weight: 500;
}

.ficha-respuesta.tecnica .texto-contenido {
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: left;
    color: #444;
}

.btn-ver-mas {
    display: inline-block;
    padding: 8px 16px;
    background: #3d6e6e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    margin-top: 5px;
}

.btn-ver-mas:hover {
    background: #2a4e4e;
    padding: 0 18px;
}

.ficha-respuesta p {
    font-size: 0.9rem;
}


@media (max-width: 350px) {
    .ficha-contenedor {
        max-width: 280px;
    }

    .ficha-respuesta p {
        padding: 0px 0;
    }

}

@media (max-width: 420px) {


}



.ficha-respuesta .texto-contenido {
    /* Por defecto seguir mostrando contenido completo; si se desea truncar, aplicar otra clase */
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    margin-bottom: 10px;
}

/* Mostrar la descripción técnica completa siempre, con fuente más pequeña y alineada a la izquierda */
.ficha-respuesta.tecnica {
    /* Mantener comportamiento por defecto: colapsable via JS */
    background-color: transparent;
    padding: 6px 0 0 0;
}

.ficha-respuesta.tecnica .texto-contenido {
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: left;
    color: #444;
}

/* Collapsed state: show truncation with ellipsis (same behavior as before) */
.ficha-respuesta .texto-contenido.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ficha-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.btn-toggle-text {
    display: inline-block;
    padding: 8px 16px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-toggle-text:hover {
    background: #4b5563;
}

.btn-ver-mas {
    display: inline-block;
    padding: 8px 16px;
    background: #3d6e6e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
    margin-top: 5px;
}

.btn-ver-mas:hover {
    background: #2a4e4e;
}

.popup-overlay-prod {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-overlay-prod.mostrar {
    display: flex;
}

.popup-content-prod {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 35px !important;
    border-radius: 10px;
    max-width: 590px;
    height: auto;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-x: hidden;
    text-align: center;
    max-height: 700px;
}

.popup-close-prod {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.popup-close-prod:hover {
    color: #3d6e6e;
}

.popup-text-prod {
    line-height: 1.6;
    color: #555;
    width: 100%;
}


.ficha-respuesta {
    padding: 15px 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    background-color: #fafafa;
    text-align: center;
}

.btn-ver-mas {
    display: inline-block;
    padding: 7px 16px;
    background: #3d6e6e;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.btn-ver-mas:hover {
    background: #2a4e4e;
    transform: translateY(-2px);
}

.ficha-respuesta {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease-out;
    background-color: #fafafa;
}

.ficha-item.activo .ficha-respuesta {
    padding: 15px 25px;
    max-height: 2000px;
}

.ficha-respuesta.descargas {
    text-align: left;
    /* padding: 10px 12px; */
}

.ficha-respuesta.descargas div {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 0;
}

.ficha-respuesta.descargas i {
    font-size: 22px;
    margin-right: 12px;
    color: #39524F;
    min-width: 24px;
}

.ficha-respuesta.descargas a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    display: block;
}

.ficha-respuesta.descargas p {
    margin: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.5;
    word-break: break-word;
    hyphens: auto;
}

.ficha-respuesta.descargas a:hover {
    color: #39524F;
    text-decoration: underline;
}


.popup-imagen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-imagen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.popup-imagen-contenido {
    position: relative;
    z-index: 10001;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-imagen-contenido img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    border-radius: 8px;
}

.cerrar-popup {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #39524F;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.cerrar-popup:hover {
    background: #2a3d3a;
}


/* === EFECTO DESCARGAS === */
.ficha-item.destacado-descarga {
    animation: cardPulse 1.5s ease-in-out 1.5s;
}

@keyframes cardPulse {

    0%,
    100% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.02);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.015);
    }
}

.ficha-item.destacado-descarga .ficha-respuesta {
    background-color: #f0f9f7 !important;
    transition: background-color 0.5s ease 1.5s;
}

.ficha-item.destacado-descarga .ficha-cabecera {
    background-color: #e8f5f2 !important;
    transition: background-color 0.5s ease 1.5s;
}

:root {
    --ficha-max-width: 550px;
}

.ficha-contenedor {
    max-width: var(--ficha-max-width);
    width: calc(100% - 40px);
    padding: 18px;
}

.ficha-titulo-principal {
    font-size: clamp(1.35rem, 4.5vw, 2rem);
}

.ficha-cabecera span {
    font-size: clamp(1rem, 3.6vw, 1.1rem);
}

.ficha-respuesta p,
.ficha-respuesta .texto-contenido {
    font-size: clamp(0.85rem, 3.2vw, 1rem);
}

.btn-ver-mas {
    display: none !important;
}

@media (max-width: 600px) {
    .ficha-contenedor {
        width: calc(100% - 0px);
        padding: 12px;
        border-radius: 8px;
    }

    .ficha-titulo-principal {
        font-size: 1.35rem;
    }

    .ficha-cabecera {
        padding: 8px;
    }

    .ficha-cabecera span {
        margin-right: 12px;
    }

    .ficha-respuesta {
        padding: 8px 10px;
        text-align: left;
    }

    .ficha-respuesta .texto-contenido.collapsed {
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 350px) {
    .ficha-contenedor {
        max-width: 280px;
        padding: 10px;
    }

    .ficha-titulo-principal {
        font-size: 1.2rem;
    }

    .ficha-respuesta {
        padding: 6px 8px;
    }

    .ficha-respuesta p,
    .ficha-respuesta .texto-contenido {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .ficha-respuesta.descargas p {
        font-size: 0.8rem;
        line-height: 1.4;
        word-break: break-word;
    }
}