.toast-container {
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 10px;
        max-width: 400px;
        width: 100%;
    }

    .toast {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 18px;
        background: #1e293b;
        color: #fff;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        animation: slideInRight 0.4s ease forwards;
        font-size: 14px;
    }

    .toast.hide {
        animation: slideOutRight 0.3s ease forwards;
    }

    .toast-success {
        background: #10b981;
    }
    .toast-error {
        background: #ef4444;
    }
    .toast-warning {
        background: #f59e0b;
    }
    .toast-info {
        background: #3b82f6;
    }

    .toast-close {
        margin-left: auto;
        cursor: pointer;
        font-size: 20px;
        line-height: 1;
        opacity: 0.7;
        transition: opacity 0.2s;
    }
    .toast-close:hover {
        opacity: 1;
    }

    @keyframes slideInRight {
        0% {
            transform: translateX(100%);
            opacity: 0;
        }
        100% {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOutRight {
        0% {
            transform: translateX(0);
            opacity: 1;
        }
        100% {
            transform: translateX(100%);
            opacity: 0;
        }
    }

    /* ============================================
        POPUP SLIDE (CART & WISHLIST)
        ============================================ */
    .popup-slide {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 88;
        height: 100vh;
        width: 100%;
        visibility: hidden; /* Ganti display: none */
        transition: visibility 0s 0.4s; /* Delay untuk visibility */
    }

    .popup-slide.active {
        visibility: visible;
        transition: visibility 0s 0s;
    }
    .popup_slide_overlay{
        background: rgba(0, 0, 0, 0.589);
        position: fixed; /* Ganti absolute ke fixed */
        right: 0;
        top: 0;
        width: 100vw;
        height: 100vh;
        z-index: 80;
        animation: animasi_overlay_out 0.4s ease forwards;
    }
    .popup-slide.active .popup_slide_overlay {
        animation: animasi_overlay 0.4s ease forwards;
        animation-delay: .3s;
        opacity: 0; 
    }

    @keyframes animasi_overlay {
        0% {
            opacity: 0;
        }
        100% {
            opacity: 1;
        }
    }
    @keyframes animasi_overlay_out {
        0% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }

    .popup-slide-box{
        width: 100%;
        max-width: 440px;
        background: #ffffff;
        height: 100vh;
        display: flex;
        flex-direction: column;
        position:absolute;
        right:0;
        top: 0;
        z-index: 99;
        animation: popup_slide_out 0.4s ease forwards;
    }
    .popup-slide.active .popup-slide-box{
        animation: popup_slide_in 0.4s ease forwards;
    }
    @keyframes popup_slide_in {
        0% {
            transform: translateX(100%);
        }
        100% {
            transform: translateX(0);
        }
    }
    @keyframes popup_slide_out {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(100%);
        }
    }
    /* ============================================
        POPUP HEADER
        ============================================ */
    .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #ffffff;
    z-index: 2;
}

.popup-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-header h2 iconify-icon {
    font-size: 22px;
}

.popup-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-header-actions .btn-clear {
    font-size: 13px;
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    display: none;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.popup-header-actions .btn-clear:hover {
    background: #fef2f2;
}

.popup-header-actions .btn-clear.visible {
    display: inline-flex;
}

.btn-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s;
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* ============================================
   POPUP BODY
   ============================================ */
.popup-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    background: #fafbfc;
}

.popup-body::-webkit-scrollbar {
    width: 4px;
}

.popup-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.popup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.popup-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
.popup-body {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.popup-body-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #94a3b8;
    text-align: center;
    padding: 20px;
}

.popup-body-empty iconify-icon {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 12px;
}

.popup-body-empty p:first-of-type {
    font-weight: 600;
    color: #475569;
    margin: 0 0 4px 0;
    font-size: 16px;
}

.popup-body-empty p:last-of-type {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   CART ITEMS
   ============================================ */
#cart-content .space-y-3 > * + * {
    margin-top: 12px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    border-radius: 8px;
}

.cart-item:hover {
    background: #f8fafc;
    padding-left: 12px;
}

.cart-item:last-child {
    border-bottom: none;
}

/* Product Image */
.cart-item-image {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image .placeholder {
    font-size: 28px;
    color: #cbd5e1;
}

/* Product Info */
.cart-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 4px 0;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Quantity & Actions */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* popup.css atau style.css */

.cart-item-price-wrapper {
    display: flex;
    align-items: center;
    gap: .2vw;
    flex-wrap: wrap;
}

.cart-item-price {
    font-size: .8vw;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.cart-item-price-discount {
    color: #ef4444;
    font-weight: 700;
}

.cart-item-price-original {
    font-size: .6vw;
    color: #9ca3af;
    text-decoration: line-through;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
}

.qty-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    user-select: none;
}

.qty-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.qty-btn:active {
    transform: scale(0.9);
}

.qty-input {
    width: 38px;
    height: 30px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    padding: 0;
    outline: none;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-input:focus {
    background: #f8fafc;
}

/* Remove Button */
.btn-remove {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.btn-remove:hover {
    background: #fef2f2;
    color: #ef4444;
    transform: scale(1.1);
}

.btn-remove:active {
    transform: scale(0.9);
}

.btn-remove svg {
    width: 18px;
    height: 18px;
}

/* ============================================
   POPUP FOOTER
   ============================================ */
.popup-footer {
    border-top: 1px solid #e2e8f0;
    padding: 16px 20px;
    background: #ffffff;
    flex-shrink: 0;
    display: none;
}

.popup-footer.visible {
    display: block;
}

.popup-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.popup-footer-total-label {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.popup-footer-total {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 2px 0 0 0;
}

.popup-footer-buttons {
    display: flex;
    gap: 8px;
}

.btn-outline {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-primary {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
    transform: scale(0.97);
}

/* ============================================
   LOADING STATE
   ============================================ */
#cart-content.loading,
#wishlist-content.loading {
    position: relative;
    min-height: 200px;
}

#cart-content.loading::after,
#wishlist-content.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   CART BADGE
   ============================================ */
.cart-badge,
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    line-height: 1;
    border: 2px solid #ffffff;
}

.cart-badge.hidden,
.cart-count.hidden {
    display: none !important;
}

/* Wishlist Badge */
.wishlist-badge,
.wishlist-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    line-height: 1;
    border: 2px solid #ffffff;
}

.wishlist-badge.hidden,
.wishlist-count.hidden {
    display: none !important;
}

/* ============================================
   WISHLIST ITEMS
   ============================================ */
.wishlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    border-radius: 8px;
}

.wishlist-item:hover {
    background: #f8fafc;
    padding-left: 12px;
}

.wishlist-item:last-child {
    border-bottom: none;
}

.wishlist-item-image {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wishlist-item-image .placeholder {
    font-size: 28px;
    color: #cbd5e1;
}

.wishlist-item-info {
    flex: 1;
    min-width: 0;
}

.wishlist-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wishlist-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 4px 0 0 0;
}

.wishlist-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-sm-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-sm-primary:hover {
    background: #1d4ed8;
}

.btn-sm-danger {
    background: #fef2f2;
    color: #ef4444;
}

.btn-sm-danger:hover {
    background: #fee2e2;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .popup-slide-box {
        max-width: 75vw;
    }
}

@media (max-width: 480px) {
    .popup-slide-box {
        max-width: 100vw;
        border-radius: 0;
    }

    .popup-header {
        padding: 14px 16px;
    }
    
    .popup-header h2 {
        font-size: 16px;
    }

    .popup-body {
        padding: 12px 16px;
    }

    .popup-footer {
        padding: 14px 16px;
    }

    .popup-footer-inner {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .popup-footer-buttons {
        justify-content: center;
        gap: 12px;
    }

    .btn-outline,
    .btn-primary {
        flex: 1;
        justify-content: center;
        padding: 12px 20px;
    }

    .cart-item-image,
    .wishlist-item-image {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }

    .cart-item-name,
    .wishlist-item-name {
        font-size: 13px;
    }

    .cart-item-price,
    .wishlist-item-price {
        font-size: 14px;
    }

    .qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .qty-input {
        width: 34px;
        height: 28px;
        font-size: 12px;
    }

    .popup-footer-total {
        font-size: 18px;
    }

    .popup-body-empty iconify-icon {
        font-size: 48px;
    }

    .popup-body-empty p:first-of-type {
        font-size: 15px;
    }

    .popup-body-empty p:last-of-type {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .popup-header {
        padding: 12px 14px;
    }
    
    .popup-header h2 {
        font-size: 14px;
    }
    
    .popup-body {
        padding: 10px 12px;
    }

    .cart-item {
        gap: 10px;
        padding: 10px 10px 10px 0;
    }

    .cart-item-image,
    .wishlist-item-image {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .cart-item-name,
    .wishlist-item-name {
        font-size: 12px;
    }

    .cart-item-price,
    .wishlist-item-price {
        font-size: 13px;
    }

    .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .qty-input {
        width: 30px;
        height: 24px;
        font-size: 11px;
    }

    .btn-remove svg {
        width: 16px;
        height: 16px;
    }

    .popup-footer {
        padding: 12px 14px;
    }

    .popup-footer-total {
        font-size: 16px;
    }

    .btn-outline,
    .btn-primary {
        font-size: 12px;
        padding: 10px 16px;
    }
}

/* ============================================
   UTILITY
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 8px;
}

.shrink-0 {
    flex-shrink: 0;
}

.wishlist-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wishlist-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    border-radius: 10px;
    position: relative;
}

.wishlist-item:hover {
    background: #f8fafc;
    padding-left: 12px;
}

.wishlist-item:last-child {
    border-bottom: none;
}

/* Wishlist Image */
.wishlist-item-image {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wishlist-item-image .placeholder {
    font-size: 28px;
    color: #cbd5e1;
}

/* Wishlist Info */
.wishlist-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.wishlist-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.wishlist-item-name:hover {
    color: #2563eb;
}

.wishlist-item-category {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 4px 0;
}

.wishlist-item-price {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Wishlist Actions */
.wishlist-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.wishlist-item-actions .btn-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wishlist-item-actions .btn-sm-primary {
    background: #2563eb;
    color: #ffffff;
}

.wishlist-item-actions .btn-sm-primary:hover {
    background: #1d4ed8;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wishlist-item-actions .btn-sm-primary:active {
    transform: scale(0.95);
}

.wishlist-item-actions .btn-sm-danger {
    background: #fef2f2;
    color: #ef4444;
}

.wishlist-item-actions .btn-sm-danger:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.05);
}

.wishlist-item-actions .btn-sm-danger:active {
    transform: scale(0.95);
}

.wishlist-item-actions .btn-sm iconify-icon {
    font-size: 18px;
}

/* Empty state button */
.popup-body-empty .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    background: #2563eb;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-top: 16px;
}

.popup-body-empty .btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .wishlist-item {
        gap: 10px;
        padding: 10px 10px 10px 0;
    }

    .wishlist-item-image {
        width: 52px;
        height: 52px;
        min-width: 52px;
        min-height: 52px;
    }

    .wishlist-item-name {
        font-size: 13px;
    }

    .wishlist-item-price {
        font-size: 14px;
    }

    .wishlist-item-actions .btn-sm {
        width: 30px;
        height: 30px;
    }

    .wishlist-item-actions .btn-sm iconify-icon {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .wishlist-item {
        gap: 8px;
        padding: 8px 8px 8px 0;
    }

    .wishlist-item-image {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .wishlist-item-name {
        font-size: 12px;
    }

    .wishlist-item-price {
        font-size: 13px;
    }

    .wishlist-item-actions .btn-sm {
        width: 26px;
        height: 26px;
    }

    .wishlist-item-actions .btn-sm iconify-icon {
        font-size: 14px;
    }

    .wishlist-item-category {
        font-size: 10px;
    }
}