/* 1. Reset Global y Fuentes */
body, h1, h2, h3, h4, h5, h6, p, li, label, span, b, button {
    font-family: "Poppins", sans-serif !important;
}

* {
    box-sizing: border-box;
}


  

/* 2. El Contenedor Grid (Control de Columnas) */
.contenedor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas en Desktop */
    gap: 25px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* 3. La Cajita (Contenedor Principal) */
.box-pr-fac-m3 {
   
   
     width: 266px;
    max-width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    /* margin: 0 auto !important; */
    display: flex;
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 10px;
    height: 415px;


    
    
}

/* 4. Imagen y Tag de Descuento */
.top_img_1-pr-fac-m3 {
     width: 240px;
    height: 240px;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 12px;
    position: relative;
    
    margin-right: auto;
    margin-left: 10px;
    margin-bottom: auto;
    margin-top: 10px;

}

.tag-descuento-referencia {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff7f7f;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 13px;
    z-index: 5;
}


.producto-titulo-referencia {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* Limita a 2 líneas */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    
    /* Dimensiones y Espaciado */
    width: 100% !important;
    height: 38px !important; /* Aumentado a 38px para que quepan bien las 2 líneas de 16px */
    margin: 0 0 8px 0 !important;
    
    /* Estilo de Texto */
    color: #000000 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 1.2 !important; /* Ajustado para que no se corte la fuente */
    font-family: 'Poppins', sans-serif !important;
    text-align: left !important;
}
.ppp-pr-fac-m3 {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Si el nombre de la empresa es largo, pone puntos */
}

/* 6. Precios y Etiquetas */
.precio-columna {
    display: flex;
    flex-direction: column;
}

.precio-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}

.precio-afiliado {
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.precio-publico {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

/* 7. Botón Comprar */
.btn-comprar-referencia {
    background-color: #78B645;
    color: white !important;
    font-weight: 700;
    font-size: 13px;
    text-align: center;
    text-decoration: none !important;
    padding: 10px 15px;
    border-radius: 6px;
    transition: 0.3s;
}

.btn-comprar-referencia:hover {
    background-color: #619438;
}

/* 8. RESPONSIVE: Mobile */
@media screen and (max-width: 768px) {
    .contenedor-grid {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
        padding: 15px;
        gap: 20px;
    }

    .box-pr-fac-m3 {
        max-width: 100%; /* Que use todo el ancho del celular */
    }

    .top_img_1-pr-fac-m3 {
        height: 250px; /* Un poco más alta en móvil para que luzca la foto */
    }
}