/* ============================================
   Mini-winkelwagen header + fly-to-cart animatie
   ROK4 Commerce Shop
   ============================================ */

/* Header: zoek + winkelwagen naast elkaar */
.header-right-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Winkelwagen knop naast zoekveld */
.cart-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cart-header-btn:hover {
    background: var(--rok4-primary, #000);
    color: #fff;
    border-color: var(--rok4-primary, #000);
}

.cart-header-btn .bi-cart3 {
    font-size: 1.35rem;
}

.cart-header-btn .cart-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: #c00;
    border-radius: 9px;
}

.cart-header-btn .cart-count-badge.empty {
    display: none;
}

/* Dropdown mini-cart */
.cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border: 1px solid #eee;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.cart-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cart-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-dropdown-body {
    max-height: 280px;
    overflow-y: auto;
}

.cart-dropdown-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}

.cart-dropdown-item-img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.cart-dropdown-item-info {
    flex: 1;
    min-width: 0;
}

.cart-dropdown-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-dropdown-item-meta {
    font-size: 0.8rem;
    color: #666;
}

.cart-dropdown-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.cart-dropdown-item-total {
    font-weight: 600;
    white-space: nowrap;
}

.cart-dropdown-item-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.cart-dropdown-item-remove:hover {
    background: #e0e0e0;
    color: #c00;
}

.cart-dropdown-item-remove .bi-x-lg {
    font-size: 0.75rem;
}

.cart-dropdown-empty {
    padding: 24px 16px;
    text-align: center;
    color: #888;
    font-size: 0.9rem;
}

.cart-dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #eee;
}

.cart-dropdown-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.cart-dropdown-footer-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-dropdown-btn-cart {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    font-weight: 600;
    color: var(--rok4-primary, #000);
    background: #fff;
    border: 1px solid var(--rok4-primary, #000);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.cart-dropdown-btn-cart:hover {
    color: #fff;
    background: var(--rok4-primary, #000);
}

.cart-dropdown-btn-checkout {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    font-weight: 600;
    color: #fff;
    background: var(--rok4-primary, #000);
    border: none;
    border-radius: 6px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.cart-dropdown-btn-checkout:hover {
    color: #fff;
    opacity: 0.9;
}

/* Wrapper voor dropdown positionering */
.cart-header-wrap {
    position: relative;
}

/* Fly-to-cart animatie: vliegend productplaatje */
.fly-to-cart {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    pointer-events: none;
    z-index: 9999;
}

.fly-to-cart img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 991.98px) {
    .cart-dropdown {
        right: 0;
        left: auto;
    }
}
