/* =========================================================================
   Estilos para el HTML de beneficios (CMS heredado). Aislados bajo
   .benefits-cms para no afectar el resto del diseño. Portan las clases
   Bootstrap 3 mínimas (grid, box, modal) que usa ese contenido.
   ========================================================================= */

.benefits-cms .row { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.benefits-cms [class*="col-"] { padding: 10px; box-sizing: border-box; }
.benefits-cms .col-12 { width: 100%; }
.benefits-cms .col-8 { width: 66.666%; }
.benefits-cms .col-6 { width: 50%; }
.benefits-cms .col-4 { width: 33.333%; }
@media (min-width: 768px) {
    .benefits-cms .col-md-4 { width: 33.333%; }
    .benefits-cms .col-md-6 { width: 50%; }
}
@media (max-width: 767px) {
    .benefits-cms .col-md-4, .benefits-cms .col-6 { width: 100%; }
}

/* Tarjeta */
.benefits-cms .box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: calc(100% - 20px);
    display: flex;
    flex-direction: column;
    transition: box-shadow .15s, transform .15s;
}
.benefits-cms .box:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.benefits-cms .box { cursor: pointer; }
.benefits-cms .modal .box, .benefits-cms .modal .modal-content { cursor: auto; }

.benefits-cms .box-header {
    position: relative;
    height: 200px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f2f7f7, #e9f4f2);
    overflow: hidden;
    padding: 12px !important;
}
.benefits-cms .box-header img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Unifica la tipografía del contenido del CMS con la del portal (Inter),
   sin tocar los <i> por si usan fuentes de iconos. */
.benefits-cms { font-family: var(--font) !important; }
.benefits-cms p, .benefits-cms span, .benefits-cms b, .benefits-cms strong,
.benefits-cms font, .benefits-cms a, .benefits-cms div, .benefits-cms li,
.benefits-cms td, .benefits-cms h1, .benefits-cms h2, .benefits-cms h3,
.benefits-cms h4, .benefits-cms h5, .benefits-cms label, .benefits-cms small {
    font-family: var(--font) !important;
}

.benefits-cms .box-body { padding: 15px 18px; font-size: 14.5px; color: var(--ink); }
.benefits-cms .box-body .row { margin: 0; align-items: center; gap: 10px; flex-wrap: nowrap; }
/* Cada celda del pie en una sola línea, con puntos suspensivos si no cabe */
.benefits-cms .box-body .row > * {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
/* Texto del descuento: fuente del portal, negrita media */
.benefits-cms .box-body p,
.benefits-cms .box-body span,
.benefits-cms .box-body b,
.benefits-cms .box-body strong,
.benefits-cms .box-body font {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block;
    line-height: 1.3;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -.005em;
}
/* Enlace "Ver más" */
.benefits-cms .box-body a {
    color: var(--brand-700);
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s;
}
.benefits-cms .box-body a:hover { color: var(--brand); text-decoration: none; }

/* Modal (Bootstrap 3) — sobrescribe el .modal genérico de app.css por mayor especificidad */
.benefits-cms .modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    max-width: none;
    background: none;
    border-radius: 0;
    overflow: auto;
    padding: 24px 16px;
    box-shadow: none;
}
.benefits-cms .modal.show { display: block; }
.benefits-cms .modal .modal-dialog {
    max-width: 720px;
    margin: 40px auto;
    position: relative;
    z-index: 1060;
}
.benefits-cms .modal .modal-dialog.modal-lg { max-width: 820px; }
.benefits-cms .modal .modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}
.benefits-cms .modal .modal-header {
    position: relative;
    padding: 0 !important;
    border-bottom: 1px solid var(--line-2);
}
.benefits-cms .modal .modal-header img { width: 100%; display: block; }
.benefits-cms .modal .modal-body { padding: 22px 24px; line-height: 1.7; color: var(--ink); }
.benefits-cms .modal .modal-footer { padding: 16px 24px; border-top: 1px solid var(--line-2); }

/* Botón de cierre (×): forzar arriba-derecha, sobre los estilos en línea del CMS */
.benefits-cms .modal .close {
    position: absolute !important;
    top: 12px !important;
    right: 14px !important;
    left: auto !important;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border: 0; border-radius: 50%;
    background: rgba(15, 30, 36, .5) !important;
    color: #fff !important;
    font-size: 26px !important;
    line-height: 1 !important;
    cursor: pointer;
    z-index: 2;
}
.benefits-cms .modal .close:hover { background: rgba(15, 30, 36, .75) !important; }

.benefits-cms .btn2 {
    border-radius: 10px; border: 1px solid transparent; height: auto !important;
    padding: 10px 18px; font-weight: 600; cursor: pointer; font-family: var(--font);
}
.benefits-cms .btn-primary { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.benefits-cms .btn-primary:hover { background: var(--brand-600) !important; }

/* Backdrop compartido */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(15, 30, 36, .45); z-index: 1040;
}
body.modal-open { overflow: hidden; }
