@charset "UTF-8";

/* ==========================================================================
   目錄 (Table of Contents)
   1. 全域變數與基礎設定 (Variables & Base)
   2. 導覽列與大型選單 (Navbar & Mega Menu)
   3. 首頁輪播 (Hero Carousel)
   4. 產品列表與卡片 (Product Cards)
   5. 頁尾與社群連結 (Footer & Social Links)
   6. 預約系統專用樣式 (Booking System)
   7. 輔助動畫與排版優化 (Animation & Typography)
   8. 前台動態內容區塊 - 突圍佈局 (Dynamic Content: Breakout Layout)
   9. 前台動態內容區塊 - 圖片比例 (Dynamic Content: Image Ratio)
   10. 響應式佈局微調 (Responsive Utilities)
   ========================================================================== */

/* =========================================
   1. 全域變數與基礎設定 (Variables & Base)
   ========================================= */
:root {
    /* 顏色變數 */
    --primary-color: #0d6efd;       /* 主色調 (品牌色) */
    --primary-hover: #0b5ed7;       /* 主色懸停 (按鈕或連結 Hover) */
    --secondary-color: #6c757d;     /* 次要色 (輔助文字或背景) */
    --text-dark: #333333;           /* 深色文字 (主要閱讀文字) */
    --text-white: #ffffff;          /* 淺色文字 (深色背景上的文字) */
    --text-muted: #666666;          /* 弱化文字 (次要資訊) */
    --light-bg: #f8f9fa;            /* 淺灰背景 (區塊區隔) */
    --dark-bg: #151515;             /* 深灰背景 (頁尾或反白區塊) */
    --border-color: #e9ecef;        /* 邊框色 */
    
    /* 尺寸變數 */
    --navbar-height: 76px;          /* 導覽列高度 (PC 電腦版) */
    --navbar-height-mobile: 66px;   /* 導覽列高度 (Mobile 手機版) */
}

body {
    font-family: "Microsoft JhengHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden; /* ★ 終極防護：防止 Safari 彈性滾動產生的橫向捲軸 */
    padding-top: var(--navbar-height); /* 預留上方 Fixed Header 的高度 */
}

a {
    text-decoration: none;
    transition: all 0.3s ease; /* 所有連結自帶平滑轉場效果 */
}

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

/* 防止手機版 iframe (如 YouTube 影片、Google 地圖) 撐破螢幕 */
iframe { 
    max-width: 100% !important; 
}


/* =========================================
   2. 導覽列與大型選單 (Navbar & Mega Menu)
   ========================================= */
.navbar {
    background: #fff;
    transition: box-shadow 0.3s;
}

.navbar .nav-link {
    font-weight: 500;
    color: #333 !important;
    padding: 10px 18px !important;
    font-size: 1rem;
    text-align: center;
}

.navbar .nav-link:hover, 
.navbar .nav-link.active {
    color: var(--primary-color) !important;
}

/* 一般下拉選單樣式 */
.dropdown-menu:not(.mega-menu) {
    border: none; 
    box-shadow: 0 5px 15px rgba(0,0,0,0); 
    border-radius: 8px; 
    padding: 10px 0;
}
.dropdown-item { padding: 8px 20px; font-size: 0.95rem; }
.dropdown-item:hover { background-color: #f8f9fa; color: var(--primary-color); }

/* 大型選單 (Mega Menu) - PC 版設定 */
@media (min-width: 992px) {
    .navbar .has-megamenu { position: static !important; }
    .navbar .dropdown-menu.mega-menu {
        width: 100%; 
        left: 0; right: 0; 
        padding: 40px 0; 
        border: none;
        border-top: 3px solid var(--primary-color);
        box-shadow: 0 15px 30px rgba(0,0,0,0);
        margin-top: -2px; 
        background: var(--dark-bg);
        border-radius: 0 0 8px 8px; 
        display: none;
    }
    .navbar .has-megamenu:hover .dropdown-menu.mega-menu {
        display: block; 
        animation: fadeIn 0.3s ease;
    }
}

/* 巨型選單內的分類卡片 */
.mega-cat-item {
    display: block; 
    text-align: center; 
    padding: 15px; 
    border-radius: 8px;
    transition: all 0.3s ease; 
    background: #fff; 
    border: 1px solid transparent;
    color: var(--text-dark);
}
.mega-cat-item:hover {
    background: #f8f9fa; 
    border-color: #eee; 
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0); 
    color: var(--primary-color);
}
.mega-cat-img {
    width: 100%; height: 120px; object-fit: cover; border-radius: 6px;
    margin-bottom: 12px; background-color: #f1f1f1;
}
.mega-cat-name { font-weight: bold; font-size: 0.95rem; }


/* =========================================
   3. 首頁輪播 (Hero Carousel)
   ========================================= */
#homeCarousel .carousel-item { background-color: #333; }
#homeCarousel img { object-fit: cover; object-position: center; }
.carousel-control-next, .carousel-control-prev { width: 10%; }

/* 輪播圖文字遮罩 (毛玻璃效果) */
.carousel-caption {
    background: rgba(0, 0, 0, 0.1); 
    position: absolute; bottom: 15%; padding: 20px;
    border-radius: 10px; text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    backdrop-filter: blur(2px); right: 20%; left: 20%;
}

/* 輪播圖片各裝置高度比例限制 */
@media (min-width: 992px) { #homeCarousel img { width: 100%; aspect-ratio: 16 / 5; } }
@media (max-width: 991px) { #homeCarousel img { width: 100%; aspect-ratio: 16 / 5; } }
@media (max-width: 576px) { #homeCarousel img { width: 100%; aspect-ratio: 1 / 1; } }


/* =========================================
   4. 產品列表與卡片 (Product Cards)
   ========================================= */
.product-block { margin-bottom: 3rem; }
.product-card { transition: all 0.3s ease; overflow: hidden; background: #fff; }
.product-card:hover .card-img-top { transform: scale(1.05); }
.product-card .card-img-top { transition: transform 0.5s ease; height: 200px; object-fit: cover; }

/* 卡片懸停浮浮效果 */
.hover-up { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-up:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important; }

/* 側邊欄分類清單 */
.list-group-item { border: none; border-bottom: 1px solid #f1f1f1; padding: 12px; }
.list-group-item:hover, .list-group-item.active {
    background-color: #f8f9fa; color: var(--primary-color); font-weight: 500; border-color: #f1f1f1;
}
.list-group-item.active { background-color: #e7f1ff; }

/* 產品內頁分頁按鈕 (Tabs) */
.nav-tabs { border-bottom: 1px solid #dee2e6; }
.nav-tabs .nav-link { color: var(--text-dark); background: var(--light-bg); margin-right: 2px; border: 0px solid #dee2e6; border-bottom: 1px solid #dee2e6; }
.nav-tabs .nav-link.active { color: var(--text-white); background: var(--dark-bg); border-bottom-color: #fff; }
.nav-tabs .nav-link:hover { color: var(--text-white); background: var(--dark-bg); }
.nav-tabs button { font-size: .85rem; padding: 8px 12px; }


/* =========================================
   5. 頁尾與社群連結 (Footer & Social Links)
   ========================================= */
#site-footer { background-color: #212529; color: #adb5bd; font-size: 0.95rem; }

.social-links a {
    width: 40px; height: 40px; line-height: 40px; text-align: center; border-radius: 50%;
    background: rgba(255,255,255,0.1); color: #fff; margin-right: 10px; transition: all 0.3s; display: inline-block;
}
.social-links a.icon-fb:hover { background: #1877f2; transform: translateY(-3px); }
.social-links a.icon-ig:hover { background: #e1306c; transform: translateY(-3px); }
.social-links a.icon-yt:hover { background: #ff0000; transform: translateY(-3px); }
.social-links a.icon-line:hover { background: #00c300; transform: translateY(-3px); }
.hover-white:hover { color: #fff !important; padding-left: 5px; }


/* =========================================
   6. 預約系統專用樣式 (Booking System)
   ========================================= */
/* 預約服務項目卡片 */
.service-card { cursor: pointer; transition: all 0.3s; border: 2px solid transparent; }
.service-card:hover { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important; }
.service-card.selected { border-color: var(--primary-color); background-color: #f0f8ff; }
.service-radio { display: none; } /* 隱藏真實的 radio input */
.step-title { background: var(--primary-color); color: #fff; width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; margin-right: 10px; font-weight: bold; }

/* Flatpickr 日曆套件覆寫 */
.flatpickr-innerContainer { width: 100% !important; max-width: 100% !important; padding: 0; margin: 0; display: block; }
.flatpickr-rContainer{ display: block; }
.flatpickr-calendar.inline { width: 100% !important; max-width: 100% !important; box-shadow: 0 .5rem 1rem rgba(0,0,0,.08); border: 1px solid #dee2e6; border-radius: 12px; padding: 15px 10px; }
.flatpickr-days, .dayContainer { width: 100% !important; min-width: 100% !important; max-width: 100% !important; }
.flatpickr-day { max-width: 14.28% !important; height: 65px !important; line-height: 45px !important; font-size: 1.15rem !important; border-radius: 10px !important; margin-bottom: 5px; position: relative; }
.flatpickr-weekday { font-size: 1rem !important; padding: 15px 0 !important; color: #6c757d !important; font-weight: bold; }
.flatpickr-month { height: 60px !important; }
.flatpickr-current-month { font-size: 1.4rem !important; padding-top: 8px !important; }
.flatpickr-day.selected { background: var(--primary-color) !important; border-color: var(--primary-color) !important; font-weight: bold; }

/* 日曆上的預約狀態標籤 */
.day-status { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; line-height: 1.2; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,0.2); color:#fff; }
.bg-am-booked { background-color: #fd7e14; color: #fff; } 
.bg-pm-booked { background-color: #6f42c1; color: #fff; } 

/* 載入中遮罩 */
#calendar-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.8); z-index: 10; display: flex; align-items: center; justify-content: center; border-radius: 12px; backdrop-filter: blur(2px); }


/* =========================================
   7. 輔助動畫與排版優化 (Animation & Typography)
   ========================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 富文本 (Rich Text) 內部排版優化 */
.content-body p, .content-body div { line-height: 1.8; margin-bottom: 1.5rem; }


/* ==========================================================
   8. 前台動態內容區塊 - 突圍佈局 (Dynamic Content: Breakout Layout)
   ========================================================== */
/* 照片藝廊懸停特效 */
.gallery-item { cursor: pointer; transition: transform 0.2s; }
.gallery-item:hover { transform: scale(1.03); z-index: 10; }

/* ★ 核心：區塊突圍容器 (Container Breakout) 
   打破 Bootstrap Container 的限制，讓特定區塊可以自由佔滿或自訂螢幕寬度比例。
*/
.block-wrap-100, .block-wrap-80, .block-wrap-60 {position: relative; max-width: none !important; clear: both;}

/* 100% 寬度：手機與電腦皆滿版顯示 (使用 100vw 配合負邊距完美抵銷 Bootstrap 的 Container padding) */
.block-wrap-100 { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding-left: 0; padding-right: 0;}

/* 80% & 60% 寬度 (手機版)：強迫滿版，但左右保留安全的 1.5rem 內距避免貼齊螢幕邊緣 */
.block-wrap-80, .block-wrap-60 { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); padding-left: 1.5rem; padding-right: 1.5rem;}

/* 80% & 60% 寬度 (電腦大螢幕版)：精準套用設定的 vw 單位置中，不再受 max-width 綁架 */
@media (min-width: 992px) {
    .block-wrap-80 { width: 80vw; margin-left: calc(50% - 40vw); margin-right: calc(50% - 40vw); padding-left: 0; padding-right: 0;}
    .block-wrap-60 { width: 60vw; margin-left: calc(50% - 30vw); margin-right: calc(50% - 30vw); padding-left: 0; padding-right: 0;}
}

/* ==========================================================
   9. 前台動態內容區塊 - 圖片比例 (Dynamic Content: Image Ratio)
   ========================================================== */
/* 通用圖片填滿設定 */
.obj-fit { object-fit: cover; width: 100%; height: 100%; }

/* [模式 A] 傳統 Bootstrap padding-top 寫法 (用於舊版相容與特定區塊) */
.ratio { position: relative; width: 100%; background: #eee; overflow: hidden; }
.ratio::before { display: block; content: ""; width: 100%; }
.ratio-1x1::before  { padding-top: 100%; }
.ratio-4x3::before  { padding-top: 75%; }
.ratio-16x9::before { padding-top: 56.25%; }
.ratio-21x9::before { padding-top: 42.85%; }
.ratio > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* [模式 B] 現代化 aspect-ratio 寫法 (用於 single_img 樣板等新功能) */
.img-container { width: 100%; overflow: hidden; position: relative; }
.img-container img { width: 100%; height: 100%; object-fit: cover; }
.ratio-1-1 { aspect-ratio: 1 / 1; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.ratio-16-9 { aspect-ratio: 16 / 9; }
.ratio-21-9 { aspect-ratio: 21 / 9; }
.ratio-original { aspect-ratio: auto; }


/* =========================================
   10. 響應式佈局微調 (Responsive Utilities)
   ========================================= */
@media (max-width: 991px) {
    /* 手機版導覽列留白 */
    body { padding-top: var(--navbar-height-mobile); }
    
    /* 手機版選單排版重置 */
    .navbar .has-megamenu { position: relative !important; }
    .navbar .dropdown-menu.mega-menu {
        width: auto; padding: 15px; box-shadow: none; border-top: none; border: none;
        background: #fff; margin:0 10px;
    }
    
    .mega-cat-img { height: 60px; }
    .mega-cat-item { margin-bottom: 10px; padding: 10px; background: #fff; border: 1px solid #eee; }
    
    /* 確保手機版選單可以滾動 */
    .navbar-collapse { min-height: 100dvh; overflow-y: auto; padding-bottom: 20px; }
}