/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* 头部导航 */
.header {
    background-color: #66BB6A;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 100%;
    overflow: visible;
    position: relative;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.logo span {
    color: #ff9900;
}

/* 汉堡菜单按钮 - 默认隐藏，移动端显示 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    margin-left: auto;
    flex-shrink: 0;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 导航菜单 - 桌面端样式 */
.nav-menu {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* 移动端菜单头部 */
.menu-close-header {
    display: none;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    border-bottom-color: #ff9900;
}

/* 搜索框 */
.search-container {
    flex: 1;
    max-width: 400px;
    min-width: 250px;
    position: relative;
}

.search-box {
    display: flex;
    background: white;
    border-radius: 4px;
    overflow: hidden;
}

.search-box input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-box button {
    padding: 0.7rem 1.2rem;
    background-color: #ff9900;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background-color: #e68900;
}

/* 搜索建议下拉框 */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.7rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 0.7rem;
    border-radius: 4px;
}

.suggestion-info h4 {
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.suggestion-info p {
    font-size: 0.8rem;
    color: #ff9900;
    font-weight: bold;
}

/* 主内容区 */
.main-content {
    padding: 2rem 0;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #ff9900;
    display: inline-block;
    color: #2e7d32;
}

.category-section {
    margin-bottom: 3rem;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.category-title {
    font-size: 1.3rem;
    color: #2e7d32;
}

.view-all {
    color: #ff9900;
    text-decoration: none;
    font-size: 0.9rem;
}

.view-all:hover {
    text-decoration: underline;
}

/* 商品卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-content {
    padding: 0.8rem;
}

.card-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-category {
    color: #666;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

/* 分类标签 */
.category-tag {
    display: inline-block;
    background-color: #e9ecef;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin: 0.25rem;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
}

.category-tag:hover {
    background-color: #ff9900;
    color: white;
    transform: scale(1.05);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    color: #2e7d32;
    text-decoration: none;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #e8f5e9;
    border-color: #81c784;
}

.pagination .current {
    background-color: #81c784;
    color: white;
    border-color: #81c784;
}

.pagination .disabled {
    color: #ccc;
    border-color: #eee;
    pointer-events: none;
}

.page-info {
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* 语言切换器样式 */
.language-switcher {
    position: relative;
    margin-left: 1rem;
}

.lang-dropdown {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: white;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

.lang-icon {
    font-size: 1rem;
}

.lang-name {
    font-weight: 500;
}

.lang-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.lang-dropdown:hover .lang-arrow {
    transform: rotate(180deg);
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: #333 !important;
    transition: all 0.2s;
    cursor: pointer;
    background: white;
}

.lang-option:hover {
    background: #e8f5e9;
    color: #2e7d32 !important;
}

.lang-option.active {
    background: #81c784;
    color: white !important;
}

.lang-flag {
    font-size: 1.1rem;
}

/* 搜索结果页 */
.search-header {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-stats {
    color: #666;
    margin-top: 0.5rem;
}

.no-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 页脚 */
.footer {
    background-color: #232f3e;
    color: #aaa;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer a {
    color: #ff9900;
    text-decoration: none;
}

/* WhatsApp 横幅 */
.whatsapp-bar {
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 0;
}

.whatsapp-bar-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.85rem;
    color: #666;
}

.whatsapp-icon {
    font-size: 0.9rem;
    color: #888;
}

.whatsapp-label {
    color: #666;
    font-weight: normal;
}

.whatsapp-number {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.whatsapp-number:hover {
    color: #ff9900;
    text-decoration: underline;
}

.contact-image {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========================================
   移动端适配 (768px及以下)
   ======================================== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
        max-width: 100%;
        width: 100%;
    }

    /* 头部适配 */
    .header {
        padding: 0.8rem 0;
        overflow: visible;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
        position: relative;
    }

    .logo {
        flex-shrink: 0;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .logo span {
        display: inline;
    }

    /* 搜索框 */
    .search-container {
        order: 3;
        flex: 1;
        width: calc(100% - 45px);
        max-width: none;
        margin-top: 0.5rem;
        min-width: 0;
    }

    .search-box input {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }

    .search-box button {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    /* 汉堡菜单显示 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 导航菜单 - 移动端半屏侧滑样式 */
    .nav-menu {
        display: none;
        position: fixed;
        top: 0;
        left: auto;
        right: -100%;
        bottom: 0;
        flex-direction: column;
        background: #66BB6A;
        padding: 0;
        gap: 0;
        box-shadow: -4px 0 12px rgba(0,0,0,0.2);
        z-index: 1000;
        width: 80%;
        max-width: 320px;
        max-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: right 0.3s ease-in-out;
    }

    .nav-menu.active {
        display: flex;
        right: 0;
    }

    /* 菜单遮罩层 */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease-in-out;
    }

    .menu-overlay.active {
        display: block;
        opacity: 1;
    }

    /* 菜单头部 */
    .menu-close-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        background: #66BB6A;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .menu-title {
        color: white;
        font-size: 1.2rem;
        font-weight: bold;
    }

    .menu-close-btn {
        background: transparent;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s;
    }

    .menu-close-btn:hover {
        transform: rotate(90deg);
    }

    .nav-menu a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        font-size: 1rem;
        width: 100%;
        box-sizing: border-box;
        border-bottom-color: transparent;
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .nav-menu a:hover, .nav-menu a.active {
        border-bottom-color: #ff9900;
        background: rgba(255,255,255,0.1);
    }

    /* 语言切换器 */
    .language-switcher {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
    }

    .lang-dropdown {
        width: 100%;
    }

    .lang-current {
        width: 100%;
        justify-content: center;
        padding: 0.8rem;
    }

    .lang-menu {
        right: auto;
        left: 0;
        width: 100%;
        min-width: auto;
    }

    /* 菜单打开时隐藏搜索框 */
    .header-content.menu-open .search-container {
        display: none;
    }

    /* 主内容区 */
    .main-content {
        padding: 1.5rem 0;
    }

    /* 商品卡片网格 */
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .card-image {
        height: 160px;
    }

    .card-content {
        padding: 0.6rem;
    }

    .card-title {
        font-size: 0.9rem;
        margin-bottom: 0.2rem;
    }

    .card-category {
        font-size: 0.75rem;
    }

    /* 分类标签 */
    .category-tag {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
        margin: 0.2rem;
        display: inline-block;
    }

    /* 分页 */
    .pagination {
        gap: 0.3rem;
    }

    .pagination a, .pagination span {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .page-info {
        font-size: 0.85rem;
    }

    /* 标题 */
    .section-title {
        font-size: 1.3rem;
    }

    .category-title {
        font-size: 1.1rem;
    }

    /* WhatsApp横幅 */
    .whatsapp-bar {
        padding: 6px 0;
    }

    .whatsapp-bar-content {
        font-size: 0.75rem;
        justify-content: center;
        gap: 5px;
    }

    .whatsapp-number {
        font-size: 0.85rem;
    }

    /* 页脚 */
    .footer {
        padding: 1.5rem 0;
        font-size: 0.85rem;
    }

    /* 联系页图片 */
    .contact-image img {
        max-width: 90%;
    }
}

/* ========================================
   手机适配 (480px及以下)
   ======================================== */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
        max-width: 100%;
        width: 100%;
    }

    /* 头部 */
    .header {
        padding: 0.6rem 0;
        overflow: visible;
    }

    .header-content {
        gap: 0.3rem;
    }

    .logo {
        flex: 0 0 auto;
    }

    .logo a {
        font-size: 1rem;
    }

    .logo span {
        display: none;
    }

    /* 搜索框 */
    .search-container {
        flex: 1;
        min-width: 0;
        width: auto;
        margin-top: 0.3rem;
    }

    .search-box input {
        padding: 0.5rem 0.6rem;
        font-size: 0.9rem;
    }

    .search-box button {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
    }

    /* 移动端搜索按钮只显示图标 */
    .search-box button span {
        display: none;
    }

    .search-box button::after {
        content: "🔍";
    }

    /* 导航菜单 */
    .nav-menu {
        padding-top: 0;
        width: 85%;
        max-width: 300px;
    }

    .nav-menu a {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    /* 菜单头部 */
    .menu-close-header {
        padding: 0.8rem 1rem;
    }

    .menu-title {
        font-size: 1.1rem;
    }

    .menu-close-btn {
        width: 36px;
        height: 36px;
        font-size: 1.8rem;
    }

    /* 汉堡菜单 */
    .mobile-menu-toggle {
        width: 28px;
        height: 22px;
    }

    .mobile-menu-toggle span {
        height: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(7px, 7px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* 主内容区 */
    .main-content {
        padding: 1rem 0;
    }

    /* 商品卡片网格 - 两列布局 */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .card-image {
        height: 130px;
    }

    .card-content {
        padding: 0.5rem;
    }

    .card-title {
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 0.1rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .card-category {
        font-size: 0.7rem;
    }

    /* 分类标签 */
    .category-tag {
        padding: 0.35rem 0.75rem;
        font-size: 0.8rem;
        margin: 0.15rem;
    }

    /* 分页 */
    .pagination {
        gap: 0.25rem;
        margin: 1.5rem 0;
    }

    .pagination a, .pagination span {
        padding: 0.4rem 0.7rem;
        font-size: 0.85rem;
        min-width: 34px;
        text-align: center;
    }

    .page-info {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }

    /* 标题 */
    .section-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .category-title {
        font-size: 1rem;
    }

    .category-header {
        flex-wrap: wrap;
    }

    /* 搜索结果 */
    .search-header {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .search-stats {
        font-size: 0.85rem;
    }

    .no-results {
        padding: 2rem 1rem;
    }

    /* 搜索建议 */
    .suggestions-dropdown {
        max-height: 250px;
    }

    .suggestion-item {
        padding: 0.6rem;
    }

    .suggestion-item img {
        width: 35px;
        height: 35px;
    }

    .suggestion-info h4 {
        font-size: 0.85rem;
    }

    .suggestion-info p {
        font-size: 0.75rem;
    }

    /* 页脚 */
    .footer {
        padding: 1rem 0;
        font-size: 0.8rem;
    }

    .footer p {
        margin-bottom: 0.3rem;
    }

    /* WhatsApp横幅 */
    .whatsapp-bar {
        padding: 5px 0;
    }

    .whatsapp-bar-content {
        font-size: 0.7rem;
    }

    .whatsapp-icon {
        font-size: 0.8rem;
    }
}

/* ========================================
   小屏幕手机 (375px及以下)
   ======================================== */
@media (max-width: 375px) {
    .container {
        padding: 0 10px;
    }

    /* 头部 */
    .header {
        padding: 0.5rem 0;
    }

    .logo a {
        font-size: 0.9rem;
    }

    .header-content {
        gap: 0.2rem;
    }

    .search-container {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .search-box input {
        padding: 0.45rem 0.5rem;
        font-size: 0.85rem;
    }

    .search-box button {
        padding: 0.45rem 0.5rem;
        font-size: 0.8rem;
    }

    .mobile-menu-toggle {
        width: 26px;
        height: 20px;
    }

    .mobile-menu-toggle span {
        height: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* 导航菜单 */
    .nav-menu a {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    /* 默认隐藏（桌面端） */
.menu-close-header {
        display: none;
    }

    @media (max-width: 768px) {
    /* 移动端显示 */
    .menu-close-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        background: #66BB6A;
        position: sticky;
        top: 0;
        z-index: 10;
    }
}

    .menu-title {
        font-size: 1rem;
    }

    .menu-close-btn {
        width: 32px;
        height: 32px;
        font-size: 1.6rem;
    }

    /* 内容区域 */
    .card-grid {
        gap: 0.6rem;
    }

    .card-image {
        height: 110px;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .card-category {
        font-size: 0.65rem;
    }

    .pagination a, .pagination span {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
        min-width: 30px;
    }
}

/* 小屏幕手机适配 (360px及以下) */
@media (max-width: 360px) {
    /* 导航菜单 */
    .nav-menu {
        width: 90%;
        max-width: 280px;
    }

    .nav-menu a {
        padding: 0.8rem 0.9rem;
        font-size: 0.85rem;
    }

    /* 菜单头部 */
    .menu-close-header {
        padding: 0.6rem 0.9rem;
    }

    .menu-title {
        font-size: 1rem;
    }

    .menu-close-btn {
        width: 30px;
        height: 30px;
        font-size: 1.5rem;
    }

    /* 汉堡菜单 */
    .mobile-menu-toggle {
        width: 24px;
        height: 18px;
    }

    .mobile-menu-toggle span {
        height: 2px;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }

    /* 内容区域 */
    .card-grid {
        gap: 0.5rem;
    }

    .card-image {
        height: 100px;
    }

    .card-title {
        font-size: 0.75rem;
    }

    .card-category {
        font-size: 0.65rem;
    }

    /* 分页 */
    .pagination {
        gap: 0.2rem;
    }

    .pagination a, .pagination span {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
        min-width: 28px;
    }
}