:root {
    --brand-red: #e31e24; 
    --dark: #1a1a1a;
    --gray-bg: #f4f6f9;
    --border-color: #eaeaea;
    --white: #ffffff;
    --text-main: #333;
    --text-light: #666;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background: var(--gray-bg); color: var(--text-main); line-height: 1.6; }

.container { width: 90%; max-width: 1200px; margin: 0 auto; }

/* HEADER */
.main-header { background: var(--white); padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.nav-flex { display: flex; justify-content: space-between; align-items: center; }
.main-logo { height: 70px; width: auto; }
nav a { text-decoration: none; color: var(--dark); font-weight: 600; margin-left: 20px; font-size: 0.95rem; transition: 0.3s; }
nav a:hover { color: var(--brand-red); }

/* SECCIÓN PROPIEDADES */
.properties-section { padding: 60px 0; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2.5rem; color: var(--dark); }

/* GRID Y TARJETAS */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }
.card { background: var(--white); border-radius: 15px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); cursor: pointer; transition: 0.3s; position: relative; border: 1px solid var(--border-color); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-8px); border-color: var(--brand-red); box-shadow: 0 10px 25px rgba(227, 30, 36, 0.15); }

.card-badge { position: absolute; top: 15px; left: 15px; background: var(--brand-red); color: white; padding: 5px 12px; font-size: 0.75rem; font-weight: 700; border-radius: 20px; letter-spacing: 1px; z-index: 10; text-transform: uppercase; box-shadow: 0 2px 10px rgba(0,0,0,0.2); }

.card-img-wrapper { height: 220px; width: 100%; position: relative; background: #ddd; }
.card-img { width: 100%; height: 100%; object-fit: cover; }

.card-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.card-type { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; font-weight: 600; margin-bottom: 5px; }
.card-title { font-size: 1.3rem; color: var(--dark); font-weight: 700; margin-bottom: 10px; line-height: 1.2; }
.card-price { font-size: 1.5rem; color: var(--brand-red); font-weight: 700; margin-bottom: 15px; }

/* Iconos de info básica en la tarjeta */
.card-basic-info { display: flex; gap: 15px; border-top: 1px solid var(--border-color); padding-top: 15px; margin-top: auto; color: var(--text-light); font-size: 0.9rem; font-weight: 600; }
.card-basic-info span { display: flex; align-items: center; gap: 5px; }
.card-basic-info i { color: var(--brand-red); font-size: 1.1rem; }

/* SECCIÓN AGENTE */
.agent-compact-section { background: var(--white); padding: 60px 0; border-radius: 20px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); margin-bottom: 60px; }
.agent-grid { display: grid; grid-template-columns: 300px 1fr; gap: 50px; align-items: center; max-width: 900px; margin: 0 auto; }
.agent-photo-wrapper { border-radius: 15px; overflow: hidden; border: 5px solid var(--gray-bg); }
.agent-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-info h2 { font-size: 2.2rem; color: var(--dark); margin: 10px 0; }
.btn-whatsapp { background: #25d366; color: white; padding: 12px 25px; text-decoration: none; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; transition: 0.3s; }
.btn-whatsapp:hover { background: #1eb954; transform: scale(1.02); }
.w-100 { width: 100%; margin: 15px 0; font-size: 1.1rem; padding: 15px; }

/* MODAL Y FICHA TÉCNICA */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; justify-content: center; align-items: center; padding: 20px; }
.close-modal { position: absolute; top: 15px; right: 30px; color: white; font-size: 2.5rem; cursor: pointer; z-index: 2010; transition: 0.3s; }
.close-modal:hover { color: var(--brand-red); }

.modal-content-wrapper { width: 100%; max-width: 1200px; max-height: 95vh; }
.modal-main-layout { display: flex; background: var(--white); border-radius: 15px; overflow: hidden; height: 85vh; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }

/* Lado Izquierdo: Fotos */
.modal-image-container { flex: 1.2; background: #000; position: relative; display: flex; flex-direction: column; }
.modal-image-container img { width: 100%; height: calc(100% - 60px); object-fit: contain; background: #111; }
.modal-controls { height: 60px; display: flex; justify-content: center; align-items: center; gap: 20px; background: #1a1a1a; color: white; }
.nav-btn { background: #333; border: none; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.nav-btn:hover { background: var(--brand-red); }

/* Lado Derecho: Info */
.modal-info-sidebar { flex: 1; padding: 30px 40px; overflow-y: auto; background: var(--white); }
.modal-badge { display: inline-block; background: var(--brand-red); color: white; padding: 4px 10px; font-size: 0.75rem; border-radius: 4px; font-weight: 700; margin-bottom: 10px; }
.modal-info-sidebar h2 { font-size: 2rem; color: var(--dark); line-height: 1.1; margin-bottom: 5px; }
.info-location { color: var(--text-light); font-size: 0.95rem; margin-bottom: 15px; }
.info-price { font-size: 2.2rem; color: var(--brand-red); font-weight: 700; margin-bottom: 5px; }
.divider { border: none; border-top: 1px solid var(--border-color); margin: 25px 0; }
.modal-info-sidebar h3 { font-size: 1.1rem; color: var(--dark); margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Grid de Características */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.info-item { background: var(--gray-bg); padding: 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; }
.info-item i { color: var(--brand-red); font-size: 1.2rem; width: 20px; text-align: center; }
.info-item-text { display: flex; flex-direction: column; }
.info-item-label { font-size: 0.75rem; color: var(--text-light); text-transform: uppercase; font-weight: 600; }
.info-item-value { font-size: 0.95rem; color: var(--dark); font-weight: 700; }

.info-description { font-size: 0.95rem; color: var(--text-light); line-height: 1.7; text-align: justify; }

/* Lista de Comodidades */
.amenities-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.amenities-list li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--dark); }
.amenities-list li i { color: #25d366; font-size: 1rem; }

/* Footer */
.main-footer { background: var(--dark); color: white; text-align: center; padding: 30px 0; }

/* Responsive */
@media (max-width: 992px) {
    .modal-main-layout { flex-direction: column; height: 90vh; }
    .modal-image-container { flex: none; height: 50%; }
    .modal-info-sidebar { flex: none; height: 50%; padding: 20px; }
    .agent-grid { grid-template-columns: 1fr; text-align: center; }
    .agent-photo-wrapper { max-width: 250px; margin: 0 auto; }

/* --- NUEVOS ESTILOS PARA LA PÁGINA INDIVIDUAL Y BOTONES --- */
.bg-light { background-color: var(--gray-bg); }
.btn-back { background: var(--dark); color: white; padding: 10px 20px; border-radius: 8px; font-weight: 600; }
.btn-back:hover { background: var(--brand-red); color: white; }

.mb-10 { margin-bottom: 10px !important; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--dark);
    color: var(--dark);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.btn-outline:hover {
    background: var(--dark);
    color: white;
}

.page-detalle {
    margin-top: 40px;
    margin-bottom: 60px;
}
.detalle-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    display: flex;
    overflow: hidden;
    min-height: 80vh;
}

/* Responsive para la página de detalle */
@media (max-width: 992px) {
    .detalle-container { flex-direction: column; }
}

}