/* ============================================
   smp_ficha.css - Punto Hogar Inmobiliaria
   Estilos de la ficha de detalle de inmueble
   ============================================ */

.ficha-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 50px;
}

/* =====================
   BREADCRUMB
   ===================== */
.ficha-breadcrumb {
    margin-bottom: 16px;
}

.ficha-breadcrumb a {
    color: #FF3A5A;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.ficha-breadcrumb a:hover {
    text-decoration: underline;
}

/* =====================
   CABECERA
   ===================== */
.ficha-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ficha-cabecera-left { flex: 1; }

.ficha-titulo {
    font-size: 26px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
    line-height: 1.3;
}

.ficha-ubicacion {
    font-size: 15px;
    color: #666;
    margin: 0;
}

.ficha-cabecera-right {
    text-align: right;
    flex-shrink: 0;
}

.ficha-precio {
    font-size: 28px;
    font-weight: 700;
    color: #FF3A5A;
    line-height: 1.2;
}

.ficha-operacion {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* =====================
   GALERÍA
   ===================== */
.ficha-galeria {
    margin-bottom: 30px;
}

.galeria-principal {
    position: relative;
    width: 100%;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16/9;
    max-height: 520px;
}

.galeria-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.galeria-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Botones galería */
.galeria-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.galeria-btn:hover { background: rgba(0,0,0,0.8); }
.galeria-prev { left: 12px; }
.galeria-next { right: 12px; }

.galeria-contador {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 12px;
    z-index: 2;
}

/* Miniaturas */
.galeria-miniaturas {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.miniatura {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    opacity: 0.65;
}

.miniatura.active,
.miniatura:hover {
    border-color: #FF3A5A;
    opacity: 1;
}

.miniatura img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================
   CUERPO PRINCIPAL
   ===================== */
.ficha-cuerpo {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    align-items: start;
}

/* =====================
   SECCIONES IZQUIERDA
   ===================== */
.ficha-section-title {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #FF3A5A;
    display: inline-block;
}

/* Características */
.ficha-caracteristicas {
    margin-bottom: 28px;
}

.caract-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
}

.caract-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f8f8;
    border-radius: 4px;
    font-size: 14px;
}

.caract-label {
    color: #777;
    font-weight: 500;
}

.caract-valor {
    color: #222;
    font-weight: 700;
    text-align: right;
}

/* Extras / tags */
.caract-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.extra-tag {
    background: #FF3A5A;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

/* Descripción */
.ficha-descripcion {
    margin-bottom: 28px;
}

.descripcion-texto {
    font-size: 14px;
    line-height: 1.8;
    color: #444;
}

/* Mapa */
.ficha-mapa {
    margin-bottom: 28px;
}

#mapa-ficha {
    border-radius: 6px;
    border: 1px solid #eee;
}

/* =====================
   FORMULARIO (columna derecha)
   ===================== */
.ficha-formulario {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 24px 20px;
    margin-bottom: 16px;
    position: sticky;
    top: 80px;
}

.ficha-formulario h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 0 0 6px;
}

.form-subtitulo {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #444;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #FF3A5A;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #FF3A5A;
}

.form-check label {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.form-check label a {
    color: #FF3A5A;
}

.btn-enviar {
    width: 100%;
    padding: 12px;
    background: #FF3A5A;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s;
    letter-spacing: 0.02em;
}

.btn-enviar:hover { background: #e02244; }
.btn-enviar:disabled { background: #ccc; cursor: default; }

/* Contacto agencia */
.ficha-contacto-agencia {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-tel,
.btn-whatsapp {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}

.btn-tel {
    background: #fff;
    border: 2px solid #FF3A5A;
    color: #FF3A5A;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.btn-tel:hover,
.btn-whatsapp:hover { opacity: 0.85; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 900px) {
    .ficha-cuerpo {
        grid-template-columns: 1fr;
    }

    .ficha-formulario {
        position: static;
    }

    .caract-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .ficha-cabecera {
        flex-direction: column;
    }

    .ficha-cabecera-right {
        text-align: left;
    }

    .ficha-titulo {
        font-size: 20px;
    }

    .ficha-precio {
        font-size: 22px;
    }

    .galeria-principal {
        aspect-ratio: 4/3;
    }
}

.foto-principal-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;  /* o 16/9 según prefieras */
    background: #111;      /* fondo oscuro para los bordes vacíos */
    overflow: hidden;
}

.galeria-contenido {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.foto-principal {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* respeta proporciones, no recorta */
    display: block;
}