/* =============================================
   NS Side Cart — bykenneth.nl
   ============================================= */

/* ── Body lock ── */
body.ns-cart-open {
    overflow: hidden;
}

/* ── Trigger knop in header ── */
.ns-cart-trigger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    color: #111;
    transition: opacity 0.15s;
}

.ns-cart-trigger:hover { opacity: 0.6; }

.ns-cart-icon-svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* Count badge */
.ns-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    line-height: 1;
}

.ns-cart-count--visible {
    opacity: 1;
    transform: scale(1);
}

/* ── Overlay ── */
.ns-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 99998;
    pointer-events: none;
    transition: background 0.3s ease;
}

.ns-cart-overlay--visible {
    background: rgba(0, 0, 0, 0.45);
    pointer-events: all;
}

/* ── Drawer ── */
.ns-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 100vw;
    height: 100%;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.12);
}

.ns-cart-drawer--open {
    transform: translateX(0);
}

/* Loading dimmer */
.ns-cart-drawer--loading .ns-cart-body {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Header ── */
.ns-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ns-cart-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #111;
    margin: 0;
}

.ns-cart-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    color: #111;
    transition: opacity 0.15s;
}
.ns-cart-close:hover { opacity: 0.5; }
.ns-cart-close svg { width: 20px; height: 20px; }

/* ── Gratis verzending balk ── */
.ns-cart-shipping-bar {
    padding: 14px 24px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ns-cart-shipping-bar__track {
    height: 3px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ns-cart-shipping-bar__fill {
    height: 100%;
    background: #111;
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ns-cart-shipping-bar--done .ns-cart-shipping-bar__fill {
    background: #2a9d5c;
}

.ns-cart-shipping-bar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #555;
    margin: 0;
    text-align: center;
}

.ns-cart-shipping-bar--done .ns-cart-shipping-bar__label {
    color: #2a9d5c;
    font-weight: 700;
}

/* ── Body (scrollbaar) ── */
.ns-cart-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    transition: opacity 0.2s;
    scroll-behavior: smooth;
}

.ns-cart-body::-webkit-scrollbar { width: 3px; }
.ns-cart-body::-webkit-scrollbar-track { background: transparent; }
.ns-cart-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* Loading */
.ns-cart-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

.ns-cart-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e8e8e8;
    border-top-color: #111;
    border-radius: 50%;
    animation: nsCartSpin 0.7s linear infinite;
}

@keyframes nsCartSpin { to { transform: rotate(360deg); } }

/* ── Items lijst ── */
ul.ns-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ns-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    transition: opacity 0.3s, transform 0.3s;
}

.ns-cart-item--removing {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

/* Afbeelding */
.ns-cart-item__img-wrap {
    flex-shrink: 0;
    width: 90px;
    height: 110px;
    display: block;
    overflow: hidden;
    background: #f8f8f8;
    border: 1px solid #f0f0f0;
    position: relative;
}

.ns-cart-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.3s;
}

.ns-cart-item__img-wrap:hover .ns-cart-item__img {
    transform: scale(1.04);
}

.ns-cart-item__sale {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #111;
    color: #fff;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.15em;
    padding: 3px 5px;
}

/* Info */
.ns-cart-item__info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.ns-cart-item__brand {
    display: block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #aaa;
    margin-bottom: 4px;
}

.ns-cart-item__name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
}
.ns-cart-item__name:hover { opacity: 0.6; }

/* Variatie meta */
.ns-cart-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.ns-cart-item__meta-item {
    font-size: 10px;
    color: #888;
    background: #f5f5f5;
    padding: 2px 7px;
    letter-spacing: 0.03em;
}

/* Bottom: qty + prijs */
.ns-cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Hoeveelheid */
.ns-cart-item__qty {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e0e0e0;
    height: 30px;
}

.ns-qty-btn {
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 300;
    color: #333;
    padding: 0;
    transition: background 0.12s;
    flex-shrink: 0;
}

.ns-qty-btn:hover:not(:disabled) { background: #f5f5f5; }
.ns-qty-btn:disabled { opacity: 0.3; cursor: default; }

.ns-qty-num {
    width: 28px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #111;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Prijs */
.ns-cart-item__price {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

.ns-cart-item__price del {
    color: #bbb;
    font-weight: 400;
    font-size: 11px;
    margin-right: 3px;
}

.ns-cart-item__price ins {
    text-decoration: none;
}

/* Verwijder knop */
.ns-cart-item__remove {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px;
    color: #ccc;
    display: flex;
    transition: color 0.15s;
}
.ns-cart-item__remove:hover { color: #111; }
.ns-cart-item__remove svg { width: 14px; height: 14px; }

/* ── Footer ── */
.ns-cart-footer {
    flex-shrink: 0;
    padding: 20px 24px 28px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.ns-cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.ns-cart-subtotal__label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111;
}

.ns-cart-subtotal__amount {
    font-size: 18px;
    font-weight: 800;
    color: #111;
}

.ns-cart-tax-note {
    font-size: 10px;
    color: #aaa;
    margin: 0 0 16px;
    letter-spacing: 0.02em;
}

/* Checkout knop */
.ns-cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    background: #111;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    border: 1px solid #111;
    transition: background 0.18s, color 0.18s;
    margin-bottom: 10px;
    box-sizing: border-box;
}
.ns-cart-checkout-btn:hover {
    background: #fff;
    color: #111;
}
.ns-cart-checkout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Winkelwagen knop */
.ns-cart-view-btn {
    display: block;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #777;
    text-decoration: none;
    transition: color 0.15s;
}
.ns-cart-view-btn:hover { color: #111; }

/* ── Leeg ── */
.ns-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
    flex: 1;
}

.ns-cart-empty__icon {
    width: 52px;
    height: 52px;
    color: #d0d0d0;
    margin-bottom: 20px;
}

.ns-cart-empty p {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
    letter-spacing: 0.02em;
}

.ns-cart-empty__cta {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #fff;
    background: #111;
    padding: 13px 24px;
    text-decoration: none;
    border: 1px solid #111;
    transition: background 0.18s, color 0.18s;
}
.ns-cart-empty__cta:hover { background: #fff; color: #111; }

/* ── Mobiel ── */
@media screen and (max-width: 480px) {
    .ns-cart-drawer { width: 100vw; }

    .ns-cart-item__img-wrap { width: 75px; height: 92px; }

    .ns-cart-checkout-btn { padding: 14px; font-size: 10px; }
}

/* ── Fly to cart animatie ── */
.ns-fly-item {
    will-change: transform, left, top, width, height, opacity;
    transform-origin: center center;
}

/* Cart trigger bounce na aankomst */
@keyframes nsCartBounce {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.4); }
    50%  { transform: scale(0.88); }
    70%  { transform: scale(1.15); }
    85%  { transform: scale(0.96); }
    100% { transform: scale(1); }
}

.ns-cart-trigger--bounce {
    animation: nsCartBounce 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* WooCommerce notice onderdrukken op product pagina */
.single-product .woocommerce-notices-wrapper,
.single-product .woocommerce-message,
.single-product .woocommerce-info {
    display: none !important;
}

/* ── Add to cart knop loading state ── */
.single_add_to_cart_button.ns-atc-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.single_add_to_cart_button.ns-atc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nsCartSpin 0.7s linear infinite;
}

/* ── Busy state: subtiele dimmer, geen blokkerende spinner ── */
.ns-cart-drawer--busy .ns-cart-body {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.15s;
}

/* WC notices onderdrukken op product pagina */
.single-product .woocommerce-notices-wrapper { display: none !important; }

/* Add to cart loading state */
.single_add_to_cart_button.ns-atc-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.single_add_to_cart_button.ns-atc-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nsCartSpin 0.65s linear infinite;
}

/* Fly item */
.ns-fly-item { will-change: left, top, width, height, opacity; }

/* Cart bounce */
@keyframes nsCartBounce {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.45); }
    55%  { transform: scale(0.85); }
    75%  { transform: scale(1.12); }
    90%  { transform: scale(0.97); }
    100% { transform: scale(1); }
}
.ns-cart-trigger--bounce { animation: nsCartBounce 0.55s cubic-bezier(0.4,0,0.2,1); }
