/* ================================================================
   RESPONSIVE.CSS — JMPE20260509
   Responsive & Adaptive Layout System
   Mobile-first | Breakpoints: 320 · 375 · 425 · 768 · 1024 · 1440 · 1920
   ================================================================ */

/* ── 1. GLOBAL RESETS ────────────────────────────────────────── */
/* JMPE20260509 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-width: 320px;
}

img,
video,
svg {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* ── 2. AUTH CONTAINER & CARD ────────────────────────────────── */
/* JMPE20260509 */
#auth {
    padding: 0.5rem 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
}

#auth > .container {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#auth .card {
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
}

#auth .card-body {
    padding: 0.75rem;
}

#auth .col-lg-7,
#auth .col-md-12,
#auth .col-sm-12 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* ── 3. LOGO SCALING ─────────────────────────────────────────── */
/* JMPE20260509 */
#auth .text-center > img {
    max-height: clamp(60px, 15vw, 100px);
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* ── 4. TYPOGRAPHY ───────────────────────────────────────────── */
/* JMPE20260509 */
#auth h3 {
    font-size: clamp(1rem, 4vw, 1.75rem);
    word-break: break-word;
    hyphens: auto;
    line-height: 1.3;
}

#auth h4 {
    font-size: clamp(0.95rem, 3.5vw, 1.4rem);
    word-break: break-word;
}

p,
li {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── 5. FORM ELEMENTS ────────────────────────────────────────── */
/* JMPE20260509 */
.form-control,
.form-select,
select.form-select,
input.form-control,
textarea.form-control {
    width: 100%;
    max-width: 100%;
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    min-height: 44px;
}

.form-group {
    margin-bottom: 0.75rem;
}

label {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    margin-bottom: 0.25rem;
    line-height: 1.4;
    display: inline-block;
}

fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0;
}

/* ── 6. BUTTONS ──────────────────────────────────────────────── */
/* JMPE20260509 */
.btn {
    min-height: 44px;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    padding: 0.5rem 1rem;
    white-space: normal;
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-block,
.w-100p {
    width: 100%;
    display: flex;
}

/* Pair of buttons side by side → stack on small screens */
@media (max-width: 480px) {
    #imprimir-constancia .row {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    #imprimir-constancia .row .col-md-6 {
        flex: 0 0 auto;
        width: auto;
        max-width: clamp(160px, 80vw, 280px);
        margin-bottom: 0;
    }

    #imprimir-constancia .row .col-md-6 .btn {
        width: 100%;
        min-width: 0;
    }
}

/* ── 7. TABLES — GENERAL RESPONSIVE ─────────────────────────── */
/* JMPE20260509 */
.table {
    width: 100%;
    table-layout: auto;
}

/* Auto-scroll for any table inside main card on mobile */
@media (max-width: 600px) {
    #auth .col-md-12 {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #auth .table-responsive,
    #auth .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ── 8. CONSTANCIA — STACKED TABLE ON VERY SMALL SCREENS ────── */
/* JMPE20260509 */
.rwd-constancia table.table tr {
    display: table-row;
}

@media (max-width: 430px) {
    .rwd-constancia table.table tr {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #dee2e6;
        padding: 0.25rem 0;
    }

    .rwd-constancia table.table td {
        display: block;
        width: 100% !important;
        padding: 0.15rem 0.5rem;
        border: none;
    }

    .rwd-constancia table.table thead tr {
        flex-direction: row;
    }

    .rwd-constancia table.table thead th {
        font-size: 0.75rem;
        padding: 0.3rem;
        word-break: break-word;
    }

    .rwd-constancia table.table tbody td:first-child {
        border-bottom: none;
        padding-bottom: 0;
        font-size: 0.78rem;
        color: #6c757d;
    }
}

/* ── 9. TERMINOS Y CONDICIONES TABLE ─────────────────────────── */
/* JMPE20260509 */
.tyc-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.p-constancia {
    padding: clamp(0.75rem, 3vw, 1rem) !important;
    width: 100% !important;
    max-width: 800px !important;
    box-sizing: border-box !important;
}

/* Reset the fixed pixel widths from the TyC table */
.p-constancia table.MsoTableGrid {
    width: 100% !important;
    max-width: 375px;
    table-layout: fixed;
}

.p-constancia table.MsoTableGrid td {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    word-break: break-word;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
}

/* ── 10. FLOATING MESSAGES (Resultado) ───────────────────────── */
/* JMPE20260509 */
.floating-message,
.floating-message-3 {
    max-width: min(90vw, 500px) !important;
    width: auto !important;
    text-align: center;
    word-break: break-word;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    padding: 0.5rem 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Fix the problematic bottom: 80% that causes off-screen on mobile */
.floating-message-3 {
    bottom: auto !important;
    top: 1rem !important;
    position: fixed !important;
}

/* ── 11. ALERTS ──────────────────────────────────────────────── */
/* JMPE20260509 */
.alert {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    word-break: break-word;
    overflow-wrap: break-word;
    padding-right: 2.5rem;
}

.alert-dismissible .close {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    padding: 0.6rem 0.75rem !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    z-index: 2;
}

/* ── 11b. BOOTSTRAP 3 POLYFILL modal-dialog-centered ─────────── */
/* JMPE20260513 — Bootstrap 3 no incluye esta clase */
.modal-dialog-centered {
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    align-items: center;
    min-height: calc(100vh - 60px);
}

/* ── 12. MODAL — MANTENIMIENTO ───────────────────────────────── */
/* JMPE20260509 */
.modal-dialog {
    margin: 0.5rem auto;
    max-width: min(500px, 95vw);
}

.modal-content {
    border-radius: 0.5rem;
}

#modal-mantenimiento .modal-body {
    padding: clamp(1rem, 4vw, 1.875rem) !important;
}

#modal-mantenimiento .modal-body .fa-clock,
#modal-mantenimiento .modal-body i {
    font-size: clamp(2rem, 8vw, 3rem) !important;
}

#modal-mantenimiento .modal-body p {
    font-size: clamp(0.8rem, 2.5vw, 0.9rem) !important;
    margin-top: clamp(0.5rem, 2vw, 1.25rem) !important;
}

/* ── 13. CHECKSMS — FIXED WIDTH INPUTS ──────────────────────── */
/* JMPE20260509 */
input#nClaveSMS {
    width: min(200px, 75vw) !important;
    min-width: 120px !important;
    min-height: 44px;
    font-size: 1rem;
}

.w-custom {
    width: min(200px, 75vw) !important;
}

.btn-tab {
    width: min(180px, 43vw) !important;
    min-height: 44px;
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
}

/* CheckSMS clearfix button pair */
@media (max-width: 480px) {
    #cCapcha .clearfix,
    #creditoForm .clearfix {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    #cCapcha .clearfix .btn,
    #creditoForm .clearfix .btn {
        width: 100%;
        float: none !important;
    }

    #cCodClave .row.justify-content-center {
        flex-direction: column;
        align-items: center;
    }
}

/* ── 14. DIVIDER TEXT ────────────────────────────────────────── */
/* JMPE20260509 */
.divider-text {
    font-size: clamp(0.78rem, 2.5vw, 0.875rem);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ── 15. IMPORTANTE LIST (Index) ─────────────────────────────── */
/* JMPE20260509 */
.text-importante {
    font-size: clamp(0.78rem, 2.5vw, 0.8125rem) !important;
}

.text-importante ul,
.text-importante li {
    font-size: inherit;
    line-height: 1.5;
}

/* ── 16. CHECKBOX & RADIO ────────────────────────────────────── */
/* JMPE20260509 */
.form-check {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

.form-check-input {
    flex-shrink: 0;
    margin-top: 0.2rem;
    width: 1rem;
    height: 1rem;
}

.form-check label,
.form-check .checkbox label {
    font-size: clamp(0.78rem, 2.5vw, 0.875rem);
    line-height: 1.45;
    margin-bottom: 0;
}

.form-check .checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
}

/* ── 17. CREDITO INPUT (Index) ───────────────────────────────── */
/* JMPE20260509 */
#nr_credito {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    letter-spacing: 0.02em;
}

/* ── 18. HCAPTCHA ────────────────────────────────────────────── */
/* JMPE20260509 */
.h-captcha {
    transform-origin: left center;
    max-width: 100%;
}

@media (max-width: 380px) {
    .h-captcha {
        transform: scale(0.85);
        transform-origin: left center;
    }
}

/* ── 19. FADE-TOGGLE (Index selects) ─────────────────────────── */
/* JMPE20260509 */
.fade-toggle {
    width: 100%;
}

/* ── 20. PRINT BUTTON ────────────────────────────────────────── */
/* JMPE20260509 */
#imprimir-constancia {
    overflow: hidden;
    border-radius: 0.4rem;
}

/* JMPE20260513 — botones centrados */
#imprimir-constancia .row {
    justify-content: center;
    gap: 0.75rem;
}

#imprimir-constancia .row .col-md-6 {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

#imprimir-constancia .row .col-md-6 .btn {
    width: auto;
    min-width: clamp(110px, 36vw, 160px);
}

/* ── 21. INPUT-LIKE (Resultado) ──────────────────────────────── */
/* JMPE20260509 */
.input-like {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    font-size: clamp(0.85rem, 2.5vw, 1rem) !important;
}

/* ── 22. OlvideMiCredito LINK ────────────────────────────────── */
/* JMPE20260509 */
#select-regular label a {
    display: inline-block;
    font-size: clamp(0.75rem, 2.5vw, 0.875rem) !important;
    margin-left: 4px;
}

@media (max-width: 400px) {
    #select-regular label {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    #select-regular label a {
        margin-left: 0;
    }
}

/* ─────────────────────────────────────────────────────────────
   BREAKPOINTS
   ───────────────────────────────────────────────────────────── */

/* ── BP 1 → max 320px (smallest phones) ─────────────────────── */
/* JMPE20260509 */
@media (max-width: 320px) {
    #auth .card-body {
        padding: 0.5rem;
    }

    #auth h3 {
        font-size: 0.95rem;
    }

    .btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.5rem;
    }

    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }

    .form-check label,
    .form-check .checkbox label {
        font-size: 0.72rem;
    }

    .form-control,
    .form-select {
        font-size: 0.82rem;
    }

    .divider-text {
        font-size: 0.72rem;
    }

    .btn-tab {
        width: 100% !important;
    }
}

/* ── BP 2 → 321px – 375px (standard iPhone) ─────────────────── */
/* JMPE20260509 */
@media (min-width: 321px) and (max-width: 375px) {
    #auth .card-body {
        padding: 0.75rem;
    }

    #auth h3 {
        font-size: 1rem;
    }

    .btn-tab {
        width: 100% !important;
    }
}

/* ── BP 3 → 376px – 425px (large phones) ────────────────────── */
/* JMPE20260509 */
@media (min-width: 376px) and (max-width: 425px) {
    #auth .card-body {
        padding: 1rem;
    }
}

/* ── BP 4 → 426px – 767px (small tablets / phablets) ────────── */
/* JMPE20260509 */
@media (min-width: 426px) and (max-width: 767px) {
    #auth .card-body {
        padding: 1.25rem;
    }
}

/* ── BP 5 → 768px (tablets) ─────────────────────────────────── */
/* JMPE20260509 */
@media (min-width: 768px) {
    #auth .card-body {
        padding: 1.5rem;
    }

    #auth > .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    #auth h3 {
        font-size: 1.5rem;
    }

    #auth .text-center > img {
        max-height: 90px;
    }

    .btn {
        font-size: 0.875rem;
    }

    .form-control,
    .form-select {
        font-size: 0.95rem;
    }

    .rwd-constancia table.table tr {
        display: table-row;
    }

    .rwd-constancia table.table td {
        display: table-cell;
    }

    #imprimir-constancia .row .col-md-6 {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        margin-bottom: 0;
    }
}

/* ── BP 6 → 1024px (tablet landscape / small laptop) ────────── */
/* JMPE20260509 */
@media (min-width: 1024px) {
    #auth .card-body {
        padding: 2rem;
    }

    #auth h3 {
        font-size: 1.75rem;
    }

    #auth .text-center > img {
        max-height: 100px;
    }
}

/* ── BP 7 → 1440px (HD desktop) ─────────────────────────────── */
/* JMPE20260509 */
@media (min-width: 1440px) {
    #auth > .container {
        max-width: 1320px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .btn {
        font-size: 0.9rem;
    }
}

/* ── BP 8 → 1920px (Full HD / UltraWide) ────────────────────── */
/* JMPE20260509 */
@media (min-width: 1920px) {
    #auth > .container {
        max-width: 1600px;
    }

    body {
        font-size: 1.05rem;
    }

    #auth h3 {
        font-size: 2rem;
    }

    .btn {
        font-size: 1rem;
        min-height: 48px;
    }

    .form-control,
    .form-select {
        font-size: 1rem;
        min-height: 48px;
    }
}

/* ================================================================
   JMPE260509 - ERS080-2026  ·  Nuevos componentes
   ================================================================ */

/* ── 23. LOGO INSTITUCIONAL ──────────────────────────────────── */
/* JMPE260509 - ERS080-2026 */
.logo-institucional {
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}

/* ── 24. WALLETS SECTION ─────────────────────────────────────── */
/* JMPE260509 - ERS080-2026 */
.wallets-section {
    margin: 0.6rem 0 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

.wallets-title {
    font-size: clamp(0.72rem, 2.2vw, 0.8rem);
    color: #6c757d;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.01em;
}

.wallets-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(0.35rem, 2vw, 0.75rem);
    justify-content: center;
    align-items: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}

.wallets-grid::-webkit-scrollbar {
    display: none;
}

.wallet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    cursor: default;
}

.wallet-logo {
    width: clamp(38px, 10vw, 48px);
    height: clamp(38px, 10vw, 48px);
    object-fit: contain;
    background: #fff;
    border-radius: 7px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: block;
}

.wallet-logo:hover,
.wallet-item:focus-within .wallet-logo {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.wallet-name {
    font-size: clamp(0.62rem, 1.8vw, 0.72rem);
    color: #6c757d;
    text-align: center;
    font-weight: 500;
}

@media (max-width: 320px) {
    .wallet-logo {
        width: 36px;
        height: 36px;
    }

    .wallets-grid {
        gap: 0.3rem;
    }
}

@media (min-width: 768px) {
    .wallet-logo {
        width: 48px;
        height: 48px;
    }
}

/* ── 25. MODAL RECOMENDACIONES ───────────────────────────────── */
/* JMPE260509 - ERS080-2026 */
#modal-recomendaciones .modal-dialog {
    margin-top: 1vh;
}

#modal-recomendaciones .modal-content.modal-recomendaciones-content {
    border: none;
    border-radius: 0.6rem;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

#modal-recomendaciones .modal-recomendaciones-header {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: #fff;
    border-bottom: none;
    padding: clamp(0.75rem, 3vw, 1.1rem) clamp(0.75rem, 3vw, 1.25rem);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.btn-close-recomendaciones {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.25s ease, border-color 0.2s ease;
    padding: 0;
    margin-left: 0.5rem;
}

.btn-close-recomendaciones:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    transform: rotate(90deg) scale(1.1);
}

.btn-close-recomendaciones:active {
    transform: rotate(90deg) scale(0.95);
}

#modal-recomendaciones .modal-title {
    font-size: clamp(0.85rem, 3vw, 1rem);
    font-weight: 700;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #fff !important;
    flex: 1;
    text-align: center;
}

.modal-recomendaciones-icon {
    width: clamp(1rem, 3.5vw, 1.2rem);
    height: clamp(1rem, 3.5vw, 1.2rem);
    flex-shrink: 0;
    stroke: #fff;
}

#modal-recomendaciones .modal-recomendaciones-body {
    padding: clamp(0.75rem, 3vw, 1.25rem);
    background: #fff;
}

.recomendaciones-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recomendaciones-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0;
    font-size: clamp(0.78rem, 2.4vw, 0.875rem);
    line-height: 1.5;
    border-bottom: 1px solid #f2f2f2;
    color: #333;
    word-break: break-word;
}

.rec-check {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 0.22rem;
}

.recomendaciones-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recomendaciones-list li strong {
    color: #c0392b;
}

#modal-recomendaciones .modal-recomendaciones-footer {
    justify-content: center;
    border-top: 1px solid #f0f0f0;
    padding: clamp(0.6rem, 2.5vw, 1rem);
    background: #fff;
}

.btn-recomendaciones {
    min-width: clamp(110px, 38vw, 150px);
    font-weight: 700;
    font-size: clamp(0.82rem, 2.5vw, 0.9rem);
    letter-spacing: 0.02em;
}

/* ── 26. OLVIDEMICREDITO RESPONSIVE ──────────────────────────── */
/* JMPE260509 - ERS080-2026 */
.olvide-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

#tabla1,
#tabla2 {
    min-width: 380px;
    margin-bottom: 0;
}

#cTableCred .dflex {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

@media (max-width: 400px) {
    #cTableCred .btn-tab {
        flex: 1 1 calc(50% - 0.3rem);
        min-width: 0;
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem;
    }
}

/* ── 27. CHECKSMS INPUT RESPONSIVE ──────────────────────────── */
/* JMPE260509 - ERS080-2026 */
#cCodClave .row.justify-content-center {
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 480px) {
    #cCodClave .row.justify-content-center {
        flex-direction: column;
        align-items: center;
    }

    #cCodClave .col-md-4 {
        text-align: center;
    }
}

/* ── 28. CARD HEADER BAR (logo izq · wallets der) ──────────── */
/* JMPE20260513 - ERS080-2026 */
.card-header-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.4rem, 2vw, 1rem);
    padding-bottom: 0.6rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.header-logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-logo-wrap .logo-institucional {
    height: clamp(44px, 11vw, 90px);
    width: auto;
    max-width: clamp(80px, 26vw, 155px);
    object-fit: contain;
    margin: 0;
}

.card-header-bar .wallets-section {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: none;
    text-align: right;
}

.card-header-bar .wallets-title {
    text-align: right;
    margin-bottom: 0.3rem;
}

.card-header-bar .wallets-grid {
    justify-content: flex-end;
    padding-bottom: 0;
    /* JMPE20260617 - desplaza los logos a la izquierda, alineados al inicio del texto */
    margin-right: clamp(0.75rem, 6vw, 2.5rem);
}

@media (max-width: 320px) {
    .header-logo-wrap .logo-institucional {
        height: 40px;
        max-width: 70px;
    }

    .card-header-bar .wallets-grid {
        gap: 0.25rem;
    }
}

/* ── 29. IMÁGENES, TABLAS Y BOTONES EN CONSTANCIAS ───────────── */
/* JMPE20260513 */

/* Imágenes responsive dentro de cualquier constancia */
.p-constancia img,
#imprimir-constancia img {
    max-width: 100% !important;
    height: auto !important;
    display: inline-block;
}

/* word-break en celdas de tablas de constancias */
.rwd-constancia td,
.p-constancia td,
#imprimir-constancia td {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Centra el row de botones que está fuera de #imprimir-constancia (Error.cshtml) */
.p-constancia .row {
    justify-content: center;
    gap: 0.75rem;
}

.p-constancia .row .col-md-6 {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.p-constancia .row .col-md-6 .btn {
    width: auto;
    min-width: clamp(110px, 36vw, 160px);
}

@media (max-width: 480px) {
    .p-constancia .row {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .p-constancia .row .col-md-6 {
        flex: 0 0 auto;
        width: auto;
        max-width: clamp(160px, 80vw, 280px);
        margin-bottom: 0;
    }

    .p-constancia .row .col-md-6 .btn {
        width: 100%;
        min-width: 0;
    }
}

/* ── 30. FLEX-BETWEEN — GRUPOS DE BOTONES (Resultado, Cancelación…) */
/* JMPE20260513 */

/* Oculta el espaciador <p style="width:50px"> — el gap se encarga */
.flex-between > p {
    display: none !important;
}

.flex-between {
    gap: clamp(0.5rem, 2vw, 1rem);
    flex-wrap: wrap;
}

.flex-between .btn.w-50p {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: clamp(90px, 38vw, 150px);
}

@media (max-width: 480px) {
    .flex-between {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }

    .flex-between .btn.w-50p {
        width: clamp(160px, 80vw, 280px) !important;
    }
}
