/*
 * Vloershop Core — vergelijk-functie (native, premium-shop-stijl).
 * Rond icoon-knopje op de kaart (onder het hartje), outline-pill op de PDP,
 * mini-cart-balk met thumbnails, en een nette overlay met header + spectabel.
 * Theme-resistant (button-resets + selectieve !important), --vs-* met fallbacks.
 */

.vs-product-card__compare,
.vs-compare-pill,
.vs-compare-bar,
.vs-compare-overlay {
    --vs-cmp-accent: var(--vs-color-primary, #2a3065);
    --vs-cmp-accent-dark: #1f2450;
    --vs-cmp-text: #1f2733;
    --vs-cmp-muted: #667085;
    --vs-cmp-border: #e2e5ee;
    /* Eigen font forceren: op de de-Elementor archiefpagina valt de body terug op
       Times New Roman, en `font: inherit` op de knoppen erfde die serif. */
    --vs-cmp-font: 'Lato', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-family: var(--vs-cmp-font);
}

.vs-compare-ico { width: 18px; height: 18px; flex: 0 0 auto; display: block; }

/* ---- Kaart: rond icoon, gestapeld onder het wishlist-hartje ---- */
.vs-product-card__compare {
    position: absolute !important;
    top: 60px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 3;
    width: 40px !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, .9) !important;
    background-image: none !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12) !important;
    color: #5b6b7b !important;
    cursor: pointer !important;
    line-height: 0 !important;
    transition: background .14s ease, color .14s ease, transform .14s ease !important;
}
.vs-product-card__compare:hover,
.vs-product-card__compare:focus-visible {
    background: #fff !important;
    color: var(--vs-cmp-accent) !important;
}
.vs-product-card__compare.is-active {
    background: var(--vs-cmp-accent) !important;
    color: #fff !important;
}
.vs-product-card__compare .vs-compare-ico { width: 19px; height: 19px; }

/* ---- PDP: outline-pill ---- */
.vs-compare-pdp { margin: 12px 0 0; }
.vs-compare-pill--pdp {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 9px 16px !important;
    background: #fff !important;
    background-image: none !important;
    border: 1.5px solid var(--vs-cmp-border) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    color: var(--vs-cmp-accent) !important;
    font-family: var(--vs-cmp-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    cursor: pointer !important;
    transition: border-color .14s ease, background .14s ease, color .14s ease !important;
}
.vs-compare-pill--pdp:hover {
    border-color: var(--vs-cmp-accent) !important;
    background: #f5f6fb !important;
}
.vs-compare-pill--pdp.is-active {
    background: var(--vs-cmp-accent) !important;
    border-color: var(--vs-cmp-accent) !important;
    color: #fff !important;
}

/* ---- Zwevende balk (mini-cart) ---- */
.vs-compare-bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 9985;
    transform: translate(-50%, 26px);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s cubic-bezier(.22, .61, .36, 1), opacity .28s ease;
    max-width: calc(100vw - 24px);
}
.vs-compare-bar.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}
.vs-compare-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px 12px 18px;
    background: #fff;
    border: 1px solid var(--vs-cmp-border);
    border-radius: 16px;
    box-shadow: 0 12px 38px rgba(15, 23, 42, .2);
}
.vs-compare-bar__thumbs {
    display: flex;
    align-items: center;
    gap: 8px;
}
.vs-compare-bar__thumb {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #f1f3f8;
    overflow: visible;
    flex: 0 0 auto;
}
.vs-compare-bar__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}
.vs-compare-bar__thumb-x {
    position: absolute !important;
    top: -6px !important;
    right: -6px !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--vs-cmp-text) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 13px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}
.vs-compare-bar__thumb-x:hover { background: #e3342f !important; }
.vs-compare-bar__actions { display: flex; align-items: center; gap: 14px; padding-left: 14px; border-left: 1px solid var(--vs-cmp-border); }
.vs-compare-bar__btn {
    appearance: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    padding: 11px 20px !important;
    border: 0 !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    background: var(--vs-cmp-accent) !important;
    background-image: none !important;
    color: #fff !important;
    font-family: var(--vs-cmp-font) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: background .15s ease, opacity .15s ease !important;
}
.vs-compare-bar__btn:hover { background: var(--vs-cmp-accent-dark) !important; }
.vs-compare-bar__btn:disabled { opacity: .5 !important; cursor: not-allowed !important; }
.vs-compare-bar__link {
    appearance: none !important;
    -webkit-appearance: none !important;
    margin: 0 !important;
    padding: 4px 6px !important;
    border: 0 !important;
    box-shadow: none !important;
    background: none !important;
    background-image: none !important;
    cursor: pointer !important;
    font-family: var(--vs-cmp-font) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--vs-cmp-muted) !important;
    text-decoration: none !important;
    text-underline-offset: 2px !important;
    transition: color .14s ease !important;
}
.vs-compare-bar__link:hover { color: var(--vs-cmp-text) !important; text-decoration: underline !important; }

@media (max-width: 600px) {
    .vs-compare-bar { left: 12px; right: 12px; bottom: 12px; transform: translateY(26px); max-width: none; }
    .vs-compare-bar.is-visible { transform: translateY(0); }
    .vs-compare-bar__inner { gap: 12px; padding: 10px 12px; }
    .vs-compare-bar__thumb { width: 40px; height: 40px; }
    /* Op smal scherm maar 2 thumbs tonen om de balk compact te houden. */
    .vs-compare-bar__thumb:nth-child(n+3) { display: none; }
    .vs-compare-bar__btn { padding: 10px 16px !important; }
    .vs-compare-bar__link { display: none; }
}

/* ---- Overlay ---- */
body.vs-compare-lock { overflow: hidden; }
.vs-compare-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    opacity: 0;
    transition: opacity .22s ease;
}
.vs-compare-overlay.is-visible { opacity: 1; }
.vs-compare-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .58);
    backdrop-filter: blur(2px);
}
.vs-compare-overlay__panel {
    position: relative;
    width: 100%;
    max-width: 1080px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .34);
    overflow: hidden;
    transform: translateY(14px) scale(.985);
    transition: transform .24s cubic-bezier(.22, .61, .36, 1);
}
.vs-compare-overlay.is-visible .vs-compare-overlay__panel { transform: translateY(0) scale(1); }

.vs-compare-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 16px 22px;
    border-bottom: 1px solid var(--vs-cmp-border);
    flex: 0 0 auto;
}
.vs-compare-overlay__title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: var(--vs-cmp-text) !important;
}
.vs-compare-overlay__close {
    width: 40px !important;
    height: 40px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f3f4f8 !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--vs-cmp-text) !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}
.vs-compare-overlay__close:hover { background: #e7e9f1 !important; }
.vs-compare-overlay__scroll {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
.vs-compare-overlay__loading { min-height: 220px; }
.vs-compare-overlay__error { padding: 48px 24px; text-align: center; color: var(--vs-cmp-muted); }

/* ---- Vergelijktabel ---- */
.vs-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--vs-cmp-text);
}
.vs-compare-table th,
.vs-compare-table td {
    padding: 13px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #eef0f4;
}
.vs-compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
    border-bottom: 2px solid #e6e8ef;
    vertical-align: bottom;
}
.vs-compare-table__corner { width: 150px; }
.vs-compare-table__head { position: relative; min-width: 200px; width: 25%; }
.vs-compare-table__remove {
    position: absolute !important;
    top: 2px !important;
    right: 8px !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #f3f4f8 !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--vs-cmp-muted) !important;
    font-size: 17px !important;
    line-height: 1 !important;
    cursor: pointer !important;
}
.vs-compare-table__remove:hover { background: #e3342f !important; color: #fff !important; }
.vs-compare-table__product { display: block; text-decoration: none; color: inherit; }
.vs-compare-table__imgwrap {
    display: block;
    width: 100%;
    max-width: 160px;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f4f5f7;
    margin-bottom: 10px;
}
.vs-compare-table__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-compare-table__name {
    display: block;
    font-weight: 700;
    line-height: 1.3;
    color: var(--vs-cmp-text);
}
.vs-compare-table__price { margin-top: 6px; font-weight: 700; color: var(--vs-cmp-accent); }
.vs-compare-table__price del,
.vs-compare-table__price .woocommerce-Price-amount del { color: var(--vs-cmp-muted) !important; font-weight: 500; }
.vs-compare-table__view {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--vs-cmp-accent);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease;
}
.vs-compare-table__view:hover { background: var(--vs-cmp-accent-dark); }
.vs-compare-table__key {
    font-weight: 600;
    color: var(--vs-cmp-muted);
    background: #fafbfc;
    white-space: nowrap;
}
.vs-compare-table tbody tr:nth-child(even) td,
.vs-compare-table tbody tr:nth-child(even) .vs-compare-table__key { background: #fbfcfe; }

@media (max-width: 600px) {
    .vs-compare-overlay { padding: 0; }
    .vs-compare-overlay__panel { max-width: none; max-height: 100vh; height: 100dvh; border-radius: 0; }
    .vs-compare-table__head { min-width: 150px; }
    .vs-compare-table__corner { width: 100px; }
    .vs-compare-table__imgwrap { max-width: 110px; }
    .vs-compare-table th, .vs-compare-table td { padding: 11px 12px; }
}

/* Prijs-eenheid (per m²/m/stuk) in de vergelijktabel */
.vs-compare-table__unit {
    font-size: 12px;
    font-weight: 600;
    color: var(--vs-cmp-muted, #667085);
}
