/* ============================================
   SPITI.BIZ - SHOPPING CART STYLES
   完全兼容現有網站設計
   ============================================ */

/* 購物車 Modal 動畫 */
#cartModal {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateX(100%);
    opacity: 0;
}

#cartModal.active {
    transform: translateX(0);
    opacity: 1;
}

/* 購物車項目樣式 */
.cart-item {
    transition: background-color 0.2s;
}

.cart-item:hover {
    background-color: #fafafa;
}

.cart-item button {
    transition: all 0.2s;
}

.cart-item button:hover {
    transform: scale(1.1);
    color: #FF6B35;
}

/* 購物車計數徽章 */
.action-btn .count {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B35;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Toast 通知樣式（使用現有的 notification-toast）*/
.notification-toast.active {
    display: flex;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 空購物車狀態 */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-cart ion-icon {
    font-size: 100px;
    color: #e0e0e0;
    margin-bottom: 20px;
}

/* 結帳按鈕樣式 */
.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.checkout-btn:active {
    transform: translateY(0);
}

/* 購物車側邊欄覆蓋層 */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 8998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* 數量選擇器 */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-selector button {
    padding: 8px 12px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.quantity-selector button:hover {
    background: #e0e0e0;
}

.quantity-selector span {
    padding: 8px 16px;
    background: white;
    min-width: 50px;
    text-align: center;
    font-weight: 600;
}

/* 響應式設計 */
@media (max-width: 768px) {
    #cartModal {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cart-item-image {
        width: 100%;
        height: 150px;
    }
}

/* 載入動畫 */
.cart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.cart-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 價格標籤 */
.price-tag {
    font-size: 18px;
    font-weight: 700;
    color: #FF6B35;
}

.original-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

/* 免運費提示 */
.free-shipping-banner {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    margin: 15px;
    font-weight: 600;
}

.shipping-progress {
    margin-top: 10px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.shipping-progress-bar {
    height: 100%;
    background: white;
    transition: width 0.3s ease;
}

/* 優惠券輸入框 */
.coupon-input {
    display: flex;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #f0f0f0;
}

.coupon-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.coupon-input button {
    padding: 10px 20px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.coupon-input button:hover {
    background: #e55a2a;
}

/* 安全徽章 */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
    margin-top: 15px;
}

.security-badge ion-icon {
    font-size: 18px;
    color: #4CAF50;
}