/* ============================================================
   TC Color Search — Stili campo ricerca varianti colore
   ============================================================ */

/* Layout: label sopra, campo sotto — occupa tutta la riga */
.variations tr:has(.tc-search-wrapper) {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.variations tr:has(.tc-search-wrapper) td {
    display: block;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

.variations tr:has(.tc-search-wrapper) td.label {
    padding-bottom: 0;
}

.tc-search-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid #d0d0d0;
    background: #fff;
    box-sizing: border-box;
}

/* Input di ricerca */
.tc-search-input {
    flex: 1;
    padding: 12px 44px 12px 16px;
    border: none;
    font-size: 12px;
    font-family: inherit;
    color: #333;
    background: transparent;
    box-sizing: border-box;
    letter-spacing: 0.08em;
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
}

.tc-search-input:focus {
    outline: none;
}

.tc-search-input::placeholder {
    color: #ff2222;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Pulsante lente */
.tc-search-icon-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    background: #f0f0f0;
    border: none;
    border-left: 1px solid #d0d0d0;
    color: #555;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.tc-search-icon-btn:hover {
    background: #ff2222;
    color: #fff;
}

/* Pulsante cancella */
.tc-search-clear {
    position: absolute;
    top: 50%;
    right: 54px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff2222 !important;
    border: none;
    color: #fff !important;
    font-size: 14px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
    z-index: 2;
}

.tc-search-clear:hover {
    background: #cc0000 !important;
    color: #fff !important;
}

/* Dropdown risultati */
.tc-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.tc-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.tc-search-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Singolo risultato */
.tc-search-dropdown li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    line-height: 1.4;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-search-dropdown li:hover,
.tc-search-dropdown li.tc-active {
    background: #f5f5f5;
    color: #111;
}

/* Testo evidenziato nella ricerca */
.tc-search-dropdown li mark {
    background: #fff3cd;
    color: inherit;
    font-weight: 600;
    padding: 0;
    border-radius: 2px;
}

/* Nessun risultato */
.tc-search-dropdown li.tc-no-results {
    color: #999;
    cursor: default;
    font-style: italic;
    font-size: 13px;
}

.tc-search-dropdown li.tc-no-results:hover {
    background: transparent;
}

