.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    overflow-y: auto;
    padding: 30px;
    box-sizing: border-box;
}

.lightbox-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-radius: 25px;
}

.lightbox-closebutton {
    position: absolute;
    transform: translate(50%, -50%);
    right: 0px;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    z-index: 10;
    transition: background 0.3s;
}

.lightbox-closebutton:hover {
    background: rgba(0, 0, 0, 0.8);
}

.lightbox-header {
    background: #4B807A;
    padding: 30px;
    color: white;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
}

.content-top {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
    padding-bottom: 5%;
}

.partner-logo {
    width: calc(50% - 15px);
    /* 扣掉 gap 的一半 */
    display: flex;
    justify-content: center;
    align-items: center;
    /* 讓圖片在容器內垂直居中 */
    background: #F9F9F9;
}

.partner-logo img {
    width: 60%;
    object-fit: contain;
}

.partner-info {
    width: calc(50% - 15px);
    /* 扣掉 gap 的一半 */
}

.lightbox-content-title {
    font-size: 24px;
    margin: 5% auto 4% auto;
    padding-bottom: 5px;
    border-bottom: 2px solid #4B807A;
    letter-spacing: 3px;
    width: fit-content;
}

.partner-info h2 {
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: bold;
}

.partner-description {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 10% 0;
    opacity: 0.9;
}

.partner-location {
    font-size: 12px;
    margin: 0;
    opacity: 0.8;
}

.lightbox-content h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3%;
    letter-spacing: 3px;
}

.lightbox-content h1 img {
    width: 40px;
}

.lightbox-content {
    padding: 30px;
    max-height: 70vh;
    overflow-y: scroll;
    /* 改成 scroll 強制顯示 */
    scrollbar-gutter: stable;
    /* 保持 scrollbar 空間 */
}

.lightbox-content h2 {
    text-align: center;
    color: #2C2F33;
}

.lightbox-content h3 {
    font-size: 18px;
    margin: 0 0 20px 0;
    color: #2C2F33;
    text-align: center;
}

.earn-method {
    margin-bottom: 30px;
}

.earn-item {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    padding: 10px 15px;
    background: #ECECED;
    align-items: center;
}

.earn-type {
    color: #4B807A;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.earn-desc {
    font-size: 14px;
    line-height: 1.5;
}

.terms-section {
    border: 1px solid #ECECED;
    overflow: hidden;
    margin-top: 30px;
}

.terms-table {
    width: 100%;
    border-collapse: collapse;
}

.terms-table tr {
    border-bottom: 1px solid #ECECED;
}

.terms-table tr:last-child {
    border-bottom: none;
}

.nav-item {
    width: 150px;
    padding: 20px 15px;
    background: #BEB79C;
    color: white;
    text-align: center;
    vertical-align: middle;
}

.terms-content-item {
    padding: 20px;
    background: white;
    line-height: 1.6;
    vertical-align: middle;
}

.terms-content-item p.topic {
    color: #4B807A;
}

.terms-content-item p,
.terms-content-item ol,
.terms-content-item ul {
    font-size: 14px;
    margin: 0px;
    color: unset;
}

.terms-content-item p:last-child {
    margin-bottom: 0;
}

.terms-content-item a {
    color: #4B807A;
    text-decoration: underline;
}

/* 客製化 Scrollbar */
.lightbox-content::-webkit-scrollbar {
    width: 8px;
}

.lightbox-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.lightbox-content::-webkit-scrollbar-thumb {
    background: #4B807A;
    transition: background 0.3s;
}

.lightbox-content::-webkit-scrollbar-thumb:hover {
    background: #3a6660;
}

/* 整個 lightbox 的 scrollbar 也可以客製化 */
.lightbox::-webkit-scrollbar {
    width: 10px;
}

.lightbox::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox::-webkit-scrollbar-thumb {
    background: #4B807A;
    transition: background 0.3s;
}

.lightbox::-webkit-scrollbar-thumb:hover {
    background: #3a6660;
}

.store-info-section {
    margin: 20px 0 50px 0;
}

.store-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.store-item {
    background: #F9F9F9;
    padding: 12px 20px;
    border-left: 1px solid #4B807A;
}

.store-single {
    grid-column: 1 / -1;
    /* 讓最後一個跨兩欄 */
}

.store-name {
    font-size: 16px;
    color: #2C2F33;
    margin: 0 0 5px 0;
}

.store-address {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.location-icon {
    flex-shrink: 0;
}

.location-icon img {
    width: 20px;
}

.store-address p {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #2C2F33;
}

.store-note {
    color: #86878B !important;
    font-size: 13px !important;
}

.insurance-list {
    margin: 30px 0;
}

.insurance-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid #F9F9F9;
}

.insurance-table thead th {
    background: #4B807A;
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 16px;
    letter-spacing: 2px;
    font-weight: normal;
    border-right: 1px solid #ECECED;
}

.insurance-type {
    width: 70%;
}

.miles-earn {
    width: 30%;
}

.insurance-table tbody tr {
    border-bottom: 1px solid #ECECED;
}

.insurance-table tbody tr:last-child {
    border-bottom: none;
}

.insurance-table tbody td {
    padding: 15px 20px;
    font-size: 14px;
    line-height: 1.5;
    vertical-align: middle;
    border-right: 1px solid #ECECED;

}

.insurance-table tbody td:first-child {
    color: #2C2F33;
}

.insurance-table tbody td:last-child {
    text-align: center;
    font-weight: bold;
    font-size: 16px;

}

.insurance-table tbody .td-conversionRate {
    gap: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insurance-table tbody td:last-child img {
    width: 20px;
}

.miles-icon {
    margin-right: 5px;
    font-size: 14px;
}

/* RWD 響應式設計 */
@media (max-width: 768px) {
    .lightbox {
        padding: 25px;
    }

    .lightbox-header {
        padding: 20px;
    }

    .content-top {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .partner-logo,
    .partner-info {
        width: 100%;
    }

    .partner-logo img {
        /* width: 60px; */
    }

    .partner-info h2 {
        font-size: 20px;
    }

    .lightbox-content {
        padding: 20px;
        max-height: 50vh;
    }

    .earn-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .terms-table,
    .terms-table tr,
    .terms-table td {
        display: block;
    }

    .nav-item {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #A59578;
    }

    .terms-content-item {
        border-bottom: 2px solid #ddd;
    }

    .store-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .store-single {
        grid-column: 1;
    }

    .store-item {
        padding: 15px;
    }

    .store-name {
        font-size: 15px;
    }

    .insurance-table,
    .insurance-table thead,
    .insurance-table tbody,
    .insurance-table th,
    .insurance-table td,
    .insurance-table tr {
        display: block;
    }

    .insurance-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .insurance-table tbody tr {
        border: 1px solid #ccc;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 15px;
        background: white;
    }

    .insurance-table tbody td {
        border: none;
        padding: 5px 0;
        position: relative;
    }

    .insurance-table tbody td:first-child::before {
        content: "保險專案：";
        font-weight: bold;
        color: #4B807A;
    }

    .insurance-table tbody td:last-child::before {
        content: "里數獲得：";
        font-weight: bold;
        color: #4B807A;
        display: block;
    }

    .insurance-table tbody td:last-child {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .lightbox-container {
        margin: 10px 0;
    }

    .lightbox-header {
        padding: 15px;
    }

    .lightbox-content {
        padding: 15px;
        max-height: 80vh;
    }

    .partner-info h2 {
        font-size: 18px;
    }

    .partner-description {
        font-size: 13px;
    }
}

/* 載入指示器樣式 */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4B807A;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.retry-btn:hover {
    background: #3a6660 !important;
}