/* =========================================================================
   GWA Energy - Site Design System (2026-10)
   與 minica 品牌站 (minica.gwaenergy.com.tw) 一致：暖白底、墨黑字、單一橘色重點
   ========================================================================= */

:root {
    /* 色彩 */
    --ink: #111111;
    --ink-2: #3A3633;
    --muted: #6F6862;          /* 內文次要字，於 --paper 上對比 ≥ 4.5 */
    --muted-2: #8A817C;        /* 裝飾/輔助線條 */
    --line: #E6E0D7;
    --paper: #F8F6F2;
    --paper-2: #EFEBE4;
    --surface: #FFFFFF;
    --brand: #FF6B00;          /* minica 橘：只用於按鈕底色、重點標示 */
    --brand-strong: #C2410C;   /* 橘色文字/連結用 (AA) */
    --brand-soft: #FFF1E6;
    --success: #1F7A4D;
    --danger: #B42318;

    /* 字體 */
    --font-sans: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* 尺寸 */
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(17, 17, 17, .06);
    --shadow: 0 10px 30px rgba(17, 17, 17, .08);
    --nav-h: 72px;
    --container: 1200px;

    /* 舊頁面相容 (News / news-detail 等仍使用這些變數) */
    --primary-color: var(--ink);
    --accent-color: var(--brand);
    --text-dark: var(--ink);
    --bg-light: var(--paper);

    /* Bootstrap 5 主色改為品牌色系 */
    --bs-primary: #111111;
    --bs-primary-rgb: 17, 17, 17;
    --bs-link-color: var(--brand-strong);
    --bs-link-hover-color: #9A3412;
    --bs-body-font-family: var(--font-sans);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--paper);
    --bs-border-color: var(--line);
}

/* ---------- Base ---------- */
html { scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
    overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { color: var(--ink); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: #9A3412; }
p a, li a { text-decoration: underline; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 12px; color: #fff; }

/* Bootstrap 覆寫：舊頁面的 text-primary / btn-primary 不再出現 Bootstrap 藍 */
.text-primary { color: var(--ink) !important; }
.bg-primary { background-color: var(--ink) !important; }
.text-warning { color: var(--brand-strong) !important; }
.btn-primary { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: #000; --bs-btn-hover-border-color: #000; --bs-btn-active-bg: #000; }
.btn-outline-primary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink); --bs-btn-hover-border-color: var(--ink); --bs-btn-hover-color: #fff; }
.form-control, .form-select { border-color: var(--line); border-radius: 10px; padding: .65rem .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--ink); box-shadow: 0 0 0 .2rem rgba(255, 107, 0, .25); }
.form-label { font-weight: 600; font-size: .92rem; }

/* ---------- Layout ---------- */
.container-xl { max-width: var(--container); }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.section-alt { background: var(--surface); }
.section-dark { background: var(--ink); color: #EDE9E3; }
.section-dark h1, .section-dark h2, .section-dark h3 { color: #fff; }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand-strong); margin-bottom: .75rem; }
.section-dark .eyebrow { color: var(--brand); }
.lead-muted { color: var(--muted); font-size: 1.1rem; }
.display-title { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 800; letter-spacing: -.02em; }
.section-title { font-size: clamp(1.7rem, 3vw, 2.4rem); margin-bottom: 1rem; }
.page-hero { padding: calc(var(--nav-h) + 64px) 0 56px; background: var(--paper); border-bottom: 1px solid var(--line); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.page-hero p { color: var(--muted); max-width: 680px; font-size: 1.1rem; }

/* 舊頁面的 .page-header 與 section-padding 統一外觀 */
.page-header { padding: calc(var(--nav-h) + 56px) 0 48px !important; background: var(--paper) !important; color: var(--ink) !important; border-bottom: 1px solid var(--line); }
.page-header h1, .page-header p { color: var(--ink) !important; }
.section-padding { padding: 96px 0; }
.section-title h2 { color: var(--ink); }
.section-title .line { background: var(--brand); }

/* ---------- Buttons ---------- */
.btn { border-radius: 999px; font-weight: 600; padding: .7rem 1.4rem; }
.btn-sm { padding: .4rem .9rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn-brand { background: var(--brand); color: var(--ink); border: 1px solid var(--brand); }
.btn-brand:hover, .btn-brand:focus { background: #E85F00; border-color: #E85F00; color: var(--ink); }
.btn-ink { background: var(--ink); color: #fff; border: 1px solid var(--ink); }
.btn-ink:hover, .btn-ink:focus { background: #000; color: #fff; }
.btn-line { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-line:hover, .btn-line:focus { background: var(--ink); color: #fff; }
.btn-light-line { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.6); }
.btn-light-line:hover { background: #fff; color: var(--ink); }
/* 舊按鈕類別相容 */
.btn-custom-primary { background: var(--brand); color: var(--ink); border: 1px solid var(--brand); border-radius: 999px; }
.btn-custom-primary:hover { background: #E85F00; color: var(--ink); }

/* ---------- Navbar ---------- */
.site-nav {
    position: fixed; inset: 0 0 auto 0; z-index: 1030; height: var(--nav-h);
    display: flex; align-items: center;
    background: rgba(248, 246, 242, .88);
    -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.site-nav.is-scrolled { border-bottom-color: var(--line); background: rgba(248, 246, 242, .97); }
.site-nav .navbar-brand img { height: 40px; width: auto; }
.site-nav .nav-link { color: var(--ink); font-weight: 500; padding: .5rem .85rem !important; border-radius: 999px; }
.site-nav .nav-link:hover, .site-nav .nav-link.active { background: var(--paper-2); color: var(--ink); }
.site-nav .dropdown-menu { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem; min-width: 240px; }
.site-nav .dropdown-item { border-radius: 10px; padding: .55rem .8rem; font-weight: 500; }
.site-nav .dropdown-item small { display: block; color: var(--muted); font-weight: 400; }
.site-nav .dropdown-item:hover { background: var(--paper); color: var(--ink); }
@media (max-width: 991.98px) {
    .site-nav { height: auto; min-height: var(--nav-h); }
    .site-nav .navbar-collapse { background: var(--paper); border-top: 1px solid var(--line); margin: 0 -12px; padding: 12px; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
    .site-nav .dropdown-menu { box-shadow: none; border: 0; padding-left: 1rem; }
}

/* ---------- Hero (home) ---------- */
.hero { padding: calc(var(--nav-h) + 48px) 0 72px; background: var(--paper); overflow: hidden; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); font-weight: 800; letter-spacing: -.03em; }
.hero .hero-sub { color: var(--muted); font-size: 1.2rem; max-width: 560px; }
.hero-visual { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.hero-stats strong { display: block; font-size: 1.6rem; font-weight: 800; }
.hero-stats span { color: var(--muted); font-size: .9rem; }

/* ---------- Cards ---------- */
.card-soft { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; height: 100%; transition: box-shadow .2s, transform .2s; }
.card-soft:hover { box-shadow: var(--shadow); }
.card-soft .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem; }
.card-media { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.card-media .media { aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.card-media .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card-media:hover .media img { transform: scale(1.03); }
.card-media .body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-media .body .mt-auto { padding-top: 1rem; }
.spec-list { list-style: none; padding: 0; margin: 0; }
.spec-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.spec-list li span:first-child { color: var(--muted); }
.spec-list li span:last-child { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.badge-soft { display: inline-block; background: var(--paper-2); color: var(--ink-2); border-radius: 999px; padding: .25rem .7rem; font-size: .8rem; font-weight: 600; }
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); }

/* 舊卡片類別相容 */
.category-card { border-radius: var(--radius-lg); box-shadow: none; border: 1px solid var(--line); }
.category-card:hover { transform: none; box-shadow: var(--shadow); }
.feature-item:hover .feature-icon-circle { transform: none; }

/* ---------- Dealer band / CTA ---------- */
.cta-band { background: var(--ink); color: #EDE9E3; border-radius: var(--radius-lg); padding: 48px; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #CFC8BF; }

/* ---------- News ---------- */
.news-card { display: block; color: var(--ink); text-decoration: none; }
.news-card:hover { color: var(--ink); }
.news-card .media { aspect-ratio: 16 / 10; border-radius: var(--radius); overflow: hidden; background: var(--paper-2); }
.news-card .media img { width: 100%; height: 100%; object-fit: cover; }
.news-card time { color: var(--muted); font-size: .85rem; }
.news-card h3 { font-size: 1.1rem; margin-top: .4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #BDB6AD; padding: 72px 0 32px; }
.site-footer h4 { color: #fff; font-size: .95rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 1.1rem; }
.site-footer a { color: #D8D2CA; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer .footer-logo { height: 40px; background: #fff; border-radius: 8px; padding: 6px 10px; }
.site-footer .legal { border-top: 1px solid #2B2825; margin-top: 48px; padding-top: 24px; font-size: .85rem; }

/* ---------- Cookie banner ---------- */
#cookie-banner-container { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1060; pointer-events: none; }
.cookie-toast { pointer-events: auto; max-width: 560px; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cookie-toast:not(.show) { display: none; }

/* ---------- Reveal (取代 AOS；無 JS 或減少動態時內容直接顯示) ---------- */
.js-reveal [data-aos] { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.js-reveal [data-aos].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .js-reveal [data-aos] { opacity: 1; transform: none; transition: none; }
    * { scroll-behavior: auto !important; }
}

/* ---------- Dealer portal ---------- */
.portal-shell { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 72px; min-height: 70vh; }
.portal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 24px; }
.portal-bar .nav-pills .nav-link { border-radius: 999px; color: var(--ink); font-weight: 600; }
.portal-bar .nav-pills .nav-link.active { background: var(--ink); color: #fff; }
.part-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%; display: flex; flex-direction: column; }
.part-card .media { aspect-ratio: 1 / 1; background: var(--paper-2); display: flex; align-items: center; justify-content: center; }
.part-card .media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.part-card .media .ph { color: var(--muted-2); font-size: 2.2rem; }
.part-card .body { padding: 16px; display: flex; flex-direction: column; flex: 1; gap: .35rem; }
.part-card .pn { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; color: var(--muted); }
.part-card h3 { font-size: 1rem; margin: 0; }
.stock-in { color: var(--success); font-weight: 600; font-size: .85rem; }
.stock-low { color: #A15C07; font-weight: 600; font-size: .85rem; }
.stock-out { color: var(--danger); font-weight: 600; font-size: .85rem; }
.qty-input { width: 84px; text-align: center; }
.cart-count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--ink); font-size: .75rem; font-weight: 700; align-items: center; justify-content: center; margin-left: 6px; }
.status-pill { display: inline-block; border-radius: 999px; padding: .2rem .7rem; font-size: .8rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); }
.status-Submitted { background: #FFF1E6; color: #9A3412; }
.status-Confirmed, .status-PISent { background: #EAF2FF; color: #1D4ED8; }
.status-Shipped { background: #E7F6EE; color: var(--success); }
.status-Completed { background: #EDEDED; color: #333; }
.status-Cancelled { background: #FDECEA; color: var(--danger); }
.auth-card { max-width: 480px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px; }
.auth-card.wide { max-width: 760px; }
.empty-state { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; margin-bottom: 1rem; color: var(--muted-2); }

/* ---------- Utilities ---------- */
.text-muted-2 { color: var(--muted) !important; }
.rounded-xl { border-radius: var(--radius-lg) !important; }
.border-line { border-color: var(--line) !important; }
@media (max-width: 767.98px) {
    .section, .section-padding { padding: 64px 0; }
    .cta-band { padding: 32px 24px; }
    .hero-stats { gap: 1.5rem; }
}
