﻿/* 測試白底效果（僅此頁面） */
.flat-seller.bg_hdf_light_brown {
    background-color: #ffffff;
}

@media (min-width: 1150px) {
    .tf-page-cart-wrap {
        display: grid;
        grid-template: repeat(2, auto) / 66% 1fr;
        column-gap: 2rem;
    }
}

@media only screen and (max-width: 1149px) {
    .tf-page-cart-footer {
        margin-top: 0px;
    }
}

.tf-table-page-cart td:first-child {
    text-align: start;
    padding-left: 10px !important;
}

.table-cart-frame {
    background-color: #fdfdfd;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 0px 8px rgb(134, 134, 134);
}

/* 步驟導航美化 */
.cart-steps {
    display: flex;
    justify-content: center;
    margin: 15px 0px 35px 0px;
    align-items: center;
    flex-wrap: wrap;
}

.cart-steps .step {
    font-size: 16px;
    font-weight: 700;
    padding: 10px 20px;
    border: 1px solid #381e0f;
    transition: all 0.3s ease;
    margin: 5px;
    border-radius: 5px;
}

.cart-steps .step.active {
    color: white;
    background-color: #381e0f;
    text-align: center;
}

.cart-steps .step:not(.active) {
    color: #381e0f;
    background-color: white;
    text-align: center;
}

.order-purchaser-label {
    font-weight: 600;
    padding-right: 25px;
    font-size: 16px;
    width: 120px;
}

/* 移除 .cart-steps li:hover:not(.active) 的樣式，因為不再是互動元素 */
/* 表格樣式優化 */
.tf-table-page-cart {
    width: 100%;
    border-collapse: collapse;
    margin: 0px;
}

.tf-table-page-cart th,
.tf-table-page-cart td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-align: center;
    /* 修改為置中 */
    vertical-align: middle;
}

.tf-table-page-cart th {
    color: #381e0f;
    font-size: 16px;
    text-transform: uppercase;
}

.tf-table-page-cart tbody tr:last-child td {
    border-bottom: none;
}

.tf-cart-item_product {
    display: flex;
    align-items: center;
}

.tf-cart-item_product .img-box {
    width: 80px;
    height: 80px;
    margin-right: 15px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tf-cart-item_product .img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tf-cart-item_product .cart-info .cart-title {
    font-size: 16px;
    color: #381e0f;
    font-weight: 600;
    text-decoration: none;
}

.tf-cart-item_product .cart-info .cart-meta-variant {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-weight: bold;
}

.tf-cart-item_product .cart-info .remove-cart {
    font-size: 14px;
    color: #d9534f;
    /* 移除按鈕顏色 */
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
    font-weight: bold;
}

.tf-cart-item_product .cart-info .remove-cart:hover {
    text-decoration: underline;
}

.tf-cart-item_price,
.tf-cart-item_quantity,
.tf-cart-item_total {
    font-size: 16px;
    color: #381e0f;
}

select {
    color: #42210B !important;
    background-color: #ffffff;
    border: 1px solid #42210B !important;
    border-color: #42210B;
    border-radius: 0 !important;
}

/* 總計和折扣碼區域 */
.tf-page-cart-footer {
    border-top: 1px solid #eee;
    padding-top: 20px;
    background-color: #fdfdfd;
    /* 淺色背景 */
    padding: 5px 25px 25px 25px;
    border-radius: 10px;
    box-shadow: 0 0px 8px rgb(134, 134, 134);
}

.tf-cart-totals-discounts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 增加底部內邊距 */
    border-bottom: 1px dashed #ccc;
    /* 虛線分隔 */
}

.tf-cart-totals-discounts:last-of-type {
    border-bottom: none;
    /* 最後一個不顯示虛線 */
    padding-bottom: 0;
}

.tf-cart-totals-discounts h3 {
    font-size: 24px;
    /* 增大字體 */
    color: #381e0f;
    margin: 0;
}

.tf-cart-totals-discounts .total-value {
    font-size: 24px;
    /* 增大字體 */
    font-weight: 700;
    color: #d9534f;
    /* 醒目顏色 */
}

.cart-checkout-btn .tf-btn {
    /* 增大內邊距 */
    font-size: 20px;
    /* 增大字體 */
    border-radius: 10px !important;
    /* 更大的圓角 */
    background-color: #381e0f;
    /* 深棕色按鈕 */
    color: white;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: 25px;
    transition: background-color 0.3s ease;
    /* 添加過渡效果 */
}

.cart-checkout-btn .tf-btn:hover {
    background-color: #42210B;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .footer .footer-wrap .footer-body {
        padding-top: 0px;
        padding-bottom: 40px;
        position: relative;
    }

    .cart-checkout-btn .tf-btn {
        margin-top: 10px;
    }

    .flat-spacing-5 {
        padding: 20px 0px;
    }

    .flat-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        margin-bottom: 15px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .cart-steps {
        display: flex;
        justify-content: center;
        margin: 0px 0px 15px 0px;
        align-items: center;
        flex-wrap: wrap;
    }

    .cart-steps .step.active {
        color: white;
        background-color: #381e0f;
        text-align: center;
    }

    .cart-steps .step {
        font-size: 14px;
        font-weight: bold;
        padding: 10px;
        border: 1px solid #381e0f;
        /* cursor: pointer; */
        transition: all 0.3s ease;
        margin: 5px;
        border-radius: 5px;
    }

    .tf-cart-totals-discounts h3 {
        font-size: 20px;
        color: #381e0f;
        margin: 0;
    }

    .tf-cart-totals-discounts .total-value {
        font-size: 20px;
        font-weight: 700;
        color: #d9534f;
    }

    .tf-cart-totals-discounts {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: none;
    }

    .tf-page-cart-note label {
        margin-bottom: 5px;
        display: block;
    }

    /* 桌面版表格在手機上隱藏 */
    .desktop-cart-table {
        display: none;
    }

    .table-cart-frame {
        display: none;
    }

    /* 手機版購物車列表樣式 */
    .mobile-cart-list {
        display: block;
    }

    .mobile-cart-item {
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 15px;
        padding: 15px;
        box-shadow: 0 0px 8px rgb(134, 134, 134);
    }

    .mobile-cart-item-header {
        display: flex;
        align-items: flex-start;
        margin-bottom: 15px;
    }

    .mobile-cart-item-image {
        width: 80px;
        height: 80px;
        margin-right: 15px;
        flex-shrink: 0;
    }

    .mobile-cart-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }

    .mobile-cart-item-info {
        flex: 1;
    }

    .mobile-cart-item-title {
        font-size: 16px;
        font-weight: 600;
        margin: 0 0 5px 0;
        color: #333;
    }

    .mobile-cart-item-variant {
        font-size: 14px;
        color: #666;
        margin: 0 0 8px 0;
    }

    .mobile-cart-item-price {
        font-size: 16px;
        font-weight: 600;
        color: #381e0f;
    }

    .mobile-cart-item-remove {
        background: none;
        border: none;
        font-size: 24px;
        color: #999;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-cart-item-remove:hover {
        color: #d9534f;
    }

    .mobile-cart-item-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 15px;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-curr-cart-item-controls {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-top: 15px;
        border-top: 1px solid #f0f0f0;
    }

    .mobile-cart-item-quantity {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-cart-item-quantity label {
        font-size: 14px;
        color: #666;
        margin: 0;
    }

    .mobile-cart-item-quantity select {
        padding: 0px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
        min-width: 70px;
    }

    .mobile-cart-item-subtotal {
        font-size: 16px;
        font-weight: 600;
        color: #381e0f;
    }
}

/* 桌面版樣式 */
@media (min-width: 769px) {
    .desktop-cart-table {
        display: table;
    }

    .mobile-cart-list {
        display: none;
    }
}

@media (max-width: 600px) {
    .cart-steps {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 10px;
        /* 行間、列間距 */
        justify-items: stretch;
        align-items: stretch;
        margin: 20px 0;
        padding: 0 10px;
    }

    .cart-steps .step {
        min-width: 0;
        /* 讓內容自適應 */
        margin: 0;
        /* 由 gap 控制間距 */
        width: 100%;
        box-sizing: border-box;
    }
}

.nav-tabs .nav-link {
    border: none;
    background-color: transparent;
    color: #6c584c;
    font-size: 1.1rem;
    padding: 10px 20px;
    margin: 0 5px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #381e0f;
}

.nav-tabs .nav-link.active {
    color: #381e0f;
    background-color: transparent;
    border-bottom: 2px solid #381e0f;
    font-weight: bold;
}

.tab-content {
    padding-top: 20px;
}

.cart-tab-count {
    background-color: #381e0f;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.9em;
    margin-left: 5px;
    font-weight: normal;
}
