/* ═══════════════════════════════════════════════════════
   SEARCH BAR COMPONENT
   Used on: homepage, products page
   Width: not too wide, max 480px, centered
═══════════════════════════════════════════════════════ */

.product-search-wrap {
    max-width: 480px;
    margin: 0 auto 1.5rem;
    width: 100%;
}

.product-search-form {
    position: relative;
    width: 100%;
}

.product-search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.75rem;
    font-size: 0.9rem;
    color: #1f2937;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 9999px;
    transition: all 0.2s ease;
    outline: none;
}

.product-search-input::placeholder {
    color: #9ca3af;
}

.product-search-input:focus {
    border-color: #1591DC;
    box-shadow: 0 0 0 3px rgba(21, 145, 220, 0.12);
    background: #ffffff;
}

.product-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: #9ca3af;
    pointer-events: none;
    transition: color 0.2s ease;
}

.product-search-input:focus ~ .product-search-icon {
    color: #1591DC;
}

/* Clear button (X) - muncul kalau ada value */
.product-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f3f4f6;
    border: none;
    border-radius: 999px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.product-search-clear:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.product-search-clear svg {
    width: 14px;
    height: 14px;
}

/* Show clear button when input has value */
.product-search-form.has-value .product-search-clear {
    display: inline-flex;
}

/* Mobile - tighter padding */
@media (max-width: 640px) {
    .product-search-wrap {
        margin-bottom: 1.25rem;
        padding: 0 0.5rem;
    }
    .product-search-input {
        padding: 0.625rem 2.75rem 0.625rem 2.5rem;
        font-size: 0.875rem;
    }
}
