/*
 * Cuentas de clientes y favoritos (sitio público).
 * Reutiliza las clases de la plantilla (.popup, .popup-form, .form-field, .btn2)
 * y agrega lo propio con el prefijo mh-.
 * Plan: docs-dev/2026-10-06_plan_cuentas_clientes_favoritos.md
 */

:root {
    --mh-accent: var(--color-template, #C72C41);
    --mh-text: #242526;
    --mh-muted: #6b6c70;
    --mh-border: #dfe0e5;
    --mh-error: #c0392b;
    --mh-surface: #ffffff;
    --mh-soft: #f5f5f7;
}

/* ===================== Modal de cuenta ===================== */

#customer-popup,
#mh-confirm {
    display: none;
    width: 410px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    text-align: left;
    border-radius: 6px;
}
#customer-popup.active,
#mh-confirm.active {
    display: block;
    opacity: 1;
    z-index: 99999;
    margin: 0;
}
#customer-popup > h3,
#mh-confirm > h3 {
    text-align: center;
    margin: 0;
}
.mh-account__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--mh-text);
    font-size: 20px;
    line-height: 32px;
    cursor: pointer;
    z-index: 2;
}
.mh-account__tabs {
    display: flex;
    border-bottom: 1px solid var(--mh-border);
}
.mh-account__tabs[hidden] {
    display: none;
}
.mh-account__tab {
    flex: 1;
    padding: 14px 8px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--mh-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.mh-account__tab.is-active {
    color: var(--mh-accent);
    border-bottom-color: var(--mh-accent);
}
#customer-popup .popup-form {
    padding: 20px 30px 26px;
}
#customer-popup .popup-form > form {
    padding: 0;
    margin: 0;
    border: 0;
}
#customer-popup .form-field input[type="text"],
#customer-popup .form-field input[type="email"],
#customer-popup .form-field input[type="tel"],
#customer-popup .form-field input[type="password"] {
    width: 100%;
}
#customer-popup .form-field input.is-invalid,
.mh-page-card .form-field input.is-invalid {
    border-color: var(--mh-error);
}
#customer-popup .btn2 {
    width: 100%;
    margin-top: 14px;
}
.mh-account__intro,
.mh-account__help {
    color: var(--mh-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.mh-account__alert {
    background: #fdecea;
    color: var(--mh-error);
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.mh-account__alert.is-info {
    background: #e8f4fd;
    color: #1d5f8a;
}
.mh-account__alert[hidden] {
    display: none;
}
.mh-account__error {
    display: block;
    color: var(--mh-error);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
    text-align: left;
}
.mh-account__error:empty {
    display: none;
}
.mh-account__policy small a {
    color: var(--mh-accent);
    text-decoration: underline;
}
.mh-account__policy .input-field > label small {
    white-space: normal;
}
.mh-account__policy {
    overflow: hidden;
}
.mh-account__policy .mh-account__error {
    clear: both;
    padding-top: 4px;
}
.mh-account__captcha {
    margin-top: 6px;
}
.mh-account__link {
    display: inline-block;
    border: 0;
    background: transparent;
    padding: 0;
    margin-top: 12px;
    color: var(--mh-accent);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}
.mh-account__forgot {
    float: right;
    border: 0;
    background: transparent;
    padding: 0;
    margin-top: 5px;
    color: var(--mh-text);
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}
.mh-account__forgot:hover {
    color: var(--mh-accent);
}
.mh-account__link[hidden] {
    display: none;
}
#customer-popup [data-pane][hidden] {
    display: none;
}
.mh-account__done {
    text-align: center;
    padding: 10px 0 0;
}
.mh-account__done > i {
    font-size: 48px;
    color: var(--mh-accent);
}
.mh-account__done p {
    color: var(--mh-text);
    font-size: 15px;
    line-height: 1.6;
    margin: 12px 0 0;
}

/* Confirmación para quitar un favorito */
#mh-confirm {
    width: 380px;
}
#mh-confirm .popup-form {
    padding: 24px 30px 26px;
}
.mh-confirm__text {
    color: var(--mh-text);
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
    margin: 0 0 20px;
}
.mh-confirm__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mh-confirm__actions .btn2 {
    flex: 1;
    margin: 0;
}
.mh-confirm__cancel {
    flex: 1;
    height: 51px;
    border: 1px solid var(--mh-border);
    border-radius: 30px;
    background: #ffffff;
    color: var(--mh-text);
    font-size: 14px;
    cursor: pointer;
}
.mh-confirm__cancel:hover {
    border-color: var(--mh-text);
}

/* reCAPTCHA en pantallas angostas */
@media (max-width: 400px) {
    #customer-popup .popup-form {
        padding: 18px 16px 22px;
    }
    #customer-popup .mh-recaptcha {
        transform: scale(0.88);
        transform-origin: 0 0;
    }
}

/* ===================== Tarjeta de inmueble ===================== */

/* Home, /inmuebles, mapa, similares de la ficha y "Mis favoritos" (clase
   mh-property-card en cada vista). Esquinas redondeadas, también en la foto. */
.card.mh-property-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #ececf0;
    box-shadow: 0 10px 24px rgba(36, 37, 38, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card.mh-property-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(36, 37, 38, 0.14);
}

/* Carrusel de fotos (parcial property_card_images + property-card.js).
   Puntos arriba al centro: abajo están el precio (izquierda) y el corazón (derecha). */
.mh-gallery {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.mh-gallery__track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    will-change: transform;
}
.blog-image-container .mh-gallery__img {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: cover;
}
.mh-gallery__dots {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 3;
}
.mh-gallery__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: width 0.25s ease, background-color 0.25s ease;
}
.mh-gallery__dot.is-active {
    width: 18px;
    background-color: #ffffff;
}
.mh-gallery__dot:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .mh-gallery__track {
        transition: none;
    }
}

/* ===================== Pestañas del home (Venta / Arriendo) ===================== */

.mh-home-tabs__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 30px;
}
.section-heading.mh-home-tabs__heading {
    float: none;
    width: auto;
    margin-bottom: 0;
    text-align: left;
}
.mh-home-tabs__heading h2 {
    float: none;
    margin: 0;
}
/* Píldora gris; la pestaña activa queda blanca, como el fondo de la página */
.mh-home-tabs__nav {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 4px;
    border-radius: 30px;
    background-color: #efeff1;
}
.mh-home-tabs__nav .nav-item {
    margin: 0;
}
.mh-home-tabs__nav .nav-link {
    padding: 9px 20px;
    border: 0;
    border-radius: 26px;
    color: #6b6c70;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.mh-home-tabs__nav .nav-link:hover {
    color: var(--mh-text);
}
.mh-home-tabs__nav .nav-link.active {
    background-color: #ffffff;
    color: var(--mh-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
@media (max-width: 767px) {
    .mh-home-tabs__header {
        flex-direction: column;
        align-items: flex-start;
    }
    .mh-home-tabs__nav {
        width: 100%;
    }
    .mh-home-tabs__nav .nav-item {
        flex: 1;
    }
    .mh-home-tabs__nav .nav-link {
        text-align: center;
    }
}

/* ===================== Corazón de favoritos ===================== */

.mh-fav {
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.mh-fav:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
.mh-fav.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.mh-fav--card {
    position: absolute;
    right: 18px;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 22px;
    z-index: 3;
}
.mh-fav--card:hover {
    transform: scale(1.1);
}
.mh-fav--card.is-active {
    background-color: #ffffff;
    color: var(--mh-accent);
}
.mh-fav--detail {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--mh-accent);
    border-radius: 30px;
    color: var(--mh-accent);
    background-color: #ffffff;
    font-size: 15px;
    line-height: 1;
    margin: 0 0 10px 12px;
    white-space: nowrap;
}
.mh-fav--detail i {
    font-size: 20px;
}
.mh-fav--detail.is-active {
    background-color: var(--mh-accent);
    color: #ffffff;
}
.mh-fav--detail:focus-visible {
    outline-color: var(--mh-accent);
}

/* ===================== Aviso flotante ===================== */

.mh-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    border-radius: 6px;
    background-color: #242526;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 100000;
}
.mh-toast[hidden] {
    display: none;
}
.mh-toast__close {
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
}

/* ===================== Menú "Mi cuenta" del header ===================== */

/* Cuenta en la barra superior (escritorio) */
@media (min-width: 992px) {
    .mh-topbar-right {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 20px;
    }
}
.mh-topbar-account .mh-topbar-account__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    color: var(--color-btn-color, #ffffff);
    font-size: 15.5px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}
.mh-topbar-account .mh-topbar-account__link i {
    font-size: 19px;
}
.mh-topbar-account .mh-topbar-account__link:hover,
.mh-topbar-account .mh-topbar-account__link:focus {
    color: var(--color-btn-color, #ffffff);
    opacity: 0.85;
    text-decoration: none;
}
.mh-topbar-dropdown {
    position: relative;
}
.mh-topbar-account .mh-topbar-account__link {
    user-select: none;
}
.mh-topbar-account__menu {
    min-width: 210px;
    margin-top: 10px;
    padding: 6px 0;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1100;
}
.mh-topbar-account__menu .dropdown-item,
.mh-topbar-account__menu .dropdown-item-text {
    padding: 10px 18px;
    font-size: 14px;
    text-align: left;
}
.mh-topbar-account__menu .dropdown-item {
    color: var(--mh-text);
    background: transparent;
    border: 0;
    width: 100%;
    cursor: pointer;
}
.mh-topbar-account__menu .dropdown-item:hover {
    background-color: var(--mh-soft);
    color: var(--mh-accent);
}
.mh-topbar-account__menu .dropdown-item i {
    margin-right: 6px;
}
.mh-topbar-account__name {
    color: var(--mh-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--mh-border);
    margin-bottom: 4px;
}

/* Cuenta dentro del menú móvil: alineada como "Zona Clientes" y "Pagos en línea" */
@media (max-width: 991px) {
    .header .navbar-sign-content .mh-account-entry {
        width: 100%;
        margin: 0 !important;
    }
    .header .navbar-sign-content .mh-account-entry > .nav-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        margin: 0;
        text-align: left;
    }
    .header .navbar-sign-content .mh-account-entry > .nav-link i {
        top: 0;
        margin-right: 0;
    }
    .header .navbar-sign-content .mh-account-entry b {
        font-weight: 400;
    }
}
.mh-account-menu .dropdown-menu {
    min-width: 200px;
}
.mh-account-menu .mh-account-menu__name {
    color: var(--mh-muted);
    font-weight: 600;
    text-transform: none;
    cursor: default;
}
.mh-account-menu .mh-account-menu__name:hover {
    background: transparent;
}
.mh-account-menu__logout {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

/* ===================== Página "Mis favoritos" ===================== */

.popular-listing.mh-favorites {
    padding: 50px 0 70px;
}
/* Pestañas tipo píldora (Venta / Arriendo) */
.mh-favorites__bar {
    display: flex;
    justify-content: center;
    margin-bottom: 36px;
}
.mh-favorites__tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 40px;
    background-color: var(--mh-soft);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
.mh-favorites__tabs .nav-item {
    margin: 0;
}
.mh-favorites__tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 0;
    border-radius: 30px;
    color: var(--mh-muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.mh-favorites__tabs .nav-link i {
    font-size: 19px;
}
.mh-favorites__tabs .nav-link:hover {
    color: var(--mh-text);
}
.mh-favorites__tabs .nav-link.active {
    background-color: var(--mh-accent);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(199, 44, 65, 0.3);
}
.mh-favorites__count {
    display: inline-block;
    min-width: 24px;
    padding: 4px 7px;
    border-radius: 12px;
    background-color: #ffffff;
    color: var(--mh-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
}
.mh-favorites__tabs .nav-link.active .mh-favorites__count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.mh-favorites .mh-property-card {
    margin-bottom: 30px;
}
.mh-favorites__card .img-block {
    position: relative;
}
.mh-favorites__card.is-unavailable .img-block img {
    filter: grayscale(1);
    opacity: 0.6;
}
.mh-property-card.is-unavailable:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(36, 37, 38, 0.08);
}
.mh-favorites__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    background-color: #242526;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
}
.mh-favorites__empty {
    text-align: center;
    padding: 40px 16px;
}
.mh-favorites__empty[hidden] {
    display: none;
}
.mh-favorites__empty > i {
    font-size: 54px;
    color: var(--mh-accent);
}
.mh-favorites__empty p {
    color: var(--mh-text);
    font-size: 16px;
    margin: 10px 0 0;
}
.mh-favorites__empty .mh-favorites__hint {
    color: var(--mh-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===================== Páginas de cuenta (confirmación, restablecer) ===================== */

.mh-page-card {
    background: var(--mh-surface);
    border-radius: 12px;
    border-top: 5px solid var(--mh-accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    padding: 36px;
    margin: 50px 0 70px;
}
.mh-page-card h2 {
    color: var(--mh-text);
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0;
}
.mh-page-card p {
    color: var(--mh-muted);
    font-size: 15px;
    line-height: 1.6;
}
.mh-page-card__icon {
    font-size: 54px;
    color: var(--mh-accent);
}
.mh-page-card form {
    margin-top: 20px;
    text-align: left;
}
.mh-page-card .form-field input {
    width: 100%;
}
.mh-page-card .btn2 {
    width: 100%;
    margin-top: 10px;
}
.mh-resend-form__message {
    margin-top: 14px;
    text-align: center;
}
.mh-resend-form__message[hidden] {
    display: none;
}

@media (max-width: 767px) {
    .mh-favorites__tabs .nav-link {
        padding: 10px 16px;
    }
    .mh-page-card {
        padding: 28px 16px;
        margin: 30px 0 50px;
    }
    .mh-fav--detail {
        margin: 10px 0;
    }
}

/* Con el modal abierto se oculta el botón flotante de chat (GetButton), que en
   móvil queda encima del botón "Crear cuenta" */
body.mh-account-open [id^="gb-widget"] {
    display: none !important;
}
