/* ========================================
   DK Custom Search - Styles
   ======================================== */

/* === Body scroll lock when search is open === */
body.has-overlay-active {
    overflow: hidden;
}

/* === Search Input - matches original .yith-s styling from main.css === */
.dk-search-form {
    position: relative;
    margin: 0;
    height: 51px;
}

.dk-search-form .dk-search-icon {
    display: none;
}

.dk-search-input {
    height: 50px;
    width: 100%;
    min-width: 550px;
    font-size: 14px;
    padding-left: 15px;
    -webkit-appearance: none !important;
    font-family: "Cocogoose", sans-serif;
    border: 1px solid #efefef;
    border-radius: 5px;
    color: #3A3A3A;
    background: #fff;
    outline: none;
    z-index: 999999999;
    position: static;
    box-sizing: border-box;
}

@media screen and (max-width: 1350px) {
    .dk-search-input {
        min-width: 450px;
    }
}

@media screen and (max-width: 1025px) {
    .dk-search-input {
        width: calc(100vw - 40px);
        margin: 0 auto;
        display: block;
        min-width: 200px;
    }
}

@media screen and (max-width: 365px) {
    .dk-search-input {
        font-size: 12px;
    }
}

.dk-search-input::placeholder {
    color: #b5b5b5;
}

.dk-search-input:focus {
    border-color: #efefef;
    outline: none;
}

.dk-search-input.has-overlay-active {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom-color: transparent !important;
}

@media (max-width: 1024px) {
    .dk-search-input.has-overlay-active {
        border-bottom-left-radius: 5px !important;
        border-bottom-right-radius: 5px !important;
    }
}

/* === Search Submit Button === */
.dk-search-form {
    position: relative;
}

.dk-search-submit {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%);
    left: auto !important;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    color: white;
    height: 38px;
    width: 39px;
    padding: 0;
    z-index: 999999999;
}

.dk-search-submit:hover .button-shape-background g g g path {
    fill: #A5B214 !important;
}

/* Override main.css: .website-header .search-wrapper svg { position: absolute; right: 0; top: -1px } */
.dk-search-submit svg {
    position: static !important;
}

.dk-search-submit .button-shape-background {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
}

.dk-search-submit .feather-search {
    position: relative !important;
    top: -2px !important;
    left: auto !important;
    right: auto !important;
    z-index: 2;
}

@media screen and (max-width: 1024px) {
    .dk-search-submit {
        right: 8px !important;
    }
}

/* === Searched before icon fix === */
.search-collapse .searched-before a,
.search-collapse-mobile .searched-before a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-collapse .searched-before a svg,
.search-collapse-mobile .searched-before a svg {
    width: 14px;
    height: 14px;
    min-width: 14px;
    color: #b5b5b5;
    position: static !important;
}

/* === Override product-of-the-week border from main.css === */
.website-header .search-wrapper .search-collapse .product-of-the-week,
.website-header .search-wrapper-mobile .search-collapse-mobile .product-of-the-week {
    border-top: none;
}

/* === Category slider images - blend white backgrounds away === */
.category-slider-wrapper .category figure img {
    mix-blend-mode: multiply;
}

/* === Slider button position fix === */
.website-header .search-wrapper .search-collapse .search-buttons .search-right-slide-button,
.website-header .search-wrapper .search-collapse .search-buttons .search-left-slide-button {
    top: 70px;
}

/* === Category tile images - blend white backgrounds away === */
.search-collapse .search-slider-wrapper .category figure img,
.search-collapse-mobile .search-slider-wrapper .category figure img {
    mix-blend-mode: multiply;
}

/* === Category tile label - single line, truncate === */
.search-collapse .search-slider-wrapper .category p,
.search-collapse-mobile .search-slider-wrapper .category p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 5px;
    margin: 6px 0;
    font-size: 13px;
}

/* Hide browser search decoration */
.dk-search-input::-webkit-search-decoration,
.dk-search-input::-webkit-search-cancel-button,
.dk-search-input::-webkit-search-results-button,
.dk-search-input::-webkit-search-results-decoration {
    display: none;
}

.dk-search-input::-ms-clear,
.dk-search-input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

/* === Toggle Switch - sliding tab === */
.dk-search-tabs {
    display: flex;
    padding: 20px 15px 10px 15px;
    margin: 0;
}

.dk-search-toggle {
    display: flex;
    position: relative;
    background: #F5F5F5;
    border-radius: 25px;
    padding: 3px;
    width: 100%;
    max-width: 100%;
}

.dk-search-toggle .dk-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 50%;
    height: calc(100% - 6px);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

.dk-search-toggle.ai-active .dk-toggle-slider {
    transform: translateX(calc(100% - 6px));
}

.dk-search-tab {
    flex: 1;
    padding: 8px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #b5b5b5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: color 300ms;
    font-family: "Cocogoose", sans-serif;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.dk-search-tab svg {
    width: 13px;
    height: 13px;
}

.dk-search-tab:hover {
    color: #3A3A3A;
}

.dk-search-tab.active {
    color: #b9c725;
}

/* === Results Container - matches search-collapse padding === */
.dk-search-results {
    padding: 7px 15px;
}

.dk-results-section {
    margin-bottom: 15px;
    border-top: 1px solid #efefef;
    padding-top: 10px;
}

.dk-results-section:first-child {
    border-top: none;
    padding-top: 0;
}

.dk-results-section .section-title,
.dk-ai-products .section-title {
    font-size: 14px;
    font-weight: 500;
    color: #3A3A3A;
    margin: 0 0 8px 0;
    padding: 0;
    font-family: "Cocogoose", sans-serif;
}

/* === Product Result Card === */
.dk-result-product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #3A3A3A;
    transition: background 200ms;
}

.dk-result-product:hover {
    background: #F5F5F5;
}

.dk-result-product.is-out-of-stock {
    opacity: 0.5;
}

.dk-result-product .product-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: #F5F5F5;
    border: 1px solid #efefef;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dk-result-product .product-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.dk-result-product .product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dk-result-product .product-name {
    font-size: 14px;
    font-weight: 500;
    color: #3A3A3A;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "Cocogoose", sans-serif;
}

.dk-result-product .product-brand {
    font-size: 12px;
    color: #999;
}

.dk-result-product .product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dk-result-product .product-price {
    font-size: 14px;
    font-weight: 600;
    color: #B9C725;
}

.dk-result-product .product-price.has-sale .current {
    color: #FA7171;
    font-weight: 600;
}

.dk-result-product .product-price.has-sale .original {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

.dk-result-product .product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.dk-result-product .product-rating svg {
    position: static !important;
}

.dk-result-product .stock-badge {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.dk-result-product .stock-badge.out-of-stock {
    background: #FFF0F0;
    color: #FA7171;
}

.dk-result-product .stock-badge.on-backorder {
    background: #FFF8E0;
    color: #E5A100;
}

/* === Category Result === */
.dk-result-category {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #3A3A3A;
    transition: background 200ms;
}

.dk-result-category:hover {
    background: #F5F5F5;
}

.dk-result-category svg {
    width: 16px;
    height: 16px;
    color: #B9C725;
}

.dk-result-category .cat-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

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

/* === Content Result (Blog/KB) === */
.dk-result-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #3A3A3A;
    transition: background 200ms;
}

.dk-result-content:hover {
    background: #F5F5F5;
}

.dk-result-content .content-thumb {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: #F5F5F5;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dk-result-content .content-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dk-result-content .content-thumb svg {
    width: 20px;
    height: 20px;
    color: #B9C725;
}

.dk-result-content .content-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dk-result-content .content-title {
    font-size: 14px;
    font-weight: 500;
}

.dk-result-content .content-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #999;
}

.dk-result-content .content-type {
    background: #F0F4D0;
    color: #8A9418;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 11px;
}

.dk-result-content .reading-time {
    display: flex;
    align-items: center;
    gap: 3px;
}

.dk-result-content .reading-time svg {
    width: 12px;
    height: 12px;
}

/* === View All Link - matches hardloper "Bekijken" style === */
.dk-search-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 15px;
    margin-top: 5px;
    border-top: 1px solid #efefef;
    text-decoration: none;
    color: #b9c725;
    font-size: 14px;
    font-weight: 500;
    font-family: "Cocogoose", sans-serif;
    transition: all 300ms;
}

.dk-search-view-all:hover {
    color: #A5B214;
}

.dk-search-view-all:hover svg {
    transform: translateX(5px);
}

.dk-search-view-all svg {
    width: 16px;
    height: 16px;
    position: relative;
    top: 1px;
    transition: all 300ms;
}

/* === Empty State === */
.dk-search-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.dk-search-empty svg {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    color: #D4D4D4;
}

.dk-search-empty p {
    margin: 0 0 5px 0;
    font-size: 14px;
}

.dk-search-empty .hint {
    font-size: 13px;
    color: #B9B9B9;
}

/* === AI Search Panel - huisstijl === */
.dk-ai-panel {
    padding: 7px 15px;
}

.dk-ai-welcome {
    text-align: center;
    padding: 15px 10px;
    color: #666;
    font-size: 14px;
    font-family: "Cocogoose", sans-serif;
}

.dk-ai-welcome-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    background: #B9C725;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dk-ai-welcome-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.dk-ai-welcome p {
    margin: 0;
    line-height: 1.5;
}

.dk-ai-input-wrapper {
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 0 0 15px 0;
}

.dk-ai-input {
    flex: 1;
    height: 44px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 1px solid #efefef;
    border-radius: 5px;
    font-size: 14px;
    color: #3A3A3A;
    outline: none;
    transition: border-color 300ms;
    font-family: "Cocogoose", sans-serif;
}

.dk-ai-input:focus {
    border-color: #B9C725;
}

.dk-ai-input::placeholder {
    color: #B9B9B9;
    font-size: 13px;
}

.dk-ai-submit {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    color: white;
    padding: 0;
    position: relative;
}

.dk-ai-submit:hover .button-shape-background g g g path {
    fill: #A5B214 !important;
}

.dk-ai-submit .button-shape-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.dk-ai-submit .feather {
    position: relative;
    z-index: 2;
    width: 18px;
    height: 18px;
    color: #fff;
}

/* === AI Loading === */
.dk-ai-loading {
    text-align: center;
    padding: 30px 20px;
}

.dk-ai-loading p {
    margin: 10px 0 0;
    font-size: 14px;
    color: #999;
}

.dk-ai-loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dk-ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: #B9C725;
    border-radius: 50%;
    animation: dk-dot-bounce 1.4s ease-in-out infinite both;
}

.dk-ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.dk-ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.dk-ai-loading-dots span:nth-child(3) { animation-delay: 0; }

@keyframes dk-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === AI Advice === */
.dk-ai-advice {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #F8FAE8;
    border: 1px solid #E8ECC0;
    border-radius: 5px;
    margin-bottom: 15px;
}

.dk-ai-advice-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: #B9C725;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dk-ai-advice-icon svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

.dk-ai-advice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #3A3A3A;
    font-family: "Cocogoose", sans-serif;
    font-weight: 400;
}

/* === AI Product Cards === */
.dk-ai-products {
    margin-bottom: 15px;
}

.dk-ai-product-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px;
    border-radius: 5px;
    text-decoration: none;
    color: #3A3A3A;
    transition: background 200ms;
}

.dk-ai-product-card:hover {
    background: #F5F5F5;
}

.dk-ai-product-card .product-thumb {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: #F5F5F5;
    border: 1px solid #efefef;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dk-ai-product-card .product-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.dk-ai-product-card .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dk-ai-product-card .product-name {
    font-size: 14px;
    font-weight: 500;
    font-family: "Cocogoose", sans-serif;
}

.dk-ai-product-card .product-price {
    font-size: 14px;
    font-weight: 600;
    color: #B9C725;
}

.dk-ai-product-card .product-price.has-sale .current {
    color: #FA7171;
}

.dk-ai-product-card .product-price.has-sale .original {
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

.dk-ai-product-card .relevance-reason {
    font-size: 12px;
    color: #8A9418;
    font-style: italic;
    line-height: 1.4;
}

/* === AI Error === */
.dk-ai-error {
    text-align: center;
    padding: 20px;
    color: #FA7171;
}

.dk-ai-error svg {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.dk-ai-error p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* === AI Remaining === */
.dk-ai-remaining {
    text-align: center;
    font-size: 12px;
    color: #B9B9B9;
    padding: 10px 0 0;
    margin: 0;
    border-top: 1px solid #efefef;
}

/* === Mobile Overrides === */
@media screen and (max-width: 1024px) {
    .website-header .search-wrapper-mobile .search-collapse-mobile {
        height: calc(100vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: none;
        background: #fff;
        padding-bottom: 150px;
    }

    .dk-search-tabs {
        margin: 0;
        padding: 0 20px;
        margin-top: 15px;
    }

    .dk-search-tab {
        padding: 10px 15px;
        font-size: 12px;
    }

    .dk-search-results {
        padding: 7px 20px;
    }

    .dk-ai-panel {
        padding: 7px 20px;
    }

    .dk-result-product .product-thumb {
        width: 48px;
        height: 48px;
        min-width: 48px;
    }

    .dk-result-product .product-name {
        font-size: 13px;
    }

    .dk-ai-input::placeholder {
        font-size: 12px;
    }

    .website-header .search-wrapper-mobile .search-collapse-mobile .search-buttons .search-right-slide-button,
    .website-header .search-wrapper-mobile .search-collapse-mobile .search-buttons .search-left-slide-button {
        top: 60px;
    }

    .website-header .search-wrapper-mobile .feather {
        top: -1px !important;
        right: 0 !important;
    }

    .website-header .search-wrapper-mobile .search-collapse-mobile .button-wrapper .button svg {
        top: 5px !important;
        height: 20px !important;
        z-index: 99 !important;
        margin-left: 10px !important;
        margin-right: 5px !important;
        position: relative !important;
        left: 0 !important;
        transition: all 300ms !important;
        stroke-width: 3 !important;
    }
}
