/**
 * 📱 PORTAL INMOBILIARIO DOMIA - RESPONSIVE & MOBILE POLISH
 * Experiencia táctil fluida, diseño adaptable y proporciones elásticas.
 */

/* 📱 STICKY BARRA DE CONVERSIÓN MÓVIL (En detalle de propiedad) */
.mobile-sticky-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: var(--border-subtle);
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mobile-sticky-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: var(--container-max);
    margin: 0 auto;
}

.mobile-sticky-cta__price {
    display: flex;
    flex-direction: column;
}

.mobile-sticky-cta__price-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.mobile-sticky-cta__price-val {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary-ink);
    line-height: 1.1;
}

/* 📱 MENÚ FLOTANTE MÓVIL INFERIOR (THUMB-ACCESSIBLE DOCK - 4 ACCIONES RÁPIDAS) */
.mobile-bottom-dock {
    display: none;
}

/* 💻 TABLETS Y DISPOSITIVOS MEDIANOS (< 992px) */
@media (max-width: 992px) {
    .portal-nav-toggle {
        display: block;
    }

    .portal-nav-links {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        background: var(--brand-primary);
        flex-direction: column;
        align-items: flex-start;
        padding: 24px var(--container-padding);
        gap: 20px;
        box-shadow: var(--shadow-elevated);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateY(-150%);
        transition: transform var(--transition-base);
        z-index: 999;
    }

    .portal-nav-links.is-open {
        transform: translateY(0);
    }

    .portal-nav-link {
        font-size: 1.1rem;
        width: 100%;
        padding: 8px 0;
        color: var(--brand-primary-contrast);
    }

    /* HERO ASIMÉTRICO EN TABLET (COBERTURA TOTAL SIN DESFASAJE NI BORDES AZULES) */
    .portal-hero-slider {
        min-height: 74vh;
        padding-bottom: 0 !important;
        position: relative;
        overflow: hidden;
    }

    .hero-slide {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        z-index: 1;
    }

    .hero-slide.is-active {
        opacity: 1 !important;
        pointer-events: auto;
        z-index: 2;
    }

    .hero-slide__bg {
        position: absolute;
        inset: -50px;
        width: calc(100% + 100px);
        height: calc(100% + 100px);
        background-size: cover;
        background-position: center;
        z-index: 0;
    }

    .hero-slide__overlay {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        pointer-events: none;
        background: linear-gradient(
            180deg, 
            rgba(var(--brand-primary-deep-rgb, 15, 23, 42), 0.94) 0%, 
            rgba(var(--brand-primary-deep-rgb, 15, 23, 42), 0.82) 55%, 
            rgba(var(--brand-primary-deep-rgb, 15, 23, 42), 0.48) 100%
        ) !important;
    }

    .hero-slide__container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 40px;
        padding-bottom: 70px;
        position: relative;
        z-index: 2;
        width: 100%;
    }

    .search-box-fields {
        grid-template-columns: 1fr 1fr;
    }

    .search-box-fields .portal-btn {
        grid-column: span 2;
    }

    .location-popover {
        width: 100%;
    }

    .vitrina-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .portal-about__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .exp-panel.is-active {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .portal-contact-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .portal-about__image {
        min-height: 300px;
    }

    .portal-footer__grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .catalog-page-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        display: none;
        position: static;
    }

    .filter-sidebar.is-visible-mobile {
        display: block;
        margin-bottom: 24px;
    }

    .filter-toggle-mobile-btn {
        display: inline-flex !important;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .lead-inquiry-card {
        position: static;
        margin-top: 32px;
    }
}

/* 📱 SMARTPHONES Y MÓVILES (< 768px) - VISTA MÓVIL PRINCIPAL */
@media (max-width: 768px) {
    :root {
        --navbar-height: 64px;
    }

    /* 🏷️ BARRA SUPERIOR MÓVIL: SÓLO ISOLOGO + BOTONES DE ACCIÓN EN ÍCONO */
    .portal-navbar__inner {
        padding: 0 14px;
        justify-content: space-between;
    }

    .portal-brand {
        flex: 0 1 auto;
        min-width: 0;
        gap: 0;
    }

    .portal-brand .portal-brand__name {
        display: none !important;
    }

    .portal-navbar.is-floating-dock {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        padding: 0 12px !important;
    }

    .portal-brand__logo {
        box-sizing: content-box;
        height: 36px;
        width: auto;
        max-width: 155px;
        object-fit: contain;
        padding: 4px 8px;
        border-radius: 9px;
    }

    .nav-section-indicator {
        display: none !important;
    }

    .portal-navbar__actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    /* BOTONES SÓLO ÍCONO TÁCTIL EN EL HEADER */
    .portal-navbar .portal-btn--consignar,
    .portal-navbar .portal-btn--propietarios,
    .portal-navbar .portal-menu-trigger {
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: unset;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .portal-navbar .portal-btn--consignar span,
    .portal-navbar .portal-btn--consignar span.btn-text,
    .portal-navbar .portal-btn--propietarios span,
    .portal-navbar .portal-btn--propietarios span.btn-text,
    .portal-navbar .portal-menu-trigger span {
        display: none !important;
    }

    .portal-navbar .portal-btn--consignar i,
    .portal-navbar .portal-btn--propietarios i,
    .portal-navbar .portal-menu-trigger i {
        font-size: 1.25rem !important;
        margin: 0 !important;
        line-height: 1;
    }

    /* CONSIGNAR DESTACADO EN NAVBAR MÓVIL (100% CONTRASTE SIEMPRE) */
    .portal-navbar .portal-btn--consignar {
        background: var(--brand-accent) !important;
        border: 1px solid var(--brand-accent) !important;
        color: var(--brand-accent-contrast) !important;
        box-shadow: 0 3px 10px rgba(var(--brand-accent-rgb), 0.35);
    }

    .portal-navbar .portal-btn--consignar i {
        color: var(--brand-accent-contrast) !important;
    }

    /* BOTONES ALARGADOS Y COMPLETOS EN EL FOOTER DEL DRAWER MÓVIL */
    .portal-menu-drawer .drawer-action-btn {
        width: 100% !important;
        height: auto !important;
        padding: 10px 18px !important;
        border-radius: var(--radius-full) !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.88rem !important;
        font-weight: 600 !important;
        background: var(--brand-accent) !important;
        color: var(--brand-accent-contrast) !important;
        border: 1px solid var(--brand-accent) !important;
    }

    .portal-menu-drawer .drawer-action-btn span {
        display: inline !important;
    }

    .portal-menu-drawer .drawer-action-btn i {
        font-size: 1.15rem !important;
        margin-right: 6px !important;
    }

    .portal-menu-drawer .drawer-portales-row {
        gap: 8px;
    }

    .portal-menu-drawer .drawer-action-btn-sm {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
    }

    .portal-menu-drawer .drawer-social-row {
        margin: 2px 0;
    }

    .portal-menu-drawer .drawer-social-row .social-pill-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.1rem !important;
    }

    .portal-menu-drawer .drawer-footer-info {
        font-size: 0.75rem;
        gap: 10px;
        padding-top: 2px;
    }

    /* 🖼️ HERO MÓVIL: MÁXIMO CONTRASTE Y LEGIBILIDAD (COBERTURA TOTAL SIN BORDES AZULES) */
    .portal-hero-slider {
        padding-bottom: 0 !important;
        min-height: 74vh;
        position: relative;
        overflow: hidden;
    }

    .hero-slide {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 74vh;
    }

    .hero-slide__bg {
        position: absolute;
        inset: -36px;
        width: calc(100% + 72px);
        height: calc(100% + 72px);
        background-size: cover;
        background-position: var(--hero-pos-mobile, 76% 22%);
        transform-origin: var(--hero-pos-mobile, 76% 22%);
        z-index: 0;
    }

    .hero-slide__content {
        opacity: 1 !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        height: 100% !important;
        justify-content: flex-end !important;
    }

    .hero-slide__clear-side {
        display: none !important;
    }

    .hero-kinetic-cycler {
        margin-bottom: 14px !important;
    }

    .hero-slide__overlay {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        pointer-events: none;
        background: linear-gradient(
            180deg, 
            rgba(var(--brand-primary-deep-rgb, 12, 17, 24), 0.14) 0%, 
            rgba(var(--brand-primary-deep-rgb, 12, 17, 24), 0.22) 42%, 
            rgba(var(--brand-primary-deep-rgb, 12, 17, 24), 0.78) 68%, 
            rgba(var(--brand-primary-deep-rgb, 12, 17, 24), 0.95) 100%
        ) !important;
    }

    .hero-slide__container {
        position: relative;
        z-index: 2;
        width: 100%;
        height: 100%;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
        padding-top: 96px;
        padding-bottom: 54px;
    }

    .hero-slide__actions {
        margin-top: 12px !important;
        padding-top: 4px !important;
        margin-bottom: 6px !important;
    }

    .hero-kinetic-title {
        font-size: clamp(1.65rem, 5.8vw, 2.2rem) !important;
        color: #FFFFFF !important;
        line-height: 1.22;
        text-shadow: 0 3px 20px rgba(0, 0, 0, 0.85), 0 1px 4px rgba(0, 0, 0, 0.95) !important;
        font-weight: 700;
    }

    .hero-kinetic-item {
        opacity: 0;
    }

    .hero-kinetic-item.is-visible {
        opacity: 1 !important;
        visibility: visible;
    }

    .hero-kinetic-cycler {
        min-height: 125px;
    }

    .hero-kinetic-icon-wrapper {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .hero-slide__actions {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        margin-top: 24px;
    }

    .hero-slide__actions .portal-btn {
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    }

    .search-box-fields {
        grid-template-columns: 1fr;
    }

    .search-box-fields .portal-btn {
        grid-column: span 1;
    }

    .properties-grid {
        grid-template-columns: 1fr;
    }

    .portal-footer__grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .portal-footer__bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .specs-pills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 📱 MENÚ FLOTANTE MÓVIL INFERIOR (THUMB DOCK DE 4 ACCIONES RÁPIDAS) */
    .mobile-bottom-dock {
        display: flex;
        position: fixed;
        bottom: 14px;
        left: 14px;
        right: 14px;
        max-width: 410px;
        margin: 0 auto;
        z-index: 998;
        background: rgba(var(--brand-primary-deep-rgb, 12, 17, 24), 0.94);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(var(--brand-accent-rgb, 194, 103, 61), 0.48);
        border-radius: 36px;
        box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45), 0 0 18px rgba(var(--brand-accent-rgb, 194, 103, 61), 0.18);
        padding: 6px 8px;
        align-items: center;
        justify-content: space-around;
        transform: translateY(140%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease, border-color 0.3s ease;
    }

    .mobile-bottom-dock.is-visible {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-dock-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.72);
        text-decoration: none;
        padding: 6px 2px;
        cursor: pointer;
        position: relative;
        font-family: var(--font-body);
        transition: color 0.2s ease, transform 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-dock-btn:active {
        transform: scale(0.92);
    }

    .mobile-dock-btn i {
        font-size: 1.35rem;
        line-height: 1;
        display: block;
    }

    .mobile-dock-label {
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1;
    }

    .mobile-dock-btn.is-active,
    .mobile-dock-btn:hover {
        color: #FFFFFF;
    }

    /* 🟢 WHATSAPP DESTACADO EN EL DOCK MÓVIL CON PULSO RADAR */
    .mobile-dock-btn--wa {
        color: #25D366 !important;
    }

    .mobile-dock-pulse {
        position: absolute;
        top: 6px;
        right: 18px;
        width: 7px;
        height: 7px;
        background-color: #25D366;
        border-radius: 50%;
        box-shadow: 0 0 0 rgba(37, 211, 102, 0.6);
        animation: mobileWaPulse 2s infinite;
    }

    @keyframes mobileWaPulse {
        0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.8); }
        70% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0); }
        100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
    }

    /* 🌓 MENÚ FLOTANTE MÓVIL EN MODO CLARO (.dock--light) SINCRONIZADO CON EL SUPERIOR */
    .mobile-bottom-dock.dock--light {
        background: rgba(255, 255, 255, 0.94) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(var(--brand-primary-rgb), 0.16) !important;
        box-shadow: 0 16px 40px rgba(var(--brand-primary-deep-rgb), 0.14), 0 0 14px rgba(var(--brand-accent-rgb), 0.18) !important;
    }

    .mobile-bottom-dock.dock--light .mobile-dock-btn {
        color: var(--brand-primary-ink) !important;
    }

    .mobile-bottom-dock.dock--light .mobile-dock-btn.is-active,
    .mobile-bottom-dock.dock--light .mobile-dock-btn:hover {
        color: var(--brand-accent-ink) !important;
    }

    .mobile-bottom-dock.dock--light .mobile-dock-btn--wa {
        color: #15803D !important;
    }

    /* OCULTAR EL BOTÓN FLOTANTE TRADICIONAL EN MÓVIL (INTEGRADO EN EL DOCK) */
    .portal-whatsapp-floating {
        display: none !important;
    }

    /* PADDING INFERIOR PARA QUE NINGÚN CONTENIDO QUEDE TAPADO POR EL DOCK */
    body {
        padding-bottom: 84px !important;
    }
}
