/* Mini Cart Overlay */
.sundy-ccc-mini-cart-overlay-wrapper {
    position: absolute;
    top: 60px; /* Adjust based on header height */
    right: 0;
    z-index: 99999;
    display: flex;
    justify-content: flex-end;
    pointer-events: none; /* Never block clicks when cart is closed */
}

#sundy-ccc-mini-cart-dropdown {
    width: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
    border: 1px solid #f0f0f0;
    
    /* Responsive height limits voor desktop & laptop */
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

#sundy-ccc-mini-cart-dropdown.sundy-ccc-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* Re-enable interaction when open */
}

.sundy-ccc-mini-cart-content {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Cruciaal voor flexbox overflow-scroll */
    flex: 1;
}

/* Header */
.sundy-ccc-mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
}

.sundy-ccc-mini-cart-header h2 {
    font-family: var(--bde-heading-font-family) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 0;
    color: #000;
}

.sundy-ccc-mini-cart-close {
    background: none;
    border: 1px solid #eaeaea;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.sundy-ccc-mini-cart-close:hover {
    background: #f5f5f5;
}

/* Shipping Progress Bar */
.sundy-ccc-shipping-bar-wrap {
    padding: 4px 24px 16px;
    border-bottom: 1px solid #f5f5f5;
}

.sundy-ccc-shipping-bar-msg {
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.sundy-ccc-shipping-bar-track {
    background: #ebebeb;
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}

.sundy-ccc-shipping-bar-fill {
    height: 100%;
    border-radius: 99px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Items */
.sundy-ccc-mini-cart-items {
    padding: 0 24px;
    flex-grow: 1;
    overflow-y: auto;
    min-height: 0;
    max-height: 400px; /* Hersteld om op gigantische schermen niet onnodig lang te worden */
}

.sundy-ccc-cart-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    transition: opacity 0.3s;
}

.sundy-ccc-cart-item:last-child {
    border-bottom: none;
}

.sundy-ccc-cart-item-image {
    width: 50px;
    height: 50px;
    background: #f7f7f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
}

.sundy-ccc-cart-item-image img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    object-fit: contain;
}

.sundy-ccc-cart-item-details {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px; /* Prevent title from hitting price */
}

.sundy-ccc-cart-item-title {
    font-family: inherit;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #000;
    margin: 0;
}

.sundy-ccc-cart-item-title a {
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

.sundy-ccc-cart-item-title small {
    font-family: var(--bde-body-font-family);
    font-weight: 400; /* Optional: reset bold weight if parent h4 forces it */
    color: #606060;
}

.sundy-ccc-cart-item-price {
    font-size: 16px !important;
    color: #606060;
    margin-right: 0; /* Shifted to trash margin-left natively */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.sundy-ccc-cart-item-price bdi,
.sundy-ccc-cart-item-price span.amount {
    font-weight: 400 !important;
    color: #606060 !important;
    font-size: 16px !important;
}

.sundy-ccc-cart-item-price del {
    font-size: 12px !important;
    color: #606060 !important;
}

.sundy-ccc-cart-item-price del bdi,
.sundy-ccc-cart-item-price del span.amount {
    font-weight: 400 !important;
    font-size: inherit !important;
    color: inherit !important;
}

.sundy-ccc-cart-item-price ins {
    text-decoration: none !important;
}

.sundy-ccc-cart-item-price ins bdi,
.sundy-ccc-cart-item-price ins span.amount {
    color: #606060 !important;
    font-weight: 400 !important;
    font-size: 16px !important;
}

.sundy-ccc-cart-item-remove {
    background: none;
    border: 1px solid #eaeaea;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-left: 8px; /* 8px exact gap between price and removing bin */
    flex-shrink: 0;
    cursor: pointer;
}

.sundy-ccc-cart-item-remove:hover {
    background: #ffebeb;
    border-color: #ffcccc;
}

.sundy-ccc-empty-cart {
    padding: 24px 0 16px;
    text-align: center;
    color: #000;
    font-weight: 700;
}

.sundy-ccc-shop-now-btn {
    margin: 0 24px 24px;
    width: calc(100% - 48px);
    box-sizing: border-box;
}

/* Footer */
.sundy-ccc-mini-cart-footer {
    padding: 24px;
    border-top: 1px solid #f0f0f0;
}

.sundy-ccc-mini-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sundy-ccc-total-label {
    font-family: var(--bde-heading-font-family);
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.sundy-ccc-total-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
}

.sundy-ccc-total-price del {
    color: #888;
    margin-right: 6px;
    text-decoration: line-through;
    font-size: 16px;
    font-weight: 400;
}

.sundy-ccc-tax-label {
    font-size: 12px;
    font-weight: 400;
    color: #888;
    margin-right: 4px;
}

/* Checkout Button */
.sundy-ccc-checkout-btn,
.sundy-ccc-checkout-btn:hover {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #22c55e !important;
    color: #ffffff !important;
    font-weight: 500;
    font-size: 16px;
    border-radius: 16px;
    height: 50px !important;
    box-sizing: border-box;
    padding: 0 14px;
    text-decoration: none !important;
    position: relative;
    transition: background 0.2s;
}

.sundy-ccc-checkout-btn:hover {
    background: #1ea34d !important;
}

.sundy-ccc-checkout-btn span {
    margin: 0;
    color: #ffffff !important;
}

.sundy-ccc-checkout-btn svg {
    position: absolute !important;
    left: 4px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: #fff !important;
    border-radius: 12px !important;
    height: calc(100% - 8px) !important;
    width: auto !important;
    aspect-ratio: 1 / 1 !important;
    padding: 14px !important;
    box-sizing: border-box !important;
}

/* Payment Icons */
.sundy-ccc-payment-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px auto 0 auto;
    max-width: 100% !important;
}

.sundy-ccc-payment-icons img {
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    padding: 4px;
    background: #fff;
}

/* Trigger Icon */
.sundy-ccc-cart-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: #f7f7f7;
    border-radius: 50%;
    color: #111;
    text-decoration: none;
    transition: background 0.2s;
}

.sundy-ccc-cart-trigger:hover {
    background: #eaeaea;
}

.sundy-ccc-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #22c55e;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-family: sans-serif;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px; /* for >9 items */
}

/* Mobile Styling */
@media (max-width: 767px) {
    #sundy-ccc-mini-cart-dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        max-height: 70vh; /* Aangepast naar max 70vh op verzoek */
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%);
        border: none;
        border-top: 1px solid #eaeaea;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 999999;
        /* Flexbox om de interne scroll soepel te maken en de footer op z'n plek te houden */
        display: flex;
        flex-direction: column;
    }
    
    #sundy-ccc-mini-cart-dropdown.sundy-ccc-open {
        transform: translateY(0);
    }
    
    .sundy-ccc-mini-cart-content {
        /* Neemt de maximaal toegestane 70vh hoogte van parent aan zonder over te vloeien */
        flex: 1;
        min-height: 0;
    }
    
    .sundy-ccc-mini-cart-items {
        /* Laat de items de resterende ruimte invullen en scrollen */
        max-height: none;
        flex: 1;
        min-height: 0; /* Cruciaal voor Flexbox: Laat de div kleiner worden dan zijn inhoud, zodat overflow activeert! */
        overflow-y: auto;
    }
}

/* Custom Icon Styling Resets */
img.sundy-ccc-custom-icon {
    max-width: 100%;
    max-height: 100%;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: block;
}

.sundy-ccc-cart-trigger.sundy-ccc-has-custom-icon {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

.sundy-ccc-mini-cart-close.sundy-ccc-has-custom-icon {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    width: auto !important;
    height: auto !important;
}

.sundy-ccc-cart-item-remove.sundy-ccc-has-custom-icon {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* Checkbox overrides */
.sundy-ccc-checkout-terms .form-row input[type="checkbox"] {
    position: relative;
    top: 2px;
}

/* Verberg de standaard WooCommerce "Bekijk Winkelwagen" knop die na AJAX toevoegen verschijnt */
a.added_to_cart {
    display: none !important;
}

.sundy-ccc-checkout-custom-icon-wrapper {
    position: absolute;
    left: 4px;
    top: 4px;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
