/* Search Modal Styles */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease-in-out;
}

.search-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: color 0.2s;
    z-index: 10;
}

.search-close-btn:hover {
    color: #333;
}

.search-container-modal {
    padding: 30px;
}

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

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    color: #999;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.1);
}

/* Search Suggestions */
.search-suggestions {
    margin-top: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.search-suggestions-list {
    display: flex;
    flex-direction: column;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    cursor: pointer;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-item.no-suggestions {
    text-align: center;
    color: #999;
    cursor: default;
}

.suggestion-item.no-suggestions:hover {
    background: transparent;
}

.suggestion-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background: #f5f5f5;
}

.suggestion-details {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-sku {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.suggestion-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 4px;
}

.view-all-results {
    display: block;
    padding: 12px;
    text-align: center;
    background: var(--primary-color) !important;
    color: white !important;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.view-all-results:hover {
    opacity: 0.9;
}

.suggestion-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-modal.active {
        padding-top: 80px;
        align-items: flex-start;
    }

    .search-modal-content {
        width: 95%;
        margin: auto;
        margin-top: 0;
    }

    .search-container-modal {
        padding: 20px;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Scrollbar styling for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

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