/* Variables and Global Styles */
:root {
    --primary-color: #8c1a1e;
    /* Granate del logo */
    --accent-color: #f7e9ae;
    /* Amarillo/Dorado del logo */
    --dark-bg: #2d2d2d;
    --text-color: #0d0d0d;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: #f8f9fa;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 90vh;
    background-image: url('../img/fondo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* Parallax effect */
}

@media (max-width: 991px) {
    .hero-section {
        background-attachment: scroll;
    }
}

/* Dark overlay for better text readability */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(15, 23, 42, 0.4) 100%);
    z-index: 1;
}

.hero-section>.container {
    position: relative;
    z-index: 2;
}

.drop-shadow {
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* Cards Premium Styling */
.card-property {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 100%;
}

.card-property:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.05);
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 65%;
    /* Aspect ratio for images */
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card-property:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Badges and Interactive icons */
.badge-etiqueta {
    position: absolute;
    top: 15px;
    left: 15px;
    /* Moved to left to make space for heart on right */
    z-index: 2;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.btn-favorite {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    font-size: 1.2rem;
    color: #ccc;
    /* Default grey heart */
}

.btn-favorite:hover {
    transform: scale(1.1);
    background-color: white;
}

.btn-favorite.active {
    color: #ef4444;
    /* Red heart when solid */
}

/* Custom icons and hearts */
.icon-heart::before {
    content: "🤍";
}

.btn-favorite.active .icon-heart::before {
    content: "❤️";
}

.badge-venta {
    background-color: var(--primary-color);
    color: white;
}

.badge-alquiler {
    background-color: var(--accent-color);
    color: #333;
    /* Dark text for yellow bg */
}

.card-body {
    padding: 1.5rem;
}

.property-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-bg);
}

.property-price {
    font-size: 1.6rem;
    font-weight: 800;
    color: #000000;

}

.property-features {
    display: flex;
    gap: 1.5rem;
    color: #6c757d;
    font-size: 0.95rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background-color: #6a1316;
    /* Darker red */
    border-color: #6a1316;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(140, 26, 30, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.text-primary {
    color: var(--primary-color) !important;
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(30, 1, 1, 0.95) !important;
}

.nav-logo {
    height: 80px;
    width: auto;
    transition: all 0.3s ease;
}

@media (max-width: 576px) {
    .nav-logo {
        height: 50px;
    }
}

.brand-text {
    white-space: nowrap;
}

@media (max-width: 576px) {
    .brand-text {
        white-space: normal;
        max-width: 160px;
    }
}

.icon-circle {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f8f9fa;
    flex-shrink: 0;
    line-height: 1;
}

.icon-circle i {
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .icon-circle {
        width: 48px;
        height: 48px;
    }
}

/* Filters Section */
.filters-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* Animations (Scroll) */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Detail Page Specifics */
.hero-detail {
    height: 60vh;
    min-height: 500px;
}

@media (max-width: 768px) {
    .hero-detail {
        height: 40vh;
        min-height: 300px;
    }
}

.hero-detail::before {
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 100%);
}

/* Carrusel de Detalle - Proporciones */
.carousel-item {
    background-color: #ffffff; /* Fondo blanco para las imágenes que no llenen todo el espacio */
}

.carousel-item img {
    height: 500px;
    object-fit: contain; /* Para que la imagen se vea entera sin recortes */
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 350px; /* En vez de auto, le damos un alto fijo para que 'contain' funcione bien en móvil */
        aspect-ratio: auto;
    }
}

/* Lightbox / Zoom Utility */
.cursor-zoom {
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.cursor-zoom:hover {
    opacity: 0.9;
}

#imgFull {
    max-height: 85vh;
    width: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* --- SERVICIOS DE MANITAS --- */
.service-marquee-wrapper {
    width: 100%;
    padding: 10px 0 20px 0;
    /* Efecto de desvanecido elegante en los bordes para que no se corten las tarjetas bruscamente */
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.service-marquee-track {
    width: max-content;
    animation: scroll-marquee 25s linear infinite;
}

.service-marquee-track:hover {
    animation-play-state: paused;
}

.service-card-marquee {
    width: 320px;
    flex-shrink: 0;
}

@keyframes scroll-marquee {
    to {
        /* Se desplaza exactamente a la mitad porque hemos duplicado las 5 tarjetas para el loop infinito */
        transform: translateX(calc(-50% - 0.75rem));
    }
}

.service-card {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: linear-gradient(145deg, #ffffff, #fcfcfc);
    border: 1px solid rgba(140, 26, 30, 0.08) !important;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(140, 26, 30, 0.12) !important;
    border-color: rgba(140, 26, 30, 0.2) !important;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: rgba(140, 26, 30, 0.08) !important;
}

.service-card:hover .service-icon {
    background-color: var(--primary-color) !important;
    color: white !important;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 10px 20px rgba(140, 26, 30, 0.25);
}

.btn-solicitar-servicio {
    transition: all 0.3s ease;
    border-width: 2px;
}

.service-card:hover .btn-solicitar-servicio {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 8px 15px rgba(140, 26, 30, 0.25);
}