/**
 * Estilos para el plugin Casago Proveedores
 */

/* Contenedor principal */
#casago-proveedores-container {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
}

/* Separador */
.separator {    
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-04);
}

/* Filtros */
.casago-filters {    
    margin-bottom: 30px;
    padding-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
    font-size: 16px;
}

.filter-group select {
    padding: 8px 12px;    
}

/* Botones */
.casago-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.casago-btn:hover {
    background: #005a87;
}

.casago-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#apply-filters {
    height: fit-content;
}

/* Secciones de servicio */
.servicio-section {
    margin-bottom: 40px;
}

.servicio-title {
    font-size: 24px;
    color: var(--color-text);
    margin-bottom: 0;
}

/* Grid de proveedores */
.proveedores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Tarjetas de proveedor */
.proveedor-card {
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.proveedor-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.proveedor-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.proveedor-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.proveedor-content {
    padding: 20px;
}

.proveedor-title {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.proveedor-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.proveedor-title a:hover {
    color: #0073aa;
}

.proveedor-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.proveedor-meta {    
    font-size: 14px;
    color: #555;
}
.meta-label {
    font-weight: 600;
    color: var(--color-text);
}
.box-meta {
    background: var(--color-04);
    padding: 20px;
    border-radius: var(--border-radius);
}
.proveedor-description a {
    color: var(--color-text);
    transition: .3s;
    &:hover {
        color: var(--color-secondary);
    }
    &:focus, &:focus-visible {
        outline: none;
    }
}

/* Contenedor de botón cargar más */
.load-more-container {    
    margin-top: 20px;
}

.load-more-btn {
    min-width: 150px;
    max-height: 40px;
}

/* Imagen Categoría */
.box-servicio-title {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.servicio-icon {
  width: 32px;
  height: auto;
  margin-right: 15px;
}

/* Descripción Proveedor */
.proveedor-description {
    font-size: 14px;
}

/* Estados de carga */
.casago-proveedores-results .loading {
    opacity: 0.6;
    pointer-events: none;
}
.casago-proveedores-results .load-more-btn.loading {
    padding: 8px 20px;
}

.casago-proveedores-results .loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensaje de no hay más resultados */
.no-more-results {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .casago-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .proveedores-grid {
        grid-template-columns: 1fr;
    }
    
    .servicio-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #casago-proveedores-container {
        padding: 10px;
    }
    
    .casago-filters {
        padding: 15px;
    }
    
    .proveedor-content {
        padding: 15px;
    }
}

/* Animaciones para nuevos elementos */
.proveedor-card.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para mensajes de estado */
.casago-message {
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.casago-message.info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #0066cc;
}

.casago-message.error {
    background: #ffe7e7;
    border: 1px solid #ffb3b3;
    color: #cc0000;
}
