/* KBE Cart Popup */
:root {
    --kbe-popup-btn-bg: #333;
}

#kbe-cart-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
}
#kbe-cart-popup-overlay.kbe-cart-popup-visible {
    display: flex;
    animation: kbeOverlayIn 0.2s ease;
}

#kbe-cart-popup {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: kbePopupIn 0.25s ease;
}

#kbe-cart-popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
#kbe-cart-popup-close:hover {
    color: #333;
}

/* Header */
.kbe-cart-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 700;
    color: #10B981;
}

/* Product row */
.kbe-cart-popup-product {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.kbe-cart-popup-image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
}
.kbe-cart-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}
.kbe-cart-popup-details {
    flex: 1;
    min-width: 0;
}
.kbe-cart-popup-name {
    font-size: 14px;
    font-weight: 600;
    color: #212223;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.kbe-cart-popup-price {
    font-size: 15px;
    font-weight: 700;
    color: #212223;
}
.kbe-cart-popup-price del {
    color: #999;
    font-weight: 400;
    font-size: 13px;
}

/* Cart total */
.kbe-cart-popup-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    font-size: 15px;
    color: #333;
}
.kbe-cart-popup-subtotal {
    font-weight: 700;
    font-size: 16px;
    color: #212223;
}

/* Buttons */
.kbe-cart-popup-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.kbe-cart-popup-btn {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s;
}
.kbe-cart-popup-btn:hover {
    opacity: 0.85;
}
/* View Cart button inherits actual site button color */
.kbe-cart-popup-btn-cart {
    background: var(--kbe-popup-btn-bg);
    color: #fff !important;
}
.kbe-cart-popup-btn-continue {
    background: #f3f4f6;
    color: #333;
}

/* Loading state on button */
.kbe-btn-cart.kbe-adding {
    pointer-events: none;
    opacity: 0.7;
}

/* Animations */
@keyframes kbeOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes kbePopupIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mobile */
@media (max-width: 480px) {
    #kbe-cart-popup {
        padding: 20px;
        border-radius: 10px;
    }
    .kbe-cart-popup-actions {
        flex-direction: column;
    }
}
