/* =========================================
   1. 全局設定與 CSS Reset (Global Variables)
========================================= */
:root {
    --bg-color: #F9F8F6;       /* 燕麥白背景 */
    --text-primary: #1A1A1A;   /* 炭灰主文字 */
    --text-secondary: #555555; /* 次要文字 */
    --brand-color: #7D8C7A;    /* 鼠尾草綠主色 */
    --brand-hover: #5f6b5d;    
    --footer-bg: #1A1A1A;      /* 深色頁尾 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

/* =========================================
   2. 導覽列與巨型選單 (Navigation & Mega Menu)
========================================= */
.main-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4rem;
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    position: relative; /* 讓下拉選單以此為定位基準 */
    height: 80px;
}

.brand-logo a {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-decoration: none;
}

/* =========================================
   搜尋列 (Search Bar) - 優化點擊與 Focus 狀態
========================================= */
.search-bar {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 8px 15px;
    width: 250px;
    transition: all 0.3s ease;
}

/* 當使用者點擊輸入框時的高亮效果 */
.search-bar:focus-within {
    border-color: var(--brand-color);
    background: #fff;
    box-shadow: 0 0 5px rgba(125, 140, 122, 0.2); 
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.search-bar button:hover {
    color: var(--brand-color);
}

/* 第一層主選單排版 */
.nav-menu {
    display: flex;
    list-style: none;
    height: 100%;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-item:hover .nav-link {
    color: var(--brand-color);
}

/* =========================================
   導覽列右側功能區 (Language, Login, Cart)
========================================= */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.lang-switcher, .user-profile, .cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
}

.lang-switcher:hover, .user-profile:hover, .cart-btn:hover {
    color: var(--brand-color);
}

/* 讓 SVG 圖示垂直置中 */
.nav-actions svg {
    display: block;
}

/* 購物車數字小標籤 (Cart Badge) */
.cart-btn {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -10px;
    background-color: var(--brand-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1;
}

.menu-toggle {
    display: none; /* 桌面版隱藏 */
    cursor: pointer;
    font-size: 24px;
}

/* 巨型選單面板 (Mega Menu Panel) */
.mega-menu-panel {
    display: none;
    position: absolute;
    top: 100%; /* 貼齊導航列底部 */
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    padding: 40px 60px;
    box-sizing: border-box;
    z-index: 100;
    border-top: 1px solid #eee;
}

.nav-item.has-mega-menu:hover .mega-menu-panel {
    display: flex;
    justify-content: space-between;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-columns {
    display: flex;
    gap: 60px;
}

.column-title {
    font-size: 14px;
    color: #767676;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sub-menu {
    list-style: none;
}

.sub-menu li {
    margin-bottom: 12px;
}

.sub-menu a {
    font-size: 14px;
    color: #111;
    text-decoration: none;
}

.sub-menu a:hover {
    text-decoration: underline;
    font-weight: 500;
    color: var(--brand-color);
}

/* 視覺亮點區 (精選實拍圖片) */
.menu-featured-image {
    width: 320px;
    display: flex;
    flex-direction: column;
}

.menu-featured-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
}

.featured-text span {
    font-size: 12px;
    color: #cc0000;
    font-weight: 700;
}

.featured-text h4 {
    margin: 6px 0 16px;
    font-size: 18px;
}

.btn-shop-now {
    display: inline-block;
    background-color: #111;
    color: #fff;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 40px;
    text-align: center;
    transition: background 0.3s;
    text-decoration: none;
}

.btn-shop-now:hover {
    background-color: #333;
}

/* =========================================
   3. 主視覺 (Hero Banner)
========================================= */
.hero-banner {
    position: relative;
    width: 100%;
    height: 70vh;
    /* 已將背景替換為你的現代傢俱實拍圖 */
    background-image: url('../Img/Furniture/modern-furniture.jpg'); 
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(249, 248, 246, 0.3); /* 半透明遮罩 */
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--text-primary);
    padding: 2rem;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

/* =========================================
   區塊 2：主視覺大輪播 (Hero Carousel) 改良
========================================= */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0; /* 預設隱藏 */
    transition: opacity 0.8s ease-in-out;
}

.carousel-slide.active {
    opacity: 1; /* 顯示 active 狀態的輪播圖 */
}

.carousel-slide::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(249, 248, 246, 0.2); /* 降低遮罩濃度，展現實拍質感 */
}

/* 輪播控制點 */
.carousel-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: var(--brand-color);
}

/* =========================================
   區塊 3：熱門商品分類捷徑 (Category Quick Links)
========================================= */
.category-quick-links {
    padding: 5rem 4rem 2rem;
    text-align: center;
}

.category-grid {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 3rem;
}

.category-item {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.category-item:hover {
    transform: translateY(-10px);
}

.category-img-wrapper {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    background-color: #f0f0f0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.category-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-item h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

/* =========================================
   區塊 4：空間靈感精選 (Inspiration Preview)
========================================= */
.inspiration-preview {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 4rem 4rem 5rem;
    background-color: #fff;
}

.inspiration-container {
    flex: 2;
    height: 600px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.inspiration-text {
    flex: 1;
    padding: 4rem;
    background-color: var(--bg-color);
    height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.inspiration-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.inspiration-text p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.btn-outline {
    display: inline-block;
    padding: 12px 28px;
    border: 2px solid var(--text-primary);
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    align-self: flex-start;
}

.btn-outline:hover {
    background-color: var(--text-primary);
    color: #fff;
}

/* 懸浮商品卡片 (IKEA Style) */
.floating-product-card {
    position: absolute;
    bottom: 40px;
    right: -50px; /* 故意凸出圖片邊緣創造層次感 */
    width: 250px;
    background: #fff;
    padding: 15px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f5f5f5;
}

.floating-info h4 {
    font-size: 1rem;
    margin: 0;
}

.view-details {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--brand-color);
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 14px 36px;
    background-color: var(--brand-color);
    color: #ffffff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--brand-hover);
    transform: translateY(-2px);
}

/* =========================================
   4. 商品區塊 (Trending Section)
========================================= */
.trending-section {
    padding: 5rem 4rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.product-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.product-card .card-img {
    width: 100%;
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    background-color: #F5F5F7;
    position: relative;
}

.product-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease-in-out;
}

.product-card:hover .card-img img {
    transform: scale(1.06);
}

.card-info {
    padding: 1.5rem;
    text-align: center;
}

.card-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-info .price {
    color: var(--brand-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    padding: 8px 24px;
    background: transparent;
    border: 1px solid var(--brand-color);
    color: var(--brand-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    border-radius: 4px;
}

.add-to-cart-btn:hover {
    background: var(--brand-color);
    color: #fff;
}

/* =========================================
   5. 頁尾 (Footer)
========================================= */
.site-footer {
    background-color: var(--footer-bg);
    color: #ffffff;
    padding: 4rem 4rem 2rem 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-brand h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-brand p {
    color: #aaaaaa;
}

.footer-links h4, .footer-social h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #aaaaaa;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--brand-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: #aaaaaa;
    transition: color 0.3s;
}

.social-icons a:hover {
    color: var(--brand-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333333;
    color: #777777;
    font-size: 0.9rem;
}

/* =========================================
   IKEA 式互動熱點 (Hotspots) - 新增
========================================= */
.hotspot {
    position: absolute;
    z-index: 10;
}

/* 脈衝發光的白點 */
.hotspot-dot {
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    position: relative;
    animation: pulse 2s infinite; /* 加入呼吸燈效果吸引點擊 */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.hotspot-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #111;
    border-radius: 50%;
}

.hotspot:hover .hotspot-dot {
    transform: scale(1.2);
    background-color: #fff;
    animation: none; /* 游標懸停時停止呼吸燈 */
}

/* 浮現的商品資訊卡片 */
.hotspot-tooltip {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background-color: #fff;
    padding: 12px 16px;
    width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-align: left;
}

.hotspot:hover .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hotspot-tooltip h4 {
    font-size: 14px;
    margin-bottom: 4px;
    color: #111;
    font-family: 'Inter', sans-serif;
}

.hotspot-tooltip .price {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 10px;
}

.hotspot-tooltip a {
    font-size: 12px;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee;
    padding-top: 8px;
    transition: color 0.2s;
}

.hotspot-tooltip a:hover {
    color: var(--brand-color);
}