/* --- MODULAR SEARCH FIELD STYLES (GRAVITY FORMS EQUIVALENT) --- */

.tv-search-wrapper {
    position: relative;
    width: 100%;
    max-width: 250px;
    display: flex;
    align-items: center;
}

/* INPUT STYLING */
.tv-search-input {
    /* Layout & Box Model */
    width: 100% !important;
    height: 48px !important; /* Fixed height matching Gravity Forms */
    box-sizing: border-box !important;
    margin: 0 !important;

    /* Reset Browser Styles */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Visuals matching Gravity Forms */
    background-color: var(--ze-color-surface-container-lowest) !important;
    border: 1px solid var(--ze-color-outline-variant) !important;
    border-radius: var(--ze-radius-md) !important;

    /* Typography */
    font-family: var(--ze-font-body-md-family) !important;
    font-size: 15px !important;
    color: var(--ze-color-on-surface) !important;
    line-height: normal !important;

    /* Padding matching Gravity Forms: Text left (16px), Icon right (40px) */
    padding: 0 40px 0 16px !important;

    /* Effects */
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Placeholder Color */
.tv-search-input::placeholder {
    color: var(--ze-color-on-surface-variant);
    opacity: 0.7;
}

/* Hover State */
.tv-search-input:hover {
    border-color: var(--ze-color-outline) !important;
}

/* Focus State */
.tv-search-input:focus {
    outline: none !important;
    border-color: var(--ze-color-secondary) !important;
    box-shadow: 0 0 0 4px var(--ze-color-surface-container) !important;
    background-color: var(--ze-color-surface-container-lowest) !important;
}

/* ICON STYLING */
.tv-search-icon {
    position: absolute;
    right: 16px !important;
    left: auto !important;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;

    color: var(--ze-color-on-surface-variant);
    font-size: 1rem;

    pointer-events: none;
    transition: color 0.3s ease;

    line-height: 1;
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
    opacity: 0.7;
}

/* Icon Color on Focus */
.tv-search-wrapper:focus-within .tv-search-icon {
    color: var(--ze-color-on-surface);
    opacity: 1;
}

/* STATE: Has Value (Text typed in) */
.tv-search-input.has-filter {
    border-color: var(--ze-color-on-surface) !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;
    }
}