/* --- MODULAR SEARCH FIELD STYLES --- */

.tv-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    display: flex;
    align-items: center;
}

/* INPUT STYLING */
.tv-search-input {
    /* Layout & Box Model */
    width: 100% !important;
    height: 40px !important; /* Fixed height for consistency */
    box-sizing: border-box !important;
    margin: 0 !important;

    /* Reset Browser Styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Visuals */
    background-color: #fafafa !important;
    border: 1px solid var(--border-color, #eee) !important;
    border-radius: 6px !important;

    /* Typography */
    font-size: 0.9rem !important;
    color: var(--text-muted, #777) !important;
    line-height: normal !important;

    /* Padding: Text left (12px), Icon right (40px) */
    padding: 8px 40px 8px 12px !important;

    /* Effects */
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

/* Placeholder Color */
.tv-search-input::placeholder {
    color: #ccc;
    opacity: 1;
}

/* Hover State */
.tv-search-input:hover {
    background-color: #fff !important;
    border-color: #ccc !important;
}

/* Focus State (Blue Glow using variable) */
.tv-search-input:focus {
    background-color: #fff !important;
    border-color: var(--color-primary, #4cb8cb) !important;
    box-shadow: 0 0 0 3px rgba(76, 184, 203, 0.15) !important;
    color: var(--text-main, #333) !important;
}

/* ICON STYLING */
.tv-search-icon {
    position: absolute;
    right: 15px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    color: #ccc;
    font-size: 1rem;

    pointer-events: none;
    transition: color 0.3s ease;

    line-height: 1;
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
}

/* Icon Color on Focus */
.tv-search-wrapper:focus-within .tv-search-icon {
    color: var(--color-primary, #4cb8cb);
}

/* STATE: Has Value (Text typed in) */
.tv-search-input.has-filter {
    background-color: #fff !important;
    border-color: var(--color-primary, #4cb8cb) !important;
    box-shadow: 0 0 0 3px rgba(76, 184, 203, 0.15) !important;
    color: var(--text-main, #333) !important;
}

/* --- RESPONSIVE: TABLET & MOBILE --- */
@media screen and (max-width: 1024px) {

    /* Allow full width for search wrapper */
    .tv-search-wrapper {
        max-width: 100%;
        width: 100%;
        margin-bottom: 10px;
    }

    /* Ensure input takes full space */
    .tv-search-input {
        width: 100% !important;
    }
}