/**
 * 柳林酒业官网 - 公共导航栏样式
 * 三区域布局：左侧（胶囊包裹logo）、中间（导航链接）、右侧（可展开搜索）
 * 所有子页面统一引用
 */

/* ===== 导航栏主体 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.navbar-content {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 0;
}

/* ===== 左侧区域：白色胶囊 + 金色描边包裹 logo ===== */
.navbar-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid rgba(227, 148, 35, 0.4);
    border-radius: 32px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(227, 148, 35, 0.08);
    margin: 8px 28px 8px 0;
    padding: 0 12px;
    height: 48px;
}

/* Logo */
.navbar-left .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0 18px;
    height: 100%;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* ===== 中间区域：导航链接 ===== */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 1px;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
    padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
    color: #e39423;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #e39423;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* 高亮按钮 */
.nav-link.highlight {
    background: var(--white);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
}

.nav-link.highlight:hover {
    background: var(--off-white);
    transform: translateY(-2px);
}

.nav-link.highlight::after {
    display: none;
}

/* ===== 右侧区域：可展开搜索 ===== */
.navbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-left: 16px;
}

/* 搜索容器 */
.search-wrap {
    display: flex;
    align-items: center;
    position: relative;
    height: 40px;
}

/* 搜索输入框 - 默认隐藏 */
.search-input {
    width: 0;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.35s ease;
    opacity: 0;
    pointer-events: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* 展开状态 */
.search-wrap.open .search-input {
    width: 180px;
    padding: 0 14px 0 36px;
    opacity: 1;
    pointer-events: auto;
}

.search-wrap.open .search-btn {
    position: absolute;
    left: 8px;
    background: transparent;
    border-color: transparent;
}

/* 搜索按钮 */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
    padding: 0;
    flex-shrink: 0;
    z-index: 1;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e39423;
    border-color: rgba(227, 148, 35, 0.5);
}

.search-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== 移动端汉堡按钮 ===== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    margin-left: auto;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--white);
}

/* ===== 移动端导航菜单 ===== */
.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.mobile-nav.active {
    display: block;
}

.mobile-nav a {
    display: block;
    color: var(--white);
    text-decoration: none;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav a.highlight-mobile {
    background: var(--white);
    color: var(--primary);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

/* ===== 移动端遮罩层 ===== */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
    transition: opacity 0.3s;
}

.mobile-nav-overlay.active {
    display: block;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    /* 移动端隐藏搜索和胶囊装饰 */
    .navbar-right,
    .navbar-left {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        padding: 0;
        height: auto;
    }

    .navbar-left .logo {
        padding: 0;
    }

    /* 隐藏桌面端导航 */
    .desktop-nav {
        display: none;
    }

    /* 显示汉堡按钮 */
    .hamburger {
        display: flex;
    }
}
