/* ═══════════════════════════════════════════════════════════
   GTXXL Razendsnel Zoeken — Stylesheet
   Font: Syne + JetBrains Mono (GTXXL design system)
   ═══════════════════════════════════════════════════════════ */

/* ── Variabelen ─────────────────────────────────────────── */
#gtxxl-zoek-overlay,
#gtxxl-zoek-overlay * {
    --gtxxl-groen:       #2d6a2d;
    --gtxxl-groen-licht: #3a8a3a;
    --gtxxl-groen-bg:    #f0f7f0;
    --gtxxl-tekst:       #1a1a1a;
    --gtxxl-subtekst:    #6b7280;
    --gtxxl-rand:        #e5e7eb;
    --gtxxl-wit:         #ffffff;
    --gtxxl-shadow:      0 20px 60px rgba(0,0,0,0.18);
    --gtxxl-radius:      14px;
    --gtxxl-font:        'Syne', system-ui, sans-serif;
    --gtxxl-mono:        'JetBrains Mono', monospace;
    --gtxxl-transition:  0.22s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--gtxxl-font);
}

/* ── Animaties ──────────────────────────────────────────── */
@keyframes gtxxlFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes gtxxlSpin {
    to { transform: rotate(360deg); }
}

@keyframes gtxxlShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Backdrop ───────────────────────────────────────────── */
#gtxxl-zoek-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity var(--gtxxl-transition);
}

#gtxxl-zoek-backdrop.gtxxl-zoek-open {
    display: block;
    opacity: 1;
}

/* ── Body scroll lock ───────────────────────────────────── */
body.gtxxl-zoek-actief {
    overflow: hidden;
}

/* ── Overlay container ──────────────────────────────────── */
#gtxxl-zoek-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    background: var(--gtxxl-wit);
    overflow: hidden;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: min(680px, 96vw);
    max-height: 80vh;
    border-radius: 0 0 var(--gtxxl-radius) var(--gtxxl-radius);
    box-shadow: var(--gtxxl-shadow);
    opacity: 0;
    transition: opacity var(--gtxxl-transition), transform var(--gtxxl-transition);
    flex-direction: column;
}

#gtxxl-zoek-overlay.gtxxl-zoek-open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    #gtxxl-zoek-overlay {
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        max-height: 100%;
        border-radius: 0;
        transform: translateY(-12px);
    }
    #gtxxl-zoek-overlay.gtxxl-zoek-open {
        transform: translateY(0);
    }
}

/* ── Header: zoekinput ──────────────────────────────────── */
#gtxxl-zoek-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gtxxl-rand);
    background: var(--gtxxl-wit);
    flex-shrink: 0;
}

#gtxxl-zoek-sluiten {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    color: var(--gtxxl-tekst);
    transition: color var(--gtxxl-transition);
}

#gtxxl-zoek-sluiten svg {
    width: 22px;
    height: 22px;
    stroke: var(--gtxxl-tekst);
}

#gtxxl-zoek-sluiten:hover svg { stroke: var(--gtxxl-groen); }

@media (min-width: 641px) {
    #gtxxl-zoek-sluiten { display: none; }
}

#gtxxl-zoek-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
}

#gtxxl-zoek-input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: var(--gtxxl-font);
    font-size: 16px;
    color: var(--gtxxl-tekst);
    padding: 8px 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
}

#gtxxl-zoek-input::placeholder { color: var(--gtxxl-subtekst); }

#gtxxl-zoek-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    transition: color var(--gtxxl-transition);
}

#gtxxl-zoek-submit svg {
    width: 20px;
    height: 20px;
    stroke: var(--gtxxl-subtekst);
}

#gtxxl-zoek-submit:hover svg { stroke: var(--gtxxl-groen); }

#gtxxl-zoek-wis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px;
    transition: color var(--gtxxl-transition);
}

#gtxxl-zoek-wis svg {
    width: 18px;
    height: 18px;
    stroke: var(--gtxxl-subtekst);
}

#gtxxl-zoek-wis:hover svg { stroke: var(--gtxxl-tekst); }

/* ── Suggesties ─────────────────────────────────────────── */
#gtxxl-zoek-suggesties-wrap {
    border-bottom: 1px solid var(--gtxxl-rand);
    background: var(--gtxxl-wit);
}

#gtxxl-zoek-suggesties {
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
    gap: 8px;
}

#gtxxl-zoek-suggesties .gtxxl-zoek-suggesties-rij {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#gtxxl-zoek-suggesties .gtxxl-zoek-suggesties-rij::-webkit-scrollbar { display: none; }

.gtxxl-zoek-suggesties-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin-right: 2px;
    white-space: nowrap;
}

.gtxxl-zoek-suggestie {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: #fff;
    font-size: 16px;
    color: #374151;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.5;
}

.gtxxl-zoek-suggestie strong {
    font-weight: 700;
    display: inline;
    margin: 0;
    padding: 0;
}

.gtxxl-zoek-suggestie:hover {
    border-color: #2d6a2d;
    color: #2d6a2d;
    background: #f0f7f0;
}

/* Desktop suggesties boven .main */
#gtxxl-zoek-desktop-results #gtxxl-zoek-suggesties-wrap {
    max-width: 1092px;
    margin: 0 auto;
    padding: 16px 0 0;
    border-bottom: none;
    background: transparent;
}

/* ── Body: resultaten ───────────────────────────────────── */
#gtxxl-zoek-body {
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#gtxxl-zoek-resultaten {
    display: flex;
    flex-direction: column;
}

/* ── Lege staat ─────────────────────────────────────────── */
.gtxxl-zoek-leeg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 16px;
    color: var(--gtxxl-subtekst);
    text-align: center;
}

.gtxxl-zoek-leeg svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.gtxxl-zoek-leeg p { margin: 0; font-size: 14px; }

/* ── Spinner ────────────────────────────────────────────── */
.gtxxl-zoek-main-laden {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.gtxxl-zoek-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #2d6a2d;
    border-radius: 50%;
    animation: gtxxlSpin 0.7s linear infinite;
}

.gtxxl-zoek-laden-tekst {
    display: block;
    margin-top: 12px;
    font-size: 15px;
    color: #6b7280;
    font-family: inherit;
}

/* ══════════════════════════════════════════════════════════
   DESKTOP: resultaten in .main
   ══════════════════════════════════════════════════════════ */

.gtxxl-zoek-main-wrap {
    max-width: 1092px;
    margin: 0 auto;
    padding: 24px 20px;
    animation: gtxxlFadeIn 0.2s ease both;
}

.gtxxl-zoek-main-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 16px;
    font-family: 'Syne', sans-serif;
    padding: 8px 0 8px 4px;
    gap: 16px;
}

/* Suggesties in header — links */
.gtxxl-zoek-main-header #gtxxl-zoek-suggesties-wrap {
    flex: 1;
    border-bottom: none;
    background: transparent;
}

.gtxxl-zoek-main-header #gtxxl-zoek-suggesties {
    padding: 0;
}

/* Resultaten teller — altijd rechts op desktop */
.gtxxl-zoek-main-count--right {
    font-size: 15px;
    color: #1a1a1a;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

/* Mobiel overlay: header simpel links */
#gtxxl-zoek-resultaten .gtxxl-zoek-main-header {
    justify-content: flex-start;
    padding: 14px 12px 0px 14px;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-main-count--right {
    margin-left: 0;
}

.gtxxl-zoek-main-count { font-size: 15px; color: #1a1a1a; }
.gtxxl-zoek-main-count strong { color: #2d6a2d; }

/* Desktop sluitknop — in de header naast resultaten teller */
#gtxxl-zoek-desktop-sluit {
    position: static;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    font-size: 48px;
    color: #797977;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

#gtxxl-zoek-desktop-sluit:hover { color: #1a1a1a; }

/* ── Productgrid ────────────────────────────────────────── */
.gtxxl-zoek-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 1024px) { .gtxxl-zoek-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .gtxxl-zoek-grid { grid-template-columns: repeat(2, 1fr); } }

/* Mobiel overlay: 2 kolommen */
#gtxxl-zoek-resultaten .gtxxl-zoek-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 12px;
}

@media (orientation: landscape) and (max-width: 1024px),
       (min-width: 480px) and (max-width: 640px) {
    #gtxxl-zoek-resultaten .gtxxl-zoek-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Productkaart ───────────────────────────────────────── */
.gtxxl-zoek-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    animation: gtxxlFadeIn 0.25s ease both;
    contain: layout paint;
    content-visibility: auto;
    contain-intrinsic-size: 320px;
}

.gtxxl-zoek-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card {
    border-radius: 8px;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.gtxxl-zoek-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-decoration: none !important;
    color: inherit !important;
}

.gtxxl-zoek-card-link:hover .gtxxl-zoek-card-naam { color: #2d6a2d; }

/* Afbeelding */
.gtxxl-zoek-card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid #e5e7eb;
    overflow: hidden;
}

.gtxxl-zoek-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card-img { padding: 10px; }

/* Niet op voorraad label */
.gtxxl-zoek-card-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    z-index: 1;
    white-space: nowrap;
}

.gtxxl-zoek-card--oos .gtxxl-zoek-card-img img { opacity: 0.6; }
.gtxxl-zoek-card--oos .gtxxl-zoek-card-prijs { color: #9ca3af; }

/* Info */
.gtxxl-zoek-card-info {
    flex: 1;
    padding: 10px 12px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card-info { padding: 8px 10px 4px; }

.gtxxl-zoek-card-naam {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a1a;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card-naam { font-size: 12px; }

.gtxxl-zoek-card-naam mark {
    background: #d4edda;
    color: #2d6a2d;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}


/* Footer: prijs + winkelwagen */
.gtxxl-zoek-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 14px;
    gap: 8px;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-card-footer { padding: 4px 10px 10px; }

.gtxxl-zoek-card-prijs {
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: #2d6a2d;
}

.gtxxl-zoek-card-prijs .woocommerce-Price-amount { color: #2d6a2d; }

#gtxxl-zoek-resultaten .gtxxl-zoek-card-prijs { font-size: 13px; }

/* ── Winkelwagen knop ───────────────────────────────────── */
.gtxxl-zoek-atc {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #2d6a2d;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    color: #fff;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-atc { width: 32px; height: 32px; }

.gtxxl-zoek-atc:hover { background: #3a8a3a; transform: scale(1.05); }

.gtxxl-zoek-atc svg {
    width: 20px;
    height: 20px;
    fill: #fff;
    stroke: none;
    flex-shrink: 0;
}

#gtxxl-zoek-resultaten .gtxxl-zoek-atc svg { width: 18px; height: 18px; }

.gtxxl-atc-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.gtxxl-atc-plus {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    margin-top: -1px;
}

.gtxxl-zoek-atc--options { background: #2d6a2d; }
.gtxxl-zoek-atc--options:hover { background: #3a8a3a; }
.gtxxl-zoek-atc--loading { opacity: 0.6; pointer-events: none; }
.gtxxl-zoek-atc--loading svg { animation: gtxxlSpin 0.7s linear infinite; }
.gtxxl-zoek-atc--done { background: #4caf50 !important; }

/* ── Laad meer knop ─────────────────────────────────────── */
.gtxxl-zoek-laad-meer-wrap {
    display: flex;
    justify-content: center;
    padding: 28px 0 8px;
}

/* Mobiel: laad meer onzichtbaar — IntersectionObserver doet het werk */
#gtxxl-zoek-resultaten .gtxxl-zoek-laad-meer-wrap {
    opacity: 0;
    height: 1px;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

.gtxxl-zoek-laad-meer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: transparent;
    border: 2px solid #2d6a2d;
    border-radius: 6px;
    color: #2d6a2d;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.gtxxl-zoek-laad-meer:hover { background: #2d6a2d; color: #fff; }

#gtxxl-load-sentinel { height: 1px; width: 100%; }

/* ── Skeleton cards ─────────────────────────────────────── */
.gtxxl-zoek-skeleton {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    pointer-events: none;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.gtxxl-zoek-skeleton-img,
.gtxxl-zoek-skeleton-text,
.gtxxl-zoek-skeleton-price {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: gtxxlShimmer 1.2s infinite;
}

.gtxxl-zoek-skeleton-img { aspect-ratio: 1 / 1; }
.gtxxl-zoek-skeleton-text { height: 14px; margin: 12px 12px 6px; border-radius: 4px; }
.gtxxl-zoek-skeleton-price { height: 14px; width: 60%; margin: 0 12px 14px; border-radius: 4px; }

/* Spacer voor hoogtereservering */
.gtxxl-zoek-spacer { width: 100%; grid-column: 1 / -1; }

/* ══════════════════════════════════════════════════════════
   THEMA GRID INTEGRATIE (.archive-content--grid)
   ══════════════════════════════════════════════════════════ */

.archive-content--grid .gtxxl-zoek-card {
    border-radius: 6px;
    width: 100% !important;
    max-width: 100% !important;
}

.archive-content--grid .gtxxl-zoek-card-img {
    background: #f7f7f7;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.archive-content--grid .gtxxl-zoek-card-info { padding: 12px 14px 6px; gap: 4px; }
.archive-content--grid .gtxxl-zoek-card-naam { font-size: 14px; }
.archive-content--grid .gtxxl-zoek-card-prijs { padding: 8px 14px 14px; font-size: 15px; }
.archive-content--grid .gtxxl-zoek-main-laden { grid-column: 1 / -1; }

/* Teller boven de grid */
.gtxxl-zoek-resultaat-teller {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 4px;
    font-size: 15px;
    color: #1a1a1a;
}

.gtxxl-zoek-resultaat-teller strong { color: #2d6a2d; }