:root {
    --wine: #4B1015;
    --burgundy: #2D0A0D;
    --gold: #C5A15A;
    --sand: #DCC5AC;
    --ivory: #F7F0E7;
    --white: #ffffff;
    --muted: #5c534c;
    --line: rgba(75, 16, 21, 0.14);
    --serif: "Palatino Linotype", Palatino, Georgia, serif;
    --sans: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--sans);
    color: var(--burgundy);
    background: var(--ivory);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--wine); }

a:focus, button:focus, input:focus {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.site-header, .admin-header {
    background: var(--burgundy);
    color: var(--ivory);
}

.site-header a, .admin-header a { color: var(--ivory); text-decoration: none; }

.wrap {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header .wrap, .admin-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
}

.brand {
    font-family: var(--serif);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
}

.nav { display: flex; gap: 16px; align-items: center; }

.hero {
    padding: 64px 0 48px;
}

.hero h1 {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.1;
    margin: 0 0 16px;
}

.lede { font-size: 1.125rem; max-width: 40rem; color: var(--muted); }

.panel {
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: 0 12px 40px rgba(45, 10, 13, 0.06);
    padding: 24px;
    margin: 24px 0 48px;
}

.button, button {
    appearance: none;
    border: 0;
    background: var(--wine);
    color: var(--ivory);
    font: inherit;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button:hover, button:hover { background: var(--burgundy); }

.button-ghost {
    background: transparent;
    color: var(--ivory);
    border: 1px solid var(--sand);
}

.muted { color: var(--muted); }

.flash {
    padding: 12px 14px;
    margin-bottom: 16px;
    background: #f8e8e6;
    border: 1px solid var(--wine);
}

.form { display: grid; gap: 14px; max-width: 420px; }

label { display: grid; gap: 6px; font-size: 0.95rem; }

input[type="email"], input[type="password"] {
    font: inherit;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--white);
    width: 100%;
}

.guest {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(160deg, rgba(45, 10, 13, 0.92), rgba(75, 16, 21, 0.78)),
        var(--burgundy);
}

.guest .panel { width: min(440px, 100%); margin: 0; }

.guest h1 {
    font-family: var(--serif);
    font-weight: 500;
    margin-top: 0;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }

.card {
    background: var(--white);
    border: 1px solid var(--line);
    padding: 16px;
}

.card strong { display: block; font-family: var(--serif); font-size: 1.8rem; }

table { width: 100%; border-collapse: collapse; }

th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }

.inline { display: inline; margin: 0; }

.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.error-page .panel { max-width: 520px; }

:root {
    --shadow: 0 18px 50px rgba(45, 10, 13, 0.08);
    --radius: 18px;
    --container: min(1180px, calc(100% - 40px));
    --space: 28px;
}

.skip {
    position: absolute;
    left: 12px;
    top: -40px;
    background: var(--white);
    color: var(--burgundy);
    padding: 8px 12px;
    z-index: 5;
}
.skip:focus { top: 12px; }

.site-body { background: var(--ivory); color: var(--burgundy); }
.container { width: var(--container); margin: 0 auto; }

.ticker {
    background: var(--wine);
    color: var(--ivory);
    text-align: center;
    padding: 10px 16px;
}
.ticker a { color: var(--sand); }

.site-header { background: var(--burgundy); color: var(--ivory); position: sticky; top: 0; z-index: 4; }
.site-bar {
    width: var(--container);
    margin: 0 auto;
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}
.site-header .brand span { color: var(--gold); font-weight: 400; }
.site-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.site-nav a { color: var(--ivory); text-decoration: none; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a:focus { color: var(--gold); }
.nav-enter {
    border: 1px solid var(--gold);
    border-radius: 999px;
    padding: 8px 14px;
}
.nav-toggle {
    display: none;
    background: transparent;
    color: var(--ivory);
    border: 1px solid var(--sand);
}

.home-hero { padding: 36px 0 12px; }
.hero-grid { display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.1fr; gap: 28px; align-items: stretch; }
.search-card, .hero-media, .property-card, .promo-card, .prose {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.search-card { padding: 28px; }
.eyebrow { letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-size: 0.78rem; margin: 0 0 8px; }
.search-card h1, .section-head h1, .section-head h2, .home-institutional h2, .home-section > .container > h1, .prose h1, .property-detail h1 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.15;
    margin-top: 0;
}
.search-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
}
.tab input { margin-right: 6px; }
.search-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.search-grid label, .search-form label { display: grid; gap: 6px; font-size: 0.92rem; }
.search-form input, .search-form select {
    font: inherit;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
}
.search-form button { margin-top: 16px; }
.hero-media { position: relative; min-height: 360px; overflow: hidden; display: grid; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-caption { margin: 0; padding: 14px 18px 18px; }

.sim-bar { margin: 28px 0; }
.sim-row {
    display: flex;
    gap: 0;
    background: var(--burgundy);
    color: var(--ivory);
    border-radius: var(--radius);
    overflow: auto;
}
.sim-row a {
    flex: 1 0 180px;
    color: var(--ivory);
    text-decoration: none;
    padding: 22px 16px;
    border-right: 1px solid rgba(220, 197, 172, 0.25);
    text-align: center;
}
.sim-row a:last-child { border-right: 0; }
.sim-row a:hover, .sim-row a:focus { background: var(--wine); }

@media (max-width: 700px) {
    .sim-row { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
    .sim-row a { flex: none; min-width: 0; padding: 16px 10px; border-right: 0; border-bottom: 1px solid rgba(220, 197, 172, 0.25); }
    .sim-row a:nth-child(odd) { border-right: 1px solid rgba(220, 197, 172, 0.25); }
    .sim-row a:nth-last-child(-n+2) { border-bottom: 0; }
}

.home-section { padding: 18px 0 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.section-head a { color: var(--wine); }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); background: rgba(255,255,255,0.55); }
.media-empty {
    display: grid;
    place-items: center;
    min-height: 180px;
    background: linear-gradient(160deg, var(--sand), var(--ivory));
    color: var(--burgundy);
    text-align: center;
    padding: 16px;
}
.media-empty-lg { min-height: 320px; border-radius: var(--radius); }

.carousel { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
}
.carousel-track::-webkit-scrollbar { display: none; height: 0; }
.carousel-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--white);
    color: var(--wine);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0;
}
.carousel-control:disabled { opacity: 0.35; cursor: default; }
.carousel.is-static .carousel-control { visibility: hidden; }
.property-card { flex: 0 0 min(320px, 80%); scroll-snap-align: start; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.property-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(75, 16, 21, 0.08); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.result-grid .property-card { flex: none; }
.property-media { display: block; position: relative; color: inherit; text-decoration: none; }
.property-media img { width: 100%; height: 210px; object-fit: cover; display: block; transition: transform .3s ease; }
.property-card:hover .property-media img { transform: scale(1.03); }
.icon { width: 1.1em; height: 1.1em; vertical-align: -0.15em; display: inline-block; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.interest-form { display: grid; gap: 12px; max-width: 640px; }
.interest-form input, .interest-form textarea { font: inherit; padding: 12px; border: 1px solid var(--line); background: var(--white); width: 100%; }
.seal {
    position: absolute;
    left: 12px;
    top: 12px;
    background: var(--gold);
    color: var(--burgundy);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
}
.seal-demo {
    left: auto;
    right: 12px;
    background: var(--ivory);
    color: var(--burgundy);
    border: 1px solid var(--line);
}
.demo-notice {
    margin: 0;
    background: var(--sand);
    color: var(--burgundy);
    text-align: center;
    padding: 8px 16px;
    font-size: 0.92rem;
}
.promo-card { position: relative; }
.property-body, .promo-card { padding: 16px 16px 18px; }
.property-type { color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; margin-bottom: 4px; }
.property-body h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 6px; }
.property-body h3 a { color: var(--burgundy); text-decoration: none; }
.property-price { font-size: 1.15rem; margin: 8px 0; }
.property-facts { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0; margin: 0; list-style: none; color: var(--muted); }
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.promo-card { overflow: hidden; }
.promo-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.promo-card a { color: inherit; text-decoration: none; }

.home-institutional { padding: 20px 0 36px; }
.institutional-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: center; }
.diff-list { padding-left: 18px; }

.site-footer { background: var(--burgundy); color: var(--ivory); margin-top: 36px; padding: 42px 0; }
.site-footer .brand span { color: var(--gold); }
.site-footer a { color: var(--sand); text-decoration: none; display: block; margin: 6px 0; }
.site-footer h2 { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.prose, .property-detail { padding: 28px; margin: 28px auto; }
.link-list { padding-left: 18px; }

@media (max-width: 900px) {
    .hero-grid, .institutional-grid, .promo-grid, .footer-grid, .search-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: inline-block; }
    .site-bar { position: static; }
    .site-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 78px;
        background: var(--burgundy);
        padding: 12px 20px 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .site-nav.is-open { display: flex; z-index: 5; box-shadow: 0 16px 28px rgba(45, 10, 13, 0.28); }
    .site-header { position: sticky; }
}

.admin-header .nav { flex-wrap: wrap; padding: 8px 0; }
.admin-form { display: grid; gap: 12px; max-width: 720px; }
.admin-form input, .admin-form select, .admin-form textarea, .filters input, .filters select {
    font: inherit;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--white);
    width: 100%;
}
.admin-form textarea { min-height: 96px; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.thumb { width: 72px; height: 54px; object-fit: cover; background: #eee; display: block; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.row-actions form { margin: 0; }
.button-line, .row-actions .button-line {
    background: transparent;
    color: var(--wine);
    border: 1px solid var(--wine);
}
.flash-ok { background: #e7f2ea; border-color: #1d6b3a; }
.pager { display: flex; gap: 8px; }
.gallery-admin, .gallery-public { list-style: none; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.gallery-public img { width: 180px; height: 120px; object-fit: cover; }
.card strong { display: block; font-size: 1.6rem; font-family: var(--serif); }
.simulator-form { display: grid; gap: 14px; max-width: 720px; }
.simulator-form input, .simulator-form select { font: inherit; padding: 12px; border: 1px solid var(--line); background: var(--white); width: 100%; }
.simulator-nav { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 8px 0 18px; }
.simulator-nav a { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); text-decoration: none; }
.simulator-nav a[aria-current="page"] { background: var(--wine); color: var(--ivory); border-color: var(--wine); }
.search-form label.tab,
.simulator-form label:has(input[type="radio"]),
.admin-form label:has(input[type="radio"]) { display: flex; align-items: center; gap: 8px; }
.search-form .tab input,
.simulator-form input[type="radio"],
.admin-form input[type="radio"] { width: auto; height: auto; padding: 0; border: 0; background: transparent; flex: 0 0 auto; }
.admin-form input[type="color"] { width: 64px; height: 40px; padding: 2px; }
.admin-form > button { justify-self: start; }
.simulator-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
#resultado { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
#resultado p, #resultado strong { overflow-wrap: anywhere; }
.contrast-warn { background: #fff6df; border: 1px solid #8a6a12; padding: 12px; margin-bottom: 16px; }
.theme-sample { margin: 0; }
@media (prefers-reduced-motion: reduce) {
    .carousel-track { scroll-behavior: auto; }
    .property-card, .property-media img, .button { transition: none; }
    .property-card:hover, .property-card:hover .property-media img { transform: none; }
}
