/* ==========================================================================
   MINI CART — Slide-in Drawer
   ========================================================================== */

/* Overlay achter de drawer */
.sar-minicart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sar-minicart-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* De drawer zelf — schuift in van rechts */
.sar-minicart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.sar-minicart-drawer.is-open {
    transform: translateX(0);
}

/* Header van de drawer */
.sar-minicart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.sar-minicart-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.sar-minicart-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #666;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sar-minicart-close:hover {
    background: #f5f5f5;
    color: #111;
}

/* Gratis verzending progress bar */
.sar-minicart-shipping-bar {
    padding: 0 24px;
    flex-shrink: 0;
}

.sar-shipping-bar {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.sar-shipping-msg {
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
    text-align: center;
}

.sar-shipping-msg strong {
    color: #d21b52;
}

.sar-shipping-free {
    color: #059669;
    font-weight: 600;
}

.sar-shipping-track {
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    overflow: hidden;
}

.sar-shipping-fill {
    height: 100%;
    background: linear-gradient(90deg, #d21b52, #f472b6);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.sar-shipping-free + .sar-shipping-track .sar-shipping-fill {
    background: #059669;
}

/* Scrollbaar items-gebied */
.sar-minicart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* Enkel item in de mini cart */
.sar-minicart-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #f5f5f5;
    align-items: flex-start;
}

.sar-minicart-item:last-child {
    border-bottom: none;
}

.sar-minicart-item-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #eee;
}

.sar-minicart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sar-minicart-item-info {
    flex: 1;
    min-width: 0;
}

.sar-minicart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sar-minicart-item-meta {
    font-size: 12px;
    color: #888;
    margin: 0 0 6px;
}

.sar-minicart-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #d21b52;
}

/* Prijs + qty op één rij, qty rechts */
.sar-minicart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.sar-minicart-item-qty {
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* Naam + kruisje naast elkaar */
.sar-minicart-item-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.sar-minicart-item-top .sar-minicart-item-name {
    flex: 1;
    min-width: 0;
}

/* Verwijder (×) knop */
.sar-minicart-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #aaa;
    padding: 0 2px;
    transition: color 0.15s ease;
}

.sar-minicart-remove:hover {
    color: #d21b52;
}

/* Quantity controls − 1 + */
.sar-minicart-item-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

.sar-qty-btn {
    background: #fafafa;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    line-height: 1;
}

.sar-qty-btn:hover {
    background: #f0f0f0;
    color: #111;
}

.sar-qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    border-left: 1px solid #e5e5e5;
    border-right: 1px solid #e5e5e5;
    line-height: 28px;
}

/* Leeg bericht */
.sar-minicart-empty {
    text-align: center;
    padding: 48px 24px;
    color: #999;
    font-size: 15px;
}

.sar-minicart-empty svg {
    display: block;
    margin: 0 auto 16px;
    color: #ddd;
}

/* Footer met totaal + knoppen */
.sar-minicart-footer {
    border-top: 1px solid #f0f0f0;
    padding: 20px 24px;
    flex-shrink: 0;
    background: #fafafa;
}

.sar-minicart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 700;
    color: #111;
}

.sar-minicart-total-amount {
    color: #d21b52;
    font-size: 18px;
}

.sar-minicart-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Primaire knop: naar winkelwagen */
.sar-minicart-btn-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #d21b52;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
    text-align: center;
}

.sar-minicart-btn-cart:hover {
    background: #b8164a;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

/* Secundaire knop: verder winkelen */
.sar-minicart-btn-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    color: #333;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    text-align: center;
}

.sar-minicart-btn-continue:hover {
    border-color: #d21b52;
    background: #fff5f8;
}

/* Loader spinner in add-to-cart knoppen */
.sar-loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sar-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes sar-spin {
    to { transform: rotate(360deg); }
}

/* Toegevoegd-feedback toast (optioneel) */
.sar-minicart-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100000;
    background: #10b981;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.sar-minicart-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Loading spinner op de knop */
.sar-minicart-loading .single_add_to_cart_button,
.sar-minicart-loading .btn-add-to-cart {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

/* Badge telling update animatie */
@keyframes sar-badge-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.sar-badge-pop {
    animation: sar-badge-pop 0.35s ease;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 480px) {
    .sar-minicart-drawer {
        width: 100vw;
        max-width: 100vw;
    }

    .sar-minicart-header,
    .sar-minicart-items,
    .sar-minicart-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
