/* =============================================
   MINI CART DROPDOWN - Professional & Fluid
   ============================================= */

/* Cart Icon Wrapper */
.waki-cart-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.waki-cart-trigger:hover {
    background: rgba(178, 137, 76, 0.08);
    transform: scale(1.05);
}

.waki-cart-trigger .cart-icon {
    font-size: 20px;
    color: #333;
    transition: color 0.3s ease;
}

.waki-cart-trigger:hover .cart-icon {
    color: #b2894c;
}

.waki-cart-trigger .cart-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.4);
    animation: cartBadgePulse 2s infinite;
}

@keyframes cartBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Cart Dropdown Panel */
.waki-cart-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 380px;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.waki-cart-dropdown.active {
    max-height: 520px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    overflow: visible;
}

/* Arrow indicator */
.waki-cart-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 24px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 3px;
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.04);
}

/* Cart Header */
.waki-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.waki-cart-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a1a;
}

.waki-cart-header .cart-count-label {
    background: #f5f0e8;
    color: #b2894c;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* Cart Items List */
.waki-cart-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f8f8f8;
}

.waki-cart-items::-webkit-scrollbar {
    width: 4px;
}

.waki-cart-items::-webkit-scrollbar-track {
    background: #f8f8f8;
}

.waki-cart-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Individual Cart Item */
.waki-cart-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    gap: 12px;
    transition: all 0.25s ease;
    position: relative;
    border-bottom: 1px solid #fafafa;
}

.waki-cart-item:hover {
    background: #fafaf8;
}

.waki-cart-item.removing {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    padding: 0 20px;
    margin: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.waki-cart-item-img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.waki-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.waki-cart-item-info {
    flex: 1;
    min-width: 0;
}

.waki-cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin: 0 0 3px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.waki-cart-item-details {
    font-size: 11px;
    color: #888;
    margin: 0;
}

.waki-cart-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #b2894c;
    white-space: nowrap;
}

.waki-cart-item-remove {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #999;
    font-size: 12px;
}

.waki-cart-item:hover .waki-cart-item-remove {
    opacity: 1;
}

.waki-cart-item-remove:hover {
    background: #fee;
    color: #e74c3c;
}

/* Cart Footer */
.waki-cart-footer {
    padding: 16px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafaf8;
    border-radius: 0 0 16px 16px;
}

.waki-cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.waki-cart-total-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.waki-cart-total-value {
    font-size: 17px;
    font-weight: 900;
    color: #000;
}

.waki-cart-actions {
    display: flex;
    gap: 8px;
}

.waki-cart-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.waki-cart-btn-outline {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    color: #555;
}

.waki-cart-btn-outline:hover {
    border-color: #b2894c;
    color: #b2894c;
    background: #fffdf8;
}

.waki-cart-btn-primary {
    background: linear-gradient(135deg, #b2894c, #9a7340);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(178, 137, 76, 0.3);
}

.waki-cart-btn-primary:hover {
    background: linear-gradient(135deg, #9a7340, #846230);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(178, 137, 76, 0.4);
    color: #fff;
}

/* Empty Cart State */
.waki-cart-empty {
    padding: 40px 20px;
    text-align: center;
}

.waki-cart-empty-icon {
    font-size: 40px;
    color: #ddd;
    margin-bottom: 12px;
}

.waki-cart-empty-text {
    font-size: 14px;
    color: #999;
    margin: 0 0 16px 0;
}

.waki-cart-empty-link {
    font-size: 13px;
    color: #b2894c;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.waki-cart-empty-link:hover {
    color: #9a7340;
    text-decoration: underline;
}

/* Cart Add Animation */
@keyframes cartBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.waki-cart-trigger.item-added .cart-icon {
    animation: cartBounce 0.5s ease;
    color: #b2894c;
}

/* Mobile responsive */
@media (max-width: 991px) {
    .waki-cart-dropdown {
        width: 320px;
        right: -20px;
    }
    
    .waki-cart-dropdown::before {
        right: 34px;
    }
}

@media (max-width: 575px) {
    .waki-cart-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 0;
        transform: translateY(20px);
    }
    
    .waki-cart-dropdown.active {
        max-height: 70vh;
        transform: translateY(0);
    }
    
    .waki-cart-dropdown::before {
        display: none;
    }
}

/* Overlay for mobile */
.waki-cart-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.waki-cart-overlay.active {
    display: block;
    opacity: 1;
}

/* Cart page enhancements */
.cart-item-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.cart-item-card.removing {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Toast notification for cart actions */
.waki-cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.waki-cart-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.waki-cart-toast .toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.waki-cart-toast .toast-icon.success {
    background: #27ae60;
}

.waki-cart-toast .toast-icon.error {
    background: #e74c3c;
}
