/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', '微軟正黑體', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Top Navigation Bar */
.top-nav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 80px;
}

.nav-container {
    max-width: none;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
    margin-right: 15px;
}

.logo-text {
    font-size: 20px;
    font-weight: bold;
    color: #d32f2f;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-menu li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s;
}

.nav-menu li a:hover {
    color: #d32f2f;
}

/* Secondary Navigation Bar */
.secondary-nav {
    background-color: rgba(51, 51, 51, 0.85);
    height: 50px;
    width: 100%;
    position: relative;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secondary-nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.secondary-nav-menu li a {
    color: black;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.secondary-nav-menu li a:hover {
    color: #ffcccc;
}

/* Main Content Area - Basic Positioning */
.main-content {
    min-height: calc(100vh - 110px);
}

.banner-overlay {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100vw;
    height: 40px;
    background-color: rgba(96, 96, 96, 0.8);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.sub-menu-item a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
  border: 1px solid transparent;
}

.sub-menu-item a:hover {
  color: #ffffff;
  transform: translateY(-2px) scale(1.1);
}


/* ── Hamburger Button ──────────────────────────────────────── */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
}

.hamburger-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 漢堡 → X 動畫 */
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile Menu ───────────────────────────────────────────── */
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 997;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.mobile-menu.open {
    display: block;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 一級選單項目觸發區 */
.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    background-color: #fff;
    border-bottom: 1px solid #e8e8e8;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-link:hover {
    background-color: #f5f5f5;
    color: #d32f2f;
}

.mobile-arrow {
    font-size: 11px;
    color: #888;
    transition: transform 0.3s ease;
}

.mobile-nav-item.open .mobile-arrow {
    transform: rotate(180deg);
}

/* 二級子選單 */
.mobile-sub-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: rgba(51, 51, 51, 0.9);
}

.mobile-nav-item.open .mobile-sub-menu {
    display: block;
}

.mobile-sub-menu li a {
    display: block;
    padding: 13px 20px 13px 36px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s;
}

.mobile-sub-menu li a:hover {
    background-color: rgba(211, 47, 47, 0.35);
}

/* ── RWD Breakpoint ────────────────────────────────────────── */
@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }

    .banner-overlay {
        display: none !important;
    }

    /* Logo 縮小 35% */
    .logo img {
        height: 33px;
        margin-right: 10px;
    }

    .logo-text {
        font-size: 13px;
    }

    /* Hamburger 縮小 35% */
    .hamburger-btn {
        display: flex;
        width: 26px;
        height: 26px;
        padding: 4px;
        gap: 4px;
    }

    .hamburger-btn span {
        width: 16px;
        height: 2px;
    }

    /* 重新計算 X 動畫位移 (gap:4px + height:2px → 6px) */
    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger-btn.active span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* Footer */
.footer {
    background-color: #333;
    color: white;
    padding: 40px 20px 20px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #d32f2f;
}

.footer-section p, .footer-section a {
    color: #ccc;
    text-decoration: none;
    line-height: 1.6;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #999;
}

