/* ==========================================================================
   DETAIL.CSS
   Estilos compartidos para pantallas de "VER DETALLE" de un solo registro
   (avisos-ver, clasificado-ver, y cualquier otra ficha de detalle futura).
   --------------------------------------------------------------------------
   Namespace propio: ".dt-" (Detail), para no chocar con forms.css (para
   FORMULARIOS editables) ni con list.css (para LISTADOS). Reutiliza
   variables de forms.css (--fm-color-acento, --fm-color-borde, --fm-font).

   CÓMO USARLO EN UNA FICHA NUEVA:
     <link rel="stylesheet" href=".../vistas/css/detail.css">
     Envolver todo en ".dt-wrap", la foto de portada en ".dt-hero", el
     card blanco de abajo en ".dt-body".
   ========================================================================== */


/* ══════════════════════════════════════
   1. WRAP
══════════════════════════════════════ */
.dt-wrap {
    font-family: var(--fm-font, 'Nunito', sans-serif);
    background: var(--fm-color-fondo-page, #f4f2ee);
    min-height: 100vh;
    padding-bottom: 2rem;
}

.dt-wrap * {
    box-sizing: border-box;
}


/* ══════════════════════════════════════
   2. HERO (foto de portada)
══════════════════════════════════════ */
.dt-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #1a1a1a;
}

.dt-hero img {
    width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: cover;
    object-position: top center;
    display: block;
    opacity: 1;
}

.dt-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.60) 100%);
}

.dt-hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px 18px;
}

.dt-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--fm-color-acento, #ff6200);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px 3px 8px;
    border-radius: 20px;
    margin-bottom: 7px;
    letter-spacing: .3px;
}

.dt-hero-title {
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.dt-visits {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}


/* ══════════════════════════════════════
   3. BODY (card blanco que "sube" sobre la foto)
══════════════════════════════════════ */
.dt-body {
    background: #fff;
    border-radius: 22px 22px 0 0;
    margin-top: -18px;
    position: relative;
    z-index: 2;
    padding: 20px 16px 30px;
}

/* Cuando no hay foto (dt-hero ausente): el body no necesita "subir" */
.dt-body.sin-hero {
    border-radius: 0;
    margin-top: 0;
}


/* ══════════════════════════════════════
   4. DESCRIPCIÓN (caja de texto de solo lectura)
══════════════════════════════════════ */
.dt-desc {
    background: #fff8f3;
    border: 1px solid #ffe0c8;
    border-radius: 14px;
    padding: 13px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin-bottom: 20px;
    resize: none;
    width: 100%;
    outline: none;
    font-family: var(--fm-font, 'Nunito', sans-serif);
    overflow-y: auto;
}


/* ══════════════════════════════════════
   5. PRECIO (verde, para clasificados o cualquier ficha que venda algo)
══════════════════════════════════════ */
.dt-price {
    font-size: 20px;
    font-weight: 800;
    color: #16a34a;
    margin-bottom: 16px;
}

.dt-price .moneda {
    font-size: 13px;
    font-weight: 700;
    color: #5ea86f;
    margin-right: 4px;
}


/* ══════════════════════════════════════
   6. DIVIDER
══════════════════════════════════════ */
.dt-divider {
    height: 1px;
    background: #f0ece8;
    margin: 18px 0;
}


/* ══════════════════════════════════════
   7. FILA DE INFO (dirección, fecha, contacto, etc. — ícono + texto)
══════════════════════════════════════ */
.dt-row-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid var(--fm-color-borde, #e8e4e0);
    margin-bottom: 9px;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}

.dt-row-info .ri-icon {
    font-size: 18px;
    color: var(--fm-color-acento, #ff6200);
    flex-shrink: 0;
    margin-top: 1px;
}

.dt-row-info .ri-label {
    font-size: 10px;
    color: #999;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    display: block;
    margin-bottom: 1px;
}


/* ══════════════════════════════════════
   8. GRID DE CONTACTO (WhatsApp / Tel / Email / Web)
══════════════════════════════════════ */
.dt-contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 4px;
}

.dt-contact-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 11px;
    border-radius: 14px;
    border: 1.5px solid #f0ece8;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .12s;
    -webkit-tap-highlight-color: transparent;
    /* Agregada 20260721 */
    min-width: 0;
}

.dt-contact-btn:active {
    transform: scale(.96);
}

.dt-contact-btn.wa {
    background: #f0fdf6;
    border-color: #b7edcf;
}

.dt-contact-btn.tel {
    background: #fff8f3;
    border-color: #ffd5b5;
}

.dt-contact-btn.mail,
.dt-contact-btn.web {
    background: #f5f8ff;
    border-color: #c8d8f8;
}

.dt-contact-icon {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa .dt-contact-icon {
    background: #dcf8ec;
    color: #128c50;
}

.tel .dt-contact-icon {
    background: #ffe8d6;
    color: var(--fm-color-acento, #ff6200);
}

.mail .dt-contact-icon,
.web .dt-contact-icon {
    background: #dce8ff;
    color: #1a73e8;
}

/* Agregada 20260721 */
.dt-contact-info {
     min-width: 0;
     flex: 1;
 }


.dt-contact-info .lbl {
    font-size: 10px;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    line-height: 1;
    margin-bottom: 2px;
}

.dt-contact-info .val {
    font-size: 12px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}


/* ══════════════════════════════════════
   9. MAPA
══════════════════════════════════════ */
.dt-map-box {
    border-radius: 16px;
    overflow: hidden;
    height: 200px;
    margin-bottom: 9px;
    border: 1px solid var(--fm-color-borde, #e8e4e0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.dt-map-box iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* ══════════════════════════════════════
   10. BOTONES FINALES
══════════════════════════════════════ */
.dt-bottom-actions {
    margin-top: 22px;
}


/* ══════════════════════════════════════
   11. ALERTA DE ERROR
══════════════════════════════════════ */
.dt-error {
    margin: 2rem 1rem;
    background: #fff5f5;
    border: 1.5px solid #fcc;
    border-radius: 18px;
    padding: 2rem 1.5rem;
    text-align: center;
    color: #c0392b;
}

.dt-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.dt-error h4 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: .5rem;
}

.dt-error p {
    font-size: 14px;
    color: #e57373;
}


/* ══════════════════════════════════════
   12. RESPONSIVE DESKTOP
══════════════════════════════════════ */
@media (min-width: 768px) {
    .dt-hero {
        max-width: 650px;
        margin: 0 auto;
        border-radius: 0 0 20px 20px;
    }

    .dt-hero img {
        max-height: 450px;
    }

    .dt-visits {
        top: calc(50px + 10px);
    }

    .dt-body {
        max-width: 600px;
        margin: -18px auto 0;
        padding: 24px 28px 40px;
        border-radius: 22px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, .09);
    }

    .dt-body.sin-hero {
        margin-top: 24px;
    }

    .dt-wrap {
        background: #ede9e4;
        padding-bottom: 3rem;
    }
}
