/* Container Principale */
.df-search-wrapper-frontend {
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    /* Margine sotto le schede richiesto */
    padding-bottom: 60px;
}

/* SEARCH BOX */
.df-search-box {
    position: relative;
    margin-bottom: 30px;
}

/* Titoli Sezioni (Fornitori Trovati / Documenti Trovati) */
.df-section-title {
    width: 100%;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f1f1;
}

.df-results-divider {
    grid-column: 1 / -1; /* Occupa tutta la larghezza della grid */
    border: 0;
    height: 1px;
    background: #e1e1e1;
    margin: 40px 0 10px 0;
}

/* Card Specifica Documento */
.df-type-document .df-card-icon {
    height: 60px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.df-doc-cat-badge {
    background: #f1f1f1;
    color: #666;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.df-doc-meta-date {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

/* Bottone Outline per Documenti */
.df-btn-outline {
    background: transparent;
    border: 1px solid #bd1422;
    color: #bd1422;
}

.df-btn-outline:hover {
    background: #bd1422;
    color: #fff;
}

#df-input {
    width: 100%;
    /* Più spazio a destra per la X e lo spinner */
    padding: 18px 70px 18px 25px;
    font-size: 18px;
    border: 2px solid #e1e1e1;
    border-radius: 50px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fff;
}

#df-input:focus {
    border-color: #bd1422;
    box-shadow: 0 4px 12px rgba(189, 20, 34, 0.15);
}

/* TASTO CLEAR (X) */
.df-clear-btn {
    position: absolute;
    right: 50px; /* Posizionato a sinistra dello spinner */
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 24px;
    color: #bbb;
    line-height: 1;
    width: 30px;
    height: 30px;
    text-align: center;
    transition: color 0.2s;
    display: none; /* Nascosto di default */
}

.df-clear-btn:hover {
    color: #bd1422;
}

/* SPINNER */
.df-spinner {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #bd1422;
    border-radius: 50%;
    animation: df-spin 1s linear infinite;
}

@keyframes df-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* SUGGESTIONS (Autocomplete) */
.df-suggestions-box {
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 999;
    overflow: hidden;
    display: none;
}

.df-suggestions-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.df-suggestions-box li {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f9f9f9;
    display: flex;
    align-items: center;
    transition: background 0.1s;
}

.df-suggestions-box li:hover {
    background: #fdf1f2;
}

.df-suggestions-box li:last-child {
    border-bottom: none;
}

.df-suggest-icon {
    margin-right: 10px;
    font-size: 16px;
}

.df-suggest-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* GRID RISULTATI */
.df-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* CARD FORNITORE */
.df-result-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.df-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #bd1422;
}

.df-card-logo {
    height: 80px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.df-card-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.df-placeholder-logo {
    font-size: 18px;
    font-weight: bold;
    color: #ccc;
    text-transform: uppercase;
}

.df-card-body h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #222;
}

.df-card-tags {
    margin-bottom: 15px;
    font-size: 12px;
}

.df-card-tag {
    display: inline-block;
    background: #f1f1f1;
    color: #666;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 2px;
}

.df-card-btn {
    margin-top: auto; 
    display: inline-block;
    padding: 8px 18px;
    background: #bd1422;
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.df-card-btn:hover {
    background: #a0101c;
}

.df-no-results {
    text-align: center;
    width: 100%;
    color: #777;
    font-size: 16px;
    padding: 20px;
}