/* ==========================================================
   INMUEBLES MARÍN — Hoja de estilos principal
   Paleta: Amarillo #FEDD00 · Verde azulado #3A8A9D · Carbón #232323
   Tipografía: Bebas Neue (títulos) + Montserrat (texto)
   ========================================================== */

:root {
    --yellow: #FEDD00;
    --yellow-deep: #E8C700;
    --teal: #3A8A9D;
    --teal-dark: #2C6B7A;
    --charcoal: #232323;
    --gray: #575756;
    --gray-light: #8a8a89;
    --paper: #FBFAF6;
    --white: #FFFFFF;
    --line: #E7E4D9;

    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fast: cubic-bezier(0.4, 0, 0.2, 1);
    --radius-card: 22px;
    --radius-sm: 12px;
    --shell: 1180px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--charcoal);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
.container { max-width: var(--shell); margin: 0 auto; padding: 0 28px; }

.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--charcoal); color: var(--white);
    padding: 12px 20px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: 0.3px;
    line-height: 1.05;
    margin: 0 0 0.4em;
    font-weight: 400;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }
p { margin: 0 0 1em; color: var(--gray); }
.eyebrow-free {} /* intentionally no eyebrow-label pattern used site-wide */

:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
    padding: 14px 28px; border-radius: 100px; border: 2px solid transparent;
    cursor: pointer; transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.25s var(--ease-fast);
    white-space: nowrap;
}
.btn-primary { background: var(--charcoal); color: var(--white); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(35,35,35,0.25); }
.btn-yellow { background: var(--yellow); color: var(--charcoal); }
.btn-yellow:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(254,221,0,0.4); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(58,138,157,0.35); }
.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: var(--white); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:active { transform: scale(0.97); }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(251, 250, 246, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
    transition: box-shadow 0.3s var(--ease);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { flex-shrink: 0; }
.brand-word { font-family: var(--font-display); color: var(--teal); font-size: 1.15rem; line-height: 0.95; }

.main-nav { display: flex; align-items: center; gap: 28px; font-weight: 600; font-size: 0.92rem; }
.main-nav a { position: relative; padding: 6px 0; transition: color 0.25s var(--ease-fast); }
.main-nav a:not(.btn):not(.active)::after {
    content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--teal);
    transition: right 0.3s var(--ease);
}
.main-nav a:not(.btn):hover::after { right: 0; }
.main-nav a.active { color: var(--teal); }
.lang-switch { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.85rem; color: var(--gray-light); }
.lang-switch a.active { color: var(--charcoal); }
.lang-switch a:hover { color: var(--teal); }

.menu-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 24px; height: 2px; background: var(--charcoal); transition: transform 0.3s var(--ease), opacity 0.3s var(--ease); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 84px 0 96px;
    background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow) 55%, var(--paper) 100%);
    overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; max-width: 720px; }
.hero h1 { color: var(--charcoal); }
.hero p.subtitle { font-size: 1.15rem; color: rgba(35,35,35,0.75); max-width: 560px; }
.hero-bird {
    position: absolute; right: -40px; bottom: -30px; width: 340px; opacity: 0.9;
    transform: rotate(-4deg);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Animación de entrada aplicada al cargar (no depende de scroll ni de JS,
   así el contenido SIEMPRE es visible: para buscadores, sin JavaScript,
   o si el usuario llega directo a media página por un enlace). */
.reveal { animation: fadeInUp 0.8s var(--ease) both; }
.reveal-stagger > * { opacity: 0; animation: fadeInUp 0.7s var(--ease) both; }
.reveal-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger > *:nth-child(2) { animation-delay: 0.16s; }
.reveal-stagger > *:nth-child(3) { animation-delay: 0.27s; }
.reveal-stagger > *:nth-child(4) { animation-delay: 0.38s; }

/* ---------- Search box (sign-style card) ---------- */
.search-card {
    background: var(--white);
    border: 3px solid var(--charcoal);
    border-radius: var(--radius-card);
    padding: 22px;
    margin-top: 34px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: end;
    box-shadow: 0 18px 40px rgba(35,35,35,0.12);
}
.search-field { display: flex; flex-direction: column; gap: 6px; }
.search-field label { font-size: 0.78rem; font-weight: 700; color: var(--gray); }
.search-field input, .search-field select {
    border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
    font-family: var(--font-body); font-size: 0.95rem; background: var(--paper);
    transition: border-color 0.25s var(--ease-fast), box-shadow 0.25s var(--ease-fast);
}
.search-field input:focus, .search-field select:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(58,138,157,0.15); outline: none; }
.radius-value { font-weight: 700; color: var(--teal); }

@media (max-width: 760px) {
    .search-card { grid-template-columns: 1fr; }
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-alt { background: var(--white); }
.section-teal { background: var(--teal); color: var(--white); }
.section-teal h2, .section-teal p { color: var(--white); }
.section-head { max-width: 640px; margin-bottom: 48px; }

/* ---------- Value props ---------- */
.value-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.value-item { padding: 8px 0; }
.value-icon {
    width: 56px; height: 56px; border-radius: 16px; background: var(--yellow);
    display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
    font-family: var(--font-display); font-size: 1.5rem; color: var(--charcoal);
}
@media (max-width: 860px) { .value-grid { grid-template-columns: 1fr; } }

/* ---------- Property cards (signage-inspired) ---------- */
.property-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 980px) { .property-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .property-grid { grid-template-columns: 1fr; } }

.property-card {
    background: var(--white);
    border: 3px solid var(--charcoal);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
    display: flex; flex-direction: column;
}
.property-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(35,35,35,0.18); }
.property-photo {
    aspect-ratio: 4/3; background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.property-photo img { width: 100%; height: 100%; object-fit: cover; }
.property-photo .placeholder-bird { width: 76px; opacity: 0.85; }
.property-badge {
    display: inline-flex; align-items: center; background: var(--yellow); color: var(--charcoal);
    font-weight: 700; font-size: 0.75rem; padding: 6px 14px; border-radius: 100px; border: 2px solid var(--charcoal);
}
.property-photo .property-badge {
    position: absolute; top: 14px; left: 14px;
}
.property-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.property-price { font-family: var(--font-display); font-size: 1.5rem; color: var(--teal-dark); }
.property-title { font-weight: 700; font-size: 1rem; }
.property-loc { font-size: 0.85rem; color: var(--gray); }
.property-specs { display: flex; gap: 14px; font-size: 0.82rem; color: var(--gray); margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.property-distance { font-size: 0.78rem; color: var(--teal-dark); font-weight: 600; }

/* ---------- CTA banner ---------- */
.cta-banner {
    background: var(--charcoal); color: var(--white); border-radius: 28px;
    padding: 56px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 22px;
}
.cta-banner h2 { color: var(--white); }
.cta-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ---------- Filters (properties page) ---------- */
.listing-layout { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .listing-layout { grid-template-columns: 1fr; } }
.filters-panel {
    background: var(--white); border: 2px solid var(--line); border-radius: var(--radius-card);
    padding: 26px; position: sticky; top: 100px; display: flex; flex-direction: column; gap: 18px;
}
.filters-panel h3 { margin-bottom: 4px; }
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 0.8rem; font-weight: 700; color: var(--gray); }
.field-group input, .field-group select {
    border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; font-family: var(--font-body);
    background: var(--paper); width: 100%; min-width: 0; box-sizing: border-box;
}
.field-row { display: flex; gap: 10px; }
.field-row .field-group { flex: 1 1 0; min-width: 0; }
.range-row { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Control segmentado (Venta / Arriendo) ---------- */
.segmented { display: flex; border: 2px solid var(--teal); border-radius: 100px; overflow: hidden; }
.segmented button {
    flex: 1; background: var(--white); border: none; padding: 13px 10px;
    font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.5px; text-transform: uppercase;
    cursor: pointer; color: var(--teal-dark);
    transition: background 0.25s var(--ease-fast), color 0.25s var(--ease-fast);
}
.segmented button:not(:last-child) { border-right: 2px solid var(--teal); }
.segmented button.active { background: var(--teal); color: var(--white); }
.segmented button:hover:not(.active) { background: var(--paper); }
.view-toggle { display: flex; gap: 8px; margin-bottom: 24px; }
.view-toggle button {
    border: 2px solid var(--charcoal); background: transparent; padding: 8px 18px; border-radius: 100px;
    font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: background 0.25s var(--ease-fast), color 0.25s var(--ease-fast);
}
.view-toggle button.active { background: var(--charcoal); color: var(--white); }
#mapView { display: none; height: 520px; border-radius: var(--radius-card); overflow: hidden; border: 3px solid var(--charcoal); margin-bottom: 30px; }
#mapView.active { display: block; }
#gridView.hidden { display: none; }

/* ---------- Property detail ---------- */
/* ---------- Galería de fotos (detalle de propiedad) ---------- */
.gallery { margin-bottom: 40px; }
.gallery-main {
    position: relative; aspect-ratio: 16/10; background: var(--paper);
    border: 3px solid var(--charcoal); border-radius: var(--radius-card); overflow: hidden;
    display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.gallery-main .placeholder-bird { width: 110px; height: auto; opacity: 0.85; cursor: default; }
.gallery-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.92); border: 2px solid var(--charcoal); display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 1.3rem; line-height: 1; transition: background 0.25s var(--ease-fast), transform 0.25s var(--ease-fast);
}
.gallery-nav:hover { background: var(--yellow); transform: translateY(-50%) scale(1.06); }
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-counter {
    position: absolute; bottom: 16px; right: 16px; background: rgba(35,35,35,0.75); color: #fff;
    font-size: 0.78rem; font-weight: 600; padding: 5px 14px; border-radius: 100px;
}
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs img {
    width: 88px; height: 66px; object-fit: cover; border-radius: 10px; border: 2px solid transparent;
    cursor: pointer; flex-shrink: 0; opacity: 0.65; transition: border-color 0.25s var(--ease-fast), opacity 0.25s var(--ease-fast);
}
.gallery-thumbs img:hover { opacity: 0.9; }
.gallery-thumbs img.active { border-color: var(--teal); opacity: 1; }

/* Lightbox de pantalla completa */
.lightbox {
    position: fixed; inset: 0; background: rgba(20,20,20,0.94); z-index: 999;
    display: none; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 88vw; max-height: 82vh; object-fit: contain; border-radius: 12px; }
.lightbox-close {
    position: absolute; top: 22px; right: 26px; background: none; border: none; color: #fff;
    font-size: 2.2rem; line-height: 1; cursor: pointer;
}
.lightbox .gallery-nav { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.6); color: #fff; }
.lightbox .gallery-nav:hover { background: var(--yellow); color: var(--charcoal); border-color: var(--charcoal); }

.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 50px; align-items: start; }
@media (max-width: 900px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-specs { display: flex; gap: 30px; flex-wrap: wrap; margin: 24px 0; padding: 22px 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.detail-spec-item { display: flex; flex-direction: column; }
.detail-spec-item strong { font-family: var(--font-display); font-size: 1.6rem; color: var(--teal-dark); }
.detail-spec-item span { font-size: 0.8rem; color: var(--gray); }
#detailMap { height: 280px; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); margin-top: 14px; }

.contact-card {
    background: var(--white); border: 3px solid var(--charcoal); border-radius: var(--radius-card);
    padding: 28px; position: sticky; top: 100px; display: flex; flex-direction: column; gap: 14px;
}

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-field label { font-weight: 700; font-size: 0.85rem; }
.form-field input, .form-field select, .form-field textarea {
    border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 13px 14px;
    font-family: var(--font-body); font-size: 0.95rem; background: var(--white);
    transition: border-color 0.25s var(--ease-fast), box-shadow 0.25s var(--ease-fast);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
    outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(58,138,157,0.15);
}
.form-card { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius-card); padding: 34px; max-width: 640px; }
.alert-success { background: #EAF6E9; border: 2px solid #6FBF73; color: #2C6B2E; padding: 16px 20px; border-radius: var(--radius-sm); margin-bottom: 24px; font-weight: 600; }
.alert-error { background: #FBEAEA; border: 2px solid #E28B8B; color: #7A2222; padding: 16px 20px; border-radius: var(--radius-sm); margin-bottom: 24px; font-weight: 600; }

/* ---------- Process steps ---------- */
.process-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
@media (max-width: 860px) { .process-grid { grid-template-columns: 1fr; } }
.process-step { position: relative; padding-top: 12px; border-top: 3px solid var(--teal); }
.process-step h3 { color: var(--teal-dark); }

/* ---------- Footer ---------- */
.site-footer { background: var(--charcoal); color: rgba(255,255,255,0.82); padding: 64px 0 24px; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
.footer-brand { display: flex; flex-direction: column; gap: 10px; }
.footer-brand .brand-icon { margin-bottom: 4px; }
.brand-word-footer { font-family: var(--font-display); font-size: 1.3rem; color: var(--yellow); }
.footer-tagline { font-size: 0.85rem; color: rgba(255,255,255,0.6); max-width: 220px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--yellow); margin-bottom: 4px; }
.footer-col a, .footer-city { font-size: 0.9rem; color: rgba(255,255,255,0.75); transition: color 0.25s var(--ease-fast); }
.footer-col a:hover { color: var(--yellow); }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.8rem; color: rgba(255,255,255,0.5); }

/* ---------- Legal pages ---------- */
.legal-content { max-width: 760px; }
.legal-content h2 { margin-top: 1.6em; }
.legal-content p, .legal-content li { color: var(--gray); }
.legal-content ul { padding-left: 1.4em; list-style: disc; margin-bottom: 1em; }

/* ---------- Admin ---------- */
.admin-body { background: var(--paper); }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--charcoal); color: var(--white); padding: 28px 20px; flex-shrink: 0; }
.admin-sidebar .brand-word { color: var(--yellow); }
.admin-sidebar nav { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar nav a { padding: 12px 14px; border-radius: 10px; font-weight: 600; font-size: 0.92rem; color: rgba(255,255,255,0.75); transition: background 0.2s; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.1); color: var(--white); }
.admin-main { flex: 1; padding: 40px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.admin-card { background: var(--white); border: 2px solid var(--line); border-radius: var(--radius-card); padding: 28px; margin-bottom: 26px; }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th, table.admin-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
table.admin-table th { color: var(--gray); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.badge { padding: 4px 12px; border-radius: 100px; font-size: 0.75rem; font-weight: 700; }
.badge-available { background: #EAF6E9; color: #2C6B2E; }
.badge-sold { background: #FBEAEA; color: #7A2222; }
.badge-new { background: var(--yellow); color: var(--charcoal); }
.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--yellow); }
.login-card { background: var(--white); border: 3px solid var(--charcoal); border-radius: var(--radius-card); padding: 44px; width: 100%; max-width: 400px; }
.photo-thumb { width: 90px; height: 68px; object-fit: cover; border-radius: 8px; border: 2px solid var(--line); }

/* ---------- Mobile nav ---------- */
@media (max-width: 900px) {
    .main-nav {
        position: fixed; top: 0; right: 0; height: 100vh; width: 280px; background: var(--white);
        flex-direction: column; align-items: flex-start; padding: 100px 30px 30px; gap: 22px;
        transform: translateX(100%); transition: transform 0.4s var(--ease); box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    }
    .main-nav.open { transform: translateX(0); }
    .menu-toggle { display: flex; }
    .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-toggle.open span:nth-child(2) { opacity: 0; }
    .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .admin-sidebar { display: none; }
}
