/* ========================================================= */
/* Reglas Generales y Reutilizables (sin cambios)           */
/* ========================================================= */

body {
    background-color: #f8f9fa;
    font-family: "Montserrat", sans-serif;
}

.listing-header {
    background: linear-gradient(45deg, var(--color-tema) 0%, #0e4e9b 100%);
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    color: #fff;
}

.listing-header h1 {
    font-weight: 700;
    margin-bottom: 20px;
}

.listing-header .stm-base-color {
    color: #fff;
    font-weight: 300;
}

.listing-tabs .nav-tabs {
    border-bottom: none;
}

.listing-tabs .nav-link {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-weight: 600;
    border-radius: 50px;
    padding: 10px 25px;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.listing-tabs .nav-link.active,
.listing-tabs .nav-link:hover {
    background-color: #fff;
    color: var(--color-tema);
    border-color: #fff;
}

.car-card {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    text-decoration: none !important;
    color: #333;
    display: block;
    transition: all 0.3s ease;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    color: #333;
}

.car-card .image-container img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.car-card .info-container {
    padding: 20px;
}

.car-card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-tema);
}

.car-card .title {
    font-size: 1.1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 5px 0 15px 0;
}

.car-card .features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.car-card .features li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-hover {
    transition: transform .15s ease, box-shadow .15s ease;
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .06);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
}

.card-img-top {
    height: 190px;
    object-fit: cover;
}

.tag-badge {
    font-weight: 500;
    background: #f1f3f5;
    color: #343a40;
    border: 1px solid #e9ecef;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn {
    font-weight: 600;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-header {
    position: relative;
    margin-bottom: 80px;
}

.profile-banner {
    width: 100%;
    /* height: 350px; */
    background-color: #e9ecef;
    background-position: center center;
    background-size: cover;
    border-radius: 0 0 0.5rem 0.5rem;
}

.profile-info-bar {
    background-color: #fff;
    padding: 1rem 2rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    /* align-items: center; */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, .075);
}

.profile-picture {
    position: absolute;
    left: 50px;
    bottom: 0;
    transform: translateY(25%);
    width: 160px;
    height: 160px;

    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15);
    background-color: #fff;

    object-fit: contain;
}

.profile-name {
    margin-left: 230px;
    font-weight: 700;
    font-size: 2rem;
    color: #343a40;
}

.sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}

.unified-sidebar-panel {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.unified-sidebar-panel .sidebar-section-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.filter-controls-sidebar .filter-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    font-weight: 500;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #343a40;
    transition: all 0.2s ease-in-out;
}

.filter-controls-sidebar .filter-btn:hover {
    background-color: #e9ecef;
}

.filter-controls-sidebar .filter-btn.active {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    border-color: var(--bs-primary) !important;
}

.product-card-v4 {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.product-card-v4:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.8rem 1.5rem rgba(0, 0, 0, .15) !important;
}

.product-card-v4 .card-img-top {
    height: 220px;
    object-fit: cover;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    gap: 0.75rem;
    max-height: 550px;
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item:first-child {
    grid-row: span 2;
}

.content-card,
.agent-card {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, .07);
    border: 1px solid #e9ecef;
}

.sidebar-sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 20px;
}

.section-title {
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-primary);
    display: inline-block;
}

.feature-list {
    columns: 2;
    padding-left: 1.5rem;
    gap: 1.5rem;
}

.feature-list li {
    margin-bottom: 0.5rem;
    color: #495057;
}

.feature-list li::marker {
    color: var(--bs-primary);
}

.agent-card .agent-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.agent-card .agent-header .agent-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: contain;
    margin: 0 auto 1rem;
    border: 3px solid #e9ecef;
}

.agent-card .property-price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(1px);
}

.loader-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    min-width: 260px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    text-align: center;
}

.loader-box .fa-gear {
    font-size: 42px;
    margin-bottom: 12px;
}

.property-card {
    background-color: #fff;
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, .1);
}

.property-card .card-img-container {
    position: relative;
}

.property-card .card-img-top {
    height: 220px;
    object-fit: cover;
}

.property-card .property-type-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.property-card .card-body {
    padding: 1.25rem;
}

.property-card .card-title {
    font-weight: 600;
    color: #212529;
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.75rem;
}

.property-card .card-address {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.property-card .property-features {
    display: flex;
    gap: 1rem;
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.property-card .card-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.sidebar-filter .card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .07);
}

.sidebar-filter .filter-heading {
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* ========================================================= */
/* Reglas Específicas para Móviles (< 768px)                */
/* ========================================================= */

@media (max-width: 768px) {

    /* Ajustes para el Header del Perfil */
    .profile-header {
        margin-bottom: 10px;
    }

    .profile-picture {
        position: absolute;
        bottom: 0;
        left: 80%;
        transform: translate(-50%, 25%);
        width: 120px;
        height: 120px;
        border-width: 3px;
    }

    .profile-info-bar {
        /* text-align: center; */
        flex-direction: column;
        padding: 1rem;
    }

    .profile-name {
        margin-left: 0;
        /* margin-top: 60px; */
        font-size: 1.2rem;
        /* text-align: left; */
        position: relative;
    }

    /* Ajustes para la Galería de Fotos */
    .gallery-grid {
        display: flex;
        flex-direction: column;
        max-height: none;
    }

    .gallery-item:first-child {
        grid-row: auto;
    }

    /* Ajustes para la Barra Lateral */
    .sidebar-sticky {
        position: static;
        top: 0;
        margin-bottom: 20px;
    }
}