/* Custom Cart Widget Styles - 根据图片样式修改 */
.custom-cart-widget {
    display: inline-block;
    margin: 0;
    padding: 0;
    /*background-color: #5d4037; */
    background-color: transparent!important;
    border-radius: 4px;
    padding: 5px 10px;
}

.custom-cart-button {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background-color: transparent; /* 透明背景 */
    color: #d4af37; /* 黄色文字，与图片一致 */
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    position: relative;
    transition: all 0.3s ease;
}

.custom-cart-button:hover {
    color: #ffd54f; /* 悬停时更亮的黄色 */
    /*transform: translateY(-1px);*/
}

.cart-icon-wrapper {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.custom-cart-button i {
    font-size: 20px; /* 稍大的图标，与图片一致 */
    color: #d4af37; /* 黄色图标 */
}

.cart-text {
    font-size: 14px;
    font-weight: 500;
    color: #d4af37; /* 黄色文字 */
}

.cart-item-count {
    position: absolute;
    top: -8px; /* 调整到图标右上角 */
    right: -8px;
    background-color: #ff4444; /* 红色背景突出显示 */
    color: #ffffff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; /* 更小的字体 */
    font-weight: bold;
    line-height: 1;
    min-width: 18px;
    /*border: 2px solid #5d4037; */
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 当只有图标时的样式 */
.custom-cart-button:not(:has(.cart-text)) .cart-icon-wrapper {
    margin-right: 0;
}

/* 数量为0时隐藏徽章 */
.cart-item-count[data-count="0"] {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .custom-cart-widget {
        padding: 3px 8px;
    }

    .cart-text {
        display: none; /* 移动端隐藏文字 */
    }

    .cart-icon-wrapper {
        margin-right: 0;
    }

    .custom-cart-button i {
        font-size: 18px;
    }

    .cart-item-count {
        top: -6px;
        right: -6px;
        width: 16px;
        height: 16px;
        font-size: 9px;
    }
}

/* 动画效果 */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -5px, 0);
    }
    70% {
        transform: translate3d(0, -3px, 0);
    }
    90% {
        transform: translate3d(0, -1px, 0);
    }
}

.cart-item-count.update {
    animation: bounce 0.5s ease-in-out;
}

/* 空购物车样式 */
.custom-cart-button:not(:has(.cart-item-count)) .cart-icon-wrapper::after {
    display: none;
}