/*
Theme Name: Kadence Child
Template: kadence
Version: 2.0.0 - FINAL BOSS (LIMPIO Y FUNCIONAL)
*/

/* =========================================
   1. HEADER TRANSPARENTE Y LOGO
   ========================================= */
#masthead, .site-header {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    z-index: 1000 !important;
}

/* Ajustar el logo */
.custom-logo-link img, .site-logo-img {
    max-width: 180px !important;
    height: auto !important;
}

/* Menú en blanco con sombra para leer sobre la foto */
.main-navigation a, .site-branding a, .menu-toggle {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-weight: 600 !important;
    text-transform: uppercase !important;
}

//* =========================================
   2. HERO GIGANTE (FOTO DE FONDO) - CORREGIDO
   ========================================= */
/* Apuntamos directo a la clase que acabas de poner */
.mi-hero-principal {
    min-height: 85vh !important; /* Altura imponente */
    padding-top: 200px !important; /* Espacio para que el header no tape nada */
    padding-bottom: 100px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important; /* Asegura que el overlay se posicione bien */
}

/* Oscurecer la foto (Overlay) */
.mi-hero-principal > .kt-row-layout-inner {
    background-size: cover !important;
    background-position: center center !important;
    background-color: rgba(0, 0, 0, 0.4) !important; /* Capa oscura al 40% */
}

/* Corrección extra: Si estás logueado, bajamos el header para que no lo tape la barra de admin */
.admin-bar #masthead {
    top: 32px !important;
}

/* =========================================
   3. BUSCADOR (ESTATIK) - CONTENEDOR
   ========================================= */
.es-search {
    background: rgba(26, 32, 44, 0.85) !important; /* Glassmorphism */
    padding: 20px 25px !important;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 1200px; /* Ancho controlado */
    margin: 0 auto !important;
}

/* Layout Grid: Una sola línea */
.es-search form {
    display: grid !important;
    grid-template-columns: 1.5fr 1fr 1fr 1.5fr auto !important;
    gap: 15px !important;
    align-items: center !important;
}

/* =========================================
   4. LIMPIEZA (OCULTAR BASURA)
   ========================================= */
.es-search h3, 
.es-search-more, 
.js-es-save-search,
.es-save-search-btn,
.es-field__label, 
.es-field-row label,
.select2-selection__clear,
.es-search__address .es-search__submit { /* Muerte al botón rojo */
    display: none !important;
}

/* Reset de márgenes internos */
.es-search__address, .es-field__es_category, .es-field__es_type, .es-field-row__range, .es-search__buttons {
    width: 100% !important; margin: 0 !important; padding: 0 !important;
}

/* =========================================
   5. INPUTS Y CAMPOS (LOOK & FEEL)
   ========================================= */
:root { --es-input-height: 50px; }

.es-search input[type="text"],
.select2-container .select2-selection--single {
    height: var(--es-input-height) !important;
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 4px !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
}

/* Texto Select2 */
.select2-container .select2-selection--single .select2-selection__rendered {
    color: white !important; 
    padding-left: 40px !important; 
    line-height: var(--es-input-height) !important;
}

/* Flechas Select2 */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #ffffff transparent transparent transparent !important;
}

/* =========================================
   6. ICONOS (SVG BLANCOS)
   ========================================= */
/* Ubicación (Pin) */
.es-search input[type="text"] {
    background: rgba(255,255,255,0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3'%3E%3C/circle%3E%3C/svg%3E") no-repeat 12px center !important;
    padding-left: 40px !important;
}
/* Categoría */
.es-field__es_category .select2-selection--single {
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'%3E%3C/path%3E%3Cline x1='7' y1='7' x2='7.01' y2='7'%3E%3C/line%3E%3C/svg%3E") no-repeat 12px center !important;
}
/* Tipo */
.es-field__es_type .select2-selection--single {
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'%3E%3C/path%3E%3Cpolyline points='9 22 9 12 15 12 15 22'%3E%3C/polyline%3E%3C/svg%3E") no-repeat 12px center !important;
}
/* Precio */
.es-field-row__range { display: flex !important; gap: 5px !important; }
.es-field-row__range > div { width: 50% !important; }

.es-field__min_price .select2-selection--single {
    background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'%3E%3C/line%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'%3E%3C/path%3E%3C/svg%3E") no-repeat 10px center !important;
}

/* =========================================
   7. BOTÓN DORADO (BUSCAR)
   ========================================= */
.es-search__buttons .es-btn--primary {
    height: var(--es-input-height) !important;
    background-color: #c49a6c !important;
    color: white !important;
    border: none !important;
    padding: 0 30px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    width: 100% !important;
}

/* =========================================
   8. RESPONSIVO (MÓVIL)
   ========================================= */
@media (max-width: 1024px) {
    .es-search form { grid-template-columns: 1fr 1fr !important; }
    .es-search__address, .es-field-row__range, .es-search__buttons { grid-column: span 2; }
}
@media (max-width: 600px) {
    .es-search form { display: flex !important; flex-direction: column !important; }
    .es-search { margin-top: 100px !important; } /* Espacio para el header en móvil */
}

/* FRANCOTIRADOR: Matar el botón rojo de icono específicamente */
.es-search__address button.es-btn--icon {
    display: none !important;
}

/* DOBLE TAP: Por si el anterior falla, matamos cualquier botón dentro del campo de dirección */
.es-search__address button {
    display: none !important;
}

/* 1. Centrar el contenedor en la grilla */
.es-search__buttons {
    align-self: center !important; /* Esto lo baja para que quede centrado verticalmente */
    height: 50px !important;       /* Misma altura que los inputs */
    margin: 0 !important;          /* Quitamos márgenes extraños */
    padding: 0 !important;
    display: flex !important;      /* Para acomodar el botón adentro */
    align-items: center !important;
}

/* =========================================
   TARJETAS DE PROPIEDADES (ESTILO PREMIUM)
   ========================================= */

/* 1. LA TARJETA (CONTENEDOR) */
.es-listing {
    background-color: #2b303b !important; /* Fondo Gris Oscuro */
    border: 1px solid rgba(255,255,255,0.05) !important; /* Borde sutil */
    border-radius: 8px !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important; /* Sombra suave */
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important; /* Para que todas midan lo mismo */
    transition: transform 0.3s ease !important;
}

/* Efecto al pasar el mouse (Levantar un poquito) */
.es-listing:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5) !important;
    border-color: #c49a6c !important; /* Borde dorado al hacer hover */
}

/* 2. LA IMAGEN */
.es-listing__image, 
.es-listing__image__slider {
    border-bottom: 3px solid #c49a6c !important; /* Línea dorada debajo de la foto */
}

/* 3. EL CONTENIDO (TEXTOS) */
.es-listing__content {
    padding: 20px !important;
    background-color: #2b303b !important;
    flex-grow: 1 !important; /* Empuja el footer hacia abajo para alinear */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Título de la propiedad */
.es-listing__title a {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    line-height: 1.3 !important;
    display: block !important;
    margin-bottom: 10px !important;
}

/* Precio (Dorado y grande) */
.es-price {
    color: #c49a6c !important;
    font-size: 20px !important;
    font-weight: 800 !important;
    display: block !important;
    margin-bottom: 10px !important;
}

/* Dirección y Datos (Iconos y texto gris claro) */
.es-address, 
.es-listing__meta {
    color: #a0aec0 !important;
    font-size: 13px !important;
}

/* Pintar los iconos (SVG) de dorado */
.es-listing__meta svg path {
    fill: #c49a6c !important;
}

/* 4. LIMPIEZA PARA UNIFORMIDAD */
/* Ocultamos el resumen de texto (excerpt) porque siempre descuadra las alturas */
.es-excerpt {
    display: none !important;
}

/* 5. FOOTER DE LA TARJETA (Convertirlo en Botón) */
.es-listing__footer {
    background-color: #232830 !important; /* Un poco más oscuro */
    padding: 15px !important;
    border-top: 1px solid rgba(255,255,255,0.1) !important;
    text-align: center !important;
}

/* Ocultar las etiquetas feas (Casa, Venta, etc.) del footer */
.es-listing__terms {
    display: none !important;
}

/* Crear el texto "VER DETALLES" */
.es-listing__footer::after {
    content: "VER DETALLES" !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
}

/* Hover en el footer */
.es-listing:hover .es-listing__footer::after {
    color: #c49a6c !important; /* Se pone dorado al pasar el mouse */
}	

/* =========================================
   CORRECCIÓN: ENLACE EXTENDIDO (SOLO ABAJO)
   ========================================= */

/* 1. Quitamos el bloqueo del carrusel */
.es-listing {
    position: static !important; /* Ya no es el límite del enlace */
    transform: none !important; /* Evita conflictos de capas con el slider */
}

/* 2. Convertimos el CONTENIDO en el área cliqueable */
/* Esto incluye Título, Precio y el Footer con el botón falso */
.es-listing__content {
    position: relative !important;
    z-index: 1 !important;
}

/* 3. El enlace del título se estira solo dentro del contenido */
.es-listing__title a::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 2 !important;
}

/* 4. Salvamos el corazón de favoritos (dentro del contenido) */
.es-listing__content .es-control__item--wishlist,
.es-listing__content .es-btn__wishlist {
    position: relative !important;
    z-index: 10 !important; /* Encima del enlace fantasma */
    pointer-events: auto !important;
}

/* 5. Feedback visual */
.es-listing__content:hover {
    cursor: pointer !important;
}

/* 6. Asegurar que las flechas del slider sigan vivas */
.slick-arrow, .slick-dots {
    z-index: 50 !important; /* Siempre encima de todo */
    cursor: pointer !important;
}


/* =================================================================
   HERO SECTION INMERSIVO (SINGLE PROPERTY)
   ================================================================= */

/* 1. CONTENEDOR PRINCIPAL (La caja con la foto) */
.mi-hero-propiedad {
    position: relative;
    width: 100%;
    height: 85vh; /* Ocupa el 85% de la altura de la pantalla */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end; /* Texto abajo */
    justify-content: center; /* Centrado horizontalmente */
    margin-bottom: 40px;
    margin-top: -100px; /* TRUCO: Subimos el hero para que quede DETRÁS del header transparente */
    padding-top: 100px; /* Compensamos el subidon */
}

/* En móviles, que no sea tan alto */
@media (max-width: 768px) {
    .mi-hero-propiedad {
        height: 60vh;
        align-items: flex-end;
        justify-content: flex-start; /* Alineado a la izquierda en móvil */
    }
}

/* 2. OVERLAY (El degradado negro para que se lean las letras) */
.mi-hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 60%, #1a202c 100%);
    z-index: 1;
}

/* 3. CONTENIDO (Texto) */
.mi-hero-contenido {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 1100px;
    padding: 0 20px 60px 20px; /* Espacio desde abajo */
}

@media (max-width: 768px) {
    .mi-hero-contenido {
        text-align: left; /* En móvil alineado a izquierda */
        padding-bottom: 40px;
    }
}

/* 4. TIPOGRAFÍA DEL HERO */
/* Título */
h1.mi-titulo-hero {
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    h1.mi-titulo-hero { font-size: 28px; }
}

/* Precio */
.mi-precio-hero .es-price {
    color: #c49a6c !important; /* DORADO */
    font-family: 'Montserrat', sans-serif;
    font-size: 36px !important;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
}

@media (max-width: 768px) {
    .mi-precio-hero .es-price { font-size: 26px !important; }
}

/* Etiquetas (Ref y Estado) */
.mi-hero-meta-top {
    margin-bottom: 15px;
}
.mi-etiqueta-estado, .mi-etiqueta-id {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    margin-right: 10px;
    border: 1px solid rgba(255,255,255,0.2);
}
.mi-etiqueta-estado {
    background: #c49a6c; /* Fondo dorado para "Venta/Alquiler" */
    border-color: #c49a6c;
}

/* 5. OCULTAR EL TÍTULO/PRECIO ORIGINAL DE ESTATIK */
/* Como ya lo pusimos en el Hero, hay que esconder el que trae el plugin abajo para que no salga repetido */
.es-single-property-layout .es-title, 
.es-single-property-layout .es-price,
.es-single-property-layout .es-property-price,
.es-single-property-layout h1 {
    display: none !important;
}