/* ==========================================================
   Nav & Footer layout patch — v2
   • 左上角：保留 Huodian 双行文字品牌（无 HD 徽章）
   • 正中间：Hotline 电话胶囊
   • 右侧：Home / About… 菜单项 + Get a Quote CTA + 汉堡
   • 修复 Home 按钮变形（防止 grid 拉伸 li / a）
   Loads AFTER theme-apple-fire.css
   ========================================================== */

/* ───────── Nav 三段式稳定 Grid（核心重构） ───────── */
.nav-container {
    display: grid !important;
    grid-template-columns: auto 1fr auto !important;
    grid-template-rows: auto;
    align-items: center;
    gap: 16px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

/* ───────── 左上角：Huodian 双行品牌字 ───────── */
.nav-brand {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.05;
    text-decoration: none !important;
    padding: 4px 2px;
    justify-self: start;
    white-space: nowrap;
}
.nav-brand-main {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(135deg,
        #ffffff 0%,
        #e8e8ed 50%,
        #d2d2d7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-brand-dot {
    color: #ff6a00;
    -webkit-text-fill-color: #ff6a00;
}
.nav-brand-sub {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: #ffa514;
    margin-top: 3px;
    opacity: 0.95;
}
.nav-brand:hover .nav-brand-main {
    background: linear-gradient(135deg,
        #ffffff 0%,
        #ffe3bf 60%,
        #ffa514 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ───────── 中间：联系方式 Hotline 胶囊 ───────── */
.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px 8px 12px;
    border-radius: 50px;
    background: linear-gradient(135deg,
        rgba(255, 165, 20, 0.10) 0%,
        rgba(255, 106, 0, 0.14) 100%);
    border: 1px solid rgba(255, 106, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    text-decoration: none !important;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
    justify-self: center;       /* Grid item 居中在 1fr 列内 */
    white-space: nowrap;
    max-width: 100%;
}
.nav-phone:hover {
    background: linear-gradient(135deg,
        rgba(255, 165, 20, 0.18) 0%,
        rgba(255, 106, 0, 0.22) 100%);
    border-color: rgba(255, 106, 0, 0.65);
    box-shadow:
        0 8px 24px rgba(255, 106, 0, 0.25),
        0 0 0 1px rgba(255, 106, 0, 0.22);
    transform: translateY(-2px);
}

/* WhatsApp 图标（方形胶囊 + WhatsApp 品牌绿渐变） */
.nav-phone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        #25D366 0%,
        #1ebe5a 55%,
        #128C7E 100%);
    color: #ffffff;
    flex-shrink: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 6px 18px rgba(18, 140, 126, 0.45);
}
.nav-phone-icon svg {
    width: 22px;
    height: 22px;
    stroke: none !important;  /* 新图标是 fill，不需要 stroke */
}

/* 电话文本（双行） */
.nav-phone-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}
.nav-phone-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-weight: 600;
    color: #ffa514;
    opacity: 0.95;
    margin-bottom: 3px;
}
.nav-phone-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg,
        #ffffff 0%,
        #ffd0a8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 4px rgba(255, 106, 0, 0.35));
}

/* ───────── 右侧：Nav Menu + CTA 汉堡 ───────── */
.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-self: end;
    min-width: 0;
}

/* ══════════════════════════════════════════════════
   修复 Home 等菜单项变形的核心规则：
   1) ul/li 保持 inline 流，不做拉伸
   2) nav-link 强制 inline-block + 固定 box-sizing + 明确 padding/line-height
   3) 禁止任何 grid-row grid-column 规则让 li/a 铺满
   ══════════════════════════════════════════════════ */
.nav-right .nav-menu {
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;    /* inline-flex 而不是 flex，防止独占行 */
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-end;
    gap: 4px !important;
    list-style: none !important;
    min-width: 0;
}
.nav-right .nav-menu li {
    display: inline-block !important;  /* 关键：li 保持 inline，不被 grid 拉伸 */
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 修复 a.nav-link 变形：明确 inline-block、宽高不继承 */
.nav-right .nav-menu li a.nav-link {
    display: inline-block !important;
    box-sizing: border-box !important;
    width: auto !important;           /* 不允许被父级拉成全宽 */
    height: auto !important;
    min-width: 0;
    padding: 9px 16px !important;      /* 和 style.css 原始 padding 保持一致 */
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
    border-radius: 10px !important;
    float: none !important;
    position: relative !important;
}

/* 重设 .nav-link.active 的下划线不影响尺寸 */
.nav-right .nav-menu li a.nav-link.active {
    background: rgba(255, 106, 0, 0.14) !important;
    color: #ffffff !important;
}
.nav-right .nav-menu li a.nav-link.active::after {
    content: '';
    position: absolute !important;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: linear-gradient(135deg, #ff3b00 0%, #ff6a00 50%, #ffa514 100%) !important;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 106, 0, 0.85);
    display: block !important;
}

/* ───────── 页脚品牌区（无 HD 徽章，纯文字） ───────── */
.footer-brand .nav-logo {
    display: none !important;
}
.footer-brand::before {
    content: "HUODIAN";
    display: inline-block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    background: linear-gradient(135deg,
        #ffffff 0%,
        #e8e8ed 45%,
        #ffa514 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 1px 4px rgba(255, 106, 0, 0.2));
}
.footer-brand::after {
    content: "ELECTRONIC TECHNOLOGY · EST. 2014";
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.28em;
    font-weight: 600;
    color: #ffa514;
    margin-bottom: 18px;
    opacity: 0.9;
}

/* ───────── 响应式断点 ───────── */

/* 大屏 */
@media (max-width: 1240px) {
    .nav-right .nav-menu li a.nav-link {
        padding: 8px 13px !important;
        font-size: 0.88rem !important;
    }
    .btn-nav {
        padding: 9px 18px !important;
        font-size: 0.86rem !important;
    }
}

@media (max-width: 1100px) {
    .nav-phone-label {
        display: none;
    }
    .nav-phone {
        padding: 7px 14px 7px 9px;
        gap: 10px;
    }
    .nav-phone-number {
        font-size: 0.98rem;
    }
}

/* 平板 - 隐藏菜单转为汉堡下抽屉，保留电话+品牌+CTA+汉堡 */
@media (max-width: 940px) {
    .nav-container {
        grid-template-columns: auto 1fr auto !important;
        row-gap: 0;
    }
    .nav-right .nav-menu {
        display: none !important;
    }

    /* 汉堡面板 — absolute overlay 不参与 grid 尺寸，防止顶栏变高 */
    .nav-right .nav-menu.mobile-open {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        padding: 18px !important;
        margin: 0 !important;
        background:
            linear-gradient(rgba(10, 10, 12, 0.97), rgba(8, 8, 10, 0.99)) padding-box,
            linear-gradient(135deg, #ff3b00, #ff6a00, #ffa514) border-box !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-bottom: 1px solid transparent !important;
        backdrop-filter: blur(24px) saturate(1.4) !important;
        z-index: 999;
    }

    /* 在 mobile-open 抽屉里，li 和 a 改为独占整行 */
    .nav-right .nav-menu.mobile-open li {
        display: block !important;
        width: 100% !important;
    }
    .nav-right .nav-menu.mobile-open li a.nav-link {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 14px 18px !important;
    }

    .nav-toggle {
        display: inline-flex !important;
    }

    .footer-brand {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 680px) {
    .nav-brand-sub {
        display: none;
    }
    .nav-brand-main {
        font-size: 1.1rem;
    }
    .btn-nav {
        display: none !important;
    }
    .nav-phone-number {
        font-size: 0.9rem;
    }
    .nav-phone {
        padding: 6px 12px 6px 7px;
        gap: 8px;
    }
    .nav-phone-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    .nav-phone-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px !important;
        gap: 6px;
    }
    .nav-phone-label {
        display: none;
    }
    .nav-phone-number {
        font-size: 0.78rem;
        letter-spacing: 0;
        white-space: nowrap;
    }
    .nav-phone-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }
    .nav-phone-icon svg {
        width: 18px;
        height: 18px;
    }
    .nav-phone {
        padding: 4px 10px 4px 4px;
        gap: 6px;
    }
}
