:root {
    --star-color: #f5a623;
}

/* ================= 詳情頁頂部 Banner ================= */
.hero-inner {
    position: relative;
    height: 350px;
    background: url("../../picture/line1-1024x683.webp") no-repeat center center/cover;
    display: flex;
    align-items: flex-end;
    padding-bottom: 40px;
}

.hero-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    color: #fff;
    width: 100%;
}

.hero-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.breadcrumbs {
    font-size: 14px;
    color: #fff;
    font-weight: 700;
}

/* ================= 圖集區域 ================= */
.gallery-section {
    padding: 30px 0 10px;
    background: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gallery-grid img {
    height: 240px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.gallery-grid img:hover {
    filter: brightness(0.9);
}

/* ================= 主體內容 (左右分欄) ================= */
.main-content {
    padding: 40px 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
    background: #fff;
}

/* ---- 左側：線路信息 ---- */
.details-left {
    padding: 10px 20px;
}

/* 評分與收藏 */
.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.rating-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rating-left .stars {
    color: var(--star-color);
    font-size: 16px;
    letter-spacing: 2px;
}

.rating-left .score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.score-badge {
    border: 1px solid #ddd;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: var(--primary-color);
}

.score-text {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 15px;
}

.score-count {
    color: #999;
}

.btn-favorite {
    border: 1px solid #ddd;
    background: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--primary-color);
    transition: 0.3s;
}

.btn-favorite:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 線路概要 */
.line-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    padding: 15px 0 20px;
    margin-bottom: 0;
}

.line-overview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.line-overview-icon {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 1px solid #d9dee3;
    border-radius: 8px;
    color: #6a7a86;
    background: #fff;
}

.line-overview-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.line-overview-copy strong {
    color: #111;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 700;
}

.line-overview-copy em {
    color: #5d6d7a;
    font-size: 13px;
    line-height: 1.45;
    font-style: normal;
    word-break: break-word;
}

.line-overview-icon-clock::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 10px;
    left: 10px;
}

.line-overview-icon-clock::after {
    content: "";
    position: absolute;
    width: 6px;
    height: 6px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    top: 16px;
    left: 20px;
    transform-origin: left bottom;
}

.line-overview-icon-cancel::before,
.line-overview-icon-cancel::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    top: 19px;
    left: 9px;
}

.line-overview-icon-cancel::before {
    transform: rotate(45deg);
}

.line-overview-icon-cancel::after {
    transform: rotate(-45deg);
}

.line-overview-icon-group::before {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 8px;
    left: 14px;
}

.line-overview-icon-group::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 13px;
    border: 2px solid currentColor;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    top: 22px;
    left: 8px;
}

.line-overview-icon-location::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 10px 10px 10px 2px;
    top: 8px;
    left: 12px;
    transform: rotate(-45deg);
}

.line-overview-icon-location::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    border: 2px solid currentColor;
    border-radius: 50%;
    top: 15px;
    left: 16px;
}

/* 內容區塊 */
.content-section.cms-content {
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.content-section.cms-content h2,
.content-section.cms-content h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 12px;
    line-height: 1.5;
}

.content-section.cms-content p {
    font-size: 14px;
    font-weight: 500;
    color: #444;
    line-height: 1.8;
    margin-bottom: 6px;
}

/* 行程下方詳情內容（多區塊帶分隔線） */
.line-detail-content {}

.line-detail-content h2 {
    padding-top: 25px;
    margin-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.line-detail-content h2:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.line-detail-content strong {
    color: #222;
}

/* 費用包含/不含 */
.cost-grid {
    display: flex;
    gap: 30px;
}

.cost-column {
    flex: 1;
}

.cost-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 5px 0;
}

.cost-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transform: translateY(3px);
}

.cost-text {
    color: #5E6D77;
    font-size: 14px;
    line-height: 1.6;
}

/* 行程手風琴 */
.line-itinerary-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.line-itinerary-section h2 {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

.line-itinerary-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.line-itinerary-item {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
}

.line-itinerary-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 18px 20px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}

.line-itinerary-head:hover {
    background: #f0f1f3;
}

.line-itinerary-time {
    font-size: 14px;
    font-weight: 600;
    color: #1e3a5f;
    background: #fff;
    border: 1px solid #d0d5dd;
    padding: 4px 12px;
    border-radius: 4px;
}

.line-itinerary-toggle {
    width: 28px;
    height: 28px;
    border: 1.5px solid #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    line-height: 1;
    flex-shrink: 0;
}

.line-itinerary-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.line-itinerary-item.is-open .line-itinerary-body {
    max-height: 500px;
}

.line-itinerary-body h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 20px 6px;
}

.line-itinerary-body p {
    font-size: 14px;
    color: #555;
    line-height: 1.7;
    padding: 0 20px 18px;
    margin: 0;
}

/* 列表式說明區塊 */
.info-list-group {
    display: flex;
    flex-direction: column;
}

.info-item {
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.info-item h3 {
    font-size: 20px;
    color: #222;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item h3::after {
    content: '+';
    font-weight: normal;
    color: #999;
    font-size: 24px;
    transition: transform 0.3s;
}

.info-item:hover h3 {
    color: var(--primary-color);
}

/* 展開狀態示例 (如果需要默認展開內容可添加此類) */
.info-item.active h3::after {
    transform: rotate(45deg);
}

.info-content {
    display: none;
    padding-top: 15px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.info-item.active .info-content {
    display: block;
}

/* ---- 右側：預訂表單 (側邊欄) ---- */
.sidebar-right {
    position: sticky;
    top: 20px;
}

.booking-card {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.booking-tabs {
    display: flex;
    border-radius: 25px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid #ddd;
}

.booking-tabs .tab-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.booking-tabs .tab-btn.active {
    background: var(--primary-color, #1e3a5f);
    color: #fff;
}

.booking-tabs .tab-btn:not(.active) {
    background: #fff;
    color: #333;
}

/* 表單控件 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.form-group label .req {
    color: #e53e3e;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color, #1e3a5f);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}


/* 支付按鈕群 */
.pay-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-apple {
    background: #000;
}

.btn-google {
    background: #333;
}

.btn-paypal {
    background: #0070ba;
}

.btn-paylater {
    background: #0070ba;
}

.btn-card {
    background: #2c3e50;
}

.power-by {
    text-align: center;
    font-size: 12px;
    color: #999;
    margin-top: 15px;
}



/* 響應式 */
@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 20px 15px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 15px;
    }

    .sidebar-right {
        position: relative;
        top: 0;
    }

    .line-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .hero-inner {
        height: 280px;
    }

    .line-overview-grid {
        grid-template-columns: 1fr;
    }
}

/* EyouCMS dynamic helpers */
.nav-links .is-current,
.nav-links a.active,
.nav-links a:hover {
    color: #f5a623;
}

.cms-content img {
    max-width: 100%;
    height: auto;
}

.cms-content table {
    max-width: 100%;
    border-collapse: collapse;
}

.cms-content p {
    margin-bottom: 12px;
}

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

.pagination a,
.pagination span {
    min-width: 36px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-align: center;
}

.pagination a:hover,
.pagination .active {
    background: var(--primary-color, #1e3a8a);
    border-color: var(--primary-color, #1e3a8a);
    color: #fff;
}

.logo a {
    color: inherit;
}

.header-actions a {
    color: inherit;
}

.subscribe-box form {
    display: flex;
    width: 100%;
}

.empty-tip {
    grid-column: 1 / -1;
    padding: 48px 20px;
    text-align: center;
    color: #888;
    background: #fff;
    border-radius: 8px;
}

/* Extracted common helpers */
.footer-logo {
    color: #f5a623;
    margin-bottom: 15px;
}

.detail-side-image {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* ================= 線路行程 ================= */
.content-section,
.line-itinerary-section {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

.content-section h2,
.line-itinerary-section h2 {
    font-size: 28px;
    line-height: 1.25;
    margin-bottom: 24px;
    color: #111;
    font-weight: 600;
}

.line-itinerary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.line-itinerary-item {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    overflow: hidden;
}

.line-itinerary-head {
    width: 100%;
    min-height: auto;
    border: 0;
    background: transparent;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    text-align: left;
}

.line-itinerary-time {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    padding: 3px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    color: #1e3a5f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    background: #fff;
}

.line-itinerary-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1.5px solid #999;
    border-radius: 50%;
    flex: 0 0 24px;
    color: #666;
    font-size: 16px;
    line-height: 1;
    font-weight: 400;
}

.line-itinerary-body {
    display: none;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
}

.line-itinerary-item.is-open .line-itinerary-body {
    display: block;
}

.line-itinerary-body h3 {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
    color: #333;
}

.line-itinerary-body p {
    margin: 0;
}

.booking-price-row .price span {
    margin-left: 2px;
    color: var(--text-gray);
    font-size: 13px;
    font-weight: 400;
}

/* 評論區塊 */
.reviews-section { margin-top: 10px; padding-top: 25px; }
.reviews-title { font-size: 20px; font-weight: 700; color: #222; margin-bottom: 25px; }
.review-item { padding: 25px 0; border-bottom: 1px solid #e0e0e0; }
.review-item:last-child { border-bottom: none; }
.review-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.review-user-info { display: flex; flex-direction: column; }
.review-user-info strong { font-size: 15px; color: #222; }
.review-user-info span { font-size: 13px; color: #888; }
.review-stars { color: var(--star-color); font-size: 14px; letter-spacing: 2px; margin-bottom: 12px; }
.review-detail-title { font-size: 14px; font-weight: 700; color: var(--primary-color, #1e3a5f); margin-bottom: 8px; }
.review-detail-content { font-size: 14px; color: #555; line-height: 1.7; margin: 0; }

/* 響應式 - 平板 */
@media (max-width: 992px) {
    .main-content { grid-template-columns: 1fr; padding: 20px 15px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); padding: 0 15px; }
    .sidebar-right { position: relative; top: 0; }
    .details-left { padding: 10px 15px; }
    .line-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 響應式 - 手機 */
@media (max-width: 768px) {
    .hero-inner { height: 220px; padding-bottom: 20px; }
    .hero-title { font-size: 24px; }
    .breadcrumbs { font-size: 12px; }

    .gallery-section { padding: 15px 0; }
    .gallery-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 15px; }
    .gallery-grid img { height: 200px; }

    .main-content { padding: 15px; gap: 20px; }
    .details-left { padding: 10px; }

    .details-header { padding-bottom: 12px; margin-bottom: 12px; }
    .rating-left .stars { font-size: 14px; }

    .line-overview-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px 0 15px; }
    .line-overview-icon { width: 34px; height: 34px; flex: 0 0 34px; }
    .line-overview-copy strong { font-size: 13px; }
    .line-overview-copy em { font-size: 12px; }

    .content-section.cms-content h2,
    .content-section.cms-content h3 { font-size: 16px; }
    .content-section.cms-content p { font-size: 13px; }

    .line-itinerary-section h2 { font-size: 18px; margin-bottom: 15px; }
    .line-itinerary-head { padding: 12px 14px; }
    .line-itinerary-time { font-size: 13px; padding: 3px 10px; }
    .line-itinerary-toggle { width: 24px; height: 24px; font-size: 16px; }
    .line-itinerary-body h3 { font-size: 13px; margin: 0 14px 4px; }
    .line-itinerary-body p { font-size: 13px; padding: 0 14px 14px; }

    .cost-grid { flex-direction: column; gap: 15px; }
    .cost-item { padding: 4px 0; }
    .cost-text { font-size: 13px; }

    .line-detail-content h2 { font-size: 16px; padding-top: 20px; margin-top: 20px; }

    .review-avatar { width: 40px; height: 40px; }
    .review-user-info strong { font-size: 14px; }

    .booking-card { padding: 18px; border-radius: 8px; }
    .nav-links { display: none; }
}

/* 響應式 - 小螢幕手機 */
@media (max-width: 480px) {
    .hero-inner { height: 180px; }
    .hero-title { font-size: 20px; }
    .line-overview-grid { grid-template-columns: 1fr; }
    .details-header { gap: 8px; }
    .btn-favorite { padding: 6px 12px; font-size: 13px; }
    .hotel-meta-wrapper { padding-bottom: 15px !important; margin-bottom: 15px !important; }
}