.mpm-shell,
.mpm-form,
.mpm-dashboard {
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
}

.mpm-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 10px;
    align-items: center;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.mpm-filters input,
.mpm-filters select,
.mpm-filters button,
.mpm-form input,
.mpm-form select,
.mpm-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    border: 1px solid #d7dce2;
    border-radius: 10px;
    padding: 9px 11px;
    background: #fff;
    font: inherit;
}

.mpm-filter-search {
    grid-column: span 2;
}

.mpm-check {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size: 14px;
}

.mpm-check input {
    width: auto;
    min-height: auto;
}

.mpm-locate-button,
.mpm-submit-button,
.mpm-directions,
.mpm-review-form button {
    cursor: pointer;
    border: 0;
    color: #fff;
    background: #0055A4;
    font-weight: 700;
    transition: transform .15s ease, opacity .15s ease;
}


.mpm-filters .mpm-locate-button {
    background: var(--mpm-locate-button-bg, #F58220) !important;
    color: var(--mpm-locate-button-color, #fff) !important;
    border: 1px solid var(--mpm-locate-button-bg, #F58220) !important;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--mpm-locate-button-bg, #F58220) 28%, transparent);
    white-space: nowrap;
}

.mpm-filters .mpm-locate-button:focus {
    outline: 3px solid color-mix(in srgb, var(--mpm-locate-button-bg, #F58220) 30%, transparent);
    outline-offset: 2px;
}

.mpm-locate-button:hover,
.mpm-submit-button:hover,
.mpm-directions:hover,
.mpm-review-form button:hover {
    transform: translateY(-1px);
    opacity: .92;
}

.mpm-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
}

.mpm-map {
    width: 100%;
    min-height: 620px;
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    background: #eef1f4;
}

.mpm-results {
    max-height: 620px;
    overflow: auto;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    background: #fff;
}

.mpm-results-count {
    font-weight: 800;
    margin-bottom: 10px;
}

.mpm-result-card {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 12px;
    text-align: left;
    border: 1px solid #edf0f3;
    border-radius: 14px;
    background: #fbfcfd;
    cursor: pointer;
}

.mpm-result-card strong,
.mpm-result-card span,
.mpm-result-card em {
    display: block;
}

.mpm-result-card strong {
    color: #111827;
    font-size: 15px;
}

.mpm-result-card span {
    margin-top: 3px;
    color: #4b5563;
    font-size: 13px;
}

.mpm-result-card em {
    margin-top: 5px;
    color: #0055A4;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.mpm-popup {
    min-width: 230px;
    max-width: 310px;
    line-height: 1.35;
}

.mpm-popup h3 {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.2;
}

.mpm-popup p {
    margin: 6px 0;
}

.mpm-popup-address {
    color: #4b5563;
}

.mpm-platform-badge,
.mpm-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.mpm-platform-transfermovil { background: #0055A4; }
.mpm-platform-enzona { background: #F58220; }
.mpm-platform-ambas { background: linear-gradient(90deg, #0055A4 0 50%, #F58220 50% 100%); }
.mpm-platform-no { background: #6b7280; }
.mpm-verified { background: #108a45; margin-bottom: 7px; }

.mpm-directions {
    display: inline-block;
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
}

.mpm-rating {
    margin: 8px 0;
    padding-top: 7px;
    border-top: 1px solid #e5e7eb;
}

.mpm-rating strong {
    color: #F58220;
    letter-spacing: 1px;
}

.mpm-review-form {
    display: grid;
    gap: 6px;
    margin: 8px 0;
}

.mpm-review-form select,
.mpm-review-form textarea {
    width: 100%;
    border: 1px solid #d7dce2;
    border-radius: 8px;
    padding: 7px;
}

.mpm-review-form button {
    min-height: 36px;
    border-radius: 8px;
}

.mpm-review-status {
    font-size: 12px;
    color: #108a45;
}

.mpm-login-review {
    display: inline-block;
    font-size: 13px;
    margin: 5px 0;
}

.mpm-form {
    max-width: 980px;
    margin: 0 auto 24px;
    padding: 20px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.mpm-form h2,
.mpm-dashboard h2 {
    margin-top: 0;
}

.mpm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mpm-form p {
    margin: 0;
}

.mpm-form label {
    display: block;
    margin: 0 0 6px;
    font-weight: 700;
}

.mpm-form textarea {
    min-height: 95px;
}

.mpm-full {
    grid-column: 1 / -1;
}

.mpm-check-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpm-check-row input {
    width: auto;
    min-height: auto;
}

.mpm-picker-map {
    min-height: 310px;
    border: 1px solid #d7dce2;
    border-radius: 16px;
    overflow: hidden;
    background: #eef1f4;
}

.mpm-submit-button {
    margin-top: 16px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
}

.mpm-notice {
    padding: 12px 14px;
    margin: 0 0 14px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.mpm-notice-info { background: #eef6ff; border-color: #b5d8ff; }
.mpm-notice-success { background: #effaf3; border-color: #bde8cc; }
.mpm-notice-error { background: #fff1f1; border-color: #ffd0d0; }

.mpm-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
}

.mpm-table th,
.mpm-table td {
    padding: 11px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.mpm-table th {
    background: #f8fafc;
}

@media (max-width: 1050px) {
    .mpm-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mpm-filter-search {
        grid-column: span 2;
    }
    .mpm-map-layout {
        grid-template-columns: 1fr;
    }
    .mpm-results {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .mpm-filters,
    .mpm-form-grid {
        grid-template-columns: 1fr;
    }
    .mpm-filter-search,
    .mpm-full {
        grid-column: auto;
    }
    .mpm-map {
        min-height: 520px;
        border-radius: 12px;
    }
    .mpm-form {
        padding: 14px;
    }
    .mpm-table {
        display: block;
        overflow-x: auto;
    }
}

/* Layout grande 75/25 para mapa + negocios */
.mpm-map-layout {
    grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr);
    align-items: stretch;
}

.mpm-map,
.mpm-results {
    min-height: 75vh;
    max-height: 75vh;
}

.mpm-results {
    overflow-y: auto;
}

.mpm-platform-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    padding: 2px;
}

.mpm-result-card em {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mpm-result-card em small {
    color: #374151;
    font-size: 12px;
    font-weight: 800;
}

.mpm-manager-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #b5d8ff;
    border-radius: 14px;
    background: #eef6ff;
}

.mpm-manager-panel label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.mpm-manager-panel input[type="checkbox"] {
    width: auto;
    min-height: auto;
}

@media (max-width: 1100px) {
    .mpm-map-layout {
        grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    }
}

@media (max-width: 860px) {
    .mpm-map-layout {
        grid-template-columns: 1fr;
    }
    .mpm-map {
        min-height: 62vh;
        max-height: none;
    }
    .mpm-results {
        min-height: auto;
        max-height: 42vh;
    }
}

@media (max-width: 640px) {
    .mpm-map {
        min-height: 58vh;
    }
    .mpm-results {
        max-height: 48vh;
    }
    .mpm-platform-logo {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
}

/* Versión 1.2.1: mapa más grande, ancho PC editable, layout editable y rutas dentro del mapa */
.mpm-shell {
    --mpm-map-height: 82vh;
    --mpm-map-height-tablet: 68vh;
    --mpm-map-height-mobile: 62vh;
    --mpm-map-col: 75fr;
    --mpm-list-col: 25fr;
}

.mpm-shell-wide {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: clamp(12px, 2.2vw, 32px);
    padding-right: clamp(12px, 2.2vw, 32px);
}

.mpm-map-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--mpm-map-col)) minmax(260px, var(--mpm-list-col));
    gap: 16px;
    align-items: stretch;
}

.mpm-map-wrap {
    position: relative;
    min-width: 0;
}

.mpm-map,
.mpm-results {
    min-height: var(--mpm-map-height);
    max-height: var(--mpm-map-height);
}

.mpm-map {
    height: var(--mpm-map-height);
}

.mpm-results {
    overflow-y: auto;
}

.mpm-route-status {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 500;
    display: none;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    pointer-events: none;
}

.mpm-route-status:not(:empty) {
    display: block;
}

.mpm-route-ready {
    background: rgba(16, 138, 69, .92);
}

.mpm-route-error {
    background: rgba(185, 28, 28, .92);
}

.mpm-form {
    max-width: var(--mpm-form-max-width, 980px);
}

.mpm-ajax-message {
    display: none;
    margin: 0 0 14px;
    padding: 11px 13px;
    border-radius: 12px;
    font-weight: 700;
}

.mpm-ajax-message:not(:empty) {
    display: block;
}

.mpm-ajax-loading {
    background: #eef6ff;
    border: 1px solid #b5d8ff;
    color: #0f4d7a;
}

.mpm-ajax-success {
    background: #effaf3;
    border: 1px solid #bde8cc;
    color: #0f6b3c;
}

.mpm-ajax-error {
    background: #fff1f1;
    border: 1px solid #ffd0d0;
    color: #991b1b;
}

.mpm-submit-button:disabled {
    cursor: wait;
    opacity: .65;
    transform: none;
}

@media (min-width: 1180px) {
    .mpm-filters {
        grid-template-columns: minmax(260px, 2fr) repeat(6, minmax(120px, 1fr));
    }

    .mpm-filter-search {
        grid-column: auto;
    }
}

@media (max-width: 1050px) {
    .mpm-shell-wide {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .mpm-map-layout {
        grid-template-columns: 1fr;
    }

    .mpm-map,
    .mpm-results {
        max-height: none;
    }

    .mpm-map {
        height: var(--mpm-map-height-tablet);
        min-height: var(--mpm-map-height-tablet);
    }

    .mpm-results {
        min-height: auto;
        max-height: 42vh;
    }
}

@media (max-width: 640px) {
    .mpm-map {
        height: var(--mpm-map-height-mobile);
        min-height: var(--mpm-map-height-mobile);
    }

    .mpm-results {
        max-height: 48vh;
    }

    .mpm-route-status {
        left: 8px;
        right: 8px;
        bottom: 8px;
        font-size: 12px;
    }
}

/* Versión 1.2.2: popups móviles adaptables y marcadores con logotipo real */
.mpm-shell .leaflet-popup-content-wrapper,
.mpm-shell .leaflet-popup-tip {
    box-sizing: border-box;
}

.mpm-shell .leaflet-popup-content {
    box-sizing: border-box;
    width: auto !important;
    max-width: min(380px, calc(100vw - 64px));
    margin: 12px;
}

.mpm-shell .leaflet-popup-scrolled {
    border-top: 0;
    border-bottom: 0;
    padding-right: 6px;
}

.mpm-shell .gm-style-iw,
.mpm-shell .gm-style-iw-c {
    max-width: min(380px, calc(100vw - 42px)) !important;
}

.mpm-shell .gm-style-iw-d {
    max-height: min(68vh, 520px) !important;
    overflow-y: auto !important;
}

.mpm-popup {
    box-sizing: border-box;
    width: 100%;
    min-width: min(250px, calc(100vw - 80px));
    max-width: 100%;
    overflow-wrap: anywhere;
}

.mpm-popup .mpm-platform-badge {
    max-width: 100%;
    white-space: normal;
}

.mpm-popup .mpm-review-form textarea {
    resize: vertical;
}

.mpm-marker-icon {
    background: transparent !important;
    border: 0 !important;
}

.mpm-marker-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 54px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,.28));
}

.mpm-marker-pin::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: #6b7280;
    border: 2px solid rgba(255,255,255,.92);
    box-sizing: border-box;
}

.mpm-marker-transfermovil .mpm-marker-pin::before {
    background: #0055A4;
}

.mpm-marker-enzona .mpm-marker-pin::before {
    background: #F58220;
}

.mpm-marker-ambas .mpm-marker-pin::before {
    background: linear-gradient(135deg, #0055A4 0 50%, #F58220 50% 100%);
}

.mpm-marker-no .mpm-marker-pin::before {
    background: #6b7280;
}

.mpm-marker-logo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: -8px;
    border-radius: 999px;
    background: rgba(255,255,255,.97);
    box-shadow: inset 0 0 0 1px rgba(17,24,39,.12);
    overflow: hidden;
}

.mpm-marker-logo-img {
    display: block;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.mpm-marker-letter {
    color: #111827;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
    font-family: Arial, Helvetica, sans-serif;
}

@media (max-width: 640px) {
    .mpm-shell .leaflet-popup {
        max-width: calc(100vw - 22px) !important;
    }

    .mpm-shell .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 22px) !important;
    }

    .mpm-shell .leaflet-popup-content {
        max-width: calc(100vw - 48px);
        max-height: calc(var(--mpm-map-height-mobile) - 98px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 10px;
    }

    .mpm-shell .gm-style-iw-d {
        max-height: calc(var(--mpm-map-height-mobile) - 86px) !important;
    }

    .mpm-popup {
        min-width: 0;
        font-size: 13px;
        line-height: 1.28;
    }

    .mpm-popup h3 {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .mpm-popup p {
        margin: 4px 0;
    }

    .mpm-platform-badge,
    .mpm-verified {
        font-size: 11px;
        padding: 3px 7px;
    }

    .mpm-directions {
        min-height: 40px;
        padding: 9px 10px;
    }

    .mpm-marker-pin {
        width: 40px;
        height: 50px;
    }

    .mpm-marker-logo {
        width: 25px;
        height: 25px;
        margin-top: -7px;
    }

    .mpm-marker-logo-img {
        width: 20px;
        height: 20px;
    }

    .mpm-marker-letter {
        font-size: 16px;
    }
}


/* Versión 1.2.3: popup más ancho y editable desde ajustes/shortcode */
.mpm-shell {
    --mpm-popup-width-desktop: 520px;
    --mpm-popup-width-tablet: 480px;
    --mpm-popup-width-mobile: 94vw;
}

.mpm-shell .leaflet-popup,
.mpm-shell .leaflet-popup-content-wrapper {
    max-width: min(var(--mpm-popup-width-desktop), calc(100vw - 42px)) !important;
}

.mpm-shell .leaflet-popup-content {
    width: min(var(--mpm-popup-width-desktop), calc(100vw - 74px)) !important;
    max-width: min(var(--mpm-popup-width-desktop), calc(100vw - 74px)) !important;
    margin: 12px 14px;
}

.mpm-shell .gm-style-iw,
.mpm-shell .gm-style-iw-c {
    max-width: min(var(--mpm-popup-width-desktop), calc(100vw - 42px)) !important;
}

.mpm-popup {
    min-width: 0;
}

.mpm-popup h3 {
    line-height: 1.15;
}

.mpm-popup p:not(.mpm-popup-address) {
    display: grid;
    grid-template-columns: minmax(92px, max-content) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.mpm-popup p strong {
    white-space: nowrap;
}

.mpm-popup .mpm-platform-badge {
    justify-self: start;
}

.mpm-popup .mpm-review-form {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.mpm-popup .mpm-review-form textarea,
.mpm-popup .mpm-review-status {
    grid-column: 1 / -1;
}

@media (max-width: 1050px) {
    .mpm-shell .leaflet-popup,
    .mpm-shell .leaflet-popup-content-wrapper {
        max-width: min(var(--mpm-popup-width-tablet), calc(100vw - 28px)) !important;
    }

    .mpm-shell .leaflet-popup-content {
        width: min(var(--mpm-popup-width-tablet), calc(100vw - 54px)) !important;
        max-width: min(var(--mpm-popup-width-tablet), calc(100vw - 54px)) !important;
    }

    .mpm-shell .gm-style-iw,
    .mpm-shell .gm-style-iw-c {
        max-width: min(var(--mpm-popup-width-tablet), calc(100vw - 28px)) !important;
    }
}

@media (max-width: 640px) {
    .mpm-shell .leaflet-popup,
    .mpm-shell .leaflet-popup-content-wrapper {
        max-width: min(var(--mpm-popup-width-mobile), calc(100vw - 12px)) !important;
    }

    .mpm-shell .leaflet-popup-content {
        width: min(var(--mpm-popup-width-mobile), calc(100vw - 30px)) !important;
        max-width: min(var(--mpm-popup-width-mobile), calc(100vw - 30px)) !important;
        max-height: calc(var(--mpm-map-height-mobile) - 82px);
        margin: 9px;
    }

    .mpm-shell .gm-style-iw,
    .mpm-shell .gm-style-iw-c {
        max-width: min(var(--mpm-popup-width-mobile), calc(100vw - 12px)) !important;
    }

    .mpm-shell .gm-style-iw-d {
        max-height: calc(var(--mpm-map-height-mobile) - 72px) !important;
    }

    .mpm-popup p:not(.mpm-popup-address) {
        grid-template-columns: minmax(78px, max-content) minmax(0, 1fr);
        gap: 6px;
    }

    .mpm-popup .mpm-review-form {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 7px;
    }
}

@media (max-width: 380px) {
    .mpm-popup p:not(.mpm-popup-address) {
        display: block;
    }

    .mpm-popup p strong {
        margin-right: 4px;
    }
}

/* Versión 1.2.6: contacto, horario y formulario administrativo reutilizable */
.mpm-result-hours {
    color: #6b7280;
    font-size: 12px;
}

.mpm-contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.mpm-contact-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: #effaf3;
    color: #0f6b3c;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.mpm-whatsapp-group-link {
    background: #eef6ff;
    color: #0055A4;
}

.mpm-admin-business-form {
    margin-left: 0;
    margin-right: 0;
}

.mpm-admin-business-form .mpm-picker-map,
.mpm-admin-location .mpm-picker-map {
    min-height: 420px;
}

@media (max-width: 640px) {
    .mpm-contact-list {
        display: grid;
        gap: 5px;
    }
    .mpm-contact-link {
        width: fit-content;
    }
}


/* Versión 1.3.0: Cuba completa, popup corregido, reseñas públicas y ubicación actual en formularios */
.mpm-shell .leaflet-popup-content {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
}

.mpm-popup {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
    overflow: hidden;
}

.mpm-popup * {
    box-sizing: border-box;
    max-width: 100%;
}

.mpm-popup-review {
    min-width: 0;
    overflow: hidden;
}

.mpm-popup .mpm-review-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    width: 100%;
    min-width: 0;
}

.mpm-popup .mpm-review-form input,
.mpm-popup .mpm-review-form select,
.mpm-popup .mpm-review-form textarea,
.mpm-popup .mpm-review-form button {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.mpm-popup .mpm-review-form textarea {
    resize: vertical;
    min-height: 58px;
}

.mpm-popup-actions {
    width: 100%;
    min-width: 0;
}

.mpm-popup-actions .mpm-directions {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 4px;
    white-space: normal;
}

.mpm-location-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
}

.mpm-use-current-location {
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #F58220;
    color: #fff;
    font-weight: 800;
}

.mpm-location-status {
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .mpm-popup {
        gap: 5px;
    }
    .mpm-popup .mpm-review-form,
    .mpm-popup p:not(.mpm-popup-address) {
        display: block;
    }
    .mpm-popup .mpm-review-form > * + * {
        margin-top: 6px;
    }
    .mpm-location-tools {
        display: grid;
    }
    .mpm-use-current-location {
        width: 100%;
    }
}
