/* ==========================================================================
   Modern Tech theme overrides — Propiedades CM
   Uniform design system layered on top of style.css (loaded after it).
   ========================================================================== */

:root {
    --accent-color: #7c3aed;
    --accent-color-2: #06b6d4;
    --ink-900: #0f172a;
    --ink-800: #1e293b;
    --ink-600: #475569;
    --surface-0: #ffffff;
    --surface-50: #f8fafc;
    --surface-100: #f1f5f9;
    --border-soft: rgba(15, 23, 42, 0.08);

    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    --gradient-dark: linear-gradient(135deg, #0b1220 0%, #16233f 100%);
    --gradient-text: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color-2) 100%);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --shadow-soft: 0 2px 10px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-elevated: 0 24px 48px -16px rgba(15, 23, 42, 0.3);
    --shadow-glow: 0 0 0 4px rgba(14, 165, 233, 0.16);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Base ---------- */

body {
    color: var(--ink-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: var(--ink-900);
}

a {
    transition: color 0.25s var(--ease);
}

::selection {
    background: var(--primary-color);
    color: #fff;
}

/* Scrollbar accents */
.suggestion::-webkit-scrollbar-thumb,
.search-box .list-of-suggetions::-webkit-scrollbar-thumb {
    background-color: var(--primary-color) !important;
}

/* ---------- Top utility bar ---------- */

.bravo_topbar {
    background: var(--gradient-dark) !important;
    position: relative;
    z-index: 10;
}

.bravo_topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--gradient-text);
    opacity: 0.9;
}

.bravo_topbar .topbar-left a:hover,
.bravo_topbar .top-socials a:hover {
    color: var(--accent-color-2) !important;
}

/* ---------- Main navigation (glass) ---------- */

/* Note: backdrop-filter is intentionally NOT used here. Applying it to
   .topmenu (an ancestor of the fixed-position mobile menu panel) would
   create a new containing block for position:fixed descendants, breaking
   the mobile nav's height:100% panel. Translucency alone keeps the glass
   look without that side effect. */
.topmenu {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid var(--border-soft);
    box-shadow: none !important;
}

.topmenu .header-sticky {
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: var(--shadow-card) !important;
}

.topmenu .bg-light {
    background: transparent !important;
}

.main-menu-nav .nav-link,
.navbar-nav .nav-item > a {
    font-weight: 600;
    color: var(--ink-800) !important;
}

.navbar-nav .nav-item > a:hover,
.navbar-nav .nav-item > a.active {
    color: var(--primary-color) !important;
}

/* ---------- Buttons ---------- */

.btn,
.btn-primary,
.btn-special,
.add-property,
.topsearch .btn,
.change-view i.active,
button.btn {
    border-radius: var(--radius-md) !important;
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease) !important;
}

.btn-primary,
.btn-special,
.add-property,
.topsearch .btn,
#properties-list .btn-primary,
.search-box .btn-primary {
    background: var(--gradient-primary) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover,
.btn-special:hover,
.add-property:hover,
.topsearch .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    color: #fff !important;
    background: var(--gradient-primary) !important;
}

.btn-outline {
    border-radius: var(--radius-md);
    border: 2px solid var(--ink-900);
}

.change-view i {
    border-radius: var(--radius-sm) !important;
}

.change-view i.active {
    background: var(--gradient-primary) !important;
    border-color: transparent !important;
}

/* ---------- Forms & search ---------- */

.form-control,
.select--arrow .form-control,
.search-box .form-control,
.search-box .dropdown .dropdown-toggle,
.topsearch .form-control {
    border-radius: var(--radius-md) !important;
    border-color: var(--border-soft);
    transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease) !important;
}

.form-control:focus,
.search-box .dropdown .dropdown-toggle:focus {
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-glow) !important;
}

.topsearch .input-group-text,
.topsearch .btn,
.topsearch .typesearch a {
    border-radius: var(--radius-md) !important;
}

.topsearch .input-group-lg {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    background-color: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(6px);
}

.topsearch .typesearch a.active {
    background: var(--gradient-primary) !important;
    border-radius: var(--radius-sm) !important;
}

.search-box {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.form-group--inline .form-control {
    border-radius: var(--radius-pill) !important;
}

/* ---------- Hero ---------- */

.home_banner {
    position: relative;
    background-color: var(--ink-900);
}

.home_banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.35) 0%, rgba(15, 23, 42, 0.65) 100%);
    z-index: 0;
}

.home_banner > * {
    position: relative;
    z-index: 1;
}

.banner-text-description {
    letter-spacing: -0.01em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

/* ---------- Cards: properties / projects / blog / agents ---------- */

.hourseitem,
.projecthome .item,
.list-agency .agents-grid,
.blog-container .container-grid .grid-in,
.boxright {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-card) !important;
    border: 1px solid var(--border-soft);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease) !important;
    background: var(--surface-0);
}

.hourseitem:hover,
.projecthome .item:hover,
.list-agency .agents-grid:hover,
.blog-container .container-grid .grid-in:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-elevated) !important;
}

.hourseitem .img .thumb,
.projecthome .item .img img.thumb,
.list-agency .fr-grid-thumb,
.list-agency .fr-grid-thumb img,
.blog-container .grid-in .blog-img img {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.hourseitem .info,
.projecthome .item .description,
.blog-container .grid-h {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--surface-0) !important;
}

.box_shadow .projecthome .item,
.box_shadow .homehouse .hourseitem {
    box-shadow: var(--shadow-card) !important;
}

/* Price / type ribbon → clean gradient chips */
.item-price-wrap {
    gap: 6px;
    left: 10px;
    bottom: 10px;
}

.item-price-wrap li {
    border-radius: var(--radius-pill) !important;
    background: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(4px);
    padding: 4px 14px !important;
}

.item-price-wrap li.h-type {
    background: var(--gradient-primary) !important;
    margin-right: 6px !important;
}

.item-price-wrap li:not(.h-type):before,
.item-price-wrap li:not(:last-child):after {
    display: none !important;
}

.status-label {
    border-radius: var(--radius-pill);
    background: var(--gradient-primary);
    padding: 4px 12px;
    font-weight: 700;
}

/* Agent grid */
.list-agency .agents-grid .fr-grid-footer-flex-right .prt-view {
    background: var(--gradient-primary) !important;
    border-radius: var(--radius-pill) !important;
    font-weight: 700;
}

.list-agency .agents-grid .agent-email a {
    background: var(--surface-100);
}

.list-agency .agents-grid .agent-email a:hover {
    background: var(--gradient-primary);
    color: #fff !important;
}

/* ---------- Badges / socials ---------- */

.socials ul li a {
    border-radius: var(--radius-pill);
    background: var(--gradient-primary) !important;
    border: none !important;
    transition: transform 0.25s var(--ease);
}

.socials ul li a:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--gradient-primary) !important;
    color: #fff !important;
}

/* ---------- Pagination ---------- */

.pagination .page-link {
    border-radius: var(--radius-sm) !important;
    border: none;
    margin: 0 3px;
    color: var(--ink-800);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary) !important;
    color: #fff !important;
}

.pagination .page-item.disabled .page-link {
    background: var(--surface-100) !important;
}

/* ---------- Footer ---------- */

footer {
    position: relative;
    background: linear-gradient(180deg, var(--surface-0) 0%, var(--surface-50) 100%) !important;
    border-top: none !important;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-text);
}

footer h3,
footer h4,
footer h5 {
    font-weight: 800 !important;
}

/* ---------- Misc polish ---------- */

.breadcrumb {
    background: transparent;
}

.itemarea {
    border-radius: var(--radius-md);
}

.alert,
#alert-container .alert {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-card);
}

.language_bar_chooser.dropdown-menu,
.dropdown-menu {
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-card) !important;
    border: 1px solid var(--border-soft) !important;
}

/* ---------- Responsive refinements ---------- */

@media (max-width: 991px) {
    .main-menu-content {
        background: var(--surface-0) !important;
        box-shadow: var(--shadow-elevated);
    }

    .hourseitem,
    .projecthome .item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 767px) {
    .banner-text-description {
        font-size: 1.6em;
    }

    .topsearch .input-group-lg {
        padding: 16px 12px 4px;
    }

    .item-price-wrap li {
        padding: 3px 10px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .hourseitem,
    .projecthome .item,
    .list-agency .agents-grid,
    .blog-container .container-grid .grid-in {
        border-radius: var(--radius-md) !important;
    }

    .hourseitem .img .thumb,
    .projecthome .item .img img.thumb,
    .list-agency .fr-grid-thumb,
    .blog-container .grid-in .blog-img img {
        border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
    }
}

/* ==========================================================================
   WhatsApp flotante + Asistente IA — CM Soporte Manizales
   ========================================================================== */

/* Botón flotante de WhatsApp (reemplaza el teléfono) */
.action_footer .cm-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff !important;
    box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
    animation: cm-wa-pulse 2.4s infinite;
}

.action_footer .cm-whatsapp-btn:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.6);
    color: #fff !important;
}

@keyframes cm-wa-pulse {
    0% { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 8px 22px rgba(37, 211, 102, 0.45), 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Asistente IA flotante */
#cm-ai-assistant {
    position: fixed;
    right: 20px;
    bottom: 90px;
    z-index: 1000000;
}

#cm-ai-assistant .cm-ai-toggle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-elevated);
    transition: transform 0.25s var(--ease);
}

#cm-ai-assistant .cm-ai-toggle:hover { transform: translateY(-3px) scale(1.06); }
#cm-ai-assistant.open .cm-ai-toggle { display: none; }

#cm-ai-assistant .cm-ai-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: var(--surface-0);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
    animation: cm-ai-in 0.25s var(--ease);
}

@keyframes cm-ai-in {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

#cm-ai-assistant .cm-ai-header {
    background: var(--gradient-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
}

#cm-ai-assistant .cm-ai-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
}

#cm-ai-assistant .cm-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-50);
}

#cm-ai-assistant .cm-ai-msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    word-wrap: break-word;
}

#cm-ai-assistant .cm-ai-msg.bot {
    align-self: flex-start;
    background: var(--surface-0);
    border: 1px solid var(--border-soft);
    color: var(--ink-800);
    border-bottom-left-radius: 4px;
}

#cm-ai-assistant .cm-ai-msg.user {
    align-self: flex-end;
    background: var(--gradient-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

#cm-ai-assistant .cm-ai-msg.typing { opacity: 0.6; font-style: italic; }

#cm-ai-assistant .cm-ai-wa-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

#cm-ai-assistant .cm-ai-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border-soft);
    background: var(--surface-0);
}

#cm-ai-assistant .cm-ai-input {
    flex: 1;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
}

#cm-ai-assistant .cm-ai-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

#cm-ai-assistant .cm-ai-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s var(--ease);
}

#cm-ai-assistant .cm-ai-send:hover { transform: scale(1.08); }

@media (max-width: 480px) {
    #cm-ai-assistant { right: 14px; bottom: 84px; }
    #cm-ai-assistant .cm-ai-panel { width: calc(100vw - 28px); height: 70vh; }
}

/* Enlace de WhatsApp en el pie de página */
footer .cm-footer-wa {
    display: inline-flex;
    align-items: center;
    color: #128c7e !important;
    font-weight: 700;
    text-decoration: none !important;
}
footer .cm-footer-wa i { color: #25d366; font-size: 1.15em; }
footer .cm-footer-wa:hover { color: #25d366 !important; }
