/* =========================================
   目錄 (TABLE OF CONTENTS)
   00. SYSTEM OVERRIDES & UTILITIES (系統覆寫與輔助類別)
   01. VARIABLES & WRAPPER BASE (變數與外框基礎)
   02. TYPOGRAPHY (文字排版)
   03. ANIMATIONS & COMPONENTS (動畫與共用元件)
   04. HERO SECTION (主視覺區)
   05. GUARANTEE SECTION (旅遊保障)
   06. HOTELS SECTION (精選住宿)
   07. ITINERARY SECTION (行程排版)
   08. CAROUSEL COMPONENT (輪播圖元件)
   09. RESPONSIVE DESIGN (RWD 斷點總管)
   ========================================= */


/* =========================================
   00. SYSTEM OVERRIDES & UTILITIES
   ========================================= */
/* 強制系統商品頁 100% 滿版 (消除系統自帶的白邊) */
section.group_table .container,
#ProductContent .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 消除 row 預設的負 margin，避免產生水平卷軸 */
#ProductContent .container > .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 消除系統欄位 (col-12) 預設左右各 15px 的留白 */
#ProductContent .container > .row > div[class*="col-"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Bootstrap 顯示輔助類別覆寫 */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-inline-block { display: inline-block !important; }
}

@media (min-width: 960px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-inline-block { display: inline-block !important; }
}


/* =========================================
   01. VARIABLES & WRAPPER BASE
   ========================================= */
:root {
    --xj-gold: #c4a06b;
    --xj-dark: #1a1a1a;
    --xj-white: #ffffff;
    --xj-yellow: #ffde00;
    --xj-purple: #8533cc;
    --xj-bg: #f4f1ea;
}

.xj-wrapper {
    font-family: "Noto Sans TC", sans-serif;
    background: var(--xj-bg);
    color: var(--xj-dark);
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 16px; /* 根節點基礎大小 */
}

.xj-wrapper *,
.xj-wrapper *::before,
.xj-wrapper *::after {
    box-sizing: inherit;
}

.xj-container {
    width: 90%;
    max-width: 1280px;
    margin: 0 auto;
}


/* =========================================
   02. TYPOGRAPHY
   ========================================= */
.xj-serif {
    font-family: "Noto Serif TC", serif;
}

.xj-p {
    font-size: clamp(1rem, 1vw + 0.6rem, 1.15rem);
    margin: 0 0 1rem 0;
    line-height: 1.85;
    color: #444;
    letter-spacing: 0.5px;
}

.xj-h1,
.xj-h2,
.xj-h3 {
    font-family: "Noto Serif TC", serif;
    font-weight: bold;
    line-height: 1.2;
    color: var(--xj-dark);
    margin: 0;
    letter-spacing: 2px;
}

.xj-h1 { font-size: clamp(3rem, 6vw, 4.5rem); }
.xj-h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.xj-h3 { font-size: clamp(1.35rem, 3vw, 2.1rem); }


/* =========================================
   03. ANIMATIONS & COMPONENTS
   ========================================= */
/* 滾動進度條 */
.xj-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
}

.xj-progress-bar {
    height: 4px;
    background: var(--xj-gold);
    width: 0%;
}

/* 滾動淡入動畫 */
.xj-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: 1.2s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.xj-reveal.xj-active {
    opacity: 1;
    transform: translateY(0);
}

/* 分隔線 */
.xj-divider {
    width: 100px;
    height: 4px;
    background: var(--xj-gold);
    margin: 20px auto;
}


/* =========================================
   04. HERO SECTION
   ========================================= */
.xj-hero {
    height: 100vh;
    min-height: 540px;
    max-height: 900px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--xj-white);
    text-align: center;
    background:
        linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
        url("https://www.yaofongtravel.com/material-alias/中國/北疆/紫戀北疆自由行14天/xinjiang-14day-pc.jpg") center/cover;
    background-attachment: fixed;
}

.xj-hero-content {
    z-index: 2;
    margin-top: -5rem;
}

.xj-hero .xj-h1 {
    letter-spacing: 10px;
    color: var(--xj-white);
}

.xj-hero .xj-h1 span {
    color: var(--xj-yellow);
}

.xj-hero .xj-p {
    margin: 10px auto;
    color: var(--xj-white);
    width: 85%;
    letter-spacing: 1px;
}


/* =========================================
   05. GUARANTEE SECTION
   ========================================= */
.xj-guarantee-section {
    padding: 100px 0;
    background: var(--xj-white);
    text-align: center;
}

.fa-icon {
    display: flex;
    margin: 20px auto;
    justify-content: center;
}

.fa-icon > img {
    width: 45px;
}

.xj-guarantee-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.xj-guarantee-card {
    padding: 1rem;
    border: 1px solid #eee;
    transition: 0.3s;
}

.xj-guarantee-card i {
    font-size: 2.5rem;
    color: var(--xj-gold);
    margin-bottom: 20px;
}

.xj-guarantee-card .xj-h3 {
    margin-bottom: 15px;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
}


/* =========================================
   06. HOTELS SECTION
   ========================================= */
.xj-section-hotels {
    padding: 120px 0;
}

.xj-hotel-header {
    text-align: center;
    margin-bottom: 80px;
}

.xj-hotel-header .xj-h2 { letter-spacing: 10px; }
.xj-hotel-header .xj-p {
    color: var(--xj-gold);
    letter-spacing: 5px;
    font-size: 0.9rem;
    margin-top: 10px;
}

.xj-hotel-container { margin-bottom: 150px; }

.xj-hotel-info-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.xj-hotel-title-area { flex: 1; }

.xj-hotel-detail-area {
    flex: 1;
    padding-left: 50px;
    border-left: 1px solid #ddd;
}

.xj-hotel-subtitle {
    color: var(--xj-gold);
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 15px;
    display: block;
}

.xj-hotel-info-flex .xj-p { color: #555; }

.xj-hotel-features {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--xj-gold);
    font-weight: bold;
}

.xj-hotel-features span {
    border: 1px solid var(--xj-gold);
    padding: 4px 12px;
    border-radius: 20px;
}

.xj-hotel-visual-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 250px);
    gap: 15px;
}

.xj-visual-main { grid-row: span 2; position: relative; overflow: hidden; }
.xj-visual-sub { position: relative; overflow: hidden; }

.xj-hotel-visual-grid .xj-visual-main>img,
.xj-hotel-visual-grid .xj-visual-sub>img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.xj-hotel-visual-grid .xj-visual-main:hover>img,
.xj-hotel-visual-grid .xj-visual-sub:hover>img {
    transform: scale(1.08);
}


/* =========================================
   07. ITINERARY SECTION
   ========================================= */
.xj-magazine-header {
    padding: 100px 0 50px;
    text-align: center;
}

.xj-magazine-header .xj-h1 {
    letter-spacing: 15px;
    text-transform: uppercase;
}

.xj-itinerary-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 0;
    margin-bottom: 150px;
    align-items: center;
    background: var(--xj-white);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

.xj-itinerary-row.xj-reverse { grid-template-columns: 0.8fr 1.2fr; }
.xj-itinerary-row.xj-reverse .xj-content-box { order: 2; border-left: 1px solid #eee; }
.xj-itinerary-row.xj-reverse .xj-image-box { order: 1; }

.xj-image-box {
    position: relative;
    height: 600px;
    overflow: hidden;
    background-color: #ddd;
}

.xj-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xj-image-box:hover img {
    transform: scale(1.1);
    transition: transform 1.5s ease;
}

.xj-image-box:not(:hover) img {
    transform: scale(1);
    transition: transform 1.5s ease;
}

.xj-image-tag {
    position: absolute;
    bottom: 0px;
    right: 0px;
    background: rgba(26, 26, 26, 0.8);
    color: var(--xj-white);
    padding: 5px 15px;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.xj-content-box {
    padding: 30px;
    position: relative;
}

.xj-day-badge {
    font-family: "Noto Serif TC", serif;
    font-size: clamp(3.5rem, 8vw, 5rem);
    color: rgba(196, 160, 107, 0.15);
    position: absolute;
    top: -30px;
    left: 10px;
    font-weight: bold;
}

.xj-content-box .xj-h2 { margin-bottom: 30px; position: relative; z-index: 1; }
.xj-content-box .xj-h2 span {
    display: block;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
    color: var(--xj-purple);
    letter-spacing: 3px;
    margin-top: 10px;
}

.xj-feature-list {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.xj-feature-list li {
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
    display: block;
    font-size: clamp(1rem, 1vw + 0.6rem, 1.25rem);
    line-height: 1.85;
    color: #444;
}

.xj-feature-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--xj-gold);
}

.xj-tips-tag {
    font-size: 0.9rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    font-style: italic;
}


/* =========================================
   08. CAROUSEL COMPONENT
   ========================================= */
.xj-carousel {
    position: relative;
}

.xj-carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.xj-carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.xj-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xj-carousel .xj-carousel-slide:hover img {
    transform: scale(1.05);
    transition: transform 3s ease;
}

.xj-carousel .xj-carousel-slide:not(:hover) img {
    transform: scale(1);
    transition: transform 3s ease;
}

/* 控制按鈕 */
.xj-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(26, 26, 26, 0.4);
    color: var(--xj-white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    opacity: 0;
}

.xj-carousel:hover .xj-carousel-btn { opacity: 1; }
.xj-carousel-btn:hover { background: var(--xj-gold); }

.xj-prev { left: 15px; }
.xj-next { right: 15px; }

/* 底部指示點 */
.xj-carousel-indicators {
    position: absolute;
    bottom: 30px; 
    left: 1rem;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.xj-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: 0.4s ease;
}

.xj-dot.xj-active {
    background: var(--xj-purple);
    width: 25px;
    border-radius: 4px;
}


/* =========================================
   09. RESPONSIVE DESIGN (RWD 斷點總管)
   ========================================= */

/* --- 1. 橫向平板 / 小筆電 --- */
@media (max-width: 1024px) {
    .xj-wrapper { font-size: 15px; }
    .xj-image-box { height: 500px; }
    .xj-content-box { padding: 40px; }
    .xj-guarantee-grid { gap: 15px; 
    grid-template-columns: repeat(2, 1fr);}

}

/* --- 2. 直向平板 --- */
@media (max-width: 992px) {
    /* 行程網格改垂直 */
    .xj-itinerary-row,
    .xj-itinerary-row.xj-reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    .xj-itinerary-row.xj-reverse .xj-content-box { order: unset; border-left: none; }
    .xj-itinerary-row.xj-reverse .xj-image-box { order: unset; }

    /* 飯店區塊調整 */
    .xj-hotel-info-flex { flex-direction: column; }
    .xj-hotel-detail-area {
        padding-left: 0;
        border-left: none;
        margin-top: 30px;
    }
    .xj-hotel-visual-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 400px 250px;
    }
    .xj-visual-main {
        grid-row: span 1;
        grid-column: span 2;
    }
}

/* --- 3. 手機尺寸 --- */
@media (max-width: 768px) {
    .xj-wrapper { font-size: 14px; }
    
    /* Hero 區塊替換為直立手機圖 */
    .xj-hero {
        background:
            linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
            url("https://www.yaofongtravel.com/material-alias/中國/北疆/紫戀北疆自由行14天/xinjiang-14day-xs.jpg") center/cover;
        background-attachment: scroll; /* 避免 iOS 縮放 Bug */
        align-items: flex-start;
    }
    
    .xj-hero-content { margin-top: 5rem; }
    .xj-hero .xj-h1 span { display: block; }
    
    /* 行程與飯店網格調整 */
    .xj-guarantee-grid {grid-template-columns: repeat(1, 1fr);}
    
    .xj-image-box {
        height: 100vh;
        min-height: 768px;
    }
    
    .xj-content-box { padding: 30px 20px; }
    
    .xj-hotel-visual-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px 200px 200px;
    }
    .xj-visual-main { grid-column: span 1; }
    
    /* 輪播圖按鈕手機版預設顯示 */
    .xj-carousel-btn {
        width: 35px;
        height: 35px;
        opacity: 1; 
    }
}


