/* ============================================================
   InmoCRM — Portal Público CSS
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-900: #042C53; --blue-800: #0C447C; --blue-600: #185FA5; --blue-50: #E6F1FB;
    --teal-600: #0F6E56; --teal-50: #E1F5EE;
    --green-600:#3B6D11; --green-50: #EAF3DE;
    --amber-50: #FAEEDA; --amber-600:#854F0B;
    --gray-900: #2C2C2A; --gray-800: #444441; --gray-600: #5F5E5A;
    --gray-200: #B4B2A9; --gray-100: #D3D1C7; --gray-50: #F1EFE8;
    --white: #FFFFFF;
    --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
    --border: 0.5px solid #D3D1C7;
    --shadow-card: 0 2px 8px rgba(0,0,0,.06);
}

body { font-family: 'DM Sans', system-ui, sans-serif; font-size: 15px; color: var(--gray-900); background: var(--gray-50); }

/* ── Property cards (shared) ─────────────────────────────────── */
.prop-card {
    display: flex; flex-direction: column;
    background: var(--white); border-radius: var(--radius-lg);
    border: var(--border); overflow: hidden;
    text-decoration: none; color: inherit;
    transition: transform .18s, box-shadow .18s;
}
.prop-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.09); }

.prop-card-img { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--gray-50); }
.prop-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.prop-card:hover .prop-card-img img { transform: scale(1.03); }
.prop-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-200); }
.prop-card-img-placeholder i { font-size: 36px; }

.prop-card-op { position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.op-sale { background: var(--blue-800); color: #fff; }
.op-rent { background: var(--teal-600); color: #fff; }
.op-both { background: var(--gray-800); color: #fff; }
.prop-card-featured { position: absolute; top: 10px; right: 10px; background: #EF9F27; color: #fff; border-radius: 99px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 12px; }

.prop-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.prop-card-price { font-size: 1.1rem; font-weight: 600; color: var(--blue-800); margin-bottom: 4px; }
.prop-card-title { font-size: .9rem; font-weight: 500; color: var(--gray-900); margin-bottom: 6px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prop-card-loc { font-size: .8rem; color: var(--gray-600); display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.prop-card-loc i { font-size: 13px; }
.prop-card-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--gray-600); margin-top: auto; padding-top: 10px; border-top: var(--border); }
.prop-card-stats span { display: flex; align-items: center; gap: 4px; }
.prop-card-stats i { font-size: 13px; }
.prop-card-type { margin-top: 6px; font-size: .75rem; color: var(--blue-600); font-weight: 500; }

/* ── Public listing ──────────────────────────────────────────── */
.public-list-wrap { max-width: 1280px; margin: 0 auto; padding: 24px 16px; }
.list-header { margin-bottom: 20px; }
.list-title { font-size: 1.4rem; font-weight: 600; color: var(--gray-900); }
.list-sub { font-size: 13px; color: var(--gray-600); margin-top: 3px; }

.list-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }

/* Filtros lateral público */
.list-filters { position: sticky; top: 16px; }
.filter-card { background: var(--white); border: var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 12px; }
.filter-card-title { font-size: 12px; font-weight: 600; color: var(--gray-800); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.filter-search-wrap { position: relative; }
.filter-search-wrap i { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--gray-600); }
.filter-search-input { width: 100%; height: 34px; padding: 0 8px 0 28px; border: var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--gray-900); background: var(--white); }
.filter-select-full { width: 100%; height: 34px; padding: 0 8px; border: var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--gray-900); background: var(--white); }
.filter-input-full { width: 100%; height: 34px; padding: 0 10px; border: var(--border); border-radius: var(--radius-sm); font-size: 13px; color: var(--gray-900); background: var(--white); }

.radio-group { display: flex; flex-direction: column; gap: 6px; }
.radio-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--gray-800); cursor: pointer; }
.radio-opt input { accent-color: var(--blue-600); }

.rooms-selector { display: flex; gap: 4px; flex-wrap: wrap; }
.room-opt { padding: 4px 10px; border: var(--border); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; color: var(--gray-800); background: var(--white); transition: background .1s, border-color .1s; }
.room-opt.active, .room-opt:has(input:checked) { background: var(--blue-800); color: #fff; border-color: var(--blue-800); }
.room-opt input { display: none; }

.btn-apply-filters { width: 100%; height: 36px; background: var(--blue-800); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 6px; }
.btn-apply-filters:hover { background: var(--blue-900); }
.btn-clear-filters { display: block; text-align: center; font-size: 12px; color: var(--gray-600); text-decoration: none; padding: 4px; }
.btn-clear-filters:hover { color: var(--gray-900); }

/* Grid resultados */
.results-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-count { font-size: 13px; color: var(--gray-600); }
.sort-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-600); }
.sort-select { height: 30px; padding: 0 6px; border: var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--gray-900); background: var(--white); }

.props-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 20px; }

.pagination-pub { display: flex; justify-content: center; gap: 4px; margin-top: 20px; }
.page-btn-pub { width: 34px; height: 34px; border-radius: var(--radius-sm); border: var(--border); display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 13px; color: var(--gray-600); background: var(--white); transition: background .1s; }
.page-btn-pub:hover { background: var(--gray-50); }
.page-btn-pub.active { background: var(--blue-800); color: #fff; border-color: var(--blue-800); }

/* ── Property detail ─────────────────────────────────────────── */
.detail-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

.gallery-hero { margin-bottom: 28px; }
.gallery-main { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/7; background: var(--gray-50); }
.gallery-slide { position: absolute; inset: 0; display: none; }
.gallery-slide.active { display: block; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-200); }
.gallery-placeholder i { font-size: 60px; }

.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.45); border: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2; backdrop-filter: blur(4px); transition: background .15s; }
.gallery-nav:hover { background: rgba(0,0,0,.65); }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-nav i { font-size: 20px; }
.gallery-counter { position: absolute; bottom: 12px; right: 14px; background: rgba(0,0,0,.45); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 99px; backdrop-filter: blur(4px); }

.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumb { flex-shrink: 0; width: 80px; height: 60px; border-radius: var(--radius-sm); background-size: cover; background-position: center; border: 2px solid transparent; cursor: pointer; transition: border-color .15s; }
.gallery-thumb.active { border-color: var(--blue-600); }

.detail-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 28px; }

.detail-header {}
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.detail-op-badge { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.op-sale { background: var(--blue-800); color: #fff; }
.op-rent { background: var(--teal-600); color: #fff; }
.op-both { background: var(--gray-800); color: #fff; }
.detail-type-badge { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--blue-50); color: var(--blue-800); }
.detail-featured-badge { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--amber-50); color: var(--amber-600); }
.detail-title { font-size: 1.6rem; font-weight: 600; color: var(--gray-900); line-height: 1.25; margin-bottom: 8px; }
.detail-location { font-size: 14px; color: var(--gray-600); display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.detail-location i { font-size: 16px; }
.detail-price { font-size: 2rem; font-weight: 700; color: var(--blue-800); }
.price-period { font-size: 1rem; font-weight: 400; color: var(--gray-600); }

.detail-stats { display: flex; gap: 0; border: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.detail-stat { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 12px 8px; border-right: var(--border); background: var(--white); }
.detail-stat:last-child { border-right: none; }
.detail-stat i { font-size: 20px; color: var(--blue-600); margin-bottom: 4px; }
.stat-val { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); }
.stat-lbl { font-size: 11px; color: var(--gray-600); }

.detail-section {}
.detail-section-title { font-size: 1rem; font-weight: 600; color: var(--gray-900); margin-bottom: 12px; padding-bottom: 8px; border-bottom: var(--border); }
.detail-description { font-size: 14px; line-height: 1.7; color: var(--gray-800); white-space: pre-wrap; }

.amenities-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.amenity-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-800); }
.amenity-item i { font-size: 16px; color: var(--teal-600); flex-shrink: 0; }

.details-table { border: var(--border); border-radius: var(--radius-md); overflow: hidden; }
.details-row { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 13px; border-bottom: var(--border); }
.details-row:last-child { border-bottom: none; }
.details-row span:first-child { color: var(--gray-600); }
.details-row span:last-child { font-weight: 500; color: var(--gray-900); }
.ref-code { font-size: 11px; color: var(--gray-600); font-weight: 400; }

/* Sidebar detalle */
.detail-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; }
.contact-card { background: var(--white); border: var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.contact-card-header { padding: 16px; border-bottom: var(--border); }
.contact-card-header h3 { font-size: 15px; font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.contact-card-header p { font-size: 12px; color: var(--gray-600); line-height: 1.5; }
.contact-form { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.contact-success { padding: 24px; text-align: center; flex-direction: column; align-items: center; gap: 8px; }
.contact-success i { font-size: 36px; color: var(--teal-600); }
.contact-success strong { font-size: 15px; color: var(--gray-900); }
.contact-success p { font-size: 13px; color: var(--gray-600); }

.cf-field { display: flex; flex-direction: column; gap: 4px; }
.cf-field label { font-size: 12px; font-weight: 500; color: var(--gray-800); }
.cf-field input, .cf-field textarea { width: 100%; padding: 8px 10px; border: 1.5px solid var(--gray-100); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; color: var(--gray-900); background: var(--white); transition: border-color .15s; outline: none; }
.cf-field input:focus, .cf-field textarea:focus { border-color: var(--blue-600); }
.cf-field textarea { resize: vertical; line-height: 1.5; }

.btn-contact-submit { width: 100%; height: 42px; background: var(--blue-800); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: background .15s; }
.btn-contact-submit:hover { background: var(--blue-900); }
.btn-contact-submit i { font-size: 16px; }

.btn-whatsapp { display: flex; align-items: center; justify-content: center; gap: 7px; height: 40px; background: #1D9E75; color: #fff; border-radius: var(--radius-sm); text-decoration: none; font-size: 13px; font-weight: 500; transition: background .15s; }
.btn-whatsapp:hover { background: #0F6E56; color: #fff; }
.btn-whatsapp i { font-size: 18px; }

.price-calc-card { background: var(--white); border: var(--border); border-radius: var(--radius-md); padding: 14px; }
.price-per-m2 { display: flex; justify-content: space-between; align-items: center; }
.ppm-label { font-size: 12px; color: var(--gray-600); }
.ppm-val { font-size: 15px; font-weight: 600; color: var(--gray-900); }

/* Relacionadas */
.related-section { margin-top: 40px; }
.related-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { background: var(--white); border: var(--border); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; }
.empty-state i { font-size: 36px; color: var(--gray-200); margin-bottom: 10px; display: block; }
.empty-state h3 { font-size: 15px; font-weight: 500; color: var(--gray-800); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--gray-600); margin-bottom: 16px; }
.btn-primary-sm { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: var(--blue-800); color: #fff; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; text-decoration: none; }
.btn-primary-sm:hover { background: var(--blue-900); color: #fff; }

/* ── Spinner ─────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin .7s linear infinite; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .list-layout { grid-template-columns: 1fr; }
    .list-filters { position: static; }
    .detail-layout { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}
@media (max-width: 600px) {
    .props-grid { grid-template-columns: 1fr; }
    .detail-stats { flex-wrap: wrap; }
    .detail-stat { min-width: 33%; }
    .gallery-main { aspect-ratio: 4/3; }
}

/* ── Navbar pública ──────────────────────────────────────────── */
.pub-navbar {
    background: var(--white);
    border-bottom: var(--border);
    position: sticky; top: 0; z-index: 100;
}
.pub-nav-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 16px; height: 56px;
    display: flex; align-items: center; gap: 24px;
}
.pub-brand {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; font-size: 15px; font-weight: 600;
    color: var(--blue-900); flex-shrink: 0;
}
.pub-brand-icon {
    width: 30px; height: 30px; border-radius: 7px;
    background: var(--blue-800); display: flex; align-items: center; justify-content: center;
}
.pub-brand-icon i { font-size: 17px; color: #fff; }
.pub-brand-icon.sm { width: 22px; height: 22px; border-radius: 5px; }
.pub-brand-icon.sm i { font-size: 13px; }

.pub-nav-links { display: flex; gap: 4px; flex: 1; }
.pub-nav-link {
    padding: 6px 12px; border-radius: 6px;
    font-size: 14px; color: var(--gray-600);
    text-decoration: none; transition: background .15s, color .15s;
}
.pub-nav-link:hover { background: var(--gray-50); color: var(--gray-900); }

.pub-nav-actions { display: flex; gap: 8px; }
.pub-nav-btn-outline {
    height: 32px; padding: 0 14px;
    border: var(--border); border-radius: 6px;
    font-size: 13px; font-weight: 500;
    color: var(--blue-800); text-decoration: none;
    display: flex; align-items: center;
    transition: background .15s;
}
.pub-nav-btn-outline:hover { background: var(--blue-50); }

.pub-nav-burger {
    display: none; background: none; border: none;
    font-size: 22px; color: var(--gray-800); cursor: pointer;
    margin-left: auto;
}

.pub-nav-mobile {
    display: none; flex-direction: column;
    background: var(--white); border-top: var(--border);
    padding: 8px 16px 12px;
}
.pub-nav-mobile.open { display: flex; }
.pub-nav-mobile-link {
    padding: 10px 4px; font-size: 14px;
    color: var(--gray-800); text-decoration: none;
    border-bottom: var(--border);
}
.pub-nav-mobile-link:last-child { border-bottom: none; }

/* ── Footer público ──────────────────────────────────────────── */
.pub-footer {
    background: var(--blue-900);
    margin-top: 60px;
}
.pub-footer-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 28px 16px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.pub-footer-brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 600; color: #fff;
}
.pub-footer-copy { font-size: 12px; color: rgba(255,255,255,.45); }
.pub-footer-links { display: flex; gap: 16px; }
.pub-footer-links a { font-size: 12px; color: rgba(255,255,255,.5); text-decoration: none; }
.pub-footer-links a:hover { color: rgba(255,255,255,.8); }

@media (max-width: 768px) {
    .pub-nav-links, .pub-nav-actions { display: none; }
    .pub-nav-burger { display: flex; }
    .pub-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Navbar botón primario ───────────────────────────────────── */
.pub-nav-btn-primary {
    height: 32px; padding: 0 14px;
    background: var(--blue-800, #0C447C); color: #fff;
    border-radius: 6px; font-size: 13px; font-weight: 500;
    text-decoration: none; display: flex; align-items: center; gap: 5px;
    transition: background .15s;
}
.pub-nav-btn-primary:hover { background: var(--blue-900, #042C53); color: #fff; }

/* ── Footer expandido ────────────────────────────────────────── */
.pub-footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 40px 0 32px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.pub-footer-desc {
    font-size: 13px;
    color: rgba(255,255,255,.45);
    line-height: 1.65;
    margin-top: 10px;
    max-width: 280px;
}
.pub-footer-links-col {
    display: flex; flex-direction: column; gap: 8px;
}
.pub-footer-col-title {
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,.6);
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px;
}
.pub-footer-links-col a {
    font-size: 13px; color: rgba(255,255,255,.45); text-decoration: none;
    transition: color .15s;
}
.pub-footer-links-col a:hover { color: rgba(255,255,255,.85); }
.pub-footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0 0;
}
.pub-footer-bottom-links { display: flex; gap: 16px; }
.pub-footer-bottom-links a {
    font-size: 12px; color: rgba(255,255,255,.35); text-decoration: none;
}
.pub-footer-bottom-links a:hover { color: rgba(255,255,255,.6); }

@media (max-width: 900px) {
    .pub-footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .pub-footer-top { grid-template-columns: 1fr; gap: 20px; }
    .pub-footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
