:root {
    --navy: #0b2f55;
    --navy-hover: #082541;
    --text: #202832;
    --muted: #687482;
    --line: #dfe4e8;
    --soft: #f5f6f7;
    --green: #198754;
    --page-width: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: #fff;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}
body.viewer-open { overflow: hidden; }
a { color: var(--navy); }
button, input { font: inherit; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header__inner {
    max-width: var(--page-width);
    height: 64px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; text-decoration: none; }
.brand img { width: 30px; height: 30px; }

.page-shell { max-width: var(--page-width); margin: 0 auto; padding: 24px; }

.listing-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin: 20px 0 22px; }
.listing-heading__main { min-width: 0; }
.listing-labels { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.listing-label, .listing-status { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.listing-label { color: #8a4b00; }
.listing-status { color: var(--green); }
h1 { margin: 0; color: #102d50; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -.025em; }
.listing-location { margin: 12px 0 0; color: #566473; font-size: 16px; }
.listing-reference { margin: 5px 0 0; color: #818a94; font-size: 12px; }
.listing-price { flex: 0 0 auto; padding-bottom: 2px; text-align: right; }
.listing-price strong { display: block; color: var(--navy); font-size: clamp(26px, 3vw, 38px); line-height: 1.1; }
.listing-price span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; }

.quick-facts { display: flex; flex-wrap: wrap; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.quick-facts div { min-width: 140px; padding: 14px 28px 14px 0; margin-right: 28px; }
.quick-facts dt { color: var(--muted); font-size: 12px; }
.quick-facts dd { margin: 2px 0 0; color: #172f4d; font-weight: 700; }

.gallery {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 520px;
    gap: 4px;
    margin-bottom: 40px;
    overflow: hidden;
    background: #eceff1;
    border: 1px solid var(--line);
    border-radius: 4px;
}
.gallery-item { position: relative; min-width: 0; min-height: 0; padding: 0; overflow: hidden; border: 0; background: #eef0f1; cursor: pointer; }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .15s ease; }
.gallery-item:hover img { opacity: .92; }
.image-fallback { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; color: #707981; font-size: 14px; background: #eef0f1; }
.gallery-item.has-image-error .image-fallback { display: flex; }
.gallery--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.gallery--2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.gallery--3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.gallery--3 .gallery-item:first-child { grid-row: 1 / 3; }
.gallery:not(.gallery--1):not(.gallery--2):not(.gallery--3) .gallery-item:first-child { grid-row: 1 / 3; }
.gallery--4 .gallery-item:nth-child(4) { grid-column: 2 / 4; }
.gallery-count { position: absolute; right: 16px; bottom: 16px; min-height: 40px; padding: 0 16px; border: 1px solid #b9c0c7; border-radius: 4px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 700; cursor: pointer; }
.gallery-empty { height: 360px; margin-bottom: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--soft); color: var(--muted); }

.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; }
.content-main { min-width: 0; }
.content-section { padding: 0 0 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.content-section h2, .contact-panel h2, .sidebar-section h2 { margin: 0 0 20px; color: #122e50; font-size: 21px; line-height: 1.25; }
.description-copy { max-width: 76ch; color: #34404c; white-space: pre-line; line-height: 1.75; }

.property-details { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; margin: 0; }
.property-detail { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 20px; padding: 13px 0; border-bottom: 1px solid #e8ebee; }
.property-detail dt { color: var(--muted); font-size: 14px; }
.property-detail dd { margin: 0; color: #203751; font-size: 14px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.property-detail--long { grid-column: 1 / -1; display: block; padding: 20px 0; }
.property-detail--long dt { margin-bottom: 10px; color: #233b56; font-weight: 700; }
.property-detail--long dd { max-width: 76ch; color: #3f4b57; font-weight: 400; line-height: 1.7; text-align: left; white-space: pre-line; }

.listing-meta dl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }
.listing-meta dl div { padding: 14px 0; }
.listing-meta dt { color: var(--muted); font-size: 13px; }
.listing-meta dd { margin: 3px 0 0; color: #203751; font-weight: 700; }
.safety-note { padding: 18px 20px; border-left: 3px solid var(--navy); background: #f3f6f9; }
.safety-note strong { color: #163656; }
.safety-note p { margin: 4px 0 0; color: #4b5966; font-size: 14px; }

.sidebar { position: sticky; top: 24px; }
.contact-panel { padding: 24px; border: 1px solid #cfd6dc; }
.contact-name { margin: 0; font-size: 18px; font-weight: 700; }
.contact-type { margin: 3px 0 0; color: var(--muted); font-size: 14px; }
.contact-reference { margin: 18px 0; color: var(--muted); font-size: 12px; }
.contact-actions { display: grid; gap: 10px; }
.action { min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 5px; font-size: 14px; font-weight: 700; text-align: center; text-decoration: none; }
.action-primary { background: var(--navy); color: #fff; }
.action-primary:hover { background: var(--navy-hover); }
.action-whatsapp { background: var(--green); color: #fff; }
.action-secondary { border-color: var(--navy); color: var(--navy); background: #fff; }
.sidebar-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.sidebar-section p { margin: 0 0 8px; }
.location-name { color: #26394e; font-weight: 700; }
.sidebar-note { margin-top: 16px !important; color: var(--muted); font-size: 14px; }
.text-link { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 700; }
.share-links { display: flex; flex-wrap: wrap; gap: 10px; }
.share-links a, .share-links button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cfd6dc;
    border-radius: 4px;
    background: #fff;
    color: var(--navy);
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
}
.share-links a:hover, .share-links button:hover { border-color: var(--navy); background: #f5f7f9; }
.share-links button.is-copied { border-color: var(--green); color: var(--green); }
.mobile-contact { display: none; }

.photo-viewer { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; border: 0; background: #111; color: #fff; }
.photo-viewer::backdrop { background: #111; }
.photo-viewer__top { position: absolute; z-index: 2; top: 0; left: 0; right: 0; height: 64px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,.7); }
.photo-viewer__top button, .photo-nav { border: 1px solid #6c6c6c; border-radius: 4px; background: #222; color: #fff; cursor: pointer; }
.photo-viewer__top button { padding: 8px 14px; }
.photo-stage { width: 100%; height: 100%; padding: 72px 90px 30px; display: grid; place-items: center; }
.photo-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-nav { position: absolute; z-index: 2; top: 50%; padding: 10px 12px; transform: translateY(-50%); }
.photo-nav--previous { left: 18px; }
.photo-nav--next { right: 18px; }

@media (max-width: 900px) {
    .listing-heading { display: block; }
    .listing-price { margin-top: 20px; text-align: left; }
    .content-layout { grid-template-columns: 1fr; gap: 40px; }
    .sidebar { position: static; }
    .contact-panel { max-width: 520px; }
    .gallery { height: 430px; }
}

@media (max-width: 640px) {
    body { padding-bottom: 76px; font-size: 15px; }
    .site-header__inner { height: 56px; padding: 0 16px; }
    .brand span { display: none; }
    .page-shell { padding: 18px 16px 32px; }
    h1 { font-size: 31px; }
    .listing-location { font-size: 15px; }
    .quick-facts { display: grid; grid-template-columns: 1fr 1fr; }
    .quick-facts div { min-width: 0; margin: 0; padding: 11px 10px 11px 0; }
    .gallery, .gallery[class*="gallery--"] { display: block; height: 290px; margin-inline: -16px; border-width: 1px 0; border-radius: 0; }
    .gallery-item { display: none; width: 100%; height: 100%; }
    .gallery-item:first-child { display: block; }
    .gallery-count { display: block; }
    .gallery-empty { height: 260px; margin-inline: -16px; }
    .content-layout { gap: 32px; }
    .content-section { padding-bottom: 28px; margin-bottom: 28px; }
    .property-details { grid-template-columns: 1fr; }
    .property-detail--long { grid-column: auto; }
    .listing-meta dl { grid-template-columns: 1fr; gap: 0; }
    .contact-panel { padding: 20px; }
    .mobile-contact { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
    .photo-stage { padding: 68px 12px 72px; }
    .photo-nav { top: auto; bottom: 18px; transform: none; }
}
