/* Stihl Search Styles */
.menu-stihl-delovi-pretraga {
    padding: 10px;
}

.stihl-search-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.stihl-search-form {
    position: relative;
}

.stihl-search-container .stihl-search-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 35px;
    font-size: 16px;
    line-height: 1.4;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    box-shadow: unset;
    border: 1px solid #eee;
}

.stihl-search-container .stihl-search-input:focus {
    outline: none;
    border-color: #f37a1f;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.stihl-search-container .stihl-search-input::placeholder {
    color: #757575;
    opacity: 1;
}

.stihl-search-loading {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #f37a1f;
    font-size: 14px;
}

.stihl-search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid #e1e1e1;
    border-top: 2px solid #f37a1f;
    border-radius: 50%;
    animation: stihl-spin 1s linear infinite;
}

@keyframes stihl-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stihl-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-top: none;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.stihl-search-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.stihl-search-item {
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s ease;
}

.stihl-search-item:last-child {
    border-bottom: none;
}

.stihl-search-item:hover,
.stihl-search-item-selected {
    background-color: #f8f9fa;
}

.stihl-search-link {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.stihl-search-link:hover {
    text-decoration: none;
    color: inherit;
}

.stihl-search-title {
    font-weight: 500;
    font-size: 14px;
    color: #333333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.stihl-search-category {
    font-size: 12px;
    color: #f37a1f;
    margin-bottom: 2px;
    font-weight: 500;
}

.stihl-search-description {
	display: none;
}

.stihl-search-count {
    font-size: 11px;
    color: #999999;
    font-style: italic;
}

.stihl-search-no-results,
.stihl-search-error {
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #666666;
}

.stihl-search-error {
    color: #d63638;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stihl-search-container {
        max-width: 100%;
    }
    
    .stihl-search-container .stihl-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 16px;
    }
    
    .stihl-search-results {
        max-height: 300px;
    }
    
    .stihl-search-link {
        padding: 14px 16px;
    }
}

@media (max-width: 480px) {
    .stihl-search-title {
        font-size: 13px;
    }
    
    .stihl-search-category,
    .stihl-search-model,
    .stihl-search-part {
        font-size: 11px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stihl-search-container .stihl-search-input {
        border-color: #000000;
    }
    
    .stihl-search-container .stihl-search-input:focus {
        box-shadow: 0 0 0 2px #0073aa;
    }
    
    .stihl-search-results {
        border-color: #000000;
    }
    
    .stihl-search-item:hover,
    .stihl-search-item-selected {
        background-color: #f0f0f0;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .stihl-search-container .stihl-search-input,
    .stihl-search-item,
    .stihl-search-link {
        transition: none;
    }
    
    @keyframes stihl-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
}

/* Custom scrollbar for webkit browsers */
.stihl-search-results::-webkit-scrollbar {
    width: 6px;
}

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

.stihl-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.stihl-search-results::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}