* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #2c3e50;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    background: #34495e;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    background: #ecf0f1;
    width: 250px;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin-bottom: 0.5rem;
}

.sidebar nav ul li a {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem;
    display: block;
    border-radius: 4px;
    transition: background 0.3s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a:focus {
    background: #bdc3c7;
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.search-form {
    margin: 1.5rem 0 1rem;
}

.search-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.search-form input,
.search-form button {
    width: 100%;
    padding: 0.7rem;
}

.search-form input {
    margin-bottom: 0.5rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
}

.search-form button {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.recent-searches {
    margin-top: 1.5rem;
}

.recent-searches h2 {
    margin-bottom: 0.75rem;
}

.recent-searches ul {
    list-style: none;
    max-height: 420px;
    overflow-y: auto;
}

.recent-searches li {
    margin-bottom: 0.25rem;
}

.recent-searches a {
    display: block;
    overflow: hidden;
    padding: 0.35rem 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-help {
    margin-top: 0.5rem;
    color: #64748b;
}

.search-filter-form {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(120px, 1fr) minmax(120px, 1fr) auto;
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.search-filter-form label {
    display: block;
    margin-bottom: 0.3rem;
    color: #2c3e50;
    font-size: 0.85rem;
    font-weight: 600;
}

.search-filter-form input,
.search-filter-form button {
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font: inherit;
}

.search-filter-form button {
    background: #3498db;
    color: #fff;
    cursor: pointer;
}

.product-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
    gap: 0.75rem;
    align-items: end;
    margin: 1rem 0;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.product-filters label {
    display: block;
    margin-bottom: 0.3rem;
    color: #2c3e50;
    font-size: 0.85rem;
    font-weight: 600;
}

.product-filters input,
.product-filters select,
.product-filters button,
.product-filter-reset {
    width: 100%;
    min-height: 40px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font: inherit;
}

.product-filters button {
    background: #3498db;
    color: #fff;
    cursor: pointer;
}

.product-filter-price {
    display: contents;
}

.product-filter-reset {
    display: block;
    background: #fff;
    color: #2c3e50;
    text-align: center;
    text-decoration: none;
}

.recent-products {
    margin-bottom: 2rem;
}

.popular-products {
    margin-bottom: 2rem;
}

.popular-products .block-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0;
}

.popular-products .block {
    min-width: 0;
    height: 280px;
}

.popular-products .block-image-wrapper {
    height: 130px;
}

.tradetracker-widget-card {
    overflow: hidden;
}

.tradetracker-iframe-wrapper {
    width: 100%;
    overflow-x: auto;
    text-align: center;
}

.tradetracker-iframe-wrapper iframe {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    border: 0;
}

.recent-products .block-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 0;
}

.recent-products .block {
    min-width: 0;
    height: 280px;
}

.recent-products .block-image-wrapper {
    height: 130px;
}

#recent-products-empty {
    color: #64748b;
}

.contact-form {
    display: grid;
    gap: 1rem;
    max-width: 680px;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.contact-field {
    display: grid;
    gap: 0.35rem;
}

.contact-form label {
    color: #2c3e50;
    font-weight: 600;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font: inherit;
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: fit-content;
    min-width: 180px;
    padding: 0.75rem 1.1rem;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.contact-form button:hover {
    background: #217dbb;
}

.contact-success,
.contact-errors {
    max-width: 680px;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 4px;
}

.contact-success {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
}

.contact-errors {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #991b1b;
}

.contact-errors ul {
    margin-left: 1.25rem;
}

.contact-honeypot {
    position: absolute;
    left: -9999px;
}

.voucher-card {
    max-width: 680px;
    margin: 0 0 1rem;
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid #dbe3ec;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.voucher-card h3 {
    margin-bottom: 0.35rem;
    color: #1e293b;
}

.voucher-campaign {
    color: #64748b;
    font-size: 0.9rem;
}

.voucher-code code {
    display: inline-block;
    padding: 0.2rem 0.45rem;
    background: #f1f5f9;
    border-radius: 4px;
    color: #1e3a8a;
    font-weight: 700;
}

.voucher-reveal {
    margin-left: 0.5rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #3498db;
    border-radius: 4px;
    background: #fff;
    color: #217dbb;
    cursor: pointer;
}

.voucher-reveal:disabled {
    cursor: default;
    opacity: 0.65;
}

.voucher-copy {
    margin-left: 0.35rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid #94a3b8;
    border-radius: 4px;
    background: #fff;
    color: #475569;
    cursor: pointer;
}

.voucher-copy:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.voucher-link {
    display: inline-block;
    padding: 0.6rem 0.9rem;
    background: #3498db;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 900px) {
    .product-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 520px) {
    .product-filters {
        grid-template-columns: 1fr;
    }
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.main-content h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.main-content p {
    margin-bottom: 1rem;
}

.card {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button:focus,
a:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Shared product cards for search and product listings. */
.block-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 20px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    float: none;
    clear: both;
}

.block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 380px;
    width: 100%;
    min-width: 320px;
    box-sizing: border-box;
    float: none;
}

.block:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.block a {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: #1a202c;
}

.block-image-wrapper {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 15px;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

.block img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    position: relative;
    background: #ffffff;
    z-index: 2;
}

.block img:broken,
.block img:not([src]),
.block img[src=''] {
    opacity: 0;
}

/* De placeholder staat standaard onzichtbaar op de achtergrond */
.image-placeholder {
    display: none !important; 
    width: 100% !important;
    height: 100% !important;
    background: #f8fafc !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

/* 🔥 MAGISCHE CSS: Toon de placeholder pas als de wrapper een gecrashte afbeelding heeft */
.block-image-wrapper:has(img[style*="opacity: 0"]),
.block-image-wrapper:has(img[style*="display: none"]) {
    background: #f8fafc !important;
}

.block-image-wrapper:has(img[style*="opacity: 0"]) .image-placeholder,
.block-image-wrapper:has(img[style*="display: none"]) .image-placeholder {
    display: flex !important;
}


.block-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

.block-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.5;
    color: #1e293b;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.campaign-logo {
    display: flex;
    align-items: center;
    min-height: 68px;
    margin: 0 0 8px;
}

.campaign-logo img {
    display: block;
    max-width: 240px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.block-description {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.5;
    color: #4a5568;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.relevance-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
    padding: 6px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.relevance-indicator__label {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.relevance-indicator__segments {
    display: flex;
    gap: 3px;
}

.relevance-indicator__segment {
    display: block;
    width: 24px;
    height: 5px;
    border-radius: 3px;
    background: #dbe4ee;
}

.relevance-indicator__segment--filled {
    background: #3498db;
}

.block-price {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0;
}

.pagination-wrapper {
    width: 100%;
    clear: both;
    display: block;
    margin: 20px 0;
    text-align: center;
}

.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.pagination a,
.pagination span {
    display: block;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-family: sans-serif;
}

.pagination a:hover {
    background: #edf2f7;
    color: #1e3a8a;
}

.pagination span.current-page {
    background: #1e3a8a;
    color: white;
    border-color: #1e3a8a;
}

.pagination span.dots {
    border: none;
    background: transparent;
    color: #a0aec0;
    padding: 10px 10px;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: none;
        border-bottom: 1px solid #bdc3c7;
    }

    .sidebar.active {
        display: block;
    }

    .main-content {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.2rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
}

@media (min-width: 1025px) {
}
