﻿/* css/product-configurator.css */

/* --- 1. 預覽區 (共用) --- */
.product-preview-container {
    position: sticky;
    top: 100px;
    background-color: transparent;
    border-radius: 12px;
    padding: 20px;
    box-shadow: none;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-stack {
    position: relative;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16/9;
}

    .image-stack img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: auto;
        transition: opacity 0.3s ease;
    }

/* 圖層順序 (Z-Index) */
#layer-frame {
    z-index: 55;
}

#layer-rim {
    z-index: 20;
}

#layer-tire {
    z-index: 30;
}

#layer-fender {
    z-index: 40;
}

#layer-box {
    z-index: 50;
}

#layer-handlebar {
    z-index: 60;
}

/* --- 2. 選項容器 (共用) --- */
#options-container {
    background-color: transparent;
}

.option-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    background-color: transparent;
}

    .option-group:last-child {
        border-bottom: none;
    }

.option-group-title,
.group-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    color: #333;
}

.option-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* --- 3. 樣式 A: Grid 方塊按鈕 (product_minica.aspx 用) --- */
.option-btn {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    width: 100%;
}

    .option-btn:hover {
        border-color: #aaa;
        transform: translateY(-2px);
    }

    .option-btn.active {
        border-color: #000;
        background-color: #fff;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .option-btn img {
        width: 100%;
        height: 60px;
        object-fit: contain;
        margin-bottom: 5px;
    }

.option-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
}

/* --- 4. 樣式 B: Radio 圓形/文字按鈕 (Radio 版本用) --- */
.btn-check {
    position: absolute;
    clip: rect(0,0,0,0);
    pointer-events: none;
}

/* 圓形色票 */
.swatch-label {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 2px solid #e9ecef;
    transition: all 0.2s ease;
    background-color: #fff;
}

    .swatch-label:hover {
        transform: scale(1.1);
        border-color: #ccc;
    }

.btn-check:checked + .swatch-label {
    border-color: #FB8500;
    box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.2);
    transform: scale(1.1);
}

/* 純文字 Radio */
.text-radio-label {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.6);
}

.btn-check:checked + .text-radio-label {
    background-color: #FB8500;
    color: white;
    border-color: #FB8500;
}

.selected-label-text {
    font-size: 0.9rem;
    color: #FB8500;
    font-weight: 600;
}

/* --- 5. 數量輸入區塊樣式 --- */
.quantity-group {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #eee;
}

    .quantity-group .form-label {
        font-size: 1rem;
        color: #333;
        margin-bottom: 10px;
    }

    .quantity-group .form-control {
        font-size: 1.1rem;
        font-weight: 600;
        text-align: center;
        padding: 12px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        transition: all 0.2s;
    }

        .quantity-group .form-control:focus {
            border-color: #FB8500;
            box-shadow: 0 0 0 3px rgba(251, 133, 0, 0.1);
        }

/* --- 6. 底部總結區 --- */
.summary-box {
    background-color: rgba(26, 26, 26, 0.9);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 30px;
}

    .summary-box.light {
        background-color: rgba(248, 249, 250, 0.8);
        color: #333;
        border: 1px solid #eee;
    }

/* --- 純文字按鈕樣式調整 --- */
#group-handlebar .option-btn img,
#group-fender .option-btn img,
#group-tire .option-btn img,
#group-rim .option-btn img,
#group-powertrain .option-btn img {
    display: none;
}

#group-handlebar .option-btn,
#group-fender .option-btn,
#group-tire .option-btn,
#group-rim .option-btn,
#group-powertrain .option-btn {
    height: auto;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
}

#group-handlebar .option-name,
#group-fender .option-name,
#group-tire .option-name,
#group-rim .option-name,
#group-powertrain .option-name {
    font-size: 1rem;
    margin-bottom: 0;
}

/* --- Configurator Controls 區域樣式優化 --- */
.configurator-controls {
    background-color: #DFDFDFAD;
    border-radius: 20px;
    padding: 30px;
    margin: 60px 20px 0 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* Grid 版色票用：整塊填色的按鈕 */
.option-btn.swatch-tile {
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    background-size: cover;
    background-position: center;
}

    .option-btn.swatch-tile.active {
        border-color: #000;
        box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    }

#group-powertrain .swatch-tile {
    border: 1px solid #ccc !important;
    background-color: #fff !important;
    color: #333;
}

/* --- Accessories 配件選項 --- */
.accessories-group .option-group-title {
    margin-bottom: 10px;
}

/* 每一格配件按鈕外觀 */
.accessories-table .accessory-label {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #000;
    background-color: #fff; /* 未選：白底 */
    color: #000; /* 未選：黑字 */
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

    /* hover 微浮起 */
    .accessories-table .accessory-label:hover {
        transform: translateY(-1px);
    }

/* 已選：黑底白字 */
.btn-check:checked + .accessory-label {
    background-color: #000;
    color: #fff;
}
.config-table .config-label {
    width: 220px;
}


/* --- 五組純色塊（非 DMO）文字強制白色 --- */
#group-handlebar .option-name,
#group-fender .option-name,
#group-tire .option-name,
#group-rim .option-name {
    color: #fff !important;
}

/* --- BOX 圖示放大，盡量填滿格子 --- */
#group-box .option-btn {
    padding: 6px; /* 少一點內距，留更多空間給圖片 */
}

    #group-box .option-btn img {
        height: 90px; /* 比原本 60px 高一點 */
        width: 100%;
        object-fit: contain; /* 保持等比例 */
    }

/* --- Powertrain System：按鈕加寬、文字顯示完整 --- */
#group-powertrain .option-btn {
    min-width: 220px; /* 每顆至少 220px 寬 */
}

#group-powertrain .option-name {
    white-space: nowrap; /* 不換行 */
    text-overflow: clip; /* 不要顯示 ... */
    overflow: visible;
    font-size: 1rem;
}

