/* View All Results Button */
.easy-search-view-all {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.easy-search-view-all-button {
    display: inline-block;
    padding: 12px 30px;
    background: #FFD603;
    color: #000;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    border: 2px solid #FFD603;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.easy-search-view-all-button:hover {
    background: #e6c102;
    border-color: #e6c102;
    color: #000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.easy-search-view-all-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Search Results Page */
.easy-search-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.easy-search-results-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.easy-search-results-title strong {
    color: #FFD603;
}

.easy-search-results-count {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.easy-search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Resultatenpagina: 5 producten per rij (zoals archiefpagina) */
.easy-search-results-page .easy-search-results-grid--products {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 24px;
}

@media (max-width: 1200px) {
    .easy-search-results-page .easy-search-results-grid--products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

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

@media (max-width: 576px) {
    .easy-search-results-page .easy-search-results-grid--products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

.easy-search-result-item {
    background: #fff;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.easy-search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Productkaart op resultatenpagina: archiefstijl met CTA-knop */
.easy-search-result-item--product .easy-search-result-link,
.easy-search-result-item--product .easy-search-result-link:hover,
.easy-search-result-item--product .easy-search-result-link:focus {
    text-decoration: none !important;
}

.easy-search-result-item--product .easy-search-result-link *,
.easy-search-result-item--product .easy-search-result-link:hover *,
.easy-search-result-item--product .easy-search-result-link:focus * {
    text-decoration: none !important;
}

.easy-search-result-item--product .easy-search-result-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.easy-search-result-item--product .easy-search-result-image {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    overflow: hidden;
}

.easy-search-result-item--product .easy-search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.easy-search-result-item--product .easy-search-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
}

.easy-search-result-item--product .easy-search-result-title {
    text-align: center;
    font-family: "Montserrat", Sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
    margin-bottom: 8px;
}

/* SKU niet tonen op resultatenpagina */
.easy-search-results-page .easy-search-result-item--product .easy-search-result-sku {
    display: none;
}

.easy-search-result-item--product .easy-search-result-sku {
    margin-bottom: 6px;
}

.easy-search-result-item--product .easy-search-result-cta {
    display: inline-block;
    margin-top: auto;
    padding: 12px 16px;
    background: #FFD603;
    color: #000;
    font-family: "Saira Condensed", Sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 0;
    transition: all 0.2s;
}

.easy-search-result-item--product .easy-search-result-link:hover .easy-search-result-cta {
    background: #e6c102;
}

.easy-search-result-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.easy-search-result-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.easy-search-result-content {
    padding: 15px;
}

.easy-search-result-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.4;
}

.easy-search-result-excerpt {
    font-size: 14px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.easy-search-result-sku {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.easy-search-result-price {
    font-size: 16px;
    font-weight: 600;
    color: #FFD603;
    margin-top: 10px;
}

.easy-search-results-page .easy-search-result-price,
.easy-search-results-page .easy-search-result-price * {
    color: #FFD603 !important;
}

/* Restricted product (Role and price): ENKEL VOOR PARTNERS (zelfde specificiteit als .easy-search-results-page .easy-search-result-price) */
.easy-search-results-page .easy-search-result-price--restricted,
.easy-search-results-page .easy-search-result-price--restricted * {
    color: #000 !important;
}
.easy-search-result-price--restricted {
    font-size: 14px;
}
.easy-search-result-cta--restricted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.easy-search-result-cta-lock {
    flex-shrink: 0;
    vertical-align: middle;
}

.easy-search-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
    padding: 20px 0;
}

.easy-search-pagination-link {
    padding: 10px 20px;
    background: #FFD603;
    color: #000;
    text-decoration: none;
    border-radius: 0;
    transition: background 0.3s ease;
}

.easy-search-pagination-link:hover {
    background: #e6c102;
    color: #000;
}

.easy-search-pagination-info {
    color: #666;
    font-size: 14px;
}

/* Resultatenpagina: paginering producten (paginate_links type=list) */
.easy-search-results-pagination {
    margin: 10px 0 40px 0;
}

.easy-search-results-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.easy-search-results-pagination ul.page-numbers li {
    margin: 0;
}

.easy-search-results-pagination .page-numbers {
    display: inline-block;
    min-width: 40px;
    padding: 10px 14px;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    transition: background 0.3s ease;
}

.easy-search-results-pagination a.page-numbers:hover {
    background: #e6c102;
    color: #000;
}

.easy-search-results-pagination .page-numbers.current {
    background: #FFD603;
    color: #000;
    font-weight: 700;
}

.easy-search-results-pagination .page-numbers.dots {
    background: none;
    padding: 10px 4px;
}

.easy-search-no-results,
.easy-search-no-query {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.easy-search-no-results p,
.easy-search-no-query p {
    font-size: 16px;
    margin: 0;
}

/* Close Results Button – neutrale stijl, overschrijft Elementor button-kleur */
button.easy-search-close-results,
.easy-search-results .easy-search-close-results {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    background: #f0f0f0 !important;
    background-color: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    border-radius: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #555 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-weight: 400;
    text-transform: none;
}

button.easy-search-close-results:hover,
.easy-search-results .easy-search-close-results:hover {
    background: #e5e5e5 !important;
    background-color: #e5e5e5 !important;
    color: #333 !important;
    border-color: #ccc !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.easy-search-close-results:focus {
    outline: 2px solid #FFD603;
    outline-offset: 2px;
}

/* Easy Search Container */
.easy-search-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    z-index: 99998; /* Ensure container has high z-index too */
}

/* Search Form */
.easy-search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 0;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.easy-search-form:focus-within {
    border-color: #FFD603;
    box-shadow: 0 0 0 3px rgba(255, 214, 3, 0.2);
}

.easy-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}

.easy-search-input::placeholder {
    color: #999;
}

button.easy-search-submit,
.easy-search-form .easy-search-submit {
    padding: 12px 20px;
    border: none;
    background: transparent !important;
    background-color: transparent !important;
    color: currentColor;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.easy-search-submit:hover,
.easy-search-form .easy-search-submit:hover {
    background: transparent !important;
    background-color: transparent !important;
    opacity: 0.8;
}

.easy-search-icon {
    font-size: 18px;
}

/* Results Container */
.easy-search-results {
    position: fixed;
    top: auto;
    bottom: auto;
    margin-top: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow: visible; /* Changed from auto to allow close button to be visible */
    z-index: 99999;
    display: none;
    max-width: 1400px;
    width: calc(100vw - 40px);
    left: 50%;
    transform: translateX(-50%);
}

/* Inner wrapper for scrollable content */
.easy-search-results-inner {
    max-height: 600px;
    overflow-y: auto;
    padding-top: 0;
}

.easy-search-results.has-results,
.easy-search-results.is-loading {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Loading State */
.easy-search-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* No Results */
.easy-search-no-results {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

/* Error Message */
.easy-search-error {
    padding: 20px;
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.easy-search-debug {
    margin-top: 12px;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    font-size: 11px;
    color: #333;
}
.easy-search-debug pre {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: monospace;
}

/* Search Sections */
.easy-search-section {
    padding: 20px;
}

.easy-search-section:not(:last-child) {
    border-bottom: 1px solid #e0e0e0;
}

.easy-search-section-title {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 0.5px;
}

.easy-search-results-section-title {
    font-size: 24px;
    font-weight: 600;
    margin: 30px 0 20px 0;
    color: #333;
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.easy-search-results-section-title:first-of-type {
    margin-top: 0;
}

.easy-search-date {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Search List */
.easy-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.easy-search-item {
    margin-bottom: 12px;
}

.easy-search-item:last-child {
    margin-bottom: 0;
}

.easy-search-link {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: 0;
    transition: background 0.2s ease;
}

.easy-search-link:hover {
    background: #f5f5f5;
}

/* Product Image */
.easy-search-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    margin-right: 12px;
    border-radius: 0;
    overflow: hidden;
    background: #f0f0f0;
}

.easy-search-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Search Content */
.easy-search-content {
    flex: 1;
    min-width: 0;
}

.easy-search-title {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.easy-search-title mark {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 0;
    font-weight: 700;
}

.easy-search-excerpt {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.easy-search-excerpt mark {
    background: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 0;
}

.easy-search-sku {
    display: inline-block;
    font-size: 12px;
    color: #999;
    margin-right: 12px;
}

.easy-search-price {
    display: inline-block;
    font-size: 16px;
    font-weight: 600;
    color: #FFD603;
}

/* AJAX-dropdown: prijzen naast elkaar (inline); archief/resultatenpagina blijft ongewijzigd */
.easy-search-results .easy-search-price,
.easy-search-results .easy-search-price * {
    display: inline !important;
}

/* Responsive */
@media (max-width: 768px) {
    .easy-search-results {
        max-height: 400px;
        width: calc(100vw - 20px);
        max-width: 100%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .easy-search-image {
        width: 50px;
        height: 50px;
    }
    
    .easy-search-title {
        font-size: 14px;
    }
    
    .easy-search-excerpt {
        font-size: 13px;
    }
}

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

.easy-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 0;
    margin: 8px;
}

.easy-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 0;
}

.easy-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Search Icon Container */
.easy-search-icon-container {
    position: relative;
    display: inline-block;
}

.easy-search-icon-trigger {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-size: 20px;
    color: inherit;
}

.easy-search-icon-trigger:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.easy-search-icon-symbol {
    display: inline-block;
    line-height: 1;
}

/* Search Icon Dropdown – direct onder het icoon, resultaten daaronder in flow */
.easy-search-icon-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    z-index: 9999;
    min-width: 320px;
    max-width: 520px;
    width: 90vw;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    display: none;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Override Elementor .elementor-kit-xxx button (primary color) – backdrop stays subtle and transparent */
button.easy-search-icon-dropdown-backdrop,
.easy-search-icon-dropdown button.easy-search-icon-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.08) !important;
    background-color: rgba(0, 0, 0, 0.08) !important;
    border: none;
    cursor: pointer;
    padding: 0;
}

.easy-search-icon-dropdown.is-open {
    display: block;
    opacity: 1;
}

.easy-search-icon-dropdown .easy-search-container {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 12px 16px 16px;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.easy-search-icon-dropdown .easy-search-form {
    position: relative;
}

/* Sluitknop zoekveld – neutrale stijl, overschrijft Elementor button-kleur */
button.easy-search-close,
.easy-search-form .easy-search-close {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #666 !important;
    border-radius: 0;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 10;
    padding: 0;
    font-weight: 400;
    text-transform: none;
}

button.easy-search-close:hover,
.easy-search-form .easy-search-close:hover {
    background: #f0f0f0 !important;
    background-color: #f0f0f0 !important;
    color: #333 !important;
}

.easy-search-close span {
    line-height: 1;
}

.easy-search-icon-dropdown .easy-search-results {
    position: relative;
    left: auto;
    transform: none;
    width: 100%;
    margin-top: 8px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Responsive for icon dropdown */
@media (max-width: 768px) {
    .easy-search-icon-dropdown {
        min-width: 280px;
        max-width: calc(100vw - 24px);
        right: -8px;
    }
    
    .easy-search-icon-dropdown .easy-search-container {
        padding: 10px 12px 12px;
    }
    
    .easy-search-icon-dropdown .easy-search-results {
        max-height: 60vh;
    }
}

/* ========== Mobiele versie [creativitijd_search_icon version="mobile"] ========== */
@media (max-width: 768px) {
    .easy-search-icon-container--mobile .easy-search-icon-trigger {
        min-width: 44px;
        min-height: 44px;
        padding: 12px 14px;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-symbol .easy-search-icon-svg {
        width: 24px;
        height: 24px;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: 100vh;
        display: none;
        border-radius: 0;
        border: none;
        align-items: stretch;
        justify-content: flex-start;
        flex-direction: column;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown.is-open {
        display: flex;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 16px;
        padding-top: max(16px, env(safe-area-inset-top));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        max-height: 100%;
        overflow: hidden;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-form {
        flex-shrink: 0;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-input {
        font-size: 16px;
        min-height: 48px;
        padding: 14px 18px;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-submit {
        min-width: 48px;
        min-height: 48px;
        padding: 14px;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-results {
        flex: 1;
        min-height: 0;
        max-height: none;
        margin-top: 12px;
        -webkit-overflow-scrolling: touch;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-item {
        min-height: 48px;
        padding: 12px 0;
    }
    
    .easy-search-icon-container--mobile .easy-search-icon-dropdown .easy-search-view-all-button {
        min-height: 48px;
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* Verberg mobiele shortcode op desktop (optioneel: toon alleen in mobiel menu) */
@media (min-width: 769px) {
    .easy-search-icon-container--mobile {
        display: none;
    }
}
