/* Product Selector — consolidated styles */
:root {
    --fps-ink: #1C244C;
    --fps-border: #e4e4e4;
}

/* Selector foundation */
.fps-selector {
    width: 100%;
    color: var(--fps-ink);
    font-size: 14px;
}
.fps-selector *,
.fps-selector *::before,
.fps-selector *::after { box-sizing: border-box; }
.fps-selector .fps-heading,
.fps-selector .fps-selector-title,
.fps-selector .fps-filters label { display: none; }
.fps-selector .fps-product-card[hidden],
.fps-selector .fps-empty[hidden],
.fps-selector .fps-expand-button[hidden],
.fps-selector .fps-active-filter[hidden] { display: none !important; }

/* Filters */
.fps-selector .fps-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}
.fps-selector .fps-filters select {
    display: block;
    width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 50px 0 30px;
    border: 1px solid var(--fps-ink);
    border-radius: 999px;
    background-color: #fff;
    /* 使用自定义箭头，避免浏览器原生箭头过于靠右 */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231C244C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-position: right 22px center;
    color: #8E8E8E;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 150%;
    letter-spacing: 0%;

}
/* 选中系列/阶段后切换为深蓝色 */
.fps-selector .fps-filters select.has-value {
    color: #1C244C;
}
.fps-selector .fps-filters select option {
    color: #1C244C;
}

.fps-selector .fps-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 30px 0 30px;
}
.fps-selector .fps-active-filter-text {
    color: var(--fps-ink);
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 150%;
    letter-spacing: 0%;
    vertical-align: middle;
}
.fps-selector .fps-active-filter-name { font-weight: 700; }
.fps-selector .fps-clear-filter {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--fps-ink);
    font-size: 30px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
}
.fps-selector .fps-clear-filter:is(:hover, :focus, :active) {
    border: 0;
    background: transparent;
    color: var(--fps-ink);
    box-shadow: none;
    transform: none;
}

/* Product grid and cards */
.fps-selector .fps-product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 60px;
    row-gap: 65px;
    padding: 0 60px;
    align-items: end;
}
.fps-selector .fps-product-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--fps-ink);
    text-align: center;
    position: relative;
}
.fps-selector .fps-product-name,
.fps-selector .fps-product-spec {
    color: var(--fps-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 700;
    font-size: 26px;
    line-height: 150%;
    letter-spacing: 0%;
    text-align: center;

}
.fps-selector .fps-product-name { margin: 0; }
.fps-selector .fps-product-spec { margin: 0 0 11px; }
.fps-selector .fps-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0 0 9px;
    border: 1px solid var(--fps-border);
    border-radius: 5px;
    background: #fff;
}
.fps-selector .fps-product-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.fps-selector .fps-detail-button,
.fps-selector .fps-detail-button:is(:hover, :focus),
.fps-product-price {
    margin: 0;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 150%;
    letter-spacing: 0%;
    text-align: center;
    text-decoration: underline;
    cursor: pointer;
    background: transparent;
    box-shadow: none;
    padding: 0;
}
.fps-selector .fps-product-price {
    text-decoration: none;
    margin-bottom: 10px;
}

/* Quantity controls */
.fps-selector .fps-quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}
.fps-selector .fps-qty-minus,
.fps-selector .fps-qty-plus,
.fps-selector .fps-qty-minus:hover,
.fps-selector .fps-qty-plus:hover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;;
    height: 26px;
    padding: 0;
    border: 1px solid #000000;
    border-radius: 2px;
    background: #fff;
    color: #000000;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
}
.fps-selector .fps-qty-minus:disabled,
.fps-selector .fps-qty-plus:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.fps-selector .fps-qty-value {
    width: 32px;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0%;
    text-align: center;
    height: 28px;
    line-height: 28px;
}
.fps-selector .fps-quantity label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
}
.fps-selector .fps-qty-input {
    width: 48px !important;
    height: 42px;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: var(--fps-ink);
    font-size: 14px;
    text-align: center;
}

/* Expand and empty states */
.fps-selector .fps-expand-button,
.fps-selector .fps-expand-button:is(:hover, :focus) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    color: var(--fps-ink);
    cursor: pointer;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 700;
    font-size: 34px;
    line-height: 150%;
    letter-spacing: 0%;
    gap: 5px;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-top: 30px;
}
.fps-selector .fps-expand-button::before {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
}
/* 收起产品时，显示 − */
.fps-expand-button.is-expanded::before {
    content: '−';
}
.fps-selector .fps-empty {
    padding: 24px;
    color: var(--fps-ink);
    text-align: center;
}
.fps-selector .fps-product-dialog,
.fps-selector .fps-dialog-close { color: var(--fps-ink); }

/* Selection summary (independent shortcode) */
.fps-selection-summary {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}
.fps-selection-summary h3 {
    margin: 0 0 20px;
    color: #1d2852;
    font-size: 24px;
    text-align: center;
}
.fps-selected-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 150%;
    color: var(--fps-ink);
}
.fps-selected-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #fff;
}
.fps-selected-image {
    display: flex;
    flex: 0 0 85px;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 85px;
}
.fps-selected-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.fps-selected-info { flex: 1; min-width: 0; }
.fps-selected-name {
    font-family: "Noto Sans HK", Sans-serif;
    color: #1C244C;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.5;
}
.fps-selected-note {
    margin-top: 5px;
    color: #8E8E8E;
    font-size: 16px;
    line-height: 150%;
    white-space: pre-line;
    font-family: "Noto Sans HK", Sans-serif;
}
.fps-selected-remove,
.fps-selected-remove:is(:hover, :focus, :active) {
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #1d2852;
    font-size: 36px;
    line-height: 1;
    box-shadow: none;
    transform: none;
    transition: none;
    cursor: pointer;
}
/* 可手动输入的数量选择器 */
.fps-selector .fps-quantity-editable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 中间可编辑的数量 */
.fps-selector .fps-quantity-editable .fps-qty-input {
    width: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
    font-size: 26px;
    letter-spacing: 0%;
    text-align: center;
}

/* 隐藏浏览器默认上下箭头 */
.fps-selector .fps-qty-input::-webkit-inner-spin-button,
.fps-selector .fps-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fps-selector .fps-quantity-editable .fps-qty-input:focus {
    outline: none;
    box-shadow: none;
}

.fps-stock-notice {
    margin: 0 !important;
    color: var(--fps-ink);
    font-size: 16px;
    text-align: center;
    position: absolute;
    bottom: -30px;
    text-align: center;
    width: 100%;
    font-family: "Noto Sans HK", sans-serif;
    font-weight: 400;
}

.fps-selector .fps-no-delivery-checkbox {
    width: 26px;
    height: 26px;
    margin: 0;
    accent-color: #1C244C;
    cursor: pointer;
}

/* Redemption state: quantity unavailable while checking or already redeemed */
.fps-selector .fps-quantity[hidden] { display: none !important; }
.fps-selector .fps-redemption-status {
    margin: 0 auto;
    padding: 0px 18px;
    width: min(100%, 200px);
    border-radius: 12px;
    background: #e4e4e4;
    color: #686868;
    font-size: 18px;
    text-align: center;
}
.fps-selector .fps-redemption-status[hidden] { display: none !important; }

/* 「暫時不需要」放在展開／收起按鈕下方，始終顯示 */
.fps-selector .fps-no-delivery-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 30px auto 0;
    color: #1C244C;
    font-size: 26px;
    cursor: pointer;
    font-family: "Noto Sans HK", Sans-serif;
    font-weight: 400;
}

@media (max-width: 1024px) {
    .fps-selector .fps-filters {
        margin-bottom: 24px;
    }
    .fps-selector .fps-filters select {
        font-size: 16px;
        height: 40px;
    }
    .fps-selector .fps-active-filter-text {
        font-size: 16px;
    }
    .fps-selector .fps-clear-filter {
        font-size: 24px;
    }
    .fps-selector .fps-product-grid {
        width: 516px;
        margin: 0 auto;
        padding: 0;
        column-gap: 75px;
        row-gap: 70px;
    }
    .fps-selector .fps-product-name, .fps-selector .fps-product-spec {
        font-size: 16px;
    }
    .fps-selector .fps-product-spec {
        margin-bottom: 8px;
    }
    .fps-selector .fps-detail-button, .fps-selector .fps-detail-button:is(:hover, :focus), .fps-product-price {
        font-size: 16px;;
    }
    .fps-selector .fps-product-price {
        margin-bottom: 4px;
    }
    .fps-selector .fps-quantity {
        gap: 14px;
    }
    .fps-selector .fps-quantity-editable .fps-qty-input,
    .fps-selector .fps-qty-value {
        font-size: 16px;
        width: 24px !important;
        height: 26px;
    }
    .fps-selector .fps-redemption-status {
        font-size: 16px;
        width: min(100%, 120px);
    }
    .fps-selector .fps-qty-minus, .fps-selector .fps-qty-plus, .fps-selector .fps-qty-minus:hover, .fps-selector .fps-qty-plus:hover {
        width: 16px;
        height: 16px;
    }
    .fps-selector .fps-expand-button, .fps-selector .fps-expand-button:is(:hover, :focus) {
        font-size: 24px;
    }
    .fps-selector .fps-expand-button::before {
        width: 26px;
        height: 26px;
    }
    .fps-selected-name {
        font-size: 16px;
    }
    .fps-selected-remove, .fps-selected-remove:is(:hover, :focus, :active) {
        font-size: 30px;
    }
    .fps-selected-note {
        font-size: 12px;
    }
    .fps-stock-notice {
        font-size: 12px;
        bottom: -20px;
    }
    .fps-selector .fps-no-delivery-option,
    .fps-selected-list {
        font-size: 16px;
    }
    .fps-selector .fps-no-delivery-checkbox {
        width: 16px;
        height: 16px;
    }
}
@media (max-width: 768px) {
    .fps-selector .fps-filters select {
        font-size: 12px;
        height: 34px;
    }
    .fps-selector .fps-active-filter-text {
        font-size: 12px;
    }
    .fps-selector .fps-clear-filter {
        font-size: 20px;
    }
    .fps-selector .fps-product-grid {
        width: 335px;
        margin: 0 auto;
        padding: 0;
        gap: 35px;
    }
    .fps-selector .fps-product-name, .fps-selector .fps-product-spec {
        font-size: 12px;
    }
    .fps-selector .fps-product-spec {
        margin-bottom: 4px;
    }
    .fps-selector .fps-detail-button, .fps-selector .fps-detail-button:is(:hover, :focus), .fps-product-price {
        font-size: 12px;;
    }
    .fps-selector .fps-quantity {
        gap: 10px;
    }
    .fps-selector .fps-quantity-editable .fps-qty-input,
    .fps-selector .fps-qty-value {
        font-size: 12px;
        width: 24px !important;
        height: 20px;
    }
    .fps-selector .fps-qty-minus, .fps-selector .fps-qty-plus, .fps-selector .fps-qty-minus:hover, .fps-selector .fps-qty-plus:hover {
        width: 14px;
        height: 14px;
    }
    .fps-selector .fps-expand-button, .fps-selector .fps-expand-button:is(:hover, :focus) {
        font-size: 15px;
    }
    .fps-selector .fps-expand-button::before {
        width: 20px;
        height: 20px;
    }
    .fps-selected-name {
        font-size: 12px;
    }
    .fps-selected-remove, .fps-selected-remove:is(:hover, :focus, :active) {
        font-size: 24px;
    }
    .fps-selected-note {
        font-size: 12px;
    }
    .fps-selector .fps-redemption-status {
        font-size: 12px;
        width: 80px;
    }
    .fps-stock-notice {
        font-size: 9px;
        bottom: -20px;
    }
    .fps-selector .fps-no-delivery-option,
    .fps-selected-list {
        font-size: 12px;
    }
    .fps-selector .fps-no-delivery-checkbox {
        width: 12px;
        height: 12px;
    }
}

