/**
 * BandenKopen_Compare - Stijlen
 * Locatie: app/code/BandenKopen/Compare/view/frontend/web/css/compare.css
 */

:root {
    --bk-accent:   #e8312a;
    --bk-dark:     #1a2740;
    --bk-border:   #dde3ed;
    --bk-bg:       #ffffff;
    --bk-shadow:   0 -4px 24px rgba(0,0,0,0.14);
    --bk-radius:   8px;
    --bk-font:     'Open Sans', 'Segoe UI', sans-serif;
    --bk-z:        8000;
}

/* ============================================================
   VASTE BALK ONDERAAN
   ============================================================ */
.bk-compare-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: var(--bk-z);
    background: var(--bk-bg);
    border-top: 2px solid var(--bk-dark);
    box-shadow: var(--bk-shadow);
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--bk-font);
}

.bk-compare-bar--hidden {
    bottom: -200px !important;
    pointer-events: none;
}

.bk-compare-bar--visible {
    bottom: 0 !important;
    pointer-events: auto;
}

.bk-compare-bar__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
}

/* ============================================================
   SLOTS IN DE BALK
   ============================================================ */
.bk-compare-bar__slots {
    display: flex;
    gap: 12px;
    flex: 1;
}

.bk-compare-slot {
    flex: 1;
    max-width: 180px;
    min-width: 120px;
    height: 80px;
    border-radius: var(--bk-radius);
    position: relative;
    overflow: visible;
}

.bk-compare-slot--empty {
    border: 2px dashed var(--bk-border);
    background: #f8f9fc;
}

.bk-compare-slot__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    color: #bbb;
    font-size: 0.7rem;
}

.bk-compare-slot__placeholder svg {
    width: 22px;
    height: 22px;
}

.bk-compare-slot--filled {
    border: 2px solid var(--bk-dark);
    background: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
}

.bk-compare-slot--filled img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

.bk-compare-slot__name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bk-dark);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.bk-slot-remove {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 20px;
    height: 20px;
    background: var(--bk-accent);
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
    transition: transform 0.15s, background 0.15s;
}

.bk-slot-remove:hover { transform: scale(1.15); background: #c5211a; }
.bk-slot-remove svg { width: 8px; height: 8px; }

/* ============================================================
   ACTIES IN DE BALK
   ============================================================ */
.bk-compare-bar__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.bk-compare-bar__hint {
    font-size: 0.74rem;
    color: #888;
    margin: 0;
    white-space: nowrap;
}

.bk-compare-bar__btn-compare {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bk-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 0.84rem;
    font-weight: 700;
    font-family: var(--bk-font);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.bk-compare-bar__btn-compare:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bk-compare-bar__btn-compare:not(:disabled):hover {
    background: #c5211a;
}

.bk-compare-bar__btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    font-size: 0.74rem;
    color: #999;
    font-family: var(--bk-font);
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s;
}

.bk-compare-bar__btn-clear:hover { color: var(--bk-accent); }
.bk-compare-bar__btn-clear svg { width: 13px; height: 13px; }

/* ============================================================
   VERGELIJKINGSPOPUP
   ============================================================ */
.bk-compare-popup {
    position: fixed !important;
    inset: 0;
    z-index: calc(var(--bk-z) + 100);
    display: none;
    align-items: center;
    justify-content: center;
}

.bk-compare-popup--open { display: flex; }

.bk-compare-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    cursor: pointer;
}

.bk-compare-popup__panel {
    position: relative;
    background: var(--bk-bg);
    border-radius: var(--bk-radius);
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    max-width: 900px;
    width: calc(100vw - 32px);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bk-compare-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bk-dark);
    color: #fff;
    flex-shrink: 0;
}

.bk-compare-popup__title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.bk-compare-popup__close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    opacity: 0.8;
    display: flex;
    transition: opacity 0.15s;
}

.bk-compare-popup__close:hover { opacity: 1; }
.bk-compare-popup__close svg { width: 16px; height: 16px; }

.bk-compare-popup__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 20px;
}

.bk-compare-popup__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.bk-compare-popup__col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--bk-border);
    border-radius: var(--bk-radius);
    padding: 12px;
    text-align: center;
}

.bk-compare-popup__img-link img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.bk-compare-popup__col-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bk-compare-popup__col-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--bk-dark);
    text-decoration: none;
    line-height: 1.3;
}

.bk-compare-popup__col-name:hover { color: var(--bk-accent); }

.bk-compare-popup__col-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bk-accent);
}

.bk-compare-popup__col-attr {
    font-size: 0.75rem;
    color: #666;
    background: #f4f6fb;
    border-radius: 4px;
    padding: 2px 6px;
    text-align: left;
}

.bk-compare-popup__col-remove {
    margin-top: auto;
    background: none;
    border: 1px solid var(--bk-border);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 0.72rem;
    color: #888;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.bk-compare-popup__col-remove:hover {
    border-color: var(--bk-accent);
    color: var(--bk-accent);
}

.bk-compare-popup__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--bk-border);
    flex-shrink: 0;
}

.bk-compare-popup__btn-full {
    display: inline-flex;
    align-items: center;
    background: var(--bk-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}

.bk-compare-popup__btn-full:hover { background: #c5211a; color: #fff; }

.bk-compare-popup__btn-back {
    background: none;
    border: 1px solid var(--bk-border);
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 0.82rem;
    color: #555;
    cursor: pointer;
    font-family: var(--bk-font);
    transition: border-color 0.15s;
}

.bk-compare-popup__btn-back:hover {
    border-color: var(--bk-dark);
    color: var(--bk-dark);
}

/* ============================================================
   VERLANGLIJST TOAST
   ============================================================ */
.bk-wishlist-toast {
    position: fixed !important;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: calc(var(--bk-z) + 50);
    background: var(--bk-dark);
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
    font-family: var(--bk-font);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    min-width: 280px;
    max-width: calc(100vw - 32px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.bk-wishlist-toast--hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
    pointer-events: none;
}

.bk-wishlist-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bk-wishlist-toast svg { width: 18px; height: 18px; color: var(--bk-accent); flex-shrink: 0; }

.bk-wishlist-toast__close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    margin-left: auto;
    padding: 2px;
    display: flex;
    transition: color 0.15s;
}

.bk-wishlist-toast__close:hover { color: #fff; }
.bk-wishlist-toast__close svg { width: 12px; height: 12px; }

/* ============================================================
   VERGELIJK + VERLANGLIJST KNOPPEN OP KAARTEN
   ============================================================ */
.pc-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.bk-compare-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f4f6fb;
    border: 1px solid var(--bk-border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bk-dark);
    cursor: pointer;
    font-family: var(--bk-font);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.bk-compare-trigger svg { width: 15px; height: 15px; flex-shrink: 0; }
.bk-compare-trigger:hover { background: var(--bk-dark); border-color: var(--bk-dark); color: #fff; }
.bk-compare-trigger--active { background: var(--bk-dark); border-color: var(--bk-dark); color: #fff; }
.bk-compare-trigger--active:hover { background: var(--bk-accent); border-color: var(--bk-accent); }
.bk-compare-trigger:disabled { opacity: 0.45; cursor: not-allowed; }

.bk-wishlist-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f6fb;
    border: 1px solid var(--bk-border);
    border-radius: 6px;
    padding: 6px 9px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    color: #aaa;
    flex-shrink: 0;
}

.bk-wishlist-trigger svg { width: 15px; height: 15px; }
.bk-wishlist-trigger:hover { background: #fff0f0; border-color: var(--bk-accent); color: var(--bk-accent); }
.bk-wishlist-trigger--active { background: #fff0f0; border-color: var(--bk-accent); color: var(--bk-accent); }

/* Ruimte onderaan zodat content niet achter de balk valt */
body:has(#bk-compare-bar:not(.bk-compare-bar--hidden)) {
    padding-bottom: 110px;
}

/* body overflow NIET aanpassen - triggert iOS Safari GPU repaint bug */
body.bk-overlay-open { touch-action: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    /* Balk: twee rijen   slots bovenaan, knoppen onderaan */
    .bk-compare-bar__inner {
        flex-wrap: wrap;
        padding: 8px 10px 10px;
        gap: 8px;
    }

    .bk-compare-bar__slots {
        flex: 1 1 100%;
        gap: 6px;
        order: 1;
    }

    .bk-compare-bar__actions {
        flex: 1 1 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        order: 2;
        gap: 8px;
    }

    .bk-compare-bar__hint {
        font-size: 0.7rem;
        flex: 1;
        white-space: normal;
    }

    /* Slots kleiner op mobiel */
    .bk-compare-slot {
        flex: 1;
        min-width: 0;
        height: 56px;
        max-width: none;
    }

    .bk-compare-slot--filled {
        padding: 4px 6px;
        gap: 4px;
    }

    .bk-compare-slot--filled img {
        width: 36px;
        height: 36px;
    }

    /* Naam verbergen op mobiel   alleen afbeelding */
    .bk-compare-slot__name,
    .bk-compare-slot__price {
        display: none;
    }

    .bk-compare-slot__placeholder span {
        display: none;
    }

    .bk-compare-slot__placeholder svg {
        width: 18px;
        height: 18px;
    }

    /* Vergelijk knop compact */
    .bk-compare-bar__go {
        font-size: 0.78rem;
        padding: 8px 14px;
        white-space: nowrap;
    }

    .bk-compare-bar__clear {
        font-size: 0.72rem;
        padding: 4px 8px;
        white-space: nowrap;
    }

    /* Popup grid 2 kolommen */
    .bk-compare-popup__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bk-compare-popup__footer {
        flex-direction: column;
        align-items: stretch;
    }

    /* Overlay tabel scrollbaar */
    .bk-compare-overlay__body {
        padding: 12px;
    }

    .bk-compare-table th,
    .bk-compare-table td {
        font-size: 12px;
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .bk-compare-slot {
        height: 50px;
    }

    .bk-compare-slot--filled img {
        width: 30px;
        height: 30px;
    }

    /* Maximaal 3 slots zichtbaar op kleine schermen */
    .bk-compare-slot:nth-child(n+4) {
        display: none;
    }
}
/* ============================================================
   VERGELIJK OVERLAY
   ============================================================ */
.bk-compare-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc(var(--bk-z) + 2000);
    align-items: flex-start;
    justify-content: center;
}
.bk-compare-overlay--open {
    display: flex !important;
}
.bk-compare-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,25,40,0.75);
    backdrop-filter: blur(3px);
}
.bk-compare-overlay__panel {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    width: 96vw;
    max-width: 1100px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 4vh auto 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.bk-compare-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #eef0f4;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.bk-compare-overlay__title {
    font-size: 18px;
    font-weight: 700;
    color: #21314b;
    margin: 0;
}
.bk-compare-overlay__close {
    background: none;
    border: 1.5px solid #d8dde6;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    color: #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.bk-compare-overlay__close:hover { background: #f5f7fa; }
.bk-compare-overlay__body {
    padding: 24px;
    overflow-x: auto;
}

/* ============================================================
   COMPARE INTERCEPT   feedback animaties
   ============================================================ */

/* Wis-knop pulse als lijst vol is */
@keyframes bk-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,91,51,0.7); background: #EF5B33; color: #fff; }
    50%  { box-shadow: 0 0 0 10px rgba(239,91,51,0); }
    100% { box-shadow: 0 0 0 0 rgba(239,91,51,0); background: #EF5B33; color: #fff; }
}
.bk-clear-pulse {
    animation: bk-pulse 0.6s ease 3;
    border-radius: 8px;
}

/* Balk shake bij vol */
@keyframes bk-bar-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.bk-compare-bar--attention .bk-compare-bar__inner {
    animation: bk-bar-shake 0.4s ease;
}

/* Tocompare knop rood bij vol */
.bk-tocompare--full {
    color: #EF5B33 !important;
    border-color: #EF5B33 !important;
}

/* ============================================================
   SLOT HOVER HIGHLIGHT
   ============================================================ */
.bk-compare-slot--hover-highlight {
    outline: 2.5px solid #1a73e8;
    background: #eaf2ff;
    border-radius: 8px;
    transform: translateY(-3px);
    transition: transform 0.15s, outline 0.15s, background 0.15s;
}
.bk-compare-slot--hover-highlight img {
    opacity: 1 !important;
}
/* ============================================================
   MOBIEL: MAX 3 SLOTS
   ============================================================ */

/* Verberg slot 3 en 4 op mobiel */
@media (max-width: 768px) {
    .bk-compare-slot--desktop-only {
        display: none !important;
    }
}

/* ============================================================
   FIX: PRODUCT AFBEELDINGEN OVER OVERLAY/MENU OP IOS SAFARI
   ============================================================
   Op iOS Safari breken elementen met transform/will-change uit
   hun stacking context, waardoor ze over position:fixed elementen
   kunnen vallen. isolation:isolate op de page-wrapper dwingt
   alles daarbinnen in één stacking context.
   ============================================================ */
.page-wrapper {
    isolation: isolate;
}

/* Overlay altijd helemaal bovenop — ook boven nav/header */
.bk-compare-overlay {
    isolation: isolate;
}

/* Reset stacking context triggers op product cards */
.product-item,
.product-item-info,
.product-item-photo,
.product-image-container,
.product-image-wrapper,
.pc-card,
.bk-category-card {
    will-change: auto !important;
    transform: none !important;
}