
/***********************/
/***** 購物車 Start *****/
/***********************/

/* ===== 提示訊息 ===== */
.cart-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.cart-alert-success {
    background: #eafaf1;
    border: 1px solid #a3d9b1;
    color: #1a7a3a;
}

.cart-alert-danger {
    background: #fdf0f0;
    border: 1px solid #f0b3b3;
    color: #b02a2a;
}

.cart-alert-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
    padding-top: 2px;
}

.cart-alert-success .cart-alert-icon {
    color: #27ae60;
}

.cart-alert-danger .cart-alert-icon {
    color: #e53935;
}

.cart-alert-body {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
}

.cart-alert-body h5 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
}

.cart-alert-body ul {
    padding-left: 18px;
    margin-bottom: 0;
}

/* ===== 推薦人資訊 ===== */
.cart-referral-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-radius: 12px;
    margin-bottom: 24px;
    background: #eef6ff;
    border: 1px solid #a8cfef;
    color: #1a5276;
}

.cart-referral-icon {
    font-size: 22px;
    flex-shrink: 0;
    color: #2e86c1;
}

.cart-referral-body {
    font-size: 15px;
    line-height: 1.6;
}

/* ===== 卡片容器 ===== */
.cart-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    overflow: hidden;
}

.cart-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    letter-spacing: 0.03em;
}

.cart-card-header i {
    color: #e53935;
    font-size: 18px;
}

.cart-card-badge {
    display: inline-flex;
    align-items: center;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 6px;
}

.cart-card-body-content {
    padding: 24px;
}

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

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

.cart-empty h4 {
    font-size: 20px;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
}

.cart-empty p {
    color: #999;
    font-size: 15px;
    margin-bottom: 24px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: #1a1a2e;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cart-empty-btn:hover {
    background: #e53935;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.3);
}

/* ===== 購物車商品列表 ===== */
.cart-items-list {
    padding: 0 24px;
}

.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-main {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.cart-item-type-badge {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.cart-item-upgrades {
    margin-top: 8px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.cart-item-upgrade-item {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

.cart-item-upgrade-item i {
    color: #667eea;
    margin-right: 4px;
    font-size: 10px;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #e53935;
    white-space: nowrap;
}

.cart-item-qty {
    font-size: 14px;
    color: #888;
    white-space: nowrap;
    min-width: 36px;
    text-align: center;
}

/* ===== 移除按鈕 ===== */
.btn-remove-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff0f0;
    color: #e53935;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-remove-item:hover {
    background: #e53935;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.3);
}

/* ===== 優惠碼區塊 ===== */
.cart-coupon-section {
    padding: 20px 24px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.cart-coupon-section .input-group-text {
    background: #fff;
    border-color: #e0e0e0;
    color: #e53935;
}

.cart-coupon-section .form-control {
    border-color: #e0e0e0;
}

.cart-coupon-section .form-control:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 0.2rem rgba(229, 57, 53, 0.15);
}

/* ===== 價格摘要 ===== */
.cart-summary {
    padding: 20px 24px 24px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.cart-summary-label {
    font-size: 15px;
    color: #666;
}

.cart-summary-value {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.cart-summary-discount {
    color: #27ae60;
    font-weight: 600;
}

.cart-summary-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

.cart-summary-total .cart-summary-label {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
}

.cart-summary-total .cart-summary-value {
    font-size: 22px;
    font-weight: 700;
    color: #e53935;
}

/* ===== 送出按鈕 ===== */
.cart-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 48px;
    background: linear-gradient(135deg, #e53935, #c62828);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.cart-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
    background: linear-gradient(135deg, #ef5350, #e53935);
}

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

/* ===== 表單欄位美化 ===== */
.cart-card-body-content .form-label {
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

.cart-card-body-content .form-control,
.cart-card-body-content .form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.cart-card-body-content .form-control:focus,
.cart-card-body-content .form-select:focus {
    border-color: #e53935;
    box-shadow: 0 0 0 0.2rem rgba(229, 57, 53, 0.12);
}

/* ===== 編輯器內容區塊 ===== */
.editor-block {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.editor-block img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ===== 配送相關（保留） ===== */
.logistic-show {
    display: none;
}

.logistic-show.active {
    display: block;
}

.cart-store-info {
    font-size: 16px;
    line-height: 30px;
    letter-spacing: 0.05em;
    color: #999;
}

a.cart-search-store-btn {
    display: block;
    width: 100%;
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    background: #1a1a2e;
    transition: all 0.3s ease;
}

a.cart-change-store-btn {
    display: block;
    width: 100%;
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    letter-spacing: 0.05em;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    background: #999;
    transition: all 0.3s ease;
}

a.cart-search-store-btn:hover,
a.cart-change-store-btn:hover {
    color: #fff;
    opacity: 0.85;
    transform: translateY(-1px);
}

.text-alert {
    display: none;
    color: #dc3545;
    margin-top: 2px;
}

/* 縣市區域下拉選單 */
#twzipcode-container select {
    flex: 1;
    min-width: 0;
}

/* ===== RWD 響應式 ===== */
@media (max-width: 767px) {
    .cart-alert {
        padding: 14px 16px;
        gap: 10px;
    }

    .cart-alert-icon {
        font-size: 20px;
    }

    .cart-alert-body {
        font-size: 14px;
    }

    .cart-card-header {
        padding: 14px 18px;
        font-size: 16px;
    }

    .cart-items-list {
        padding: 0 16px;
    }

    .cart-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 14px 0;
    }

    .cart-item-meta {
        width: 100%;
        justify-content: space-between;
        padding-top: 6px;
        border-top: 1px dashed #eee;
    }

    .cart-item-price {
        font-size: 15px;
    }

    .cart-coupon-section {
        padding: 16px;
    }

    .cart-summary {
        padding: 16px;
    }

    .cart-summary-total .cart-summary-label {
        font-size: 16px;
    }

    .cart-summary-total .cart-summary-value {
        font-size: 20px;
    }

    .cart-card-body-content {
        padding: 18px 16px;
    }

    .cart-submit-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .cart-empty {
        padding: 40px 16px;
    }

    .cart-empty-icon {
        font-size: 48px;
    }
}

@media (max-width: 575px) {
    .cart-item-name {
        font-size: 14px;
    }

    .cart-item-upgrades {
        padding: 8px 10px;
    }

    .cart-item-upgrade-item {
        font-size: 12px;
    }

    .cart-coupon-section .input-group {
        flex-wrap: wrap;
    }

    .cart-coupon-section .input-group .form-control {
        flex: 1 1 auto;
    }
}

/* ===================================================== */
/* 訂貨單頁面                                               */
/* ===================================================== */

/* ===== 訂貨單資訊網格 ===== */
.order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.order-info-item {
    padding: 14px 18px;
    background: #f9fafb;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.order-info-item:hover {
    background: #f0f4ff;
    border-color: #dde4f0;
}

.order-info-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
    font-weight: 500;
}

.order-info-label i {
    color: #e53935;
    width: 16px;
    text-align: center;
    margin-right: 4px;
}

.order-info-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    word-break: break-all;
}

/* ===== 操作按鈕區 ===== */
.order-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
}

.order-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.03em;
}

.order-action-btn-secondary {
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e0e0e0;
}

.order-action-btn-secondary:hover {
    background: #eee;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.order-action-btn-primary {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(229, 57, 53, 0.3);
}

.order-action-btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
    background: linear-gradient(135deg, #ef5350, #e53935);
}

/* ===== 訂貨單 RWD ===== */
@media (max-width: 767px) {
    .order-info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .order-info-item {
        padding: 12px 14px;
    }

    .order-actions {
        flex-direction: column;
    }

    .order-action-btn {
        justify-content: center;
        padding: 12px 20px;
    }
}

/***********************/
/***** 購物車 End *****/
/***********************/
