﻿.card-body {
    padding: unset;
}

.pd-card {
    padding: 12px 16px
}

.card-header-light {
    border-bottom: 1px solid #e9ecef;
}

.card-header {
    padding: 0.75rem 0.75rem;
}
/* 購物車商品項目 */
.cart-item {
    background: #fff;
    border-radius: 0; /* 🔥 移除圓角，更接近 list-group-item */
    padding: 12px 16px; /* 🔥 從 16px 減少到 12px */
    margin-bottom: 0; /* 🔥 移除間距 */
    border-bottom: 1px solid #e9ecef; /* 🔥 加入底部邊框 */
}

    .cart-item:last-child {
        /*border-bottom: none;*/ /* 最後一個不要底部邊框 */
    }

    .cart-item:hover {
        background: #f8f9fa;
        🔥 hover 時淺灰背景
    }

/* 🔥 顏色圓圈 - 縮小 */
.color-circle {
    width: 40px; /* 從 48px 改成 40px */
    height: 40px; /* 從 48px 改成 40px */
    border-radius: 50%;
    border: 2px solid #e9ecef;
}

/* 商品編號 */
.item-code,
.text-body {
    font-size: 15px; /* 🔥 稍微縮小字體 */
    font-weight: 500;
    color: #1e293b;
    line-height: 1.2; /* 🔥 減少行高 */
}

/* 數量控制按鈕 */
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px; 
}

@media (max-width: 768px) {
    .qty-control {        
        gap: 0px;
    }
}


.btn .icon {
    margin:0;
}
    

.qty-control .btn:hover {
    background: #cdd0d5;
}

    .qty-control .qty-display {
        min-width: 35px;  
        text-align: center;
        font-size: 15px;  
        font-weight: 500;
    }

/* 價格顯示 */
.item-price {
    font-size: 15px; /* 🔥 從 16px 縮小到 15px */
    font-weight: 600;
    color: #1e293b;
}

/* 🔥 購物車列表容器 - 移除間距 */
#cartItemsList {
    margin: 0;
    padding: 0;
}

    /* 🔥 包裝購物車項目的卡片 */
    #cartItemsList .cart-items-wrapper {
        border: 1px solid #e9ecef;
        border-radius: 8px;
        overflow: hidden;
    }

/* 底部統計卡片 */
#checkoutSection .card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 送出訂單按鈕 */
.btn-danger {
    background: #dc2626;
    border: none;
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

/* 空購物車樣式調整 */
#emptyCart {
    padding: 60px 20px;
}

/* 頁面底部間距（避免被底部導航遮住）*/
.pb-5 {
    padding-bottom: 80px !important;
}

/* 🔥 清空購物車按鈕 */
#clearCartBtn, #clearCartUni {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

    #clearCartBtn, #clearCartUni :hover,
    #clearCartBtn, #clearCartUni :focus,
    #clearCartBtn, #clearCartUni :active,
    #clearCartBtn, #clearCartUni :focus-visible {
        background: none !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

        #clearCartBtn img {
            height: 28px;
            display: block;
        }


#clearCartUni {
    margin-bottom: 2px;
    --tblr-btn-icon-size: 1rem;
}

/* 商品項目脈衝動畫 */
@keyframes itemPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
        background: #f8f9fa;
    }

    100% {
        transform: scale(1);
    }
}

.cart-item.item-pulse {
    animation: itemPulse 0.3s ease-in-out;
}












/* 购物车商品项目 */
/*.cart-item {
    background: #fff;
    padding: 10px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

  
    .cart-item:hover {
        background: #f8f9fa;
    }

       */


/* =====RWD布局 ===== */

/* 桌面版：单行，隐藏移动版价格 */
/*@media (min-width: 768px) {
    .price-mobile {
        display: none !important;
    }

    .price-desktop {
        display: block !important;
    }
}*/

/* 移动版：两行，隐藏桌面版价格 */
/*@media (max-width: 767px) {
    .cart-item {
        padding: 8px 12px;
    }*/

    /* 隐藏桌面版价格 */
    /*.price-desktop {
        display: none !important;
    }*/

    /* 显示移动版价格（第二行） */
    /*.price-mobile {
        display: block !important;
        margin-top: 6px;
        padding-right: 0;
    }*/

    /* 调整元素大小 */
    /*.color-circle {
        width: 28px;
        height: 28px;
    }

    .text-body {
        font-size: 14px;
    }

    .price-formula {
        font-size: 13px;
    }

    .qty-control .btn {
        width: 24px;
        height: 24px;
    }

    .qty-control .qty-display {
        min-width: 24px;
        font-size: 13px;
    }
}*/

/* 商品项目脉冲动画 */
/*@keyframes itemPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
        background: #f8f9fa;
    }

    100% {
        transform: scale(1);
    }
}

.cart-item.item-pulse {
    animation: itemPulse 0.3s ease-in-out;
}*/





/* 購物車商品項目 */
.cart-item {
    background: #fff;
    padding: 10px 16px;
    margin-bottom: 0;
    border-bottom: 1px solid #e9ecef;
}

    .cart-item:last-child {
        border-bottom: none;
    }

    .cart-item:hover {
        background: #f8f9fa;
    }

/* 🔥 主容器：左右布局 */
.cart-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* 🔥 左側：刪除 + 顏色 + 編號（橫向） */
.cart-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

/* 🔥 右側：兩行布局 */
.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.cart-item-right-row {
    display: flex;
    justify-content: flex-end;
}

/* 顏色圓圈 */
.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    flex-shrink: 0;
}

/* 商品編號 */
.text-body {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
}

/* 數量控制 */
.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .qty-control .btn {
        width: 26px;
        height: 26px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #fff;
    }

        .qty-control .btn:hover {
            background: #f3f4f6;
            border-color: #9ca3af;
        }

    .qty-control .qty-display {
        min-width: 28px;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        color: #1e293b;
    }

/* 價格公式 */
.price-formula {
    font-size: 14px;
    white-space: nowrap;
}

/* 刪除按鈕 hover 效果 */
.btn-clearUni:hover .icon {
    stroke: #dc2626;
}

/* ===== 響應式布局 ===== */

/* 🔥 桌面版：單行布局 */
@media (min-width: 768px) {
    .cart-item-right {
        flex-direction: row; /* 🔑 改成橫向 */
        align-items: center;
        gap: 12px;
    }
}

/* 🔥 移動版：右側兩行布局 */
@media (max-width: 767px) {
    .cart-item {
        padding: 12px 16px;
    }

    .cart-item-wrapper {
        gap: 8px;
    }

    /* 右側保持兩行 */
    .cart-item-right {
        gap: 8px;
    }

    /* 調整元素大小 */
    .color-circle {
        width: 28px;
        height: 28px;
    }

    .text-body {
        font-size: 14px;
    }

    .price-formula {
        font-size: 13px;
    }

    .qty-control .btn {
        width: 24px;
        height: 24px;
    }

    .qty-control .qty-display {
        min-width: 24px;
        font-size: 13px;
    }

    .btn-clearUni .icon {
        width: 16px;
        height: 16px;
    }
}

/* 商品項目脈衝動畫 */
@keyframes itemPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
        background: #f8f9fa;
    }

    100% {
        transform: scale(1);
    }
}

.cart-item.item-pulse {
    animation: itemPulse 0.3s ease-in-out;
}

/* ========================================
   結帳區樣式
   ======================================== */
/* 結帳區卡片 */
#checkoutSection .card {
    border: none;
    box-shadow: none;
}

#checkoutSection .card-body {
    padding: 20px;
}

/* Flexbox 自動換行佈局 */
.checkout-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.checkout-info {
    display: flex;
    align-items: center;
    gap: 16px; /* 合計 和 總金額 之間的間距 */
    flex: 1; /* 佔據剩餘空間 */
    min-width: 0;
}



    .checkout-info h3 {
        color: #1e293b;
        margin: 0;
        margin-left: auto; /* 🔑 推到右邊 */
        white-space: nowrap;
    }

.checkout-action {
    flex-shrink: 0; /* 按鈕不縮小 */
}

    .checkout-action .btn {
        min-width: 140px;
    }

/* 送出訂單按鈕 */
.btn-danger {
    background: #dc2626;
    border: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

/* 桌面版：單列 */
@media (min-width: 768px) {
    #checkoutSection .card-body {
        padding: 20px 24px;
    }

    .checkout-action .btn {
        padding: 12px 48px;
    }
}

/* 移動版：強制換行 */
@media (max-width: 767px) {
    .checkout-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .checkout-info {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    

    .checkout-action {
        width: 100%;
    }

        .checkout-action .btn {
            width: 100%;
            min-width: auto;
        }
}

/* 頁面底部間距（避免被底部導航遮住）*/
#checkoutSection .pb-5 {
    padding-bottom: 80px !important;
}