/* Estilos personalizados adicionales para complementar Bootstrap */

:root {
    --primary-color: #0066cc;
    --secondary-color: #00a859;
    --dark-color: #333333;
    --light-color: #f8f9fa;
}

/* Sobrescribir variables de Bootstrap para usar nuestros colores */
:root {
    --bs-primary: var(--primary-color);
    --bs-secondary: var(--secondary-color);
    --bs-dark: var(--dark-color);
}

/* Utilidades personalizadas que complementan Bootstrap */
.text-primary-custom {
    color: var(--primary-color) !important;
}

.bg-primary-custom {
    background-color: var(--primary-color) !important;
}

.btn-primary-custom {
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-bg: #0052a3;
    --bs-btn-hover-border-color: #0052a3;
    --bs-btn-active-bg: #0052a3;
    --bs-btn-active-border-color: #0052a3;
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}

.btn-primary-custom:hover {
    background-color: var(--bs-btn-hover-bg);
    border-color: var(--bs-btn-hover-border-color);
}

/* Cards de propiedades */
.property-card {
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.property-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.property-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

/* Buscador principal */
.search-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    padding: 4rem 0;
    color: white;
}

.search-hero h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-hero .form-select-sm,
.search-hero .form-control-sm {
    font-size: 0.875rem;
    padding: 0.5rem;
}

.search-hero .bg-white {
    border-radius: 12px !important;
}

/* Tabs en search-hero */
.search-hero .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.search-hero .nav-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
    margin-bottom: -2px;
    transition: all 0.3s;
}

.search-hero .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: rgba(0, 102, 204, 0.3);
}

.search-hero .nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom-color: var(--primary-color);
}

.search-hero .tab-content {
    min-height: 100px;
}

/* Footer */
.footer {
    color: #ffffff !important;
    padding: 5rem 0;
    margin-top: 4rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
}

.footer h5,
.footer h6 {
    color: #ffffff !important;
}

.footer a {
    color: #cccccc !important;
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.footer .text-muted {
    color: #cccccc !important;
}

.footer ul {
    list-style: none;
    padding-left: 0;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1;
}

.footer p {
    color: #ffffff !important;
}

/* Formularios */
.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Mapas */
.map-container {
    height: 400px;
    width: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background-color: #e5e5e5;
}

.map-container.flex-grow-1 {
    height: 100%;
    min-height: 600px;
    flex: 1 1 auto;
}

/* Asegurar que el contenedor del mapa tenga altura */
.col-lg-8 .card.h-100 {
    display: flex;
    flex-direction: column;
}

.col-lg-8 .card-body.d-flex {
    flex: 1 1 auto;
    min-height: 0;
}

.map-container:empty::before {
    content: 'Cargando mapa...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
}

#propiedadesMap {
    height: 100%;
    min-height: 600px;
    flex: 1 1 auto;
}

/* Galería de imágenes */
.gallery-thumb {
    cursor: pointer;
    transition: opacity 0.2s;
}

.gallery-thumb:hover {
    opacity: 0.7;
}

/* Hover effects */
.hover-shadow {
    transition: transform 0.2s, box-shadow 0.2s;
}

.hover-shadow:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Estadísticas section */
.stats-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Vista de lista para propiedades */
.list-group-item.property-item {
    border: 1px solid #dee2e6;
    border-radius: 8px !important;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.list-group-item.property-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.property-item .card-title a:hover {
    color: var(--primary-color) !important;
}

/* Mejoras en cards */
.property-card .card-title {
    font-size: 1.1rem;
    line-height: 1.4;
    min-height: 3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-card .property-image {
    transition: transform 0.3s;
}

.property-card:hover .property-image {
    transform: scale(1.05);
}

/* Badges mejorados */
.property-badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

/* Accordion de filtros */
.accordion-button {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.accordion-body {
    padding: 0.5rem 1rem 1rem 1rem;
}

/* Listado de propiedades compacto */
.property-item-list {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.property-item-list:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.property-item-list.border-primary {
    transition: border-color 0.3s;
}

.listado-propiedades {
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0;
    width: 100%;
}

.listado-propiedades .row {
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    max-width: 100%;
}

.listado-propiedades .row > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.listado-propiedades .col-md-6 {
    max-width: 100%;
    box-sizing: border-box;
}

.listado-propiedades .card {
    max-width: 100%;
    box-sizing: border-box;
}

.listado-propiedades .card-body {
    max-width: 100%;
    box-sizing: border-box;
}

.listado-propiedades img {
    max-width: 100%;
    box-sizing: border-box;
}

/* Asegurar que el contenedor de la columna no cause overflow */
.col-lg-4 {
    overflow-x: hidden;
    max-width: 100%;
}

.listado-propiedades::-webkit-scrollbar {
    width: 6px;
}

.listado-propiedades::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.listado-propiedades::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.listado-propiedades::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Asegurar que el scrollbar no cause overflow horizontal */
.listado-propiedades {
    box-sizing: border-box;
}

.box-search-map{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 35px 20px;
    background: #fff;
}

/* Planes de precios */
.plan-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border-radius: 12px;
}

.plan-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

.plan-card.featured {
    transform: scale(1.05);
}

.plan-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.plan-card .table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.plan-card .table td:first-child {
    width: 30px;
}

.plan-card .card-header {
    border-radius: 12px 12px 0 0 !important;
}

.plan-card .card-footer {
    border-radius: 0 0 12px 12px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .property-image {
        height: 180px;
    }

    .search-hero {
        padding: 2rem 0;
    }

    .map-container {
        height: 300px !important;
    }

    #filtrosCollapse {
        border-top: 1px solid #dee2e6;
    }

    .property-card .card-title {
        font-size: 1rem;
        min-height: auto;
    }

    .listado-propiedades {
        max-height: 500px;
    }

    .plan-card.featured {
        transform: scale(1);
    }

    .plan-card.featured:hover {
        transform: translateY(-8px);
    }
}