/* ===== css/cart.css - 購物車專用樣式 ===== */

/* 購物車空白樣式 */
.empty-cart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    text-align: center;
}

.empty-cart-icon {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-cart-message {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #666;
}

/* 購物車表格樣式 - 改進版 */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

.cart-table th {
    background-color: #f8f8f8;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.cart-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.product-cell {
    width: 40%;
}

.product-info {
    display: flex;
    align-items: center;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    border: 1px solid #eee;
}

.product-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

/* 數量控制器樣式 - 美化版 */
.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    width: 120px;
    background-color: #f9f9f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.quantity-btn {
    background-color: #f2f2f2;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

.quantity-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.quantity-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 48px;
    height: 36px;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    text-align: center;
    font-size: 1rem;
    padding: 0;
    background-color: #fff;
    font-weight: 500;
}

.quantity-input::-webkit-inner-spin-button, 
.quantity-input::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* 刪除按鈕樣式 - 美化版 */
.remove-item {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background-color: #ffeaea;
    transform: scale(1.1);
}

/* 訂單摘要樣式 - 美化版 */
.cart-summary {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cart-summary h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* 訂單摘要改善樣式 */
.summary-section-title {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.summary-section-title h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    color: #555;
}

.summary-row.item-detail {
    padding: 8px 0;
    color: #666;
    font-size: 14px;
    border-bottom: none;
}

.summary-row.item-detail .item-info {
    color: #666;
}

.summary-row.item-detail .item-price {
    color: #666;
    font-weight: normal;
}

.summary-divider {
    height: 1px;
    background-color: #ddd;
    margin: 15px 0;
}

.summary-row.subtotal {
    padding: 12px 0;
    font-weight: 600;
    color: #333;
    border-top: 1px dashed #ccc;
    border-bottom: none;
}

.summary-row.shipping {
    padding: 10px 0;
    color: #555;
    border-bottom: none;
}

.summary-row.shipping .shipping-method {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

.summary-row.shipping.free-shipping .free-text {
    color: #4caf50;
    font-weight: 600;
}

.summary-row .label {
    font-weight: 500;
}

.summary-row .amount {
    font-weight: 600;
}

.summary-row.total {
    border-bottom: none;
    margin-top: 15px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    border-top: 2px solid #333;
}

.cart-actions {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.cart-actions .btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    flex: 1;
}

.cart-actions .btn-outline {
    border: 1px solid #2e7d32;
    color: #2e7d32;
    background-color: transparent;
}

.cart-actions .btn-outline:hover {
    background-color: #f0f8f0;
}

.cart-actions .btn-primary {
    background-color: #2e7d32;
    border: 1px solid #2e7d32;
    color: white;
}

.cart-actions .btn-primary:hover {
    background-color: #1b5e20;
}

/* 結帳步驟樣式 */
.checkout-section {
    padding: 30px 0;
}

.checkout-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #eee;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.progress-step.active .step-number {
    background-color: #2e7d32;
    color: white;
}

.step-text {
    font-size: 0.9rem;
    color: #666;
}

.progress-step.active .step-text {
    color: #333;
    font-weight: 500;
}

.progress-line {
    flex-grow: 1;
    height: 2px;
    background-color: #eee;
    margin: 0 15px;
    margin-bottom: 20px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .checkout-steps {
        margin: 20px 0;
    }
    
    .step-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-title {
        font-size: 0.8rem;
    }
    
    .step:not(:last-child)::after {
        top: 20px;
    }
    
    .cart-table th:nth-child(2),
    .cart-table td:nth-child(2) {
        display: none;
    }
    
    .product-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .quantity-control {
        width: 100px;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .cart-table {
        display: block;
        border-radius: 12px;
        margin-bottom: 20px;
    }
    
    .cart-table thead {
        display: none; /* 隱藏表頭 */
    }
    
    .cart-table tbody tr {
        display: grid;
        grid-template-columns: 1fr;
        padding: 15px;
        border-bottom: 1px solid #eee;
    }
    
    .cart-table td {
        display: block;
        padding: 8px 0;
        border: none;
        text-align: right;
    }
    
    .product-cell {
        width: 100%;
        grid-column: 1 / -1;
    }
    
    .product-info {
        justify-content: flex-start;
        margin-bottom: 10px;
    }
    
    .product-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .price-cell::before {
        content: "單價: ";
        float: left;
        font-weight: 500;
    }
    
    .quantity-cell {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }
    
    .quantity-cell::before {
        content: "數量: ";
        font-weight: 500;
    }
    
    .total-cell::before {
        content: "小計: ";
        float: left;
        font-weight: 500;
    }
    
    .action-cell {
        text-align: center;
    }
    
    .quantity-control {
        width: 120px;
        height: 40px;
    }
    
    .quantity-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .quantity-input {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .remove-item {
        width: 44px;
        height: 44px;
        margin: 0 auto;
        font-size: 18px;
        background-color: #fff1f1;
    }

    /* 改善行動裝置訂單摘要樣式 */
    .cart-summary {
        padding: 20px;
        margin-top: 15px;
        border-radius: 12px;
    }
    
    .summary-row {
        padding: 15px 0;
        font-size: 16px;
    }
    
    .summary-row.total {
        font-size: 18px;
        font-weight: 700;
        padding-top: 20px;
        margin-top: 20px;
    }
    
    .cart-actions {
        margin-top: 30px;
    }
    
    .cart-actions .btn {
        font-size: 16px;
        padding: 14px 0;
        border-radius: 10px;
        font-weight: 600;
        display: block;
        text-align: center;
    }
    
    /* 繼續購物按鈕 */
    .btn-outline {
        margin-bottom: 10px;
    }
    
    /* 結帳按鈕 */
    .btn-primary {
        background-color: #2e7d32;
        box-shadow: 0 4px 10px rgba(46, 125, 50, 0.3);
    }
    
    /* 步驟指示器優化 */
    .checkout-progress {
        padding: 10px 0;
    }
    
    .step-number {
        font-size: 16px;
    }
}

/* 購物車的數量控制器樣式優化 */
.quantity-btn {
    background-color: #f0f0f0;
    border-radius: 0;
    font-weight: bold;
}

.quantity-btn:active {
    background-color: #e0e0e0;
}

.remove-item {
    background-color: #fff1f1;
    transition: all 0.2s;
}

.remove-item:active {
    background-color: #ffdddd;
}

/* 購物車繼續購物按鈕 - 行動裝置專用 */
@media (max-width: 576px) {
    .continue-shopping-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }
}