﻿/* ================================================================
   MODAL DETALLE - OPTIMIZADO ESPACIOS
   ================================================================ */

/* ESTRUCTURA */
#modalDetallePublicacion .modal-dialog {
    max-width: 420px;
    margin: 1rem auto;
}

#modalDetallePublicacion .modal-content {
    border: none !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* ================================================================
   HEADER - ESPACIOS REDUCIDOS
   ================================================================ */

.modal-header {
    border-bottom: none !important;
    padding: 0.85rem 1rem 0.5rem !important;
}

.btn-close-minimal {
    font-size: 0.65rem;
    padding: 0.4rem;
    opacity: 0.4;
}

    .btn-close-minimal:hover {
        opacity: 1;
    }

/* BADGE CATEGORÍA */
.badge-categoria-minimal {
    font-size: 0.55rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: white;
    display: inline-block;
}

/* TÍTULO */
.modal-titulo-minimal {
    font-size: 1rem;
    font-weight: 700;
    color: #2d2d2d;
    line-height: 1.25;
    margin-top: 0.4rem;
    margin-bottom: 0;
}

/* LOCALIDAD */
.modal-localidad-minimal {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.25rem;
}

    .modal-localidad-minimal i {
        font-size: 0.65rem;
        color: #D4AF37;
    }

/* ================================================================
   BODY - PADDING REDUCIDO
   ================================================================ */

.modal-body {
    padding: 0.75rem 1rem 1rem !important;
}

/* ================================================================
   IMAGEN - COMPLETA CON BOTÓN AMPLIAR
   ================================================================ */

.contenedor-img-modal {
    width: 100%;
    height: 240px;
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.65rem;
    position: relative; /* Para el botón */
}

.img-modal-fit {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CAMBIO: Muestra imagen completa */
    cursor: zoom-in;
}

/* BOTÓN AMPLIAR IMAGEN */
.btn-ampliar-imagen {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

    .btn-ampliar-imagen:hover {
        background: rgba(0, 0, 0, 0.7);
        transform: scale(1.1);
    }

    .btn-ampliar-imagen i {
        font-size: 0.85rem;
    }

/* ================================================================
   PRECIO Y REDES - MÁS COMPACTO
   ================================================================ */

.precio-modal-container {
    flex: 1;
}

.precio-modal-valor {
    font-size: 1.25rem;
    font-weight: 700;
    color: #8B1D1D;
    line-height: 1;
    white-space: nowrap;
}

/* ICONOS SOCIALES */
.social-icons-modal {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.icon-social {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

    .icon-social:hover {
        transform: scale(1.15);
    }

/* COLORES ORIGINALES */
.icon-share {
    color: #D4AF37;
}

.icon-wa {
    color: #25D366;
}

.icon-ig {
    color: #E1306C;
}

.icon-fb {
    color: #1877F2;
}

/* SEPARADOR PRECIO/REDES */
.modal-body > .d-flex.justify-content-between.align-items-center {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.65rem !important;
}

/* ================================================================
   DESCRIPCIÓN - COMPACTA
   ================================================================ */

.descripcion-modal {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 0.75rem !important;
}

.descripcion-scroll {
    max-height: 3.9em;
    overflow-y: auto;
}

.descripcion-texto {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.3;
    margin: 0;
}

/* ================================================================
   DETALLES - COMPACTOS
   ================================================================ */

.detalles-modal-container {
    padding-bottom: 0.75rem;
    margin-bottom: 0 !important;
}

.detalles-titulo {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.detalles-scroll {
    max-height: 5em;
    overflow-y: auto;
}

    /* Scrollbar */
    .descripcion-scroll::-webkit-scrollbar,
    .detalles-scroll::-webkit-scrollbar {
        width: 3px;
    }

    .descripcion-scroll::-webkit-scrollbar-track,
    .detalles-scroll::-webkit-scrollbar-track {
        background: #f8f8f8;
        border-radius: 10px;
    }

    .descripcion-scroll::-webkit-scrollbar-thumb,
    .detalles-scroll::-webkit-scrollbar-thumb {
        background: #ddd;
        border-radius: 10px;
    }

        .descripcion-scroll::-webkit-scrollbar-thumb:hover,
        .detalles-scroll::-webkit-scrollbar-thumb:hover {
            background: #ccc;
        }

/* LISTA */
.detalles-lista {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* ITEM INDIVIDUAL */
.detalle-item {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.75rem;
    color: #555;
    line-height: 1.3;
}

    .detalle-item i {
        color: #8B1D1D;
        font-size: 0.7rem;
        margin-top: 0.1rem;
        min-width: 12px;
    }

    .detalle-item strong {
        color: #333;
        font-weight: 600;
    }

/* BADGES EXTRAS */
.badges-extras {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.badge-extra {
    font-size: 0.65rem;
    color: #666;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

    .badge-extra i {
        font-size: 0.6rem;
        color: #8B1D1D;
    }

/* ================================================================
   FOOTER INLINE - ICONO + NOMBRE + LINK EN UNA LÍNEA
   ================================================================ */

.modal-footer {
    border-top: 1px solid #f0f0f0 !important;
    background: #fafafa;
    padding: 0.65rem 1rem !important;
}

.footer-content-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
}

/* ICONO CATEGORÍA */
.icono-categoria-footer {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .icono-categoria-footer i {
        font-size: 0.95rem;
        color: #8B1D1D;
    }

/* EMPRESA INFO INLINE */
.empresa-info-inline {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.empresa-nombre-inline {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-tienda-inline {
    font-size: 0.65rem;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    white-space: nowrap;
    flex-shrink: 0;
}

    .link-tienda-inline:hover {
        color: #8B1D1D;
    }

    .link-tienda-inline i {
        font-size: 0.6rem;
    }

/* BOTÓN WHATSAPP */
.btn-wsp-simple {
    background: #25D366;
    color: white !important;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.45rem 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
}

    .btn-wsp-simple:hover {
        background: #1eb957;
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(37, 211, 102, 0.2);
    }

    .btn-wsp-simple i {
        font-size: 0.8rem;
    }

/* ================================================================
   COLORES CATEGORÍAS
   ================================================================ */

.cat-bg-1 {
    background-color: #795548 !important;
}

.cat-bg-2 {
    background-color: #8B1D1D !important;
}

.cat-bg-3 {
    background-color: #43A047 !important;
}

.cat-bg-4 {
    background-color: #607D8B !important;
}

.cat-bg-5 {
    background-color: #8E24AA !important;
}

.cat-bg-6 {
    background-color: #039BE5 !important;
}

.cat-bg-0 {
    background-color: #9E9E9E !important;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 576px) {
    #modalDetallePublicacion .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .contenedor-img-modal {
        height: 200px;
    }

    .precio-modal-valor {
        font-size: 1.1rem;
    }

    .social-icons-modal {
        gap: 0.4rem;
    }

    .icon-social {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }

    .footer-content-inline {
        flex-wrap: wrap;
    }

    .empresa-info-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }

    .btn-wsp-simple {
        width: 100%;
        justify-content: center;
        padding: 0.5rem 1rem;
    }
}
