:root {
    --bg-main: #FAFAFA;
    --bg-card: #FFFFFF;
    --navy-primary: #0B2545;
    --navy-hover: #134074;
    --text-dark: #1D2A44;
    --text-muted: #6C7A89;
    --border-color: #E2E8F0;
    --shadow-light: 0 4px 15px rgba(11, 37, 69, 0.05);
    --shadow-hover: 0 8px 25px rgba(11, 37, 69, 0.1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.5;
    padding: 0 0 40px 0;
}

/* Encabezado Principal */
header {
    background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('fotos/PAGE/portada.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #FFFFFF;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

header p {
    color: #D0D8E5;
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.btn-header {
    display: inline-block;
    background-color: #FFFFFF;
    color: var(--navy-primary);
    padding: 10px 26px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-header:hover {
    background-color: #E6EDF5;
}

/* Layout */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.gallery-header {
    margin-bottom: 25px;
    text-align: center;
}

.section-title {
    font-size: 1.5rem;
    color: var(--navy-primary);
    margin-bottom: 6px;
    font-weight: 700;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.92rem;
}

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

/* Tarjeta de Propiedad */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-img-container {
    position: relative;
    width: 100%;
    height: 220px;
    background-color: #EEF2F6;
}

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

.tag-status {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--navy-primary);
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 6px;
}

.title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.features {
    list-style: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.features li {
    margin-bottom: 6px;
}

.btn-details {
    display: block;
    text-align: center;
    background: var(--navy-primary);
    color: #FFFFFF;
    border: none;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    width: 100%;
    transition: background 0.2s;
}

.btn-details:hover {
    background: var(--navy-hover);
}

.btn-map {
    background-color: #134074;
    margin-bottom: 10px;
}
.btn-map:hover {
    background-color: #0b2545;
}

/* Modal / Ventana Emergente */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 37, 69, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: #FFFFFF;
    border-radius: 12px;
    max-width: 850px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    padding: 25px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--navy-primary);
    cursor: pointer;
    font-weight: bold;
    z-index: 10;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 5px;
    align-items: start;
}

.modal-grid > div {
    min-width: 0;
}

@media (max-width: 700px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

.main-img-container {
    width: 100%;
    height: 240px;
    background: #EEF2F6;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.gallery-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    max-width: 100%;
}

.gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}
.gallery-thumbs::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
.gallery-thumbs::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.gallery-thumbs img {
    width: 55px;
    height: 55px;
    min-width: 55px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.gallery-thumbs img.active-thumb {
    border-color: var(--navy-primary);
}

.modal-info .modal-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 2px;
}

.modal-info .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.modal-info .description-box {
    font-size: 0.88rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    max-height: 180px;
    overflow-y: auto;
}

.description-box h4 {
    color: var(--navy-primary);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.description-box ul {
    list-style: none;
}

.description-box li {
    margin-bottom: 4px;
    color: #4A5568;
}

/* Modal Zoom */
.zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: zoom-out;
}

.zoom-overlay.active {
    display: flex;
}

.zoom-img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    border-radius: 4px;
}

footer {
    max-width: 1140px;
    margin: 50px auto 0 auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

@media (min-width: 740px) {
    header {
        background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url('fotos/PAGE/portadapc.jpg');
        background-position: center top; 
        padding: 120px 120px 20px 40px; 
    }
}