:root {
    --orange: #ff6a1a;
    --white: #fff;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

*,
::before,
::after {
    box-sizing: border-box;
}

.row {
    margin-right: 0;
}

#content {
    margin-top: 5rem;
}

#footer {
    width: 100%;
    margin-top: auto;
}

.navbar {
    position: fixed;
    z-index: 1000;
    top: 0;
    background-color: var(--orange);
    width: 100%;
}

.badge-lg {
    font-size: .9em;
    font-weight: 600;
}

.btn-round {
    border-radius: 2rem;
    padding-left: .75rem;
    padding-right: .75rem;
}

.btn-orange,
.btn-outline-orange {
    color: var(--white);
    border-color: var(--orange);
    background-color: var(--orange);
}

.btn-outline-orange {
    color: var(--orange);
    background-color: transparent;
}

.btn-orange:hover,
.btn-outline-orange:hover {
    color: var(--white);
    border-color: var(--orange);
    background-color: var(--orange);
}

.truncate-text {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.rounded-md {
    border-radius: 1rem;
}

.page-item.disabled {
    color: #7c98a7;
    /* padding: .375rem .75rem; */
    position: relative;
    display: block;
    background-color: #fff;
}

.btn:focus,
textarea.form-control:focus,
input.form-control:focus {
    border-color: #ff6a1a;
    box-shadow: 0 0 0 0.15rem rgba(255, 105, 26, 0.25);
}

textarea {
    resize: none;
}

.w-fit {
    width: fit-content;
}

a.logo {
    max-width: 160px;
    border-radius: 100%;
}

img.logo {
   max-width: 80px;
   cursor: pointer;
   border-radius: 100%;
   border: 1px solid #ccc;
   transition: .3s ease;
}

.badge-primary{
    color: #0067d5;
    border: 1px solid var(--bs-primary);
    background: #007bff10;
}

.badge-success {
    color: #1e7c33;
    border: 1px solid var(--bs-success);
    background: #28a74610;
}

.badge-secondary {
    color: #636b73;
    border: 1px solid var(--bs-secondary);
    background: #6c757d10;
}

.badge-warning {
    color: #a9540d;
    border: 1px solid var(--orange);
    background: #fd7e1410;
}

.header img.logo {
    width: 48px;
    height: 48px;
}

#filtros label {
    user-select: none;
}

.filtro-btn {
    display: inline-block;
    padding: .35em .65em;
    font-size: .75em;
    max-width: 175px;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.15;
    color: #4b5055;
    background-color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border: 1px solid #6c757d;
    border-radius: 50rem;
    cursor: pointer;
    user-select: none;
}

.filtro-btn:hover {
    background-color: #6c757d10;
}

.filtro-btn:active {
    background-color: #6c757d30;

}

.filtro-btn.selected {
    color: #fff;
    background-color: #737a80;
}

.filtro-btn.selected:hover {
    background-color: #5c636a;
}

#range-container {
    position: relative;
    margin-bottom: 1.5rem;
}

input[type="range"]{
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    position: absolute;
    background-color: transparent;
    pointer-events: none;
    width: 100%;
    margin: auto;
    top: 0;
    bottom: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    -webkit-appearance: none;
    height: 5px;
}

input[type="range"]::-moz-range-track {
    -moz-appearance: none;
    height: 5px;
}

input[type="range"]::-ms-track {
    appearance: none;
    height: 5px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 1rem;
    width: 1rem;
    background-color: #ff6a1a;
    cursor: pointer;
    border-radius: 10px;
    pointer-events: auto;
    margin-top: -5px;
}

input[type="range"]::-moz-range-thumb {
    -moz-appearance: none;
    height: 1rem;
    width: 1rem;
    background-color: #ff6a1a;
    cursor: pointer;
    border-radius: 10px;
    pointer-events: auto;
    margin-top: -5px;
}

input[type="range"]::-ms-thumb {
    appearance: none;
    height: 1rem;
    width: 1rem;
    background-color: #ff6a1a;
    cursor: pointer;
    border-radius: 10px;
    pointer-events: auto;
    margin-top: -5px;
}

input[type="range"]:active::-webkit-slider-thumb {
    background-color: #ce591a;
}

#range-track {
    width: 100%;
    height: 5px;
    position: absolute;
    margin: auto;
    top: 0;
    bottom: 0;
    border-radius: 5px;
}

#range-values {
    position: relative;
    width: fit-content;
    margin: 0 auto 15px;
    padding: 5px 10px;
    background-color: #ff6a1a;
    border-radius: 5px;
    text-align: center;
    color: #fff;
    font-size: .8rem;
    font-weight: 500;
}

#range-values::before {
    content: "";
    position: absolute;
    height: 0;
    width: 0;
    border-top: 10px solid #ff6a1a;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    margin: auto;
    bottom: -10px;
    left: 0;
    right: 0;
}

#propiedades {
    padding: 0;
}

#propiedades li {
    list-style: none;
}

li.propiedad {
    display: flex;
    position: relative;
    background-color: #fff;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    flex-direction: row;
    border: none;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: .75rem;
}

li.propiedad img {
    height: 200px;
    width: 300px;
    object-fit: cover;
    flex-shrink: 0;
    border-top-left-radius: .75rem;
    border-bottom-left-radius: .75rem;
    border: 1px solid #ced4da;
}

li.propiedad:hover {
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .15);
}

#detalle-propiedad {
    width: 50%;
    margin: auto;
}

#detalle-propiedad img.fachada {
    width: 100%;
    height: 375px;
    object-fit: cover;
    border-radius: 1rem;
    transition: all .2s ease-out;
}

#detalle-propiedad img.fachada:hover {
    transform: scale(1.01);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.breadcrumb {
    flex-wrap: nowrap;
}

.fachada-full {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    border-radius: 1rem;
}

img.logo-rc {
    border-radius: 50%;
    border: 1px solid #ddd;
}

img.logo-rc-sm {
    border-radius: 50%;
    width: 16px;
    height: 16px;
}

li.propiedad img.logo-rc {
    width: 25px;
    height: 25px;
}

#detalle-propiedad img.logo-rc {
    width: 55px;
    height: 55px;
}

#mapa {
    border-radius: 1rem;
    height: 375px;
    width: 100%;
    border: 0;
    margin-top: 2rem;
}

.backdrop {
    display: none;
}

.paginator {
    border: none;
    margin: 2.5rem auto 5rem;
    width: fit-content;
}

.paginator .page-item {
    padding: .35rem .75rem;
    text-decoration: none;
    font-weight: 500;
    color: #6c757d;
    border-radius: .25rem;
    transition: all .2s ease;
}

.paginator .page-item.active {
    color: #fff;
    background-color: #ff6a1a;
}

.paginator .page-item.disabled {
    padding: .375rem .5rem;
}

.paginator .page-item.disabled svg {
    stroke: #adb5bd;
}

.paginator .page-item:not(.disabled, .active):hover {
    background-color: #e9ecef;
}

@media screen and (min-width:769px) and (max-width: 1200px) {
    #propiedades {
        width: 100%;
    }

    #detalle-propiedad {
        width: 90%;
        padding-left: 3rem;
        padding-right: 3rem;
    }
}

@media screen and (max-width: 768px) {
    #propiedades {
        width: 100%;
        padding: 0 3rem;
    }

    #detalle-propiedad {
        width: 75%;
    }

    #mapa,
    #detalle-propiedad img.fachada {
        height: 250px;
    }

    .backdrop {
        display: block;
    }

    .window {
        position: fixed;
        z-index: 1050;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        visibility: hidden;
        background-color: #fff;
        background-clip: padding-box;
        outline: 0;
        transition: transform .3s ease, visibility .3s ease;
        bottom: 0;
        right: 0;
        left: 0;
        height: fit-content;
        padding: 1rem 0;
        overflow-x: hidden;
        max-height: 75%;
        border-top: 1px solid rgba(0,0,0,.2);
        transform: translateY(100%);
    }

    .window.show {
        transform: none;
        visibility: visible;
    }

    .window.show + .backdrop {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1040;
        width: 100vw;
        height: 100vh;
        background-color: #000;
        opacity: .5;
    }

    body.window-open {
        overflow: hidden;
    }

}

@media screen and (max-width:480px){
    #propiedades {
        width: 100%;
        padding: 0 1rem;
    }

    li.propiedad {
        flex-direction: column;
    }

    li.propiedad img {
        width: 100%;
        border-top-right-radius: .75rem;
        border-bottom-left-radius: 0;
    }

    #detalle-propiedad {
        width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    #mapa,
    #detalle-propiedad img.fachada {
        height: 200px;
    }
}

.btn-hoverable {
    background: #fff;
    padding: 0 .5rem;
    margin: .25rem .45rem;
    border: none;
}

.btn-hoverable:hover {
    background: #e9ecef;
}

.btn-hoverable:active {
    background: #d6dadd;
}

.card.button {
    cursor: pointer;
    border: none;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

.card.button:hover {
    box-shadow: 0 10px 18px rgb(0 0 0 / 10%);
}

/* ── Listing toolbar (sort + view toggle) ── */
.listing-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.listing-toolbar .form-select {
    font-size: .85rem;
    color: #4b5055;
}

/* ── Grid view ── */
#propiedades.grid-view > ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 0;
}

#propiedades.grid-view li.propiedad {
    flex-direction: column;
    margin: 0;
}

#propiedades.grid-view li.propiedad > a img,
#propiedades.grid-view li.propiedad img {
    width: 100%;
    height: 180px;
    border-radius: .75rem .75rem 0 0;
    border-bottom-left-radius: 0;
}

/* ── Badge de filtros activos (móvil) ── */
.badge.bg-orange {
    background-color: #ff6a1a;
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: .6rem;
    min-width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50rem;
    padding: 0 .3rem;
}

/* ── Mobile: image full-width in list view ── */
@media (max-width: 576px) {
    li.propiedad {
        flex-direction: column;
    }

    li.propiedad > a img,
    li.propiedad img {
        width: 100%;
        height: 180px;
        border-radius: .75rem .75rem 0 0;
        border-bottom-left-radius: 0;
    }
}

/* ── Precios en tarjeta ── */
.precio-row {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    line-height: 1.3;
}

.precio-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    white-space: nowrap;
}

.precio-label.credito {
    color: #ff6a1a;
}

.precio-valor {
    font-size: .95rem;
    font-weight: 600;
    color: #212529;
}

.precio-row.contado .precio-valor {
    font-size: .85rem;
    font-weight: 500;
    color: #6c757d;
}

/* ── Panel de filtros con secciones colapsables ── */
.filtro-section {
    border-bottom: 1px solid #f0f0f0;
}

.filtro-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 1rem;
    cursor: pointer;
    font-size: .875rem;
    font-weight: 600;
    color: #343a40;
    user-select: none;
    transition: background .15s ease;
}

.filtro-section-header:hover {
    background: #f8f9fa;
}

.filtro-chevron {
    font-size: .75rem;
    color: #adb5bd;
    transition: transform .2s ease;
}

.filtro-section-body {
    padding: .5rem 1rem .75rem;
    overflow: hidden;
    transition: max-height .25s ease, padding .25s ease;
}

.filtro-section-body.collapsed {
    max-height: 0 !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* ── Checkboxes tipo de compra ── */
.filtro-check {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    font-size: .875rem;
    color: #4b5055;
    padding: .2rem 0;
}

.filtro-check input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #ff6a1a;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Rango de precio dentro de tipo de compra ── */
.filtro-rango {
    margin-top: .6rem;
    padding: .5rem .75rem;
    background: #f8f9fa;
    border-radius: .5rem;
}

.filtro-rango-valores {
    display: flex;
    justify-content: space-between;
    font-size: .78rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: .35rem;
}
