/*
 * Estilos comunes de la interfaz (incluido en las 4 master pages, despues de las hojas de MAPFRE).
 */

/* ---------- Indicador de carga: overlay #divModalProgress de las master ----------
   Antes era un gif gris pequeno sobre gris; en celular parecia que la app se habia congelado.
   Ahora: fondo oscurecido, tarjeta blanca centrada y spinner en rojo MAPFRE con texto (lo agrega js/mpr-ui.js). */
.progress-overlay-mpr {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100%;
    /* Sin backdrop-filter: en Chrome movil el desenfoque deja reflejos en los bordes */
    background: rgba(26, 26, 26, .55);
    z-index: 2000;
}

.progress-overlay-mpr .progress-modal-mpr {
    width: auto;
    min-width: 160px;
    height: auto;
    margin: 0;
    padding: 24px 28px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .25);
    text-align: center;
}

.progress-overlay-mpr #imgModalProgress,
.progress-overlay-mpr .progress-modal-mpr br {
    display: none;
}

.progress-overlay-mpr .progress-modal-mpr > div:first-child::before {
    content: "";
    display: block;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border: 5px solid #f6d2cd;
    border-top-color: #d81e05;
    border-radius: 50%;
    animation: mpr-spin .8s linear infinite;
}

.progress-overlay-mpr .mpr-loading-text {
    margin-top: 14px;
    font-family: 'Noto Sans', Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #404040;
}

@keyframes mpr-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .progress-overlay-mpr .progress-modal-mpr > div:first-child::before {
        animation-duration: 2.4s;
    }
}

/* ---------- Boton de ayuda "?" junto a una etiqueta (abre UserControls/HelpDialog.ascx) ---------- */
.mpr-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -12px 0 -12px 2px;   /* area tactil de 44px sin agrandar la linea de la etiqueta */
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #666;
    font-size: 20px;
    line-height: 1;
    vertical-align: middle;
    cursor: pointer;
}
.mpr-help-btn:hover { color: #d81e05; }
.mpr-help-btn:focus-visible { outline: 3px solid rgba(216, 30, 5, .35); outline-offset: 0; }

.mpr-help-dialog .modal-title { font-weight: 700; color: #1a1a1a; }
.mpr-help-dialog .modal-body img { max-width: 100%; height: auto; }

/* ---------- Campos de fecha (js/mpr-ui.js: mprDate) ---------- */
.mpr-date .mpr-date-btn {
    min-width: 48px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    background: #f5f5f5;
    color: #404040;
}
.mpr-date .mpr-date-btn:hover { background: #e9e9e9; }

/* Calendario comodo al tacto y por encima de los modales/overlay */
.datepicker.dropdown-menu { z-index: 2100 !important; font-family: 'Noto Sans', Arial, sans-serif; }
.datepicker table tr td,
.datepicker table tr th { width: 40px; height: 40px; font-size: 15px; }
.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td span.active { background: #d81e05 !important; border-color: #d81e05 !important; color: #fff !important; }

/* ---------- Botones a todo el ancho en celular (>= 44px de alto por las variables de BS5) ---------- */
@media (max-width: 767.98px) {
    .mpr-btn-block-xs { display: block; width: 100%; }
}

/* ---------- Modal de mapa (UserControls/GoogleMapDialog.ascx) ---------- */
.mpr-modal-header-brand { background: #d81e05; color: #fff; }
.mpr-modal-header-brand .modal-title { color: #fff; font-weight: 700; }
.mpr-map-dialog .mpr-map-frame { display: block; width: 100%; height: 60vh; min-height: 260px; border: 0; }
/* Boton del mapa: la imagen mide 25px; el padding lleva el area tactil a 45px */
.mpr-map-btn { box-sizing: content-box; padding: 10px; vertical-align: middle; }

/* ---------- Formularios (card .mpr-form): mobile-first ---------- */
.mpr-form-wrap { margin: 0; }
.mpr-form { margin: 16px 0 24px; border: 1px solid #e3e3e3; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); background: #fff; overflow: hidden; }
.mpr-form > .card-header { background: #fafafa; border-bottom: 1px solid #ececec; padding: 14px 20px; }
.mpr-form > .card-header h3 { margin: 0; font-size: 18px; line-height: 1.3; color: #1a1a1a !important; font-weight: 700; }
.mpr-form > .card-header .row,
.mpr-form > .card-header [class*="col-"] { margin: 0; padding: 0; width: auto; }
.mpr-form > .card-body { padding: 8px 20px 20px; }
.mpr-form label { display: inline-block; margin: 14px 0 6px; font-size: 15px; font-weight: 700; color: #404040; }
.mpr-form .requiredSign { color: #d81e05; font-weight: 700; margin-right: 2px; }
.mpr-form .form-control,
.mpr-form select.form-control,
.mpr-form .form-select {
    min-height: 44px;
    font-size: 16px;            /* iOS no hace zoom al enfocar */
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background-color: #fff;
}
.mpr-form select.form-control {   /* flecha de los select con clase form-control (BS3) */
    appearance: auto;
    padding-right: 2rem;
}
.mpr-form .form-control:focus,
.mpr-form .form-select:focus { border-color: #d81e05; box-shadow: 0 0 0 .2rem rgba(216, 30, 5, .15); }
.mpr-form .errorMessages,
.mpr-form span[id*="rfv"],
.mpr-form span[id*="cv"],
.mpr-form span[id*="rev"] { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: #b02a37; }
.mpr-form .btn-primary { min-height: 44px; padding-left: 28px; padding-right: 28px; font-weight: 700; }
@media (max-width: 767.98px) {
    .mpr-form > .card-body { padding: 4px 16px 16px; }
    .mpr-form > .card-header { padding: 12px 16px; }
    .mpr-form .text-end { text-align: left !important; }   /* "Los campos con * son obligatorios" */
}
/* Campo de fecha: input y boton en la misma linea (mpr-content.css trae reglas de input-group de BS3 con float) */
.mpr-date.input-group { display: flex; flex-wrap: nowrap; width: 100%; }
.mpr-date.input-group > .form-control { float: none; flex: 1 1 auto; width: 1%; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.mpr-date.input-group > .mpr-date-btn { flex: 0 0 auto; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

/* ---------- Tarjetas de las landing (.image-text-article): toda la tarjeta se puede tocar ----------
   Los enlaces de la tarjeta (imagen, titulo, Acceder) van al mismo destino. El enlace del titulo extiende su
   area a toda la tarjeta; "Acceder" queda encima, con 44px de alto y foco de teclado propio. */
.image-text-article { padding-bottom: 64px; transition: box-shadow .15s ease; }
.image-text-article .entry-content > a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.image-text-article .entry-meta { padding-bottom: 12px; z-index: 2; }
.image-text-article .entry-meta a {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    margin-left: -12px;
    font-weight: 700;
}
.image-text-article .entry-meta a::after { content: "\f105"; font-family: FontAwesome; margin-left: 8px; }  /* chevron */
.image-text-article:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .10); }
.image-text-article:focus-within { outline: 3px solid rgba(216, 30, 5, .35); outline-offset: 2px; }

/* ---------- Botones: al menos 44px de alto (dedo) ---------- */
.btn, .btn-sm { min-height: 44px; }
.btn-sm { padding-top: .5rem; padding-bottom: .5rem; }

/* ---------- Campos de todo el contenido (no solo las cards .mpr-form): comodos en celular ---------- */
#main .form-control,
#main select.form-control,
#main .form-select { min-height: 44px; font-size: 16px; }

/* Footer en celular: las filas anidadas del bloque de contacto sobresalen 10px y generaban scroll horizontal.
   clip recorta lo que queda fuera de la pantalla sin cambiar como se ve (lo verifican las capturas del footer). */
#footer { overflow-x: clip; }

/* Contenedor de cada pagina en los master (columna de ancho completo, flotante y con 12px a los lados).
   Es el layout que tenia con Bootstrap 3, donde una columna fuera de una .row flotaba sola. :where() = especificidad 0:
   las hojas de MAPFRE ([class^='col'] con 6px/10px en pantallas chicas) siguen ganando, como antes. */
:where(.mpr-page) { position: relative; float: left; width: 100%; min-height: 1px; padding-left: 12px; padding-right: 12px; }

/* Tarjetas de las landing de Salud y Vida: columnas flotantes sin .row, como las dibujaba Bootstrap 3.
   :where() = especificidad 0 (las hojas de MAPFRE siguen ganando). Al modernizar esas landing se cambia por una .row. */
:where(.mpr-float-cols) > :where([class*="col-"]) { position: relative; min-height: 1px; padding-left: 12px; padding-right: 12px; }
@media (min-width: 768px) { :where(.mpr-float-cols) > :where([class*="col-sm-"]) { float: left; } }
@media (min-width: 960px) { :where(.mpr-float-cols) > :where([class*="col-md-"]) { float: left; } }

/* ---------- Directorios (Agents, RoadAsistProvider, BranchGarageDetail): resultados en tarjetas ----------
   La GridView se mantiene (paginacion y ViewState) pero su tabla se dibuja como lista de tarjetas:
   una columna en celular, dos desde 768px. */
.mpr-search { margin-top: 0; }
.mpr-results-count { margin: 4px 0 12px; font-size: 15px; font-weight: 700; color: #404040; }
.mpr-results, .mpr-results > tbody, .mpr-results > tbody > tr, .mpr-results > tbody > tr > td { display: block; width: 100%; border: 0; padding: 0; background: transparent; }
.mpr-results > tbody { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .mpr-results > tbody { grid-template-columns: 1fr 1fr; gap: 16px; } }
.mpr-results > tbody > tr { display: flex; }   /* tarjetas de la misma fila con el mismo alto */
.mpr-results > tbody > tr > td { flex: 1 1 auto; }
.mpr-result { display: flex; gap: 14px; height: 100%; padding: 16px; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.mpr-result-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; background: #fdecea; color: #d81e05; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mpr-result-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#main .mpr-result-title { margin: 2px 0 6px; font-size: 16px; line-height: 1.35; font-weight: 700; color: #1a1a1a; overflow-wrap: anywhere; }
.mpr-result-address { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: #555; overflow-wrap: anywhere; }
.mpr-result-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.mpr-result-actions .btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.mpr-results-pager { margin-top: 16px; }
.mpr-empty { padding: 28px 20px; text-align: center; background: #fff; border: 1px dashed #d9d9d9; border-radius: 10px; color: #555; }
.mpr-empty .fa { font-size: 28px; color: #d81e05; margin-bottom: 8px; }
#main .mpr-empty p { margin: 0; line-height: 1.5; }
.mpr-result-extra { color: #767676; }
/* Varios botones por tarjeta: en celular se reparten el ancho (sin un boton suelto en la segunda fila) */
@media (max-width: 767px) { .mpr-actions-fill .btn { flex: 1 1 auto; justify-content: center; } }

/* Selector segmentado (RoadAsistProvider: Proveedores / Talleres). Son dos asp:RadioButton con AutoPostBack;
   mpr-content.css oculta todo input radio y pinta su label como bloque gris/rojo de 20px de relleno: aqui se
   reemplaza por dos opciones compactas de 44px y el radio queda accesible (oculto a la vista, no al teclado). */
.mpr-segment { display: flex; gap: 4px; padding: 4px; margin-bottom: 4px; background: #f1f1f1; border-radius: 10px; }
.mpr-segment > span { flex: 1 1 0; position: relative; display: flex; }
.mpr-segment input[type=radio] { display: block; position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; padding: 0; pointer-events: none; }
.mpr-segment input[type=radio] + label { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 8px 10px; background: transparent; border-radius: 8px; color: #404040; font-size: 15px; font-weight: 600; text-align: center; cursor: pointer; transition: background-color .15s, color .15s; }
.mpr-segment input[type=radio] + label:hover { background: #e6e6e6; }
.mpr-segment input[type=radio]:checked + label { background: #d81e05; color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mpr-segment input[type=radio]:focus-visible + label { outline: 2px solid #d81e05; outline-offset: 2px; }
.mpr-promo-actions { margin-bottom: 24px; }
.mpr-promo-text { margin: 0 0 14px; font-size: 15px; line-height: 1.6; color: #555; }

/* Bloque inicial (sin busqueda): foto y contacto en tarjetas con telefonos y correos que se pueden tocar */
.mpr-promo-img { display: block; width: 100%; height: auto; border-radius: 10px; margin-bottom: 8px; }
.mpr-contact { margin-bottom: 16px; }
.mpr-contact-card { height: 100%; padding: 16px; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; }
#main .mpr-contact-card h4 { margin: 0 0 8px; font-size: 16px; line-height: 1.35; font-weight: 700; color: #1a1a1a; }
#main .mpr-contact-card p { margin: 0 0 8px; color: #555; font-size: 14px; line-height: 1.5; }
.mpr-contact-card a, .mpr-contact-card .mpr-contact-line { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; overflow-wrap: break-word; word-break: break-word; }
.mpr-contact-card .mpr-contact-line { color: #555; }
.mpr-contact-card .fa { flex: 0 0 18px; width: 18px; text-align: center; color: #d81e05; }
.mpr-contact-card a > span:not(.fa) { line-height: 1.35; }

/* Detalle de sucursal / taller (BranchGarageDetail) */
.mpr-detail { margin-bottom: 24px; }
.mpr-detail-card { padding: 20px; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.mpr-detail-desc { display: block; margin-bottom: 12px; color: #555; }
.mpr-detail-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.mpr-detail-item:last-of-type { border-bottom: 0; }
.mpr-detail-item > .fa { flex: 0 0 22px; margin-top: 3px; font-size: 18px; text-align: center; color: #d81e05; }
#main .mpr-detail-label { display: block; line-height: 1.4; font-size: 13px; font-weight: 700; color: #707070; text-transform: uppercase; letter-spacing: .02em; }
#main .mpr-detail-value { display: block; font-size: 16px; line-height: 1.5; color: #1a1a1a; overflow-wrap: anywhere; }
.mpr-detail-actions { margin-top: 16px; }
.mpr-detail-actions .btn { flex: 1 1 160px; justify-content: center; }
.mpr-detail-services-title { margin-top: 20px; }
.mpr-detail-services { list-style: none; margin: 8px 0 0; padding: 0; }
.mpr-detail-services li { display: flex; gap: 10px; padding: 6px 0; color: #404040; }
.mpr-detail-services .fa { color: #d81e05; margin-top: 4px; }
.mpr-detail-img { display: block; width: 100%; height: auto; border-radius: 10px; margin-bottom: 16px; }
.mpr-detail-map object { border-radius: 10px; overflow: hidden; }

/* Baja de SMS (StopSms): tarjeta centrada, comoda en el celular (llega desde el enlace del SMS) */
.mpr-sms { max-width: 520px; margin: 8px auto 32px; }
.mpr-sms-card { overflow: hidden; background: #fff; border: 1px solid #e3e3e3; border-radius: 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.mpr-sms-img { display: block; width: 100%; height: auto; max-height: 200px; object-fit: contain; background: #f7f7f7; }
.mpr-sms-body { padding: 20px 20px 24px; text-align: center; }
#main .mpr-sms-kicker { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: #d81e05; text-transform: uppercase; letter-spacing: .04em; }
#main .mpr-sms-title { margin: 0 0 10px; font-size: 26px; line-height: 1.25; font-weight: 700; color: #1a1a1a; }
#main .mpr-sms-text { margin: 0 0 20px; font-size: 16px; line-height: 1.5; color: #555; }
.mpr-sms-label { display: block; margin: 0 0 6px; text-align: left; font-size: 15px; font-weight: 700; color: #404040; }
.mpr-sms .mpr-sms-input { text-align: center; font-size: 20px; letter-spacing: .04em; min-height: 52px; }
.mpr-sms-hint { display: block; margin-top: 6px; color: #707070; }
.mpr-sms .errorMessages { display: block; margin-top: 6px; font-weight: 600; color: #b02a37; }
#main .mpr-sms-alert { text-align: left; font-size: 15px; line-height: 1.5; }

/* Formularios descargables (HFRequest): lista compacta en celular, grilla de tarjetas desde 768px */
.mpr-docs { margin-bottom: 8px; }
.mpr-docs-section { margin: 0 0 24px; }
#main .mpr-docs-section-title { margin: 0 0 12px; font-size: 18px; line-height: 1.3; font-weight: 700; color: #1a1a1a; }
.mpr-docs-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 768px) { .mpr-docs-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 1200px) { .mpr-docs-grid { grid-template-columns: repeat(3, 1fr); } }
.mpr-doc { display: flex; align-items: center; gap: 14px; height: 100%; min-height: 72px; padding: 12px 16px; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; color: #1a1a1a; text-decoration: none; transition: box-shadow .15s ease, border-color .15s ease; }
.mpr-doc:hover { text-decoration: none; color: #1a1a1a; border-color: #d81e05; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.mpr-doc:focus-visible { outline: 3px solid rgba(216, 30, 5, .35); outline-offset: 2px; }
.mpr-doc-icon { flex: 0 0 44px; width: 44px; height: 44px; object-fit: contain; }
.mpr-doc-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mpr-doc-title { font-size: 15px; line-height: 1.35; font-weight: 600; }
#main .mpr-doc-note { margin-top: 4px; font-size: 13px; line-height: 1.4; color: #707070; }
.mpr-doc-action { flex: 0 0 auto; color: #d81e05; font-size: 18px; }
#main .mpr-docs-info { font-size: 15px; line-height: 1.5; border-radius: 10px; }
