/* base.css - 头部和尾部共用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部保证信息 */
.guarantee-notification {
    background-color: #000;
    color: white;
    padding: 8px 0;
    font-size: 14px;
    text-align: center;
    position: relative;
    height: 40px;
    overflow: hidden;
}

.notification-container {
    position: absolute;
    width: 100%;
    transition: transform 0.5s ease;
}

.notification-item {
    padding: 5px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    transition: opacity 0.5s ease;
}

.notification-item.fade-out {
    opacity: 0;
}

.notification-item i {
    margin-right: 10px;
    color: #e02b41;
}

/* 头部样式 */
.header {
    background-color: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: #e02b41;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 5px;
    font-size: 20px;
}

.search-container {
    width: 50%;
    position: relative;
}

.search-box {
    display: flex;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px 0 0 20px;
    font-size: 14px;
    transition: all 0.3s;
    font-size: 16px; /* 防止iOS缩放 */
}

.search-input:focus {
    outline: none;
    border-color: #e02b41;
    box-shadow: 0 0 5px rgba(224, 43, 65, 0.3);
}

.search-input.error {
    border-color: #e02b41;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% {transform: translateX(0);}
    10%, 30%, 50%, 70%, 90% {transform: translateX(-5px);}
    20%, 40%, 60%, 80% {transform: translateX(5px);}
}

.search-btn {
    padding: 10px 20px;
    background: #e02b41;
    color: white;
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
}

.search-keywords {
    display: flex;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.search-keyword {
    margin-right: 10px;
    cursor: pointer;
}

.search-keyword:hover {
    color: #e02b41;
}

.nav-cart {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 15px;
    transition: background 0.3s;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    background: #f8f8f8;
    color: #e02b41;
}

.promo-icon {
    position: relative;
    color: #333;
    text-decoration: none;
    font-size: 18px;
    cursor: pointer;
}

.promo-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e02b41;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
}

.promo-icon:hover {
    color: #e02b41;
}

/* 分类导航弹出层 */
.category-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 1000px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 20px;
    margin-top: 10px;
}

.category-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.category-popup-section {
    margin-bottom: 15px;
}

.category-popup-title {
    font-weight: bold;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
    color: #e02b41;
}

.category-popup-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-popup-link {
    display: flex;
    align-items: center;
    padding: 5px 10px;
    background: #f8f8f8;
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    transition: all 0.3s;
}

.category-popup-link:hover {
    background: #e02b41;
    color: white;
}

.category-popup-link svg {
    width: 14px;
    height: 14px;
    margin-right: 5px;
    fill: currentColor;
}

/* 页脚 */
.footer {
    background-color: #fff;
    padding: 30px 0 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.footer-col h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.footer-links a:hover {
    color: #e02b41;
}

.footer-newsletter input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 8px;
    font-size: 13px;
    font-size: 16px;
}

.footer-newsletter button {
    width: 100%;
    padding: 10px;
    background: #e02b41;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

/* 支付安全区域 */
.payment-security {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.payment-security h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.payment-icons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.payment-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100px;
}

.payment-icon i {
    font-size: 30px;
    color: #4caf50;
    margin-bottom: 10px;
}

.payment-icon span {
    font-size: 12px;
    color: #666;
}

.security-info {
    text-align: center;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.copyright {
    color: #666;
    font-size: 12px;
}

.company-address {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* 返回顶部按钮 */
.back-to-top-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 99;
}

.back-to-top {
    width: 38px;
    height: 38px;
    background: #e02b41;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s;
}

.back-to-top.visible {
    opacity: 1;
}

.line-chat {
    width: 38px;
    height: 38px;
    background: #06c755;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.line-chat img {
    width: 20px;
    height: 20px;
}

/* 通知 toast */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
}

.toast-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-notification.error {
    background: #f44336;
}

.toast-notification i {
    margin-right: 10px;
    font-size: 20px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-title {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.modal-icon {
    font-size: 50px;
    color: #e02b41;
    margin-bottom: 15px;
    text-align: center;
}

.modal-message {
    margin-bottom: 20px;
    color: #666;
    text-align: center;
}

.modal-btn {
    padding: 10px 20px;
    background: #e02b41;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

.coupon-claim {
    display: block;
    margin-top: 15px;
    text-align: center;
    color: #e02b41;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .category-popup {
        width: 90%;
        left: 5%;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container {
        width: 100%;
    }
    
    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }
    
	.category-popup {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 75vh;
        border-radius: 15px 15px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
        z-index: 1001;
        padding: 20px;
        display: block !important; /* 强制显示 */
        opacity: 0;
        visibility: hidden;
    }
    
	.category-popup.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .category-popup-section {
        padding: 15px 0;
    }
    
    .category-popup-links {
        gap: 10px;
    }    

    .category-popup-link {
        padding: 8px 15px;
        font-size: 14px;
    }
    
	/* 遮罩层样式 */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
        display: none;
    }

	/* 关闭按钮样式调整 */
    .category-popup-close {
        position: sticky;
        top: 0;
        background: white;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1;
        margin-left: auto;
        margin-bottom: 10px;
    }
}

/* 确保移动端点击区域足够大 */
@media (max-width: 768px) {
    .nav-link {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    #categoryLink {
        min-height: 44px; /* 移动端最小点击区域 */
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .nav-cart {
        gap: 10px;
    }
    
    .nav-link {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
    }
    
    .back-to-top-container {
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top, .line-chat {
        width: 34px;
        height: 34px;
    }
}