/* =============================================
   NS Side Cart — Premium Edition
   Outdoor & Offroad | Rijskamp
   ============================================= */

/* ── Cart Icon (header) ── */
.ns-cart-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    padding: 4px;
    transition: transform .2s;
}
.ns-cart-trigger:hover { transform: scale(1.08); }
.ns-cart-trigger svg { width: 24px; height: 24px; }
.ns-cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b0b0b0;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    border-radius: 50%;
    line-height: 1;
    padding: 0 5px;
    transition: background .25s, transform .25s;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.ns-cart-count.ns-has-items { background: #1A6338; }
.ns-cart-count.ns-bump { animation: ns-bump .4s cubic-bezier(.36,.07,.19,.97); }
@keyframes ns-bump {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.5); }
    50%  { transform: scale(.9); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ── Overlay ── */
.ns-sc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all .4s cubic-bezier(.22,.61,.36,1);
}
.ns-sc-overlay.ns-open {
    opacity: 1;
    visibility: visible;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ── Panel ── */
.ns-sc-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(105%);
    transition: transform .4s cubic-bezier(.22,.61,.36,1);
    box-shadow: -8px 0 40px rgba(0,0,0,.12), -2px 0 8px rgba(0,0,0,.05);
}
.ns-sc-panel.ns-open { transform: translateX(0); }

/* ── Header ── */
.ns-sc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1A6338 0%, #1d7040 100%);
    flex-shrink: 0;
    position: relative;
}
.ns-sc-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #1A6338, #f59e0b);
    opacity: .6;
}
.ns-sc-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ns-sc-title svg { opacity: .8; }
.ns-sc-close {
    background: rgba(255,255,255,.15);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    transition: all .25s;
    padding: 0;
}
/* ── Header z-index fix: zorg dat header ONDER de overlay valt ── */
body.ns-sc-open header#mainbar {
    z-index: 1 !important;
}
body.ns-sc-open .ns-search {
    pointer-events: none;
}

.ns-sc-close:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
    transform: rotate(90deg);
}

/* ── Shipping progress bar ── */
.ns-sc-shipping-bar {
    padding: 14px 24px;
    background: #f8faf8;
    border-bottom: 1px solid #eef2ee;
    flex-shrink: 0;
}
.ns-sc-shipping-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ns-sc-shipping-text strong { color: #1A6338; }
.ns-sc-progress-track {
    height: 4px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}
.ns-sc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1A6338, #2d9e56);
    border-radius: 4px;
    transition: width .6s cubic-bezier(.22,.61,.36,1);
    position: relative;
}
.ns-sc-progress-fill.ns-complete {
    background: linear-gradient(90deg, #1A6338, #f59e0b);
}
.ns-sc-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.3));
    border-radius: 0 4px 4px 0;
}
.ns-sc-shipping-success {
    color: #1A6338;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

/* ── Body ── */
.ns-sc-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    scroll-behavior: smooth;
    position: relative;
}
.ns-sc-body::-webkit-scrollbar { width: 3px; }
.ns-sc-body::-webkit-scrollbar-track { background: transparent; }
.ns-sc-body::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }

/* ── Empty state ── */
.ns-sc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 40px;
    text-align: center;
}
.ns-sc-empty-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f0f7f0, #e0f0e0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ns-float 3s ease-in-out infinite;
}
@keyframes ns-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.ns-sc-empty-icon svg { stroke: #1A6338; opacity: .5; }
.ns-sc-empty-title {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin: 0;
}
.ns-sc-empty-sub {
    font-size: 13px;
    color: #999;
    margin: -4px 0 0;
    line-height: 1.5;
}
.ns-sc-shop-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #1A6338;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    transition: all .25s;
    box-shadow: 0 4px 12px rgba(26,99,56,.25);
}
.ns-sc-shop-btn:hover {
    background: #14502d;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,99,56,.3);
}

/* ── Items list ── */
.ns-sc-items {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.ns-sc-item {
    display: flex;
    gap: 16px;
    padding: 18px 24px;
    position: relative;
    transition: all .25s;
}
.ns-sc-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e5e5 15%, #e5e5e5 85%, transparent);
}
.ns-sc-item:last-child::after { display: none; }
.ns-sc-item:hover { background: #fafcfa; }
.ns-sc-item.ns-removing {
    opacity: 0;
    transform: translateX(60px) scale(.95);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    overflow: hidden;
    transition: all .35s cubic-bezier(.22,.61,.36,1);
}

/* Item image */
.ns-sc-item-img {
    width: 80px;
    min-width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s;
}
.ns-sc-item:hover .ns-sc-item-img { transform: scale(1.03); }
.ns-sc-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ns-sc-item-img a { display: block; width: 100%; height: 100%; }

/* Item info */
.ns-sc-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ns-sc-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.ns-sc-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
a.ns-sc-item-name:hover { color: #1A6338; }

.ns-sc-remove {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: all .2s;
}
.ns-sc-remove:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.1);
}

.ns-sc-item-meta {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    margin-top: 1px;
}
.ns-sc-item-meta dt, .ns-sc-item-meta dd { display: inline; margin: 0; }
.ns-sc-item-meta dl { margin: 0; }
.ns-sc-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}

/* Quantity selector */
.ns-sc-qty {
    display: inline-flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: border-color .2s, box-shadow .2s;
}
.ns-sc-qty:hover {
    border-color: #1A6338;
    box-shadow: 0 0 0 2px rgba(26,99,56,.08);
}
.ns-sc-qty-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    transition: all .15s;
    padding: 0;
    line-height: 1;
    user-select: none;
}
.ns-sc-qty-btn:hover { background: #1A6338; color: #fff; }
.ns-sc-qty-btn:active { transform: scale(.9); }
.ns-sc-qty-input {
    width: 32px;
    height: 32px;
    text-align: center;
    border: none;
    font-size: 13px;
    font-weight: 700;
    color: #222;
    background: #fff;
    -moz-appearance: textfield;
    padding: 0;
    margin: 0;
}
.ns-sc-qty-input::-webkit-outer-spin-button,
.ns-sc-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ns-sc-item-subtotal {
    font-size: 14px;
    font-weight: 700;
    color: #1A6338;
    white-space: nowrap;
    letter-spacing: -.2px;
}

/* ── Footer ── */
.ns-sc-footer {
    border-top: none;
    padding: 0;
    flex-shrink: 0;
    background: #fff;
    position: relative;
}
.ns-sc-footer::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 24px;
    background: linear-gradient(to top, #fff, transparent);
    pointer-events: none;
    z-index: 1;
}
.ns-sc-totals {
    padding: 18px 24px;
    background: #f8faf8;
    border-top: 1px solid #eef2ee;
}
.ns-sc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.ns-sc-total-label {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 500;
}
.ns-sc-subtotal-amount {
    font-size: 22px;
    font-weight: 800;
    color: #222;
    letter-spacing: -.5px;
}
.ns-sc-buttons {
    padding: 16px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ns-sc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .8px;
    transition: all .25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.ns-sc-btn-cart {
    background: #fff;
    color: #444;
    border: 2px solid #e0e0e0;
}
.ns-sc-btn-cart:hover {
    border-color: #1A6338;
    color: #1A6338;
    background: #f0f7f0;
}
.ns-sc-btn-checkout {
    background: linear-gradient(135deg, #1A6338 0%, #1d7a42 100%);
    color: #fff;
    border: 2px solid transparent;
    box-shadow: 0 4px 14px rgba(26,99,56,.3);
}
.ns-sc-btn-checkout:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26,99,56,.35);
    color: #fff;
    background: linear-gradient(135deg, #14502d 0%, #1A6338 100%);
}
.ns-sc-btn-checkout:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,99,56,.25);
}

/* ── Loading states ── */
.ns-sc-body.ns-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }
.ns-sc-body.ns-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #e5e5e5;
    border-top-color: #1A6338;
    border-radius: 50%;
    animation: ns-spin .7s linear infinite;
    z-index: 10;
}

/* ── Single product button states ── */
.single_add_to_cart_button.loading {
    pointer-events: none;
    opacity: .75;
    position: relative;
}
.single_add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ns-spin .6s linear infinite;
}
@keyframes ns-spin { to { transform: rotate(360deg); } }
.single_add_to_cart_button.added {
    background: #1A6338 !important;
    border-color: #1A6338 !important;
    color: #fff !important;
}

/* ── Item enter animation ── */
.ns-sc-item.ns-just-added {
    animation: ns-slide-in .4s cubic-bezier(.22,.61,.36,1);
}
@keyframes ns-slide-in {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .ns-sc-panel { width: 100vw; max-width: 100vw; }
    .ns-sc-item { padding: 14px 18px; gap: 12px; }
    .ns-sc-item::after { left: 18px; right: 18px; }
    .ns-sc-item-img { width: 68px; min-width: 68px; height: 68px; }
    .ns-sc-header { padding: 16px 18px; }
    .ns-sc-totals { padding: 14px 18px; }
    .ns-sc-buttons { padding: 14px 18px 18px; }
    .ns-sc-shipping-bar { padding: 12px 18px; }
}
