/* Containerul de sugestii */
.woolive-trending-container {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: #fff;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 999999; 
    border: 1px solid #eee;
    /* FIX: Asiguram ca padding-ul nu mareste latimea totala */
    box-sizing: border-box;
}

/* FIX: Resetare globala pentru elementele din interior */
.woolive-trending-container * {
    box-sizing: border-box;
}

.woolive-trending-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- NOU: Stiluri Istoric Cautari --- */
.woolive-recent-searches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.woolive-clear-recent {
    font-size: 11px;
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}
.woolive-clear-recent:hover {
    color: #ef4444; /* Rosu la hover pe sterge */
}
.woolive-recent-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}
.woolive-recent-tag {
    background: #f3f4f6;
    color: #374151 !important;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 13px;
    text-decoration: none !important;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}
.woolive-recent-tag:hover {
    background: #e5e7eb;
    color: #111827 !important;
    border-color: #d1d5db;
}
.woolive-trending-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 0 0 15px 0;
}
/* ------------------------------------ */

/* GRID: 2 Coloane pe Desktop */
.woolive-trending-tags {
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
    width: 100%; /* Asiguram latimea */
}

/* Card Produs (Link) - REDESIGN */
a.woolive-trending-tag {
    background: #fff;
    color: #333 !important;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    display: flex; 
    align-items: center;
    text-decoration: none !important;
    transition: all 0.2s ease;
    /* FIX: min-width 0 previne grid-ul sa iasa din container */
    min-width: 0; 
    width: 100%;
}

a.woolive-trending-tag:hover {
    /* MODIFICAT: Am scos border-color hardcodat. 
       Acesta va fi controlat dinamic de woolive.php pe baza culorii alese in Admin. */
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Imaginea din card */
a.woolive-trending-tag img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Container detalii (Titlu + Pret) */
.woolive-trending-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    flex-grow: 1; /* Ocupa restul spatiului */
}

.woolive-trending-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin-bottom: 3px;
    color: #333;
    display: block; /* Important pentru ellipsis */
}

.woolive-trending-price {
    font-size: 12px;
    color: #777;
    font-weight: normal;
}

/* Pretul WooCommerce (ins, del, amount) */
.woolive-trending-price del {
    color: #aaa;
    font-size: 11px;
    margin-right: 5px;
}
.woolive-trending-price ins {
    text-decoration: none;
    /* MODIFICAT: Am scos culoarea hardcodata. Va fi controlata de woolive.php */
    font-weight: 600;
}

.woolive-trending-container::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 30px;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: rotate(45deg);
    border-left: 1px solid #eee;
    border-top: 1px solid #eee;
}

/* --- RESPONSIVE MOBIL --- */
@media (max-width: 600px) {
    .woolive-trending-tags {
        grid-template-columns: 1fr; /* O singura coloana pe mobil */
    }
    .woolive-trending-container::before {
        display: none; 
    }
}