/* 购物车动画效果样式 */

/* 动画效果样式 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes numberRoll {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 产品卡片动画 */
.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    transition: all 0.3s ease;
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* 标题动画 */
.header-title h5 {
    animation: slideInLeft 0.8s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
    transition: color 0.3s ease;
}

.header-title h5:hover {
    color: #007bff;
}

/* 库存信息动画 */
.stock-info {
    animation: bounce 1s ease-in-out;
    animation-delay: 0.5s;
    animation-fill-mode: both;
}

/* 价格动画 */
.pricing-info {
    animation: fadeInUp 0.7s ease-out;
    animation-delay: 0.4s;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.amount {
    animation: numberRoll 0.8s ease-out;
    animation-delay: 0.6s;
    animation-fill-mode: both;
    transition: all 0.3s ease;
}

.amount:hover {
    transform: scale(1.1);
    color: #28a745;
}

/* 折扣标签动画 */
.discount {
    animation: pulse 2s infinite;
    animation-delay: 1s;
}

/* 按钮动画 */
.buy-now-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.buy-now-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.buy-now-button:hover::before {
    left: 100%;
}

.buy-now-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.3);
}

.buy-now-button:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

.buy-now-button.SellOut {
    animation: pulse 1.5s infinite;
    opacity: 0.7;
}

/* 每日价格动画 */
.daily-price, .daily-price-regular {
    animation: fadeInUp 1s ease-out;
    animation-delay: 0.8s;
    animation-fill-mode: both;
}

/* 试用信息动画 */
.trial-info {
    animation: slideInLeft 0.6s ease-out;
    animation-delay: 0.7s;
    animation-fill-mode: both;
}

/* 无数据动画 */
.no-data {
    animation: fadeInUp 1s ease-out;
}

/* 响应式动画优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 波纹效果动画 */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    pointer-events: none;
    animation: ripple 0.6s linear;
}

/* 底部滑出购买按钮样式 */
.slide-up-buy-button {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 25%; /* 占父容器的四分之一 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.product-card:hover .slide-up-buy-button {
    transform: translateY(0);
}

/* 移动端适配：让购买按钮始终可见 */
@media (max-width: 768px) {
    .slide-up-buy-button {
        position: static;
        transform: translateY(0) !important;
        height: auto;
        padding: 15px;
        margin-top: 15px;
        border-radius: 8px;
        border: 1px solid rgba(0, 123, 255, 0.2);
    }
    
    .product-card {
        padding-bottom: 0;
    }
}

/* 触摸设备适配 */
@media (hover: none) and (pointer: coarse) {
    .slide-up-buy-button {
        position: static;
        transform: translateY(0) !important;
        height: auto;
        padding: 15px;
        margin-top: 15px;
        border-radius: 8px;
        border: 1px solid rgba(0, 123, 255, 0.2);
    }
    
    .product-card {
        padding-bottom: 0;
    }
    
    .product-card:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }
}

.slide-effect {
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    transform: scale(0.95);
    opacity: 0.9;
}

.slide-effect:hover {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 6px 25px rgba(0, 123, 255, 0.4);
    color: white !important;
}

.slide-up-buy-button .SellOut {
    background: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0.8;
    cursor: not-allowed;
}