/* Search Modal */

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--menu-bg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.search-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--menu-bg);
    border-bottom: 1px solid rgba(128,128,128,0.2);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--title-color) 8%, transparent);
    border-radius: 10px;
    padding: 10px 14px;
}

.search-input-wrapper i {
    width: 20px;
    height: 20px;
    color: color-mix(in srgb, var(--title-color) 40%, transparent);
    flex-shrink: 0;
}

.search-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--title-color);
    font-size: 16px;
}

.search-input-wrapper input::placeholder {
    color: color-mix(in srgb, var(--title-color) 40%, transparent);
}

.search-clear-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: color-mix(in srgb, var(--title-color) 20%, transparent);
    border: none;
    border-radius: 50%;
    color: color-mix(in srgb, var(--title-color) 60%, transparent);
    cursor: pointer;
}

.search-clear-btn.visible {
    display: flex;
}

.search-clear-btn i {
    width: 14px;
    height: 14px;
}

.search-close-btn {
    background: none;
    border: none;
    color: #0066ff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px;
}

.search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
    text-align: center;
}

.search-empty i {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.search-empty p {
    font-size: 15px;
}

.search-result-item {
    display: flex;
    gap: 12px;
    background: var(--product-card-bg, #252525);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:active {
    opacity: 0.8;
}

.search-result-image {
    width: 70px;
    height: 70px;
    min-width: 70px;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-result-image-placeholder i {
    width: 24px;
    height: 24px;
    color: #555;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--title-color);
    margin-bottom: 4px;
}

.search-result-category {
    font-size: 12px;
    color: var(--product-desc-color, #888);
    margin-bottom: 6px;
}

.search-result-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--price-color);
}

.search-result-price::after {
    content: '₺';
    font-size: 12px;
    color: var(--product-desc-color, #888);
    margin-left: 2px;
}

.search-no-results,
.category-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
    text-align: center;
}

.search-no-results i,
.category-search-no-results i {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.category-search-no-results p {
    font-size: 14px;
}

/* Safe area for search modal */
@supports (padding-top: env(safe-area-inset-top)) {
    .search-modal-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
}