/* Container Box */
.cfs-search-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.cfs-search-box {
    display: flex;
    align-items: center;
    position: relative;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 24px;
    padding: 7px 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cfs-search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.cfs-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 9px;
    flex-shrink: 0;
}

#cfs-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.4;
    color: #1f2937;
    margin: 0;
    padding: 0;
}

#cfs-input::placeholder {
    color: #9ca3af;
}

/* Spinner Loader */
.cfs-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: cfs-spin 0.6s linear infinite;
    flex-shrink: 0;
    margin-left: 6px;
}

@keyframes cfs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Dropdown Window */
.cfs-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 14px 16px;
    box-sizing: border-box;
    z-index: 999999;
    max-height: 480px;
    overflow-y: auto;
}

.cfs-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
}

.cfs-group-block {
    border-top: 1px solid #f3f4f6;
    padding-top: 10px;
    margin-top: 10px;
}

.cfs-group-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Category Pill Badges */
.cfs-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cfs-category-badge {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    text-decoration: none;
    line-height: 1.3;
    transition: all 0.15s ease;
}

.cfs-category-badge:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

/* Product Item Rows */
.cfs-items-list {
    display: flex;
    flex-direction: column;
}

.cfs-product-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid #f9fafb;
    transition: background-color 0.15s ease;
}

.cfs-product-row:last-child {
    border-bottom: none;
}

.cfs-product-row:hover .cfs-item-name {
    color: #2563eb;
}

.cfs-img-wrap {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    border: 1px solid #f3f4f6;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    background: #fdfdfd;
}

.cfs-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cfs-detail-wrap {
    flex: 1;
    min-width: 0; /* Prevents flex children from breaking ellipsis */
}

.cfs-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.cfs-item-price {
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    margin-top: 2px;
}

.cfs-item-price del {
    color: #9ca3af;
    font-weight: 400;
    margin-right: 4px;
}

.cfs-item-price ins {
    text-decoration: none;
}

.cfs-empty-state {
    font-size: 13px;
    color: #6b7280;
    padding: 8px 0;
    text-align: center;
}