/* WC Search Bar - FiboSearch Style */

/* Wrapper */
.wc-search-bar-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Form */
.wc-search-form {
    position: relative;
    z-index: 1002;
}

.wc-search-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 0; /* KEINE abgerundeten Ecken */
    height: 50px;
    transition: all 0.3s ease;
}

.wc-search-bar-wrapper.is-active .wc-search-inner {
    border-color: #444;
    border-bottom-color: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Search Input */
.wc-search-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 0 15px !important;
    height: 100%;
    font-size: 15px;
    color: #444;
    outline: none !important;
    box-shadow: none !important;
}

.wc-search-input::placeholder {
    color: #838383;
    font-style: italic;
}

/* Arrow */
.wc-search-arrow {
    position: absolute;
    right: 65px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 10px 5px;
}

.wc-search-bar-wrapper.is-active .wc-search-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* Divider */
.wc-search-divider {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 28px;
    background: #e6e6e6;
}

/* Submit Button - SCHWARZ wie im Screenshot */
.wc-search-submit {
    position: relative;
    width: 56px;
    height: 100%;
    background: #000 !important; /* SCHWARZ statt grau */
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    padding: 0;
    outline: none;
}

.wc-search-submit:hover {
    opacity: 0.8;
}

.wc-search-submit svg {
    width: 20px;
    height: 20px;
}

/* Autocomplete Results */
.wc-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #444;
    border-top: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wc-search-results-inner {
    padding: 0;
}

/* Result Item */
.wc-search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #444;
    transition: background-color 0.2s ease;
    gap: 12px;
}

.wc-search-result-item:hover {
    background-color: #f8f8f8;
}

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

/* Result Image */
.wc-search-result-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    background: #f8f8f8;
}

.wc-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Result Content */
.wc-search-result-content {
    flex: 1;
    min-width: 0;
}

.wc-search-result-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-search-result-sku {
    font-size: 12px;
    color: #999;
}

/* Result Price */
.wc-search-result-price {
    font-size: 14px;
    font-weight: 600;
    color: #333; /* Schwarz statt rot */
    white-space: nowrap;
}

.wc-search-result-price .amount {
    color: #333; /* Schwarz statt rot */
}

/* Result Category Info */
.wc-search-result-category {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Search Sections */
.wc-search-section {
    border-bottom: 1px solid #e0e0e0;
}

.wc-search-section:last-child {
    border-bottom: none;
}

.wc-search-section-title {
    padding: 8px 15px;
    background: #f8f8f8;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Category Items */
.wc-search-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-decoration: none;
    color: #444;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wc-search-category-item:hover {
    background-color: #f8f8f8;
}

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

.category-name {
    font-size: 14px;
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: #999;
}

/* View All Link */
.wc-search-view-all {
    padding: 12px 15px;
    background: #f8f8f8;
    text-align: center;
}

.wc-search-view-all a {
    color: #333; /* Schwarz statt rot */
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.wc-search-view-all a:hover {
    text-decoration: underline;
}

/* No Results */
.wc-search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Overlay - GRAUER SCHLEIER */
.wc-search-overlay {
    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;
}

.wc-search-bar-wrapper.is-active .wc-search-overlay {
    display: block;
}

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

/* Loading State */
.wc-search-results.is-loading .wc-search-results-inner {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-search-results.is-loading .wc-search-results-inner:before {
    content: "";
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top-color: #E30613;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Scrollbar Styling */
.wc-search-results::-webkit-scrollbar {
    width: 8px;
}

.wc-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wc-search-results::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.wc-search-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-search-bar-wrapper {
        max-width: 100%;
    }
    
    .wc-search-inner {
        height: 45px;
    }
    
    .wc-search-input {
        font-size: 14px;
    }
    
    .wc-search-submit {
        width: 50px;
        border-radius: 0px;
    }
    
    .wc-search-arrow {
        right: 60px;
    }
    
    .wc-search-divider {
        right: 51px;
    }
    
    .wc-search-results {
        max-height: 300px;
    }
    
    .wc-search-result-item {
        padding: 10px 12px;
    }
    
    .wc-search-result-image {
        width: 40px;
        height: 40px;
    }
    
    .wc-search-result-title {
        font-size: 13px;
    }
    
    .wc-search-result-price {
        font-size: 13px;
    }
}

/* Integration mit Gallery */
.gallery-search-box .wc-search-bar-wrapper {
    max-width: 100%;
}

/* Fix für hohen Z-Index */
.wc-search-bar-wrapper.is-active {
    z-index: 9999;
}