/* Base responsive layout */
html, body {
    color: #322E21;
    font-family: 'Noto Sans TC', 'Noto Sans', sans-serif;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    -webkit-tap-highlight-color: rgba(0, 73, 31, 0.15);
}

.no-scroll {
    overflow: hidden;
}

/* Container for the entire page */
.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF;
}

.intro-title {
    font-size: 24px;
}

/* Header styling with responsive design */
.product-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    border-bottom: 1px solid #ddd;
}

/* Logo container */
.logo {
    display: flex;
    align-items: center;
}

.logo a {
    display: block;
}

.logo img {
    height: auto;
    width: auto;
    max-height: 40px;
    max-width: 50%; /* Ensures logo doesn't overflow container */
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-toggle {
    color: black;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    background: white;
}

.lang-toggle:hover {
    color: #00491f;
}

.lang-text {
    font-size: 18px;
    width: fit-content;
    font-weight: 400;
    white-space: nowrap;
}

/* Icons container */
.icon-wrap {
    display: flex;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.icon-wrap img {
    height: 25px;
    width: 25px;
    object-fit: contain;
    background: transparent;
}

.product {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 0;
    flex: 1;
}

.product-box {
    width: 60%;
    max-width: 60%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background-color: #F6F5F1;
}

.product-box-bd {
    display: flex;
    justify-content: center; /* centers horizontally */
    align-items: center;     /* centers vertically if you want */
    width: 100%;
    box-sizing: border-box;
    position: relative;
    /* Optional: set a min-height if you want vertical centering to be visible */
}

.bd1 {
    width: 80%;
    max-width: 80%;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center; /* center inner content horizontally */
}

.bd-img0 {
    width: 100%;
    max-width: 100%;
    display: block;
    object-fit: contain;
    background-color: transparent;
}

/* Overlay images are decorative — let touches pass through to plus buttons */
[id^="img"] {
    pointer-events: none;
}

.plus {
    position: absolute;
    width: 120px;
    height: 120px;
    padding: 0;
    border: none;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    transform: translate(-50%, -50%);
    outline: none;
    touch-action: manipulation;
}

.plus:focus {
    outline: none;
    box-shadow: none;
}

.plus img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.plus-pos1 {
    top: 36%;    /* Adjust these percentages to position the button */
    left: 12%;  /* Adjust these percentages to position the button */
}

/* A2 */
.overlay-area1 {
    position: absolute;
    width: 18.5%;
    height: 18.5%;
    left: 1%;
    top: 24%;
    z-index: 30;
}

.plus-pos2 {
    top: 28%;    /* Adjust these percentages to position the button */
    left: 35.5%;  /* Adjust these percentages to position the button */
}

/* A1 */
.overlay-area2 {
    position: absolute;
    width: 34.5%;
    height: 26.1%;
    left: 18%;
    top: 14.5%;
    z-index: 40;
}

.plus-pos3 {
    top: 23%;    /* Adjust these percentages to position the button */
    left: 65.5%;  /* Adjust these percentages to position the button */
}

/* B1 */
.overlay-area3 {
    position: absolute;
    width: 30%;
    height: 18.5%;
    left: 50%;
    top: 12.5%;
    z-index: 30;
}

.plus-pos4 {
    top: 28.5%;    /* Adjust these percentages to position the button */
    left: 87.5%;  /* Adjust these percentages to position the button */
}

/* B2 */
.overlay-area4 {
    position: absolute;
    width: 18.5%;
    height: 18.5%;
    left: 80%;
    top: 17.5%;
    z-index: 30;
}

.plus-pos5 {
    top: 35%;    /* Adjust these percentages to position the button */
    left: 65.5%;  /* Adjust these percentages to position the button */
}

/* C */
.overlay-area5 {
    position: absolute;
    width: 59.5%;
    height: 30%;
    left: 20.4%;
    top: 11.9%;
    z-index: 20;
}

.plus-pos6 {
    width: 400px;
    height: 120px;
    top: 47%;    /* Adjust these percentages to position the button */
    left: 52%;  /* Adjust these percentages to position the button */
}

.plus-pos6:focus {
    outline: none;
    box-shadow: none;
}

/* D2 */
.overlay-area6 {
    position: absolute;
    width: 79%;
    height: 23%;
    left: 12%;
    top: 38.5%;
    z-index: 30;
}

.plus-pos7 {
    width: 400px;
    height: 220px;
    top: 68%;    /* Adjust these percentages to position the button */
    left: 52%;  /* Adjust these percentages to position the button */
    outline: none;
    box-shadow: none;
}

.plus-pos7:focus {
    outline: none;
    box-shadow: none;
}

/* D1 */
.overlay-area7 {
    position: absolute;
    width: 75.5%;
    height: 41%;
    left: 13.8%;
    top: 53.3%;
    z-index: 20;
}


.plus2-pos1 { top: 30.5%; left: 9%; position: absolute;}
.plus2-pos2 { top: 23%; left: 32%; position: absolute;}
.plus2-pos3 { top: 18%; left: 62%; position: absolute;}
.plus2-pos4 { top: 24%; left: 85%; position: absolute;}
.plus2-pos5 { top: 29.5%; left: 62%; position: absolute;}
.plus2-pos6 { top: 43%; left: 50%; position: absolute;}
.plus2-pos7 { top: 64%; left: 50%; position: absolute;}

.share-btn {
    position: absolute;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    background: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.share-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.share-btn-pos {
    position: absolute;
    top: 85%;    /* Adjust these percentages to position the button */
    left: 83%;  /* Adjust these percentages to position the button */
}

.front_back_text {
    display: block;
    font-size: 18px;
    color: #959794;
}

.front_back_pos {
    position: absolute;
    top: 84%;    /* Adjust these percentages to position the button */
    left: 9.5%;  /* Adjust these percentages to position the button */
}

.right-box-wrapper {
    width: 40%;
    max-width: 40%;
    min-width: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden; /* 禁止水平滾動 */
    padding-bottom: 200px; /* Add padding to allow more scroll space */
}

.main-tabs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    min-height: 50px;
    position: sticky;
    top: 0;
    z-index: 11;
    background-color: white;
    border-bottom: 1px solid #ddd;
}

.main-tabs-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-tab-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #00491f;
    cursor: pointer;
    padding: 10px 8px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    touch-action: manipulation;
}

.main-tab-btn.active {
    color: #00491f;
    border-bottom: 2px solid #f5c300;
}

#fabric-link {
    font-size: 14px;
    color: #00491f;
    text-decoration: none;
    white-space: nowrap;
}

.inspiration-search-wrapper {
    display: flex;
    align-items: center;
    margin: 12px 10px 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background-color: #f7f7f7;
}

.inspiration-search-icon {
    font-size: 14px;
    margin-right: 8px;
    color: #888;
    flex-shrink: 0;
}

.inspiration-search-input {
    border: none;
    background: none;
    outline: none;
    font-size: 16px;
    color: #333;
    width: 100%;
}

.inspiration-search-input::placeholder {
    color: #aaa;
}

.option_box {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 0 10px 0 10px;
    min-height: 60px;
    position: sticky;
    top: 50px; /* offset below main-tabs-row */
    z-index: 10; 
    background-color: white;
    border-bottom: 1px solid #ddd;
}

.option_box::after {
    content: '';
    display: inline-block;
    width: 20px; /* 想要多的空白 */
    flex-shrink: 0;
}

.scroll-wrapper {
    margin-top: 10px;
    position: relative;
    display: flex;
    justify-content: center; /* 水平置中 */
    align-items: center;
    width: 100%;
}

.custom-scroll {
    position: absolute;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    user-select: none;
    margin-bottom: 10px;
    width: 100%;
    max-width: 50px;
    left: 50%;
}

.scroll-thumb {
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;                 /* 初始寬度；JS 會覆蓋 */
    background: #666666;
    border-radius: 3px;
    cursor: grab;
    transition: background 0.2s;
}

.scroll-thumb:active { cursor: grabbing; }

.option_box_item {
    flex: 0 0 auto;           /* 不固定寬度，讓內容決定 */
    width: fit-content;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 22px;
    color: #b0b0b0;
    touch-action: manipulation;
    transition: color 0.3s, font-weight 0.3s;
    margin-bottom: 10px;
    margin-top: 15px;
}

.option_box_item.active {
    color: black;
}

.option-wrapper {
    margin-top: 0;
    /*border-top: 1px solid #ddd;*/
    min-height: 100%;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.option-wrapper-title-wrapper {
    position: relative;
    display: flex;
    height: 65px;
}

.option-wrapper-title {
    position: absolute;
    font-size: 20px;
    padding: 10px;
    margin: 10px 0 10px 10px; /* top right bottom left */
    cursor: pointer;
    text-align: left;
    transition: color 0.3s, font-weight 0.3s;
    left: 0%;
    top: 0%;
    
}

#solid-title-description,
#pattern-title-description {
    position: absolute;
    color: #959794;
    font-size: 14px;
    padding: 10px;
    margin: 17px 0 10px 10px; /* top right bottom left */
    cursor: pointer;
    text-align: left;
    transition: color 0.3s, font-weight 0.3s;
    left: 16%;
    top: 0%;
    align-items: flex-end;
}

.fabric-link-wrapper {
    position: absolute;
    font-size: 14px;
    padding: 10px;
    margin: 17px 0 10px 10px; /* top right bottom left */
    cursor: pointer;
    text-align: left;
    transition: color 0.3s, font-weight 0.3s;
    right: 2%;
    top: 0%;
    align-items: flex-end;
}

#fabric-link {
    font-size: 14px;
    text-decoration: none;
    color: #0a8bd4; /* 或自訂顏色 */
}

.hyperLink {
    text-decoration: none;
    color: #0a8bd4; /* 或自訂顏色 */
}

.cover-increase-btn, .sheet-increase-btn, .pillow-increase-btn {
    padding-top: 4px;
}

.color-list-wrapper {
    padding-left: 20px;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    scrollbar-width: none;
}

.color-list-wrapper::-webkit-scrollbar {
    height: 0px; /* Chrome/Safari 隱藏 scrollbar */
}

/* Color swatch itself */
.color-swatch {
    width: 55px;
    height: 55px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); /* X, Y, 模糊, 顏色 */
    border-radius: 4px;
}

/* Selected color swatch highlight */
.color-item.selected {
    overflow: visible;
}
.color-item.selected .color-swatch {
    outline: 2px solid #000;
    outline-offset: -2px;
    border-radius: 4px;
}

/* Each color item */
.color-item {
    display: inline-block;
    width: 60px; /* Width of each color swatch */
    height: 60px; /* Height of each color swatch */
    overflow: hidden; /* Ensures the content is clipped to fit the item */
    position: relative; /* To handle hover effects inside */
    cursor: pointer; /* Makes the swatch clickable */
}

.color-list {
    margin: 0 0 10px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, 60px); /* Responsive */
    grid-auto-rows: 60px;
    max-height: calc(60px * 4 + 10px * 3);
    gap: 5px;
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 100%; /* 讓它隨父容器變化 */
    box-sizing: border-box;
}

.pagination-dots {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: #333;
}

#purchase-box {
    padding-top: 10px;
}

.order-box {
    position: fixed;
    bottom: 0;
    width: 40%;
    padding: 20px;
    box-sizing: border-box;
    border-top: 1px solid #ddd;
    background-color: white;
}

.btn-wrapper {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    background-color: white;
}

.btn-wrapper button {
    font-size: 22px;
    padding: 21px;
    line-height: 21px;
    border: 1px solid #C9CEDA;
    align-items: center;
    overflow: visible;
    cursor: pointer;
    letter-spacing: -0.18px;
    flex: 1;
    white-space: nowrap;
}

.change-option-btn {
    background-color: transparent;
    color: #00491f;
    white-space: nowrap;
    max-width: 100%;
    font-size: clamp(12px, 2vw, 20px);
}

.change-option-btn:hover {
    background-color: #00491f;
    color: white;
}

#next-step-btn {
    padding-top: 21px;
    height: 63px;
}

.finish-option-btn {
    background-color: #00491f;
    color: white;
    white-space: nowrap;
    max-width: 100%;
    font-size: clamp(12px, 2vw, 20px);
}

#color-price-label {
    font-size: 16px;
    margin-bottom: 5px;
}



.price-wrapper {
    margin: 10px 0;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.size-wrapper {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.size-option {
    text-align: center;
    margin: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 60%;
}

.size-option:hover {
    background-color: #f5f5f5;
    border-color: #00491f;
}

.size-option.selected {
    background-color: #00491f;
    color: white;
    border-color: #00491f;
}

.custom-size-input:focus {
    outline: none;
    border-color: #00491f;
}

.custom-size-inputs-row {
    justify-content: space-between;
    width: 60%;
    display: flex;
    gap: 10px;
    margin: 5px;
}

.custom-size-input {
    min-width: 0;
    flex: 1;                   /* 平均分配空間 */
    height: 30px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0; 
    box-sizing: border-box; 
}

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

/* Firefox */
.custom-size-input {
    -moz-appearance: textfield;
}

.purchase-item {
    padding-left: 10px;
}

.purchase-item-label {
    padding-left: 10px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 0px;
}

.purchase-item-description {
    padding-left: 10px;
    cursor: pointer;
    margin-top: 5px;
}

.quantity-wrapper {
    display: flex;
    align-items: center; 
    justify-content: left;
    padding-right: 25px;
    gap: 10px;
    padding-left: 10px;
}

.quantity-wrapper-inner {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #ccc;
    overflow: hidden;
    background-color: white;
}

.divider {
    width: 1px;
    background-color: #ccc;
}

.quantity-wrapper-inner button {
    width: 30px;
    height: 30px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    border: none;
    color: #322E21;
}

.quantity-wrapper input {
    width: auto;                      /* 自動寬度 */
    min-width: 2.5ch;                 /* 至少容納兩位數 */
    max-width: 4ch; 
    font-size: 16px;
    text-align: center;
    padding: 2px 5px;
    border: none;
    appearance: textfield; 
}

/* Chrome、Safari、Edge */
.quantity-wrapper input::-webkit-outer-spin-button,
.quantity-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
.quantity-wrapper input[type="number"] {
    -moz-appearance: textfield;
}

.pillow-decrease-btn, .sheet-decrease-btn, cover-decrease-btn {
    margin-bottom: 3px;
}

.price {
    font-size: 18px;
    color: black;
}

.floating-price-wrapper {
    display: none;
    position: fixed;
    right: 20px;
    bottom: 190px;
    z-index: 999;
    background-color: #f0f0f0; /* 淺灰背景 */
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: 'Noto Sans TC', sans-serif;
    color: #00491f;
    width: 145px;
    justify-content: center;  /* 水平置中 */
}

.floating-price-wrapper.collapsed {
    transform: translateX(158px); /* 收合狀態 - 只留一點按鈕 */
}


.toggle-button {
    background-color: #00491f;
    color: white;
    border: none;
    width: 25px;
    height: 60px;
    cursor: pointer;
    text-orientation: mixed;
    border-radius: 6px 0 0 6px;
    position: absolute;
    left: -25px;
    top: 10px;
}

.floating-price-wrapper img {
    width: 40px;
    height: 40px;
}

.cart-text-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    font-size: 16px;
    margin: 10px;
    text-align: center;
}

.total-price-wrapper {
    background-color: white;
    border-radius: 8px;
    padding: 5px 6px;
}

.total-price {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-size: 12px;
    align-items: center;
}

.total-price:last-child {
    margin-top: 8px;
    border-top: 1px dotted #ccc;
    padding-top: 6px;
    font-weight: bold;
}

.total-price span {
    flex-shrink: 0;
    
}

.price-label {
    flex: 0 0 40%;
    text-align: left;
}

.price-currency {
    flex: 0 0 20%;
    text-align: center;
}

.price-value {
    flex: 0 0 40%;
    text-align: right;
}

.intro-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: inline-block;
}


/* Responsive: stack vertically on small screens */
@media (max-width: 1000px) {
    .no-scroll {
        overflow: visible;
    }

    .share-btn-pos {
        position: absolute;
        top: 85%;    /* Adjust these percentages to position the button */
        left: 83.5%;  /* Adjust these percentages to position the button */
    }

    .front_back_pos {
        top: 84%;    /* Adjust these percentages to position the button */
        left: 10%;  /* Adjust these percentages to position the button */
    }
    
    .plus {
        width: 40px;
        height: 40px;
    }

    .plus img {
        width: 30px;
        height: 30px;
    }

    .product-box-header {
        position: absolute;
        height: 65px;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100; /* 確保比 .order-box 還高 */
        background-color: transparent; /* 避免透明蓋不住底層 */
        border-bottom: none;
    }

    .product {
        flex-direction: column;
    }
    .product-box,
    .right-box-wrapper {
        max-width: 100%;
        width: 100%;
    }
    .logo img {
        margin-top: 0px;
        height: auto;
        width: auto;
        max-height: 35px;
        max-width: 50%; /* Ensures logo doesn't overflow container */
    }

    .lang-toggle {
        color: black;
        border: none;
        border-radius: 2px;
        padding: 6px 10px;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.3s;
        background: transparent;
    }

    .icon-wrap img {
        width: 18px;
        height: 18px;
    }

    .share-btn img {
        width: 35px;
        height: 35px;
        object-fit: contain;
        display: block;
    }

    .order-box {
        width: 100%;
        z-index: 99;
        background-color: #FFFFFF;
    }
}

@media (max-width: 500px) {
    .no-scroll {
        overflow: hidden;
    }

    .intro-title {
        font-size: 22px;
    }
    
    .plus {
        width: 42px;
        height: 42px;
    }

    .plus img {
        width: 22px;
        height: 22px;
    }

    .plus-pos6 {
        width: 240px;
        height: 40px;
    }

    .plus-pos7 {
        width: 240px;
        height: 80px;
    }

    .product-box-header {
        position: absolute;
        height: 43px;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100; /* 確保比 .order-box 還高 */
        background-color: transparent; /* 避免透明蓋不住底層 */
        border-bottom: none;
    }

    .product {
        flex-direction: column;
        /* Base rule sets `flex: 1` (flex-basis: 0%), and flex-basis OVERRIDES
           height on a flex item — so height:100dvh was ignored and .product
           grew to its content (whole layout taller than the screen, clipped
           by body overflow:hidden, unscrollable on Android). flex:none lets
           the height below actually apply and pin the layout to the viewport. */
        flex: none;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .product-box {
        position: sticky;
        flex-shrink: 0;
        max-width: 100%;
        width: 100%;
        padding-top: 25px;
        padding-bottom: 14px;
    }

    .right-box-wrapper {
        max-width: 100%;
        width: 100%;
        /* Block inside, not flex: as a flex column with a constrained height,
           Blink (Android Chrome) shrinks the children (their min-height
           computes to 0) to exactly fit, so content never overflows and the
           panel can never scroll. Block flow stacks children at natural
           height so overflow — and scrolling — works. As a flex ITEM of
           .product, `flex:1 + min-height:0` (no height:0) is the standard
           scroll-container pattern on both Blink and WebKit. */
        display: block;
        flex: 1;
        min-height: 0;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 80px;
    }

    .custom-scroll{
        display: none;
    }

    .main-tabs-row {
        position: sticky;
        top: 0;
        z-index: 11;
    }

    .option_box {
        padding: 0 20px 0 10px;
        position: sticky;
        top: 50px;
        z-index: 10;
    }

    #tab-panel-inspiration {
        /* No nested scroller: under the block-flow wrapper this panel just
           flows at natural height and the wrapper is the single scroll
           container for both tabs. (flex:1/height:0 here would compute to a
           0-height box under a block parent.) */
        padding-bottom: 100px;
    }

    .inspiration-search-wrapper {
        position: sticky;
        top: 50px; /* stick below .main-tabs-row inside the wrapper scroll */
        z-index: 9;
        background-color: #F6F5F1;
    }

    .option-wrapper-title {
        font-size: 16px;
    }

    #default-sets-label {
        font-size: 16px;
    }

    #solid-title-description,
    #pattern-title-description {
        margin: 15px 0 10px 10px; /* top right bottom left */
        left: 17.5%;
        font-size: 12px;
    }

    .fabric-link-wrapper {
        margin-top: 12px;
    }

    #fabric-link {
        margin: 12px 0 10px 10px; /* top right bottom left */
        font-size: 12px;
    }


    .option_box_item {
        font-size: 20px;
        margin-bottom: 5px;
        margin-top: 0;
        padding-left: 10px;
        padding-right: 0px;
    }

    .option-wrapper {
        padding-bottom: 100px;
        overflow-y: visible;
    }

    .front_back_pos {
        top: 80%;    /* Adjust these percentages to position the button */
        left: 7%;  /* Adjust these percentages to position the button */
    }

    .share-btn-pos {
        top: 79.5%;    /* Adjust these percentages to position the button */
        left: 81%;  /* Adjust these percentages to position the button */
    }

    .logo img {
        margin-top: 0px;
        height: auto;
        width: auto;
        max-height: 35px;
        max-width: 40%; /* Ensures logo doesn't overflow container */
    }

    .cover-increase-btn, .sheet-increase-btn, .pillow-increase-btn {
        padding-top: 0px;
    }

    .header-buttons {
        gap: 6px;
    }

    .lang-text {
        font-size: 14px;
        width: fit-content;
        font-weight: 400;
        white-space: nowrap;
    }

    .lang-toggle {
        background: transparent;
        color: black;
        border: none;
        border-radius: 3px;
        padding: 4px 8px;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.3s;
    }
    
    .color-list-wrapper {
        padding-left: 20px;
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 20px;
    }

    .color-swatch {
        width: 45px;
        height: 45px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); /* X, Y, 模糊, 顏色 */
        border-radius: 4px; /* 可選，加上圓角讓陰影更柔和 */
    }
    .color-item {
        width: 50px;
        height: 50px;
    }

    .color-list {
        margin: 0 0 10px 10px;
        display: grid;
        grid-template-columns: repeat(auto-fit, 50px); /* Responsive */
        grid-auto-rows: 50px;
        max-height: calc(50px * 4 + 10px * 2);
        width: 100%;
        gap: 2px;
        flex: 0 0 auto;
        scroll-snap-align: start;     /* 每頁貼齊開頭 */
        box-sizing: border-box;
    }
    
    .icon-wrap img {
        width: 16px;
        height: 16px;
    }

    .floating-price-wrapper.collapsed {
        transform: translateX(155px); /* 收合狀態 - 只留一點按鈕 */
    }
    

    #purchase-box {
        padding-top: 10px;
        padding-bottom: 500px;
    }

    #next-step-btn {
        padding-top: 16px;
        height: 50px;
    }

    .front_back_text {
        font-size: 12px;
        color: #959794;
    }

    .share-btn img {
        width: 20px;
        height: 20px;
        object-fit: contain;
        display: block;
    }

    .size-option {
        width: 50%;
    }

    .custom-size-inputs-row {
        width: 50%;
    }

    .order-box {
        width: 100%;
        z-index: 99;
        background-color: #FFFFFF;
        padding-bottom: 10px;
        padding-top: 10px;
    }

    .custom-size-input {
        width: 60px;
    }

    .btn-wrapper button {
        font-size: 18px;
        padding: 16px;
        line-height: 18px;
        border: 1px solid #C9CEDA;
        align-items: center;
        overflow: visible;
        cursor: pointer;
        letter-spacing: -0.18px;
        flex: 1;
        white-space: nowrap;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .floating-price-wrapper {
        display: none;
        position: fixed;
        right: 20px;
        bottom: 155px;
        z-index: 999;
        background-color: #f0f0f0; /* 淺灰背景 */
        border-radius: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        font-family: 'Noto Sans TC', sans-serif;
        color: #00491f;
        width: 135px;
    }

    .cart-text-wrapper {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: bold;
        font-size: 14px;
        margin-bottom: 12px;
        text-align: center;
    }

    .cart-text-wrapper img {
        width: 32px;
        height: 32px;
    }

    .total-price {
        font-size: 11px;
    }
}

.material-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 30px;
}

.slide-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1;
}

.slide-btn img {
    width: 20px;
    height: 20px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.slide-btn:hover img {
    opacity: 1;
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

.order-modal-btn {
    background: none;
    border: none;
    color: #00491f;  /* 深綠色，可依實際調整 */
    cursor: pointer;
    font-family: 'Noto Sans TC', sans-serif;
    padding: 5px 10px;
    transition: color 0.2s ease;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px; /* 水平或垂直都適用 */
    margin-top: 10px;
    margin-bottom: 10px;
}

/* ===== Chat Widget ===== */

#chat-widget-wrapper {
    z-index: 9990;
}

#chat-toggle-tab {
    background: transparent;
    background-color: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    position: fixed;
    bottom: 130px;
    right: 16px;
    z-index: 9990;
    transition: transform 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

#chat-toggle-tab:hover {
    transform: scale(1.1);
}

#chat-toggle-tab img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#chat-panel {
    position: fixed;
    bottom: 188px;
    right: 20px;
    z-index: 9991;
    width: 370px;
    height: 520px;
    pointer-events: auto;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Noto Sans TC', sans-serif;
}

#chat-panel.open {
    display: flex;
}

#chat-header {
    background-color: #00491f;
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#chat-header-title {
    font-size: 15px;
    font-weight: 600;
}

#chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f9f7f4;
}

.chat-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-msg.bot {
    align-self: flex-start;
    background-color: #eae6e0;
    color: #322E21;
    border-bottom-left-radius: 4px;
}

.chat-msg.user {
    align-self: flex-end;
    background-color: #00491f;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.error {
    align-self: flex-start;
    background-color: #fdecea;
    color: #b71c1c;
    border-bottom-left-radius: 4px;
    font-size: 13px;
}

.chat-category-chips,
.chat-question-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.chat-chip {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #00491f;
    background-color: white;
    color: #00491f;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
    line-height: 1.3;
}

.chat-chip:hover {
    background-color: #00491f;
    color: white;
}

.chat-back-btn {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid #999;
    background-color: white;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 4px;
}

.chat-back-btn:hover {
    background-color: #f0f0f0;
}

#chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #e8e4df;
    background-color: #ffffff;
    flex-shrink: 0;
    gap: 8px;
}

#chat-input {
    flex: 1;
    border: 1px solid #d0ccc5;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 14px;
    font-family: 'Noto Sans TC', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #00491f;
}

#chat-send-btn {
    background-color: #00491f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

#chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

.chat-typing-indicator {
    align-self: flex-start;
    padding: 10px 14px;
    background-color: #eae6e0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.chat-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #999;
    animation: chatTypingBounce 1.4s infinite;
}

.chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTypingBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Chat mobile responsive */
@media (max-width: 500px) {
    #chat-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 210px);
        bottom: 152px;
        right: 12px;
        border-radius: 12px;
    }

    #chat-toggle-tab {
        width: 48px;
        height: 48px;
        bottom: 90px;
        right: 12px;
    }
}
