/**
 * ke_search_enhance - Search Results Styling
 * Site-configurable via TypoScript/Site Settings
 */

/* ============================================
   Results Container
   ============================================ */
.ke-enhance-results {
    margin: 2rem 0;
}

/* ============================================
   Search Box (LuigisBox-inspired)
   ============================================ */
.ke-enhance-searchbox {
    margin-bottom: 2rem;
}

.ke-enhance-search-form {
    width: 100%;
}

.ke-enhance-search-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ke-enhance-search-input-wrapper:focus-within {
    border-color: #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Search icon on LEFT side (LuigisBox style) */
.ke-enhance-search-button {
    order: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem 1.25rem 1.25rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ke-enhance-search-button:hover {
    color: #000;
}

.ke-enhance-search-button svg {
    width: 22px;
    height: 22px;
}

.ke-enhance-search-input {
    flex: 1;
    padding: 1.25rem 1.25rem 1.25rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 1.0625rem;
    color: #111827;
    outline: none;
    min-height: 60px;
}

.ke-enhance-search-input::placeholder {
    color: #9ca3af;
}

/* Override ke_search default input styles */
.ke-enhance-searchbox .tx-kesearch-pi1 input[type="search"],
.ke-enhance-searchbox input[type="search"],
.ke-enhance-search-input-wrapper input[type="search"] {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
}

.ke-enhance-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Fix for Bootstrap g-6 negative margin overlap - contains the negative margin */
.ke-enhance-results-container {
    overflow: hidden;
}

.ke-enhance-results-count {
    font-size: 1rem; /* 16px - consistent with body */
    color: #374151;
    font-weight: 300; /* Light weight like JKR site */
}

.ke-enhance-results-count strong {
    color: #111827;
    font-weight: 600;
}

.ke-enhance-results-number {
    color: #6b7280;
    font-weight: 400;
}

/* ============================================
   Section Headers
   ============================================ */
.ke-enhance-section {
    margin-bottom: 2rem;
}

.ke-enhance-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem; /* 20px - matches H5 on JKR site */
    font-weight: 300; /* Light weight like rest of site */
    margin-bottom: 1rem;
    color: #374151;
}

.ke-enhance-section-title svg {
    color: #6b7280;
}

/* ============================================
   Product Cards Grid - 3 Columns (matching shop layout)
   ============================================ */
.ke-enhance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Product Card */
.ke-enhance-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.ke-enhance-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.ke-enhance-card-image {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    padding: 1rem;
}

.ke-enhance-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ke-enhance-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
}

.ke-enhance-card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ke-enhance-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: #111827;
    line-height: 1.4;
}

.ke-enhance-card-teaser {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Page/News Items List
   ============================================ */
.ke-enhance-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ke-enhance-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s ease;
}

.ke-enhance-item:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.ke-enhance-item-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 0.5rem;
    color: #6b7280;
}

.ke-enhance-item-content {
    flex: 1;
    min-width: 0;
}

.ke-enhance-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.25rem 0;
    color: #111827;
}

.ke-enhance-item-teaser {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ke-enhance-item-url {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ke-enhance-item-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ============================================
   Badges
   ============================================ */
.ke-enhance-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border-radius: 0.25rem;
}

.ke-enhance-badge-product {
    background: #dcfce7;
    color: #166534;
}

.ke-enhance-badge-page {
    background: #dbeafe;
    color: #1e40af;
}

.ke-enhance-badge-news {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================
   Zero-Results Recovery (Enhanced)
   ============================================ */
.ke-enhance-zero-results {
    text-align: center;
    padding: 3rem 1.5rem;
}

.ke-enhance-zero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    color: #d1d5db;
}

.ke-enhance-zero-icon svg {
    width: 100%;
    height: 100%;
}

.ke-enhance-zero-title {
    font-size: 1.375rem; /* 22px - matches site H3 */
    font-weight: 300; /* Light weight like rest of site */
    color: #000;
    margin-bottom: 0.5rem;
}

.ke-enhance-zero-query {
    color: #000;
    font-weight: 300;
}

.ke-enhance-zero-text {
    color: #000;
    font-size: 1rem;
    font-weight: 300;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Zero-Results Search Field - same styling as main search, just centered */
.ke-enhance-searchbox--zero-results {
    max-width: 500px;
    margin: 0 auto 2rem;
}

/* Did You Mean Suggestion */
.ke-enhance-did-you-mean {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #fef3c7;
    border-radius: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #92400e;
}

.ke-enhance-did-you-mean svg {
    flex-shrink: 0;
}

.ke-enhance-did-you-mean a {
    color: #2563eb;
    text-decoration: underline;
    font-weight: 600;
}

.ke-enhance-did-you-mean a:hover {
    color: #1d4ed8;
}

/* Category Chips */
.ke-enhance-category-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.ke-enhance-category-chip {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 2rem;
    font-size: 0.85rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}

.ke-enhance-category-chip:hover {
    border-color: #111827;
    background: #f9fafb;
    color: #111827;
}

/* Suggestions Box (Fallback) */
.ke-enhance-suggestions-box {
    text-align: left;
    max-width: 400px;
    margin: 0 auto 2rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.ke-enhance-suggestions-box h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #000;
}

.ke-enhance-suggestions-box ul {
    font-size: 1rem;
    color: #000;
    font-weight: 300;
    padding-left: 1.25rem;
    margin: 0;
}

.ke-enhance-suggestions-box li {
    margin-bottom: 0.375rem;
}

/* Popular Products */
.ke-enhance-popular-products {
    margin-top: 2rem;
    text-align: left;
}

.ke-enhance-popular-title {
    font-size: 1.125rem; /* 18px */
    font-weight: 500;
    color: #000;
    margin-bottom: 1.5rem;
    text-align: left;
}

.ke-enhance-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    max-width: 100%;
}

.ke-enhance-popular-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.15s;
}

.ke-enhance-popular-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ke-enhance-popular-image {
    aspect-ratio: 1;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ke-enhance-popular-image img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.ke-enhance-popular-image svg {
    color: #d1d5db;
}

.ke-enhance-popular-body {
    padding: 0.75rem;
}

.ke-enhance-popular-name {
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Contact CTA */
.ke-enhance-contact-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.875rem 1.5rem;
    background: #111827;
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s;
}

.ke-enhance-contact-cta:hover {
    background: #374151;
    color: white;
}

.ke-enhance-contact-cta svg {
    flex-shrink: 0;
}

/* Legacy No Results (backward compatibility) */
.ke-enhance-no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.ke-enhance-no-results-icon {
    color: #d1d5db;
    margin-bottom: 1rem;
}

.ke-enhance-no-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.ke-enhance-no-results-text {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.ke-enhance-suggestions {
    text-align: left;
    max-width: 300px;
    margin: 0 auto;
}

.ke-enhance-suggestions h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ke-enhance-suggestions ul {
    font-size: 0.875rem;
    color: #6b7280;
    padding-left: 1.25rem;
}

.ke-enhance-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #111827;
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease;
}

.ke-enhance-contact-link:hover {
    background: #374151;
}

/* Zero-Results Responsive */
@media (max-width: 640px) {
    .ke-enhance-zero-results {
        padding: 2rem 1rem;
    }

    .ke-enhance-zero-title {
        font-size: 1.25rem;
    }

    .ke-enhance-popular-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ke-enhance-did-you-mean {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================
   Loading State
   ============================================ */
.ke-enhance-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .ke-enhance-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .ke-enhance-card-image {
        aspect-ratio: 1;
    }

    .ke-enhance-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .ke-enhance-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Type Tabs (Alle/Produkte/Seiten)
   ============================================ */
.ke-enhance-type-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
}

.ke-enhance-type-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    background: transparent;
    border: 1px solid #000;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    transition: all 0.15s;
}

.ke-enhance-type-tab:hover {
    background: #f3f4f6;
}

.ke-enhance-type-tab.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.ke-enhance-type-tab svg {
    margin-right: 0.375rem;
    width: 14px;
    height: 14px;
}

.ke-enhance-type-count {
    margin-left: 0.375rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    font-size: 0.75rem;
}

.ke-enhance-type-tab.active .ke-enhance-type-count {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   Mixed Results Sections
   ============================================ */
.ke-enhance-mixed-section {
    margin-bottom: 2rem;
}

.ke-enhance-mixed-section h4 {
    font-size: 1.25rem; /* 20px - matches H5 on JKR site */
    font-weight: 300; /* Light weight like rest of site */
    color: #374151;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ke-enhance-mixed-section h4 svg {
    color: #6b7280;
}

/* ============================================
   Page Results (List Layout)
   ============================================ */
.ke-enhance-page-result {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.ke-enhance-page-result:hover {
    border-color: #000;
}

.ke-enhance-page-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
    opacity: 0.6;
}

.ke-enhance-page-icon svg {
    width: 20px;
    height: 20px;
}

/* Page Thumbnail (for pages with images) - square, edge-to-edge */
.ke-enhance-page-thumb {
    flex-shrink: 0;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    overflow: hidden;
    /* No border-radius - edge to edge */
}

.ke-enhance-page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Adjust layout when image is present */
.ke-enhance-page-result.has-image {
    align-items: flex-start;
}

.ke-enhance-page-content {
    flex: 1;
    min-width: 0;
}

.ke-enhance-page-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.ke-enhance-page-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 4px;
    letter-spacing: 0.025em;
}

.ke-enhance-page-date {
    font-size: 0.75rem;
    color: #9ca3af;
}

.ke-enhance-page-title {
    font-size: 1.125rem; /* 18px - consistent with site typography */
    font-weight: 600;
    margin: 0.25rem 0;
    color: #111827;
}

.ke-enhance-page-teaser {
    font-size: 0.9375rem; /* 15px - more readable */
    color: #000; /* Match site body text color */
    margin: 0;
    line-height: 1.6;
}

/* Search term highlighting */
.ke-enhance-page-teaser .hit,
.ke-enhance-page-title .hit,
.ke-enhance-results .hit {
    background: #fef08a;
    color: #111827;
    padding: 0.1em 0.2em;
    border-radius: 2px;
    font-weight: 600;
}

.ke-enhance-page-url {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

.ke-enhance-page-breadcrumb {
    font-size: 0.8125rem; /* 13px */
    color: #9ca3af;
    margin-bottom: 0.5rem; /* More spacing below breadcrumb */
}

/* ============================================
   Active Filter Chips
   ============================================ */
.ke-enhance-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.ke-enhance-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: #111827;
    color: white;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.ke-enhance-filter-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.ke-enhance-filter-chip button:hover {
    opacity: 1;
}

.ke-enhance-clear-all-btn {
    padding: 0.375rem 0.75rem;
    background: #f3f4f6;
    color: #4b5563;
    border: none;
    border-radius: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.ke-enhance-clear-all-btn:hover {
    background: #e5e7eb;
}

/* ============================================
   Hidden by Type Tab
   ============================================ */
.ke-enhance-results-section[data-hidden="true"] {
    display: none;
}

/* ============================================
   Responsive Type Tabs
   ============================================ */
@media (max-width: 640px) {
    .ke-enhance-type-tabs {
        flex-wrap: wrap;
    }

    .ke-enhance-type-tab {
        flex: 1 1 auto;
        justify-content: center;
    }

    .ke-enhance-page-result {
        flex-direction: column;
        gap: 0.75rem;
    }

    .ke-enhance-page-icon {
        width: 20px;
        height: 20px;
    }

    .ke-enhance-page-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 1; /* Keep square on mobile too */
        max-height: 240px;
    }
}

/* ============================================
   Rich Autocomplete Enhancements
   ============================================ */

/* Autocomplete Container */
.ke-enhance-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

/* Section Styling */
.ke-enhance-ac-section {
    border-bottom: 1px solid #f3f4f6;
}

.ke-enhance-ac-section:last-child {
    border-bottom: none;
}

.ke-enhance-ac-section-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #9ca3af;
    background: #f9fafb;
    letter-spacing: 0.05em;
}

/* Autocomplete Items */
.ke-enhance-ac-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: inherit;
}

.ke-enhance-ac-item:hover,
.ke-enhance-ac-item.ke-enhance-ac-item--highlighted {
    background: #f3f4f6;
}

/* Item Image */
.ke-enhance-ac-image {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ke-enhance-ac-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ke-enhance-ac-image svg {
    width: 24px;
    height: 24px;
    color: #d1d5db;
}

/* Item Content Wrapper */
.ke-enhance-ac-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

/* Item Header Row (Badge + Title) */
.ke-enhance-ac-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Type Badges in Autocomplete */
.ke-enhance-ac-badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 0.25rem;
    flex-shrink: 0;
}

.ke-enhance-ac-badge--product {
    background: #dcfce7;
    color: #166534;
}

.ke-enhance-ac-badge--category {
    background: #e0e7ff;
    color: #4338ca;
}

.ke-enhance-ac-badge--brand {
    background: #fce7f3;
    color: #9d174d;
}

.ke-enhance-ac-badge--page {
    background: #dbeafe;
    color: #1e40af;
}

/* Item Title */
.ke-enhance-ac-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Search Term Highlighting */
.ke-enhance-ac-title mark,
.ke-enhance-ac-content mark {
    background: #fef08a;
    color: inherit;
    padding: 0 0.125rem;
    border-radius: 0.125rem;
}

/* Metadata Row */
.ke-enhance-ac-meta-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.125rem;
}

.ke-enhance-ac-meta {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Price Display */
.ke-enhance-ac-price {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
}

/* Autocomplete Footer ("Show All Results") */
.ke-enhance-ac-footer {
    display: flex;
    justify-content: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.ke-enhance-ac-footer a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s;
}

.ke-enhance-ac-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ke-enhance-ac-footer svg {
    width: 16px;
    height: 16px;
}

/* Empty State in Autocomplete */
.ke-enhance-ac-empty {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.ke-enhance-ac-empty svg {
    display: block;
    margin: 0 auto 0.5rem;
    width: 32px;
    height: 32px;
    color: #d1d5db;
}

/* Loading State in Autocomplete */
.ke-enhance-ac-loading {
    padding: 1rem;
    text-align: center;
}

.ke-enhance-ac-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: ke-spin 0.6s linear infinite;
}

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

/* Responsive Autocomplete */
@media (max-width: 640px) {
    .ke-enhance-autocomplete-dropdown {
        max-height: 60vh;
    }

    .ke-enhance-ac-item {
        padding: 0.75rem;
    }

    .ke-enhance-ac-image {
        width: 40px;
        height: 40px;
    }

    .ke-enhance-ac-title {
        font-size: 0.85rem;
    }

    .ke-enhance-ac-meta-row {
        flex-wrap: wrap;
    }
}

/* ============================================
   Product Cards (Shop-Style)
   Matches the shop product listing design
   ============================================ */

/* Product Card Container - clean, no hover animation */
.ke-enhance-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    height: 100%;
}

/* Product Image */
.ke-enhance-product-image {
    position: relative;
    aspect-ratio: 366 / 274;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    overflow: hidden;
}

.ke-enhance-product-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.ke-enhance-product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ke-enhance-product-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d1d5db;
    background: #f3f4f6;
}

/* Product Info */
.ke-enhance-product-info {
    padding: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Product Title - matches shop card-title style (22px, Elza Medium) */
.ke-enhance-product-title {
    font-size: 1.375rem; /* 22px */
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

.ke-enhance-product-title a {
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ke-enhance-product-title a:hover {
    color: #374151;
}

/* Product Price - matches shop H3 price style (22px, Elza Medium) */
.ke-enhance-product-price {
    font-size: 1.375rem; /* 22px */
    font-weight: 500;
    color: #000;
    margin: 0.5rem 0;
}

.ke-enhance-price-current {
    color: #000;
}

.ke-enhance-price-old {
    text-decoration: line-through;
    color: #9ca3af;
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Product Actions - using shop's card-footer structure for consistency */
/* No custom button styles needed - shop CSS handles .product-add-to-basket and .product-detail-button */

/* Grid for Product Cards - 3 Columns (matching shop layout) */
.ke-enhance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Responsive adjustments for product cards */
@media (max-width: 768px) {
    .ke-enhance-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .ke-enhance-product-title {
        font-size: 1.125rem; /* 18px */
    }

    .ke-enhance-product-price {
        font-size: 1.125rem; /* 18px */
    }
}

@media (max-width: 480px) {
    .ke-enhance-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   Pagination / Page Browser
   ============================================================================= */

.ke-enhance-pagebrowser {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.ke-enhance-pagebrowser-info {
    font-size: 0.875rem;
    color: #6b7280;
}

.ke-enhance-pagination {
    display: flex;
    justify-content: center;
}

.ke-enhance-pagination-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.ke-enhance-pagination-item {
    margin: 0;
}

.ke-enhance-pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.ke-enhance-pagination-link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
    text-decoration: none;
}

.ke-enhance-pagination-item.active .ke-enhance-pagination-link,
.ke-enhance-pagination-link.current {
    background: #000;
    border-color: #000;
    color: #fff;
}

.ke-enhance-pagination-item.disabled .ke-enhance-pagination-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ke-enhance-pagination-link svg {
    flex-shrink: 0;
}

/* Responsive pagination */
@media (max-width: 640px) {
    .ke-enhance-pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 0.5rem;
        font-size: 0.8125rem;
    }

    .ke-enhance-pagebrowser-info {
        font-size: 0.8125rem;
    }
}

/* ============================================
   Product Cards - Match Shop Layout EXACTLY
   Uses same .product-item.card classes as shop
   ============================================ */
.ke-enhance-results .product-item.card {
    /* Match shop card styling */
    --bs-card-border-width: 0;
    --bs-card-bg: transparent;
    --bs-card-spacer-x: 0;
    --bs-card-cap-color: inherit;
    --bs-card-cap-bg: transparent;
}

/* Force square aspect ratio on image container - match shop 308x308 */
.ke-enhance-results .product-item .card-img-top {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

/* Make image fill container and crop to square */
.ke-enhance-results .product-item .card-img-top picture {
    display: block;
    width: 100%;
    height: 100%;
}

.ke-enhance-results .product-item .card-img-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Card header padding - match shop */
.ke-enhance-results .product-item .card-header {
    padding-left: 0;
    padding-right: 0;
}

.ke-enhance-results .product-item .card-header .card-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

/* Card body - match shop */
.ke-enhance-results .product-item .card-body {
    padding-top: 0;
}

.ke-enhance-results .product-item .card-body .text-price {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Card footer - match shop */
.ke-enhance-results .product-item .card-footer {
    padding-left: 0;
    padding-right: 0;
}

.ke-enhance-results .product-item .card-footer .flex-30 {
    flex: 0 0 auto;
    max-width: none;
}

.ke-enhance-results .product-item .card-footer .flex-70 {
    flex: 1;
    max-width: none;
}

/* Warenkorb-Button styling - match shop */
.ke-enhance-results .product-item .product-add-to-basket .btn {
    width: auto;
    min-width: 44px;
    padding: 0.5rem 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ke-enhance-results .product-item .product-add-to-basket .btn svg {
    width: 20px;
    height: 20px;
    margin-right: 0 !important;
}

/* Detail-Button - match shop */
.ke-enhance-results .product-item .product-detail-button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
}
