/*
Theme Name: X-Ray Homes
Theme URI: https://xraymarketingagency.com
Author: Squiilo
Author URI: https://xraymarketingagency.com
Description: Theme inmobiliario tipo Airbnb, diseñado para trabajar junto con el plugin "X-Ray Real Estate Core". Todo el dato y la lógica (campos, buscador, WhatsApp, formulario de contacto) vive en el plugin; este theme solo sobreescribe cómo se ve. Requiere el plugin X-Ray Real Estate Core activo.
Version: 0.1.0
Requires at least: 5.9
Requires PHP: 7.4
Requires Plugins: xray-realestate-core
Text Domain: xray-homes
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* -------------------------------------------------------------- */
/* Design tokens                                                   */
/* -------------------------------------------------------------- */

:root {
    --xh-font-heading: 'Manrope', system-ui, -apple-system, sans-serif;
    --xh-font-body: 'Work Sans', system-ui, -apple-system, sans-serif;

    --xh-bg: oklch(98% 0.008 75);
    --xh-surface: #fff;
    --xh-border: oklch(92% 0.01 70);
    --xh-border-soft: oklch(94% 0.01 70);

    /*
     * Paleta de marca — todo lo que un cliente que reuse este theme
     * normalmente quiere cambiar sin tocar CSS. Personalizable desde
     * Apariencia → Personalizar → "Colores de marca" (ver functions.php,
     * xh_customize_register()), que sobreescribe estas mismas variables.
     * Fondo (--xh-bg) y superficies (--xh-surface) se quedan fijos a
     * propósito: son la base neutra sobre la que todo lo demás tiene que
     * seguir siendo legible, y cambiarlos sin poder probarlo en vivo es
     * justo donde más fácil se rompe el contraste.
     */
    --xh-heading: oklch(24% 0.02 55);
    --xh-text: oklch(24% 0.02 55);
    --xh-text-muted: oklch(50% 0.02 55);
    --xh-link: var(--xh-accent);
    --xh-accent: oklch(58% 0.15 40);
    --xh-accent-contrast: #fff;
    --xh-dark: oklch(24% 0.02 55);
    --xh-dark-contrast: #fff;
    --xh-success-bg: oklch(90% 0.09 155);
    --xh-success-text: oklch(32% 0.09 155);

    --xh-radius-lg: 20px;
    --xh-radius-md: 16px;
    --xh-radius-sm: 10px;
    --xh-shadow-card: 0 1px 2px rgba(30, 20, 12, 0.05);
    --xh-shadow-card-hover: 0 14px 30px rgba(30, 20, 12, 0.14);
    --xh-shadow-pop: 0 18px 40px rgba(30, 20, 10, 0.18);
    --xh-max-width: 1240px;
}

/* -------------------------------------------------------------- */
/* Base                                                             */
/* -------------------------------------------------------------- */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--xh-bg);
    color: var(--xh-text);
    font-family: var(--xh-font-body);
    font-size: 15px;
    line-height: 1.5;
}

h1, h2, h3, h4 {
    font-family: var(--xh-font-heading);
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--xh-heading);
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--xh-link); }

img { max-width: 100%; display: block; }

button, .xh-button {
    font-family: var(--xh-font-body);
    cursor: pointer;
}

.xh-wrap {
    max-width: var(--xh-max-width);
    margin: 0 auto;
    padding: 0 32px;
}

.xh-screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* -------------------------------------------------------------- */
/* Buttons & form controls (shared)                                 */
/* -------------------------------------------------------------- */

.xh-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--xh-accent);
    color: var(--xh-accent-contrast);
    border: none;
    border-radius: 999px;
    padding: 11px 22px;
    font-weight: 600;
    font-size: 14px;
}

.xh-btn-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--xh-dark);
    color: var(--xh-dark-contrast);
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
}

.xh-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--xh-border);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--xh-text);
}

/* -------------------------------------------------------------- */
/* Header / nav                                                     */
/* -------------------------------------------------------------- */

.xh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 32px;
    max-width: var(--xh-max-width);
    margin: 0 auto;
}

.xh-logo {
    font-family: var(--xh-font-heading);
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.01em;
}

.xh-logo span { color: var(--xh-accent); }

.xh-logo .custom-logo-link { display: block; }
.xh-logo img.custom-logo { display: block; max-height: 40px; width: auto; }

.xh-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--xh-text);
    list-style: none;
    margin: 0;
    padding: 0;
}

.xh-nav a { display: block; }

.xh-nav-toggle { display: none; }

/* -------------------------------------------------------------- */
/* Footer                                                           */
/* -------------------------------------------------------------- */

.xh-footer {
    padding: 32px 32px 44px;
    border-top: 1px solid var(--xh-border-soft);
    margin-top: 24px;
}

.xh-footer__row {
    max-width: var(--xh-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--xh-text-muted);
}

.xh-footer__links { display: flex; gap: 22px; flex-wrap: wrap; }

/* -------------------------------------------------------------- */
/* Hero + pill search bar (home)                                    */
/* -------------------------------------------------------------- */

.xh-hero {
    position: relative;
    margin: 0 32px;
    border-radius: var(--xh-radius-lg);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    background: linear-gradient(160deg, oklch(64% 0.14 45), oklch(38% 0.08 250) 100%);
}

.xh-hero__skyline {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 42%;
    opacity: 0.5;
}

.xh-hero__copy {
    position: relative;
    z-index: 1;
    padding: 0 56px;
    max-width: 620px;
}

.xh-hero__copy h1 {
    font-size: 40px;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 14px;
}

.xh-hero__copy p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
}

.xh-search-wrap {
    margin: -34px 56px 40px;
    position: relative;
    z-index: 2;
}

.xh-search {
    background: #fff;
    border-radius: 999px;
    box-shadow: var(--xh-shadow-pop);
    display: flex;
    align-items: stretch;
    padding: 6px;
    gap: 2px;
    flex-wrap: wrap;
}

.xh-search__field {
    flex: 1;
    min-width: 140px;
    padding: 10px 22px;
    border-right: 1px solid var(--xh-border-soft);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.xh-search__field:last-of-type { border-right: none; }

.xh-search__field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--xh-text);
}

.xh-search__field select {
    border: none;
    background: none;
    font-size: 13.5px;
    color: var(--xh-text-muted);
    font-family: var(--xh-font-body);
    padding: 0;
    width: 100%;
}

.xh-search__go {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--xh-accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
}

/* -------------------------------------------------------------- */
/* Category chips                                                   */
/* -------------------------------------------------------------- */

.xh-chips {
    display: flex;
    gap: 10px;
    padding: 8px 32px 8px;
    flex-wrap: wrap;
    max-width: var(--xh-max-width);
    margin: 0 auto;
}

.xh-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--xh-border);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--xh-text);
}

.xh-chip.is-active {
    background: var(--xh-dark);
    border-color: var(--xh-dark);
    color: var(--xh-dark-contrast);
}

/* -------------------------------------------------------------- */
/* Section heading + card grid                                      */
/* -------------------------------------------------------------- */

.xh-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 28px 32px 18px;
    max-width: var(--xh-max-width);
    margin: 0 auto;
}

.xh-section-head h2 { font-size: 22px; margin: 0; }
.xh-section-head a { font-size: 13.5px; font-weight: 600; color: var(--xh-link); }

.xh-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    padding: 0 32px 50px;
    max-width: var(--xh-max-width);
    margin: 0 auto;
}

/* -------------------------------------------------------------- */
/* Property card (xray-realestate/partials/property-card.php)       */
/* -------------------------------------------------------------- */

.xh-card {
    background: var(--xh-surface);
    border-radius: var(--xh-radius-md);
    overflow: hidden;
    box-shadow: var(--xh-shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: block;
}

.xh-card:hover {
    box-shadow: var(--xh-shadow-card-hover);
    transform: translateY(-3px);
    color: inherit;
}

.xh-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, color-mix(in oklch, var(--xh-accent) 45%, white), var(--xh-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.xh-card__media img { width: 100%; height: 100%; object-fit: cover; }

.xh-card__tag {
    position: absolute;
    top: 12px; left: 12px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
    color: var(--xh-dark);
}

.xh-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; }

.xh-card__row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.xh-card__title { font-family: var(--xh-font-heading); font-weight: 700; font-size: 15px; margin: 0; line-height: 1.3; }

.xh-card__price { font-family: var(--xh-font-heading); font-weight: 800; font-size: 16px; white-space: nowrap; }

.xh-card__location { font-size: 13px; color: var(--xh-text-muted); margin: 0; }

.xh-card__specs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--xh-text-muted); margin-top: 2px; flex-wrap: wrap; }

.xh-card__specs .xh-dot { width: 3px; height: 3px; border-radius: 999px; background: oklch(85% 0.01 70); }

/* -------------------------------------------------------------- */
/* Archive / listing page                                           */
/* -------------------------------------------------------------- */

.xh-toolbar {
    margin: 4px 32px 0;
    background: #fff;
    border: 1px solid var(--xh-border);
    border-radius: 999px;
    display: flex;
    align-items: stretch;
    padding: 6px;
    flex-wrap: wrap;
    max-width: calc(var(--xh-max-width) - 64px);
    margin-left: auto;
    margin-right: auto;
}

.xh-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 32px 8px;
    flex-wrap: wrap;
    max-width: var(--xh-max-width);
    margin: 0 auto;
}

.xh-filters form { display: contents; }

.xh-filters select {
    border: 1px solid var(--xh-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--xh-font-body);
    background: #fff;
    color: var(--xh-text);
}

.xh-filters .xh-btn-primary { padding: 8px 20px; font-size: 13px; }

.xh-sort-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xh-sort-form select {
    border: 1px solid var(--xh-border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: var(--xh-font-body);
    background: #fff;
    color: var(--xh-text);
}

.xh-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px 14px;
    max-width: var(--xh-max-width);
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 10px;
}

.xh-results-head h1 { font-size: 19px; margin: 0; }
.xh-results-head p { margin: 2px 0 0; font-size: 13px; color: var(--xh-text-muted); }

.xh-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 32px 50px;
    flex-wrap: wrap;
}

.xh-pagination .page-numbers {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--xh-text);
    border: 1px solid var(--xh-border);
    background: #fff;
}

.xh-pagination .page-numbers.current {
    background: var(--xh-dark);
    border-color: var(--xh-dark);
    color: var(--xh-dark-contrast);
}

.xh-empty { padding: 20px 32px 60px; max-width: var(--xh-max-width); margin: 0 auto; color: var(--xh-text-muted); }

/* -------------------------------------------------------------- */
/* Property detail page                                             */
/* -------------------------------------------------------------- */

.xh-property { max-width: var(--xh-max-width); margin: 0 auto; padding: 0 32px 50px; }

.xh-gallery {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    grid-auto-rows: 190px;
    gap: 8px;
    border-radius: var(--xh-radius-lg);
    overflow: hidden;
    margin-top: 6px;
}

.xh-gallery__tile {
    position: relative;
    background: linear-gradient(135deg, color-mix(in oklch, var(--xh-accent) 45%, white), var(--xh-accent));
    display: block;
    overflow: hidden;
}

.xh-gallery__tile img { width: 100%; height: 100%; object-fit: cover; }

.xh-gallery__tile--main { grid-row: span 2; }

.xh-gallery__more {
    position: absolute;
    right: 10px; bottom: 10px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
}

.xh-property__video { margin: 22px 0; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--xh-radius-md); overflow: hidden; }
.xh-property__video iframe { width: 100%; height: 100%; border: 0; }
.xh-property__video-link { margin: 22px 0; }

.xh-head-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 26px 0 6px;
    gap: 16px;
}

.xh-head-row h1 { font-size: 26px; margin: 0 0 4px; }
.xh-head-row .xh-loc { font-size: 14px; color: var(--xh-text-muted); }

.xh-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0 22px;
    border-bottom: 1px solid var(--xh-border-soft);
    flex-wrap: wrap;
}

.xh-price { font-family: var(--xh-font-heading); font-weight: 800; font-size: 26px; }

.xh-status-badge {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    background: var(--xh-success-bg);
    color: var(--xh-success-text);
}

.xh-specs-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 22px 0;
    border-bottom: 1px solid var(--xh-border-soft);
}

.xh-spec { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.xh-spec svg { color: var(--xh-accent); }
.xh-spec b { font-size: 15px; font-family: var(--xh-font-heading); }
.xh-spec span { font-size: 12px; color: var(--xh-text-muted); }

.xh-content-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 44px;
    padding: 28px 0 10px;
    align-items: start;
}

.xh-content-grid h2 { font-size: 17px; margin: 0 0 10px; }

.xh-desc { font-size: 14.5px; line-height: 1.7; color: var(--xh-text); margin: 0 0 30px; }

.xh-amenities { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin-bottom: 30px; list-style: none; padding: 0; }
.xh-amenities li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--xh-text); }
.xh-amenities svg { color: var(--xh-accent); flex-shrink: 0; }

.xh-floorplans { margin-bottom: 30px; }
.xh-floorplans ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.xh-floorplans li a {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--xh-border); border-radius: var(--xh-radius-sm);
    padding: 8px 14px;
    font-size: 13.5px; font-weight: 500; color: var(--xh-text);
}
.xh-floorplans li a:hover { border-color: var(--xh-link); }
.xh-floorplans li img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }

.xh-map-card {
    border-radius: var(--xh-radius-md);
    background: oklch(94% 0.015 75);
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--xh-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

.xh-side-card {
    background: var(--xh-surface);
    border: 1px solid var(--xh-border);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 20px;
}

.xh-agent { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.xh-agent__avatar {
    width: 52px; height: 52px;
    border-radius: 999px;
    background: var(--xh-accent);
    color: var(--xh-accent-contrast);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--xh-font-heading); font-weight: 700; font-size: 16px;
    flex-shrink: 0;
}
.xh-agent b { display: block; font-size: 14.5px; }
.xh-agent span { font-size: 12.5px; color: var(--xh-text-muted); }

/* -------------------------------------------------------------- */
/* Contact form (xray-realestate/partials/contact-form.php)         */
/* -------------------------------------------------------------- */

.xh-contact-form .xh-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.xh-contact-form label { font-size: 12.5px; font-weight: 600; color: var(--xh-text); }
.xh-contact-form input[type="text"],
.xh-contact-form input[type="email"],
.xh-contact-form textarea {
    border: 1px solid oklch(88% 0.01 70);
    border-radius: var(--xh-radius-sm);
    padding: 10px 12px;
    font-size: 13.5px;
    font-family: var(--xh-font-body);
    color: var(--xh-text);
    background: oklch(99% 0.005 75);
    width: 100%;
}
.xh-contact-form textarea { resize: vertical; min-height: 80px; }

.xh-contact-form__notice { padding: 10px 14px; border-radius: var(--xh-radius-sm); font-size: 13.5px; margin-bottom: 14px; }
.xh-contact-form__notice--success { background: var(--xh-success-bg); color: var(--xh-success-text); }
.xh-contact-form__notice--error { background: oklch(92% 0.09 25); color: oklch(35% 0.13 25); }

/* -------------------------------------------------------------- */
/* Responsive                                                        */
/* -------------------------------------------------------------- */

@media (max-width: 900px) {
    .xh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .xh-specs-row { grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
    .xh-content-grid { grid-template-columns: 1fr; }
    .xh-gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 140px; }
    .xh-gallery__tile--main { grid-column: span 2; grid-row: span 1; }
}

@media (max-width: 640px) {
    .xh-header { padding: 16px 20px; }
    .xh-nav { display: none; }
    .xh-wrap, .xh-hero, .xh-chips, .xh-section-head, .xh-grid, .xh-toolbar, .xh-filters, .xh-results-head, .xh-property {
        padding-left: 20px;
        padding-right: 20px;
    }
    .xh-hero { margin: 0 20px; min-height: 340px; }
    .xh-hero__copy { padding: 0 24px; }
    .xh-hero__copy h1 { font-size: 28px; }
    .xh-search-wrap { margin: -28px 20px 30px; }
    .xh-search { flex-direction: column; border-radius: var(--xh-radius-md); }
    .xh-search__field { border-right: none; border-bottom: 1px solid var(--xh-border-soft); }
    .xh-search__field:last-of-type { border-bottom: none; }
    .xh-search__go { width: 100%; height: 44px; border-radius: var(--xh-radius-sm); }
    .xh-grid { grid-template-columns: 1fr; }
    .xh-specs-row { grid-template-columns: repeat(2, 1fr); }
    .xh-head-row { flex-direction: column; }
}
