/**
 * WizAtom Search — v2 CSS
 * BEM: .wiz-search, .wiz-search__icon, .wiz-search__input, .wiz-search__clear
 * Hardcoded defaults; Elementor selectors override via specificity.
 */

.wiz-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

/* ─── Search icon (absolute, left of input) ───────────────────────────── */

.wiz-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    flex-shrink: 0;
    z-index: 1;
}

/* ─── Input ───────────────────────────────────────────────────────────── */

/* Parent-scoped selector (.wiz-search .wiz-search__input) gives specificity
   (0,2,0) — beats the WP theme global `input[type="text"]` at (0,1,1) which
   sets `padding: 1.5rem 3.8rem` and causes icon/placeholder overlap. */
.wiz-search .wiz-search__input {
    width: 100%;
    height: 38px;
    /* Left padding: 12px (icon offset) + 16px (icon width) + 12px (gap) = 40px */
    padding: 0 36px 0 40px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.wiz-search .wiz-search__input:focus {
    outline: none;
    border-color: var(--primary, var(--wiz-color-primary, #075465));
}

.wiz-search .wiz-search__input::placeholder {
    color: #9ca3af;
}

/* ─── No-icon variant (tighter left padding) ──────────────────────────── */

.wiz-search--no-icon .wiz-search__input {
    padding-left: 12px;
}

/* ─── Clear button (absolute, right of input) ─────────────────────────── */

.wiz-search__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 4px;
    padding: 0;
    transition: color 0.15s, background 0.15s;
    z-index: 1;
}

.wiz-search__clear:hover {
    color: #111827;
    background: #f3f4f6;
}
