/* ----------------------------------------------------------------
   interactive.css - 按钮、输入框、动画、交互反馈
---------------------------------------------------------------- */

/* --- 按钮 (Buttons) --- */

/* 底部操作区按钮 */
.ai-service-btn, .checkout-btn {
    height: 38px;
    min-width: 80px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-service-btn {
    background-color: #f0f7ff;
    color: #0066cc;
    border: 1px solid #dbeafe;
}
.checkout-btn {
    background: #ff6b35;
    color: white;
    border: none;
    box-shadow: 0 3px 8px rgba(255, 107, 53, 0.3);
}

/* 扫码按钮 */
.scan-to-order-btn {
    height: 38px;
    min-width: 80px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 19px;
    border: none;
    background: #0066cc; 
    color: white;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 102, 204, 0.3);
    flex-shrink: 0;
}

/* 订单弹窗通用按钮 */
.order-btn {
    height: 48px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease; 
    width: 100%;
}
.order-btn:active { opacity: 0.8; }
.order-btn.secondary { background: #f0f0f0; color: #666; }
.order-btn.primary { 
    background: #00bfa5;
    color: white; 
    box-shadow: 0 4px 12px rgba(0, 191, 165, 0.3);
}

/* 确认提交按钮 (支持长按) */
.confirm-btn {
    flex: 1;
    height: 46px;
    border-radius: 23px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden; 
    z-index: 1;
}

.confirm-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: rgba(0, 0, 0, 0.25); 
    z-index: -1;
    transition: width 0s; 
}

.confirm-btn.pressing::after {
    width: 100%;
    transition: width 5s linear;
}

.confirm-btn.secondary {
    background: #f0f0f0;
    color: #666;
}
.confirm-btn.primary {
    background: linear-gradient(135deg, #ff8c42, #ff6b35); 
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* --- 商品卡片交互控件 (Product Card Interactions) --- */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px; 
    height: 36px; 
}

.quantity-control button {
    width: 32px; 
    height: 32px;
    font-size: 20px;
    line-height: 1;
    border-radius: 8px; 
    border: none;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.2s;
}

.quantity-control button:active {
    background-color: #e0e0e0;
}

.quantity-control button.delete-btn {
    background-color: #fff0f0;
    color: #ff4d4f;
    margin-left: auto; 
}

.quantity-control .qty-span,
.quantity-control input {
    font-size: 16px; 
    font-weight: bold;
    min-width: 24px;
    text-align: center;
    border: none;
    background: transparent;
    color: #333;
}

.add-to-cart {
    width: 100%;
    padding: 0;
    height: 36px; 
    font-size: 13px;
    font-weight: 600;
    border-radius: 18px;
    background-color: #e6f7ff;
    color: #0099ff;
    border: 1px solid #bae7ff;
    cursor: pointer;
    transition: all 0.2s;
}
.add-to-cart:active {
    background-color: #d6efff;
}

.select-options-btn {
    width: 100%;
    padding: 0;
    height: 36px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 18px;
    background-color: #fff; 
    color: #666; 
    border: 1px dashed #bbb; 
    cursor: pointer;
    transition: all 0.2s;
}
.select-options-btn:active {
    background-color: #f0f0f0;
}

button[disabled].add-to-cart,
.quantity-control button[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
    background-color: #f5f5f5 !important;
    color: #999 !important;
    border: 1px solid #eee !important;
    box-shadow: none !important;
}

/* --- 动画 (Animations) --- */
@keyframes shake-horizontal {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake-animation {
    animation: shake-horizontal 0.4s ease-in-out;
    border-color: #ff6b35; 
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.bouncing {
    animation: bounce 0.3s 3;
}