/* 意轉靈升銷售頁 - 頂級奢華美學 CSS 樣式表 */

/* 核心變數定義 */
:root {
    --bg-primary: #FAF6F0;
    --bg-secondary: #FFFDFB;
    --color-gold-deep: #9E8059;
    --color-gold-mid: #C5A880;
    --color-gold-light: #EAD7BC;
    --color-gold-pale: #F8F3EB;
    --text-primary: #2C2824;
    --text-secondary: #6A625A;
    --text-light: #8E847A;
    --accent-purple: #9075A1; /* 頂輪/眉心輪紫色 */
    --accent-green: #6C826A;  /* 心輪綠色 */
    --white: #FFFFFF;
    --shadow-premium: 0 20px 40px rgba(158, 128, 89, 0.08);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --border-radius: 20px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 全域重設與基本樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Noto Sans TC', 'Outfit', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: radial-gradient(circle at top, #FFFDFB 0%, #FAF6F0 100%);
    overflow-x: hidden;
}

/* 金色漸變文字與底色 */
.gold-text {
    background: linear-gradient(135deg, var(--color-gold-deep) 0%, var(--color-gold-mid) 50%, var(--color-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.text-gold {
    color: var(--color-gold-mid);
}

/* Header 導覽列 */
.main-header {
    width: 100%;
    max-width: 800px;
    background: rgba(255, 253, 251, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(197, 168, 128, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.02);
}

.header-container {
    height: 70px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Cormorant Garamond', 'Noto Sans TC', serif;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.cta-nav-btn {
    background: linear-gradient(135deg, var(--color-gold-deep) 0%, var(--color-gold-mid) 100%);
    color: var(--white);
    text-decoration: none;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(158, 128, 89, 0.2);
    transition: var(--transition-smooth);
}

.cta-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(158, 128, 89, 0.3);
    opacity: 0.95;
}

/* 主銷售頁容器：置中且限制最大寬度，呈現如精品 APP 般的流暢閱讀體驗 */
.sales-container {
    width: 100%;
    max-width: 800px;
    background-color: var(--white);
    box-shadow: 0 0 60px rgba(158, 128, 89, 0.05);
    display: flex;
    flex-direction: column;
}

/* 視覺圖片區塊 */
.visual-section {
    width: 100%;
    overflow: hidden;
}

.img-wrapper {
    width: 100%;
    line-height: 0; /* 消除圖片下方的微小空隙 */
}

.img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

/* 動態載入淡入效果 */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
    transform: translateY(0);
}

/* 結帳與互動區塊 */
.checkout-section {
    padding: 60px 24px;
    background: linear-gradient(180deg, var(--white) 0%, var(--bg-primary) 100%);
    border-top: 1px solid rgba(197, 168, 128, 0.15);
}

.checkout-container {
    max-width: 100%;
}

.checkout-header {
    text-align: center;
    margin-bottom: 40px;
}

.checkout-header h2 {
    font-size: 2.2rem;
    font-family: 'Cormorant Garamond', 'Noto Sans TC', serif;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.checkout-header .subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 結帳網格排版 */
.checkout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

/* 方案選擇與計算器卡片 */
.plan-selector-card, .checkout-form-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(197, 168, 128, 0.2);
    border-radius: var(--border-radius);
    padding: 30px 24px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
}

.plan-selector-card h3, .checkout-form-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    border-left: 4px solid var(--color-gold-mid);
    padding-left: 12px;
    color: var(--text-primary);
}

/* 切換按鈕 (訂閱/一次付清) */
.plan-toggle {
    display: flex;
    background-color: var(--color-gold-pale);
    padding: 6px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.toggle-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.toggle-btn.active {
    background-color: var(--white);
    color: var(--color-gold-deep);
    box-shadow: var(--shadow-soft);
    font-weight: 600;
}

/* 滑桿控制 */
.control-group {
    margin-bottom: 24px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.highlight-val {
    font-size: 1.2rem;
    color: var(--color-gold-deep);
}

.slider-wrapper {
    position: relative;
    padding: 10px 0;
}

/* 自訂 Range 樣式 */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--color-gold-pale);
    border-radius: 4px;
    border: 1px solid rgba(197, 168, 128, 0.1);
}

input[type=range]::-webkit-slider-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold-mid) 0%, var(--color-gold-deep) 100%);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -8px;
    box-shadow: 0 4px 10px rgba(158, 128, 89, 0.3);
    transition: transform 0.1s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    padding: 0 4px;
}

/* 快速選擇標籤 */
.quick-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tag-btn {
    flex: 1;
    background-color: var(--white);
    border: 1px solid rgba(197, 168, 128, 0.25);
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tag-btn:hover {
    background-color: var(--color-gold-pale);
    color: var(--color-gold-deep);
}

.tag-btn.active {
    background-color: var(--color-gold-pale);
    border-color: var(--color-gold-mid);
    color: var(--color-gold-deep);
    font-weight: 600;
}

/* 價格計算摘要 */
.price-summary {
    background-color: var(--color-gold-pale);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.old-price {
    text-decoration: line-through;
    color: var(--text-light);
}

.main-price {
    margin-bottom: 0;
}

.new-price {
    font-size: 1.25rem;
    color: var(--color-gold-deep);
    font-weight: 600;
}

.new-price strong {
    font-size: 1.7rem;
    font-family: 'Outfit', sans-serif;
}

.divider {
    height: 1px;
    background-color: rgba(197, 168, 128, 0.2);
    margin: 15px 0;
}

.total-price {
    margin-bottom: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.final-price {
    color: var(--accent-purple);
    font-size: 1.6rem;
}

.final-price strong {
    font-size: 2.1rem;
    font-family: 'Outfit', sans-serif;
}

/* 禮品展示盒 */
.gift-box {
    border: 1px dashed var(--color-gold-mid);
    background: linear-gradient(135deg, rgba(255,253,251,0.9) 0%, rgba(248,243,235,0.7) 100%);
    border-radius: 12px;
    padding: 20px;
}

.gift-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gift-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gold-deep);
}

.gift-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.gift-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.gift-item:last-child {
    margin-bottom: 0;
}

.gift-icon-sub {
    color: var(--color-gold-mid);
    font-size: 1.1rem;
    margin-top: 2px;
}

.gift-badge {
    display: inline-block;
    background-color: var(--accent-green);
    color: var(--white);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-weight: 500;
}

.gold-badge {
    background-color: var(--color-gold-deep);
}

.gift-text h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.gift-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 動態進入效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated-gift {
    animation: fadeInUp 0.4s ease forwards;
}

/* 填寫資料表單 */
.checkout-form-card form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group label i {
    color: var(--color-gold-mid);
}

.required {
    color: #D32F2F;
}

.optional {
    color: var(--text-light);
    font-size: 0.8rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid rgba(197, 168, 128, 0.3);
    background-color: rgba(250, 246, 240, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-gold-mid);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(197, 168, 128, 0.15);
}

.form-agreement {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 10px;
    margin-bottom: 6px;
    background-color: rgba(197, 168, 128, 0.08);
    border: 1px solid rgba(197, 168, 128, 0.25);
    border-radius: 10px;
    padding: 12px 14px;
}

.form-agreement input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #7B5BBE;
}

.form-agreement label {
    flex: 1;
    cursor: pointer;
    word-break: break-word;
    user-select: none;
}

.submit-pay-btn {
    background: linear-gradient(135deg, var(--color-gold-deep) 0%, var(--color-gold-mid) 100%);
    color: var(--white);
    border: none;
    border-radius: 30px;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(158, 128, 89, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: var(--transition-smooth);
    margin-top: 10px;
}

.submit-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(158, 128, 89, 0.35);
    opacity: 0.95;
}

.submit-pay-btn:active {
    transform: translateY(0);
}

.pay-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

/* 懸浮按鈕區 */
.floating-actions {
    position: fixed;
    bottom: 30px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99;
}

.float-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.float-btn i {
    font-size: 1.2rem;
}

.line-btn {
    background-color: #06C755; /* LINE 官方綠色 */
}

.line-btn:hover {
    background-color: #05B04B;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(6, 199, 85, 0.3);
}

.checkout-btn-floating {
    background: linear-gradient(135deg, var(--accent-purple) 0%, #7E5F92 100%);
}

.checkout-btn-floating:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(144, 117, 161, 0.3);
}

/* 頁尾樣式 */
.main-footer {
    width: 100%;
    max-width: 800px;
    background-color: var(--bg-primary);
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid rgba(197, 168, 128, 0.1);
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
}

.footer-container a {
    color: var(--color-gold-deep);
    text-decoration: none;
}

.footer-container a:hover {
    text-decoration: underline;
}

/* 手機版適應性修正 */
@media (max-width: 480px) {
    .checkout-section {
        padding: 40px 16px;
    }
    
    .plan-selector-card, .checkout-form-card {
        padding: 24px 16px;
    }

    .checkout-header h2 {
        font-size: 1.8rem;
    }
    
    .floating-actions {
        bottom: 20px;
        right: 16px;
    }
    
    .float-btn span {
        display: none; /* 小螢幕只顯示圖示 */
    }
    
    .float-btn {
        padding: 12px;
        width: 48px;
        height: 48px;
        justify-content: center;
        border-radius: 50%;
    }
}

/* ── 手機版專屬排版優化 (電腦版不受影響) ─────────────────── */
@media (max-width: 640px) {
  .header-container {
    height: 56px !important;
    padding: 0 12px !important;
    gap: 8px !important;
  }
  .logo {
    font-size: 0.95rem !important; /* 大幅縮小，避免折行 */
    letter-spacing: 1px !important;
    white-space: nowrap !important;
  }
  .back-home-link span {
    display: none !important; /* 隱藏返回首頁四個中文字，只留 🏠 */
  }
  .back-home-link {
    font-size: 1.2rem !important; /* 讓 🏠 更利於手指點按 */
    color: var(--text-primary) !important;
    padding: 4px !important;
  }
  .cta-nav-btn {
    padding: 6px 12px !important; /* 縮小按鈕內距 */
    font-size: 0.72rem !important; /* 縮小按鈕文字大小 */
    border-radius: 20px !important;
    white-space: nowrap !important;
    box-shadow: none !important;
  }
}
