/* ===================== */
/* CART ICON */
/* ===================== */
#cart-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;

    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;

    width: 75px;
    height: 75px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;

    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    z-index: 999;

    transition: 0.25s;
}

#cart-icon:hover {
    transform: scale(1.1);
}

/* BADGE */
#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;

    background: red;
    color: white;

    font-size: 13px;
    padding: 4px 7px;
    border-radius: 50%;
}

/* ===================== */
/* POPUP */
/* ===================== */
#cart-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);

    width: 860px;
    max-height: 90vh;

    background: white;
    border-radius: 15px;

    box-shadow: 0 20px 50px rgba(0,0,0,0.3);

    display: none;
    z-index: 1000;

    overflow: hidden;

    opacity: 0;
    transition: 0.3s ease;
}

/* ACTIVE STATE */
#cart-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* HEADER */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

/* CLOSE BUTTON */
#close-cart {
    cursor: pointer;
    font-size: 18px;
}

/* BODY */
.cart-body {
    padding: 15px 20px;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===================== */
/* CART ITEM             */
/* row: kiri | kanan     */
/* ===================== */

.cart-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding: 12px;
    border-radius: 10px;
    background: #f9fafb;
    margin-bottom: 10px;

    box-sizing: border-box;
    width: 100%;
}

/* ===================== */
/* KIRI: info + qty      */
/* ===================== */

.cart-left {
    flex: 0 0 180px;
    min-width: 180px;
}

/* ===================== */
/* KANAN: AI rekomendasi */
/* ===================== */

.cart-right {
    flex: 1;
    min-width: 0;
}

/* ===================== */
/* QTY CONTROL */
/* ===================== */

.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-control button {
    width: 28px;
    height: 28px;
    border: none;
    background: #4f46e5;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
}

.qty-control button:hover {
    transform: scale(1.1);
}

/* FOOTER */
.cart-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

/* CHECKOUT BUTTON */
.checkout-btn {
    width: 100%;
    padding: 12px;

    background: linear-gradient(135deg, #10b981, #059669);
    color: white;

    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.checkout-btn:hover {
    transform: scale(1.03);
}

/* ===================== */
/* ANIMASI ICON */
/* ===================== */
.cart-animate {
    transform: scale(1.3) rotate(5deg);
}

/* ===================== */
/* BACKDROP */
/* ===================== */
#cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);

    display: none;
    z-index: 999;

    opacity: 0;
    transition: 0.3s;
}

#cart-overlay.show {
    opacity: 1;
}

/* ===================== */
/* ANIMASI TERBANG */
/* ===================== */
.fly-item {
    position: fixed;
    z-index: 2000;
    pointer-events: none;

    width: 50px;
    height: 50px;

    background: radial-gradient(circle, #6366f1, #4f46e5);
    border-radius: 50%;

    box-shadow: 0 0 15px rgba(79,70,229,0.6);

    animation: flyToCart 0.8s cubic-bezier(0.65, -0.2, 0.25, 1.5) forwards;
}

@keyframes flyToCart {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--x) * 0.5), calc(var(--y) * 0.5)) scale(1.2);
    }
    100% {
        transform: translate(var(--x), var(--y)) scale(0.2);
        opacity: 0;
    }
}

/* ===================== */
/* AI CONTAINER          */
/* 2 kotak sejajar kanan */
/* ===================== */

.ai-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* ===================== */
/* MINI AI BOX           */
/* masing-masing 50%     */
/* ===================== */

.mini-ai-box {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;

    background: linear-gradient(135deg, #ffffff, #f8fafc);

    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;

    box-shadow: 0 8px 18px rgba(0,0,0,0.05);
    transition: 0.25s;
}

.mini-ai-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.08);
}

/* ===================== */
/* AI TITLE */
/* ===================== */

.mini-ai-box h4 {
    font-size: 12px;
    color: #6366f1;
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.4;
}

/* ===================== */
/* AI PRODUCT */
/* ===================== */

.ai-product {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* ===================== */
/* AI BERAT */
/* ===================== */

.ai-berat {
    font-size: 12px;
    color: #7c3aed;
    font-weight: 600;
    margin-bottom: 5px;
}

/* ===================== */
/* AI HARGA */
/* ===================== */

.ai-harga {
    font-size: 14px;
    color: #dc2626;
    font-weight: 700;
    margin-bottom: 10px;
}

/* ===================== */
/* AI BUTTON GROUP */
/* ===================== */

.mini-ai-action {
    display: flex;
    gap: 6px;
}

/* ===================== */
/* AI BUTTON */
/* ===================== */

.ai-btn {
    flex: 1;
    border: none;
    background: #111827;
    color: white;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: 0.2s;
}

.ai-btn:hover {
    background: #1f2937;
}

/* ===================== */
/* AI SKIP */
/* ===================== */

.ai-skip {
    flex: 1;
    border: none;
    background: #f1f5f9;
    color: #475569;
    padding: 8px 6px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: 0.2s;
}

.ai-skip:hover {
    background: #e2e8f0;
}

/* ===================== */
/* RESPONSIVE */
/* ===================== */

@media (max-width: 900px) {

    #cart-popup {
        width: 95vw;
    }

    .cart-item {
        flex-direction: column;
    }

    .cart-left {
        flex: unset;
        width: 100%;
    }

    .ai-container {
        flex-direction: column;
    }

    .mini-ai-box {
        width: 100%;
    }
}