/* ==========================================================================
   新懋鋁業股份有限公司 New-Green Aluminium CO., LTD.
   全站統一樣式檔 (css/style.css)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 變數與基礎設定 (Variables & Reset)
   -------------------------------------------------------------------------- */
:root {
    --primary-color: #0284c7;        /* 科技鋁藍 */
    --primary-hover: #0369a1;
    --dark-bg: #0f172a;               /* 深藍灰色 */
    --light-bg: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #334155;
    --text-muted: #64748b;
    --radius-sm: 6px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 25px -5px rgba(2, 132, 199, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --------------------------------------------------------------------------
   2. 頁首與頂部導覽列 (純白質感風格)
   -------------------------------------------------------------------------- */
.navbar-glass {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 12px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--dark-bg);
    font-weight: 700;
    font-size: 18px;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    line-height: 1.25;
}

.logo-text span {
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 400;
    display: block;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    color: var(--text-main);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.2s ease;
}

.nav-item:hover, 
.nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.btn-primary-glow {
    background: var(--primary-color);
    color: #ffffff !important;
    padding: 9px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 0 15px rgba(2, 132, 199, 0.3);
    transition: all 0.3s ease;
}

.btn-primary-glow:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 25px rgba(2, 132, 199, 0.6);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

/* --------------------------------------------------------------------------
   3. 主視覺 Banner 與頁頭 Theme
   -------------------------------------------------------------------------- */
.hero-banner-image {
    position: relative;
    background: url('../images/Taichung.jpg') center/cover no-repeat;
    color: #ffffff;
    /* 1. 增加 padding：從 100px 調整為 180px 或 200px */
    padding: 450px 0; 
    /* 2. 或直接指定最小高度（也可兩者同時設定） */
    min-height: 1300px; 
}

.hero-banner-image h1,
.hero-banner-image p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.page-header-theme {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 70px 0;
}

.badge-tech {
    display: inline-block;
    background: rgba(2, 132, 199, 0.25);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.section-padding { 
    padding: 70px 0; 
}

.bg-soft-gray { 
    background-color: #ffffff; 
}

.section-title-center { 
    text-align: center; 
    margin-bottom: 40px; 
}

.sub-heading { 
    color: var(--primary-color); 
    font-size: 12px; 
    font-weight: 700; 
    letter-spacing: 2px; 
}

/* 各頁面背景 Banner 樣式 */
.about-global-bg {
    position: relative;
    background: url('../images/global-bg.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
}

.about-global-bg h1,
.about-global-bg p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
}

.products-header-bg {
    position: relative;
    background: url('../images/products-header-bg.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
}

.products-header-bg h1,
.products-header-bg p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
}

.locations-header-bg {
    position: relative;
    background: url('../images/locations-header-bg.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
}

.locations-header-bg h1,
.locations-header-bg p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
}

.faq-header-bg {
    position: relative;
    background: url('../images/faq-header-bg.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
}

.faq-header-bg h1,
.faq-header-bg p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
}

.quote-header-bg {
    position: relative;
    background: url('../images/quote-header-bg.jpg') center/cover no-repeat;
    color: #ffffff;
    padding: 80px 0;
}

.quote-header-bg h1,
.quote-header-bg p {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
}

/* 通用按鈕 */
.btn-modern-primary {
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-modern-primary:hover { 
    background: var(--primary-hover); 
}

.btn-modern-outline {
    display: inline-block;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-modern-outline:hover { 
    background: var(--primary-color); 
    color: #ffffff; 
}

/* --------------------------------------------------------------------------
   4. 產品與加工服務卡片 (Products & Processing Cards)
   -------------------------------------------------------------------------- */
.grid-3-products,
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card-modern {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.product-img-box {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f1f5f9;
}

.product-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card-modern:hover .product-img-box img {
    transform: scale(1.05);
}

.product-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.product-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-content h3,
.product-body h3 {
    font-size: 20px;
    color: var(--dark-bg);
    margin-bottom: 10px;
    font-weight: 700;
}

.product-desc,
.product-body p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 15px;
}

.product-spec-list {
    list-style: none;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
    flex-grow: 1;
}

.product-spec-list li {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.5;
}

.btn-card-quote {
    display: block;
    text-align: center;
    background: #f8fafc;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-card-quote:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.product-body { 
    padding: 24px; 
}

.tech-spec-tag {
    display: inline-block;
    background: #e0f2fe;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.origin-tag {
    display: inline-block;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover, 
.filter-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   5. 全台據點地圖與圖片輪播 (Locations Page Styles)
   -------------------------------------------------------------------------- */
/* 預設通用圖片輪播容器 (適用於 products.html 等主要頁面) */
.carousel-container {
    position: relative;
    width: 100%;
    height: 600px; /* 通用預設高度：680px */
    overflow: hidden;
    background-color: #0f172a;
}

/* ==========================================================================
   locations.html 專用輪播高度微調 (完美調降高度，不影響 products.html)
   ========================================================================== */
.carousel-container.carousel-locations {
    height: 600px; /* PC 端據點頁降為 420px */
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* 確保廠區照片核心置中 */
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.carousel-btn.prev { left: 25px; }
.carousel-btn.next { right: 25px; }

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.dot.active, .dot:hover {
    background: var(--primary-color);
    width: 30px;
    border-radius: 6px;
}

/* 據點卡片網格 */
.locations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.location-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.location-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.location-header {
    background: #f8fafc;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.location-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-bg);
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-body {
    padding: 24px;
    display: flex;
    gap: 20px;
}

.location-info {
    flex: 1;
}

.location-info p {
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.location-info i {
    color: var(--primary-color);
    margin-top: 4px;
    width: 16px;
}

.qr-code-box {
    width: 110px;
    text-align: center;
    flex-shrink: 0;
}

.qr-code-box img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: opacity 0.2s ease;
}

.qr-code-box img:hover {
    opacity: 0.85;
}

.qr-code-box span {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 600;
}

.map-container {
    width: 100%;
    height: 250px;
    border-top: 1px solid var(--border-color);
    background: #e2e8f0;
}

.map-container iframe {
    width: 100% !important;
    height: 100% !important;
}

.phone-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.phone-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. 常見問題 (FAQ) & 我要詢價單 (Quote Form)
   -------------------------------------------------------------------------- */
.faq-item { 
    background: #ffffff; 
    border: 1px solid var(--border-color); 
    border-radius: 8px; 
    margin-bottom: 12px; 
}

.faq-question { 
    width: 100%; 
    padding: 18px 20px; 
    text-align: left; 
    background: none; 
    border: none; 
    font-weight: 600; 
    font-size: 16px; 
    cursor: pointer; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    color: var(--dark-bg);
}

.faq-answer { 
    display: none; 
    padding: 0 20px 20px; 
    color: var(--text-muted); 
    font-size: 14px; 
}

.faq-item.active .faq-answer { 
    display: block; 
}

.quote-form-card { 
    background: #ffffff; 
    border: 1px solid var(--border-color); 
    padding: 30px; 
    border-radius: var(--radius-md); 
}

.form-grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label { 
    display: block; 
    font-size: 14px; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--dark-bg);
}

.form-control { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-sm); 
    background: #f8fafc; 
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
}

/* --------------------------------------------------------------------------
   7. 頁尾 (Footer)
   -------------------------------------------------------------------------- */
.footer-dark {
    background: #090d16;
    color: #94a3b8;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3, 
.footer-nav h4 { 
    color: #ffffff; 
    margin-bottom: 12px; 
}

.footer-nav ul { 
    list-style: none; 
}

.footer-nav li { 
    margin-bottom: 10px; 
}

.footer-nav a { 
    color: #94a3b8; 
    text-decoration: none; 
    font-size: 14px; 
    transition: color 0.2s ease;
}

.footer-nav a:hover { 
    color: #ffffff; 
}

.footer-copyright { 
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
    padding-top: 20px; 
    font-size: 13px; 
    text-align: center; 
}

/* --------------------------------------------------------------------------
   8. 響應式排版 (Responsive Web Design Breakpoints)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .carousel-container {
        height: 520px; /* products.html 等通用頁面微調 */
    }
    .carousel-container.carousel-locations {
        height: 380px; /* locations.html 降高版微調 */
    }
}

@media (max-width: 992px) {
    .grid-3-products,
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .locations-grid { 
        grid-template-columns: 1fr; 
    }
    .footer-grid { 
        grid-template-columns: 1fr; 
    }
    .carousel-container {
        height: 420px;
    }
    .carousel-container.carousel-locations {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        flex-direction: column;
        padding: 15px 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
        z-index: 1001;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links .nav-item {
        padding: 14px 20px;
        font-size: 16px;
        display: block;
        width: 100%;
        text-align: center;
    }

    .footer-nav li {
        margin-bottom: 0;
    }

    .footer-nav a {
        display: block;
        padding: 10px 0;
        font-size: 15px;
    }

    .footer-brand p {
        padding: 6px 0;
    }

    .phone-link {
        padding: 6px 0;
        display: inline-block;
    }

    .carousel-container.carousel-locations {
        height: 280px;
    }
}

@media (max-width: 576px) {
    .carousel-container {
        height: 280px;
    }
    .carousel-container.carousel-locations {
        height: 220px;
    }
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    .carousel-btn.prev { left: 10px; }
    .carousel-btn.next { right: 10px; }
}

@media (max-width: 480px) {
    .grid-3-products,
    .product-grid { 
        grid-template-columns: 1fr; 
    }
    .location-body { 
        flex-direction: column-reverse; 
    }
    .qr-code-box { 
        width: 100%; 
        display: flex; 
        align-items: center; 
        gap: 15px; 
    }
    .qr-code-box img { 
        width: 80px; 
    }
}

/* --------------------------------------------------------------------------
   首頁 Banner 響應式微調 (針對平板與手機)
   -------------------------------------------------------------------------- */
/* 平板與手機螢幕 (寬度 768px 以下) */
@media (max-width: 768px) {
    .hero-banner-image {
        padding: 120px 0;   /* 縮減上下間距 */
        min-height: 400px;  /* 降低最小高度，防止圖片被過度拉大 */
    }
}

/* 小型手機螢幕 (寬度 480px 以下) */
@media (max-width: 480px) {
    .hero-banner-image {
        padding: 80px 0;    /* 進一步縮減間距 */
        min-height: 280px;  /* 適合手機螢幕的最佳視覺高度 */
    }
}