/**
 * Feofanivska Smart Search - Styles
 * 
 * Based on reference design with product cards layout
 * 
 * @author Feofanivska
 * @version 1.0.0
 */

/* ========== Search Container ========== */
.feofanivska-smart-search {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.feofanivska-search-wrapper {
    position: relative;
}

.feofanivska-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* ========== Search Input ========== */
.feofanivska-search-input {
    width: 100%;
    padding: 12px 45px 12px 45px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f5f5f7;
    transition: all 0.3s ease;
    outline: none;
}

.feofanivska-search-input:focus {
    background-color: #fff;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.feofanivska-search-input::placeholder {
    color: #999;
}

/* ========== Search Icon ========== */
.feofanivska-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
}

.feofanivska-search-icon svg {
    width: 20px;
    height: 20px;
}

/* ========== Results Container ========== */
.feofanivska-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.feofanivska-search-results.show {
    display: block;
}

/* ========== Results List ========== */
.feofanivska-search-list {
    list-style: none;
    margin: 0;
    padding: 8px;
}

/* ========== Product Item ========== */
.feofanivska-search-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.feofanivska-search-item:hover {
    background-color: #f5f5f7;
    border: 2px solid #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.feofanivska-search-item:last-child {
    margin-bottom: 0;
}

/* ========== Product Image ========== */
.feofanivska-search-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background-color: #f9f9f9;
}

.feofanivska-search-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* ========== Product Details ========== */
.feofanivska-search-item-details {
    flex: 1;
    min-width: 0;
}

.feofanivska-search-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feofanivska-search-item-model {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.feofanivska-search-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.feofanivska-search-item-price-old {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
    margin-right: 8px;
}

.feofanivska-search-item-price-special {
    color: #e74c3c;
}

/* ========== Loading & Empty States ========== */
.feofanivska-search-loading,
.feofanivska-search-empty,
.feofanivska-search-error {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.feofanivska-search-error {
    color: #e74c3c;
}

/* ========== Scrollbar Styling ========== */
.feofanivska-search-results::-webkit-scrollbar {
    width: 6px;
}

.feofanivska-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.feofanivska-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.feofanivska-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .feofanivska-smart-search {
        max-width: 100%;
    }
    
    .feofanivska-search-input {
        padding: 10px 40px 10px 40px;
        font-size: 14px;
    }
    
    .feofanivska-search-item {
        padding: 10px;
    }
    
    .feofanivska-search-item-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .feofanivska-search-item-name {
        font-size: 14px;
    }
    
    .feofanivska-search-item-price {
        font-size: 15px;
    }
    
    .feofanivska-search-results {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .feofanivska-search-input {
        padding: 8px 35px 8px 35px;
        font-size: 13px;
    }
    
    .feofanivska-search-item {
        padding: 8px;
    }
    
    .feofanivska-search-item-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
    
    .feofanivska-search-item-name {
        font-size: 13px;
    }
    
    .feofanivska-search-item-model {
        font-size: 12px;
    }
    
    .feofanivska-search-item-price {
        font-size: 14px;
    }
    
    .feofanivska-search-results {
        max-height: 350px;
    }
}

/* ========== Animation ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feofanivska-search-results.show {
    animation: fadeIn 0.2s ease;
}
