/**
 * KITTEC Search Results Grid
 * 
 * Responsive 5-column grid layout for search results.
 * Matches the mockup design.
 */

/* ==========================================================================
   Page Layout
   ========================================================================== */

.kittec-search-page {
    min-height: 60vh;
    padding-bottom: 4rem;
}

.kittec-search-page .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Search Header
   ========================================================================== */

.search-header {
    background: #f5f5f5;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.breadcrumbs {
    font-size: 0.875rem;
    margin-bottom: 1rem;
    color: #666;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #333;
    text-decoration: underline;
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
}

.search-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
}

.results-count {
    color: #666;
    margin: 0 0 1.5rem;
}

/* Inline search form */
.search-form-inline {
    display: flex;
    max-width: 400px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.search-form-inline input[type="text"] {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

.search-form-inline button {
    background: #f27a1a; /* KITTEC orange */
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form-inline button:hover {
    background: #d96a10;
}

/* ==========================================================================
   Results Grid
   ========================================================================== */

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .search-results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

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

/* ==========================================================================
   Result Cards
   ========================================================================== */

.kittec-search-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kittec-search-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

/* Card Image */
.card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f5f5f5;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
/*    object-fit: cover;*/
    object-fit: contain;

    transition: transform 0.3s ease;
}

.kittec-search-card:hover .card-image img {
    transform: scale(1.05);
}

/* Card Content */
.card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: #1a1a1a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-excerpt {
    font-size: 0.8125rem;
    color: #666;
    margin: 0 0 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Card Footer with type and weiterlesen */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.card-type {
    display: inline-block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    background: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

.card-readmore {
    font-size: 0.8125rem;
    color: #f27a1a;
    text-decoration: none;
    font-weight: 500;
}

.kittec-search-card:hover .card-readmore {
    text-decoration: underline;
}

/* ==========================================================================
   Product Line Colors (from database via inline styles)
   ========================================================================== */

/* Color bar between image and content - uses inline style background-color */
.card-color-bar {
    height: 4px;
    width: 100%;
    flex-shrink: 0;
}

/* IMPORTANT: Disable ALL old pseudo-element color bars */
/* These rules override any theme CSS that might add colored bars via ::after */
.kittec-search-card .card-image::after,
.card-product .card-image::after,
.card-series .card-image::after,
.card-productline .card-image::after,
.studio-line .card-image::after,
.classic-line .card-image::after,
.professional-line .card-image::after,
.industrial-line .card-image::after,
.accessories-line .card-image::after {
    display: none !important;
    content: none !important;
}

/* ==========================================================================
   Empty & No Results States
   ========================================================================== */

.search-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* No results - full width layout matching the results grid */
.search-no-results {
    padding: 2rem 0;
}

.search-no-results h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
    text-transform: uppercase;
}

.search-no-results > p {
    color: #666;
    margin-bottom: 2rem;
}

/* Suggestions and Popular Links as side-by-side boxes */
.search-no-results-boxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .search-no-results-boxes {
        grid-template-columns: 1fr;
    }
}

.search-suggestions,
.search-popular-links {
    text-align: left;
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
}

.search-suggestions h3,
.search-popular-links h3 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
    color: #333;
}

.search-suggestions ul,
.search-popular-links ul {
    margin: 0;
    padding-left: 1.25rem;
}

.search-suggestions li,
.search-popular-links li {
    margin-bottom: 0.5rem;
    color: #666;
}

.search-popular-links a {
    color: #f27a1a;
    text-decoration: none;
}

.search-popular-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Load More Button
   ========================================================================== */

.search-load-more {
    text-align: center;
    margin-top: 2.5rem;
}

.load-more-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 2px solid #f27a1a;
    color: #f27a1a;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-button:hover {
    background: #f27a1a;
    color: white;
}

.load-more-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.load-more-button.loading::after {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ==========================================================================
   Debug Info (Admin Only)
   ========================================================================== */

.search-debug {
    background: #f0f0f0;
    padding: 1rem;
    margin-top: 2rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    color: #666;
}
