/* ==========================================================================
   common.css — Shared styles for Chuanwei Fire website
   Used by: index.html (homepage) + all product pages
   ========================================================================== */

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    color: #333;
    line-height: 1.6;
    background: #fff;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ===== CSS Variables ===== */
:root {
    --primary: #1a5276;
    --primary-light: #2e86c1;
    --primary-dark: #0e2f44;
    --accent: #e74c3c;
    --bg-light: #f8f9fa;
    --bg-dark: #1a1a2e;
    --text: #333;
    --text-light: #666;
    --white: #fff;
    --border: #e0e0e0;
}

/* ===== Header ===== */
.header {
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000; background: var(--white);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
}
.header-inner {
    display: flex; align-items: center;
    justify-content: space-between; padding: 8px 0; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-img { height: 40px; width: auto; border-radius: 6px; }
.logo-text { display: flex; flex-direction: column; }
.logo-text h1 {
    font-size: 17px; font-weight: 700; color: var(--primary); line-height: 1.2;
}
.logo-text span,
.logo-text .logo-sub {
    font-size: 10px; color: var(--text-light); letter-spacing: 0.3px;
}

/* ===== Navigation ===== */
.nav { display: flex; gap: 20px; align-items: center; }
.nav a {
    font-size: 13.5px; font-weight: 500; color: var(--text);
    transition: color 0.3s; position: relative; white-space: nowrap;
}
.nav a::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px; background: var(--primary-light);
    transition: width 0.3s;
}
.nav a:hover { color: var(--primary-light); }
.nav a:hover::after { width: 100%; }
.nav .quote-btn {
    background: var(--primary); color: #fff !important;
    padding: 7px 18px; border-radius: 6px; font-weight: 600;
    transition: background 0.3s; white-space: nowrap;
}
.nav .quote-btn::after { display: none; }
.nav .quote-btn:hover { background: var(--primary-dark); }

/* ===== Language Toggle ===== */
.lang-toggle {
    display: flex; align-items: center; gap: 4px;
    background: var(--bg-light); border-radius: 8px;
    padding: 3px; border: 1px solid var(--border);
}
.lang-btn {
    padding: 5px 11px; border: none; border-radius: 6px;
    font-size: 12px; font-weight: 600; cursor: pointer;
    background: transparent; color: var(--text-light);
    transition: all 0.25s; font-family: inherit; line-height: 1;
}
.lang-btn.active {
    background: var(--primary); color: var(--white);
}
.lang-btn:not(.active):hover { color: var(--primary); }

/* ===== Internationalization ===== */
.i18n-item { transition: opacity 0.15s; }
.i18n-switching .i18n-item { opacity: 0; }

/* ===== Menu Toggle (Mobile) ===== */
.menu-toggle {
    display: none; flex-direction: column; gap: 4px;
    cursor: pointer; background: none; border: none; padding: 4px;
}
.menu-toggle span {
    display: block; width: 24px; height: 2.5px;
    background: var(--primary); border-radius: 3px; transition: all 0.3s;
}

/* ===== Footer (Rich — used by homepage) ===== */
.footer {
    background: var(--bg-dark); color: rgba(255,255,255,0.65);
    padding: 44px 0 24px;
}
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 24px;
}
.footer h5 { color: var(--white); font-size: 15px; margin-bottom: 14px; }
.footer p { font-size: 13px; line-height: 1.7; }
.footer a { display: block; font-size: 13px; margin-bottom: 6px; transition: color 0.3s; }
.footer a:hover { color: var(--primary-light); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 18px; text-align: center; font-size: 12px;
}

/* ===== Floating Social Buttons ===== */
.social-float { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.social-float__item { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,0.15); transition: all 0.25s; }
.social-float__item:hover { transform: scale(1.15); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
.social-float__item--whatsapp { background: #25D366; } .social-float__item--whatsapp:hover { background: #1da851; }
.social-float__item--facebook { background: #1877F2; } .social-float__item--facebook:hover { background: #0d65d9; }
.social-float__item--linkedin { background: #0A66C2; } .social-float__item--linkedin:hover { background: #084e96; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate { animation: fadeInUp 0.5s ease forwards; }

/* ===== Bilingual Text Labels ===== */
.en-text { font-size: 12px; color: var(--primary-light); display: block; }
.zh-label { display: inline; }
.en-label { display: inline; font-size: 11px; color: #999; margin-left: 4px; }

/* ===== Responsive (Common Elements) ===== */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nav {
        display: none; position: absolute; top: 100%; left: 0;
        width: 100%; background: var(--white); padding: 16px 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        flex-direction: column; gap: 12px;
    }
    .nav.open { display: flex; }
    .menu-toggle { display: flex; }
    .footer-grid { grid-template-columns: 1fr; }
    .social-float { bottom: 16px; right: 16px; gap: 8px; }
    .social-float__item { width: 42px; height: 42px; }
}

@media (max-width: 480px) {
    .logo-text h1 { font-size: 15px; }
}
