/**
 * Sección «Por qué confiar en nosotros» (sitio público).
 * Variables locales para no depender del bloque :root del home.
 */
.trust-section {
    --primary-blue: #113885;
    --white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.9);
    position: relative;
    width: 100%;
    max-width: none;
    overflow: hidden;
}

/* Ancho viewport aunque la sección esté dentro de .main-container con padding (ej. mantenciones/marca.php) */
.main-container > .trust-section {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.after-hero-spacing {
    margin-top: clamp(1.5rem, 4vw, 3rem);
}

/* Color sólido: solo el color elegido, sin velado */
.trust-section.trust-bg-mode-color .trust-overlay {
    display: none !important;
}

.trust-section.trust-bg-mode-color .trust-background {
    background-image: none;
    background-color: transparent;
}

.trust-section.trust-bg-mode-color .trust-background::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: var(--trust-bg-color, #113885);
    pointer-events: none;
}

.trust-background {
    position: relative;
    min-height: auto;
    background-image: var(--trust-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem 3rem;
}

.trust-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    /* Alpha fijada en el HTML (trust_seccion.php) para que funcione igual con imagen o color */
    background-color: rgba(0, 0, 0, var(--trust-overlay-opacity, 0.7));
    pointer-events: none;
}

.trust-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    width: 100%;
    text-align: center;
    padding-top: 0;
}

.trust-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--white);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    padding-top: 0;
}

/* Anula <p style="font-size:…"> u otros restos de editores dentro del h2 */
.trust-title * {
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

.trust-highlight {
    color: #ffd700 !important;
}

.trust-subtitle {
    font-size: clamp(0.9rem, 1.8vw, 1.1rem);
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.trust-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-top: 4rem;
}

.trust-card {
    background: var(--white);
    border-radius: 20px;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
    position: relative;
    padding-top: 3rem;
    margin-top: 2rem;
}

.trust-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.trust-icon-wrapper {
    width: 100px;
    height: 100px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translate(-50%, -8px);
    z-index: 3;
}

.trust-icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.trust-card-title {
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.trust-card-description {
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    color: #666666;
    line-height: 1.4;
}

.trust-bottom-text {
    font-size: clamp(0.85rem, 1.3vw, 1rem);
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.5;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.trust-cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-blue);
    color: var(--white);
    text-decoration: none;
    border-radius: 12px;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    font-weight: 700;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(17, 56, 133, 0.4);
    margin-bottom: 0;
}

.trust-cta-button:hover {
    background: #164299;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(17, 56, 133, 0.5);
}

@media (max-width: 1024px) {
    .trust-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .trust-background {
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .trust-background {
        padding: 0 1.5rem 2rem;
    }

    .trust-title {
        font-size: 1.8rem;
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .trust-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .trust-cards {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 3rem;
        margin-bottom: 1.5rem;
    }

    .trust-card {
        padding: 2rem 1.25rem 1.5rem;
        margin-top: 1.5rem;
    }

    .trust-icon-wrapper {
        width: 80px;
        height: 80px;
        top: -40px;
    }

    .trust-icon {
        width: 50px;
        height: 50px;
    }

    .trust-card-title {
        font-size: 1rem;
    }

    .trust-card-description {
        font-size: 0.85rem;
    }

    .trust-bottom-text {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    .trust-cta-button {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .trust-background {
        padding: 0 1rem 1.5rem;
    }

    .trust-title {
        font-size: 1.5rem;
        margin-top: 1rem;
    }

    .trust-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }

    .trust-cards {
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .trust-card {
        padding: 1.75rem 1rem 1.25rem;
        margin-top: 1.25rem;
    }

    .trust-icon-wrapper {
        width: 70px;
        height: 70px;
        top: -35px;
    }

    .trust-icon {
        width: 45px;
        height: 45px;
    }

    .trust-card-title {
        font-size: 0.95rem;
    }

    .trust-card-description {
        font-size: 0.8rem;
    }

    .trust-bottom-text {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

    .trust-cta-button {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
    }
}
