/* ===== 果然芒品牌设计系统 ===== */
:root {
    --mango: #FF8C00;
    --mango-dark: #E07800;
    --mango-light: #FFF0D0;
    --mango-bg: #FFFAF5;
    --green: #4CAF50;
    --text: #333333;
    --text-light: #999999;
    --white: #FFFFFF;
    --red: #FF4444;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --max-width: 1200px;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
    font-family: PingFang SC, Microsoft YaHei, Hiragino Sans GB, sans-serif;
    color: var(--text);
    background: var(--mango-bg);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Header ===== */
.site-header {
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--mango);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-icon { width: 32px; height: 32px; }
.nav { display: flex; gap: 24px; list-style: none; align-items: center; }
.nav a {
    text-decoration: none;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav a:hover, .nav a.active { color: var(--mango); }
.cart-icon {
    position: relative;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px 8px;
}
.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: var(--white);
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.menu-toggle { display: none; background: none; border: none; font-size: 24px; cursor: pointer; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--mango-bg) 0%, #FFF0D0 100%);
    padding: 80px 20px;
    text-align: center;
}
.hero h1 {
    font-size: 48px;
    color: var(--mango);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 12px;
}
.hero p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 32px;
}
.btn {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 28px;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-primary {
    background: var(--mango);
    color: var(--white);
}
.btn-primary:hover { background: var(--mango-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-outline {
    background: transparent;
    color: var(--mango);
    border: 2px solid var(--mango);
}
.btn-outline:hover { background: var(--mango-light); }
.btn-sm { padding: 8px 20px; font-size: 14px; }

/* ===== Sections ===== */
.section {
    padding: 60px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.section-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 40px;
}

/* ===== Features Bar ===== */
.features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 30px 20px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.feature-card {
    text-align: center;
    padding: 20px 12px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.feature-icon { font-size: 32px; margin-bottom: 8px; }
.feature-card h4 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.feature-card p { font-size: 12px; color: var(--text-light); }

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.product-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}
.product-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.product-info {
    padding: 16px;
}
.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}
.product-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--red);
}
.product-price .unit { font-size: 14px; font-weight: 400; }
.product-original {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: line-through;
}
.product-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}
.tag-onsale { background: #FFF0F0; color: var(--red); }
.tag-presale { background: #FFF8E1; color: #FF8C00; }
.product-actions {
    display: flex;
    gap: 8px;
}
.product-actions .btn {
    flex: 1;
    text-align: center;
}

/* ===== Detail Page ===== */
.detail-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}
.detail-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.detail-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
}
.detail-body { padding: 30px; }
.detail-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 16px;
}
.detail-price-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F0F0F0;
}
.detail-price {
    font-size: 36px;
    font-weight: 900;
    color: var(--red);
}
.detail-original {
    font-size: 18px;
    color: var(--text-light);
    text-decoration: line-through;
}
.detail-desc { color: #666; line-height: 1.8; margin-bottom: 20px; }
.detail-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.spec-tag {
    background: var(--mango-light);
    color: var(--mango-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
}
.buy-section {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}
.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.qty-btn {
    width: 40px;
    height: 44px;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    cursor: pointer;
}
.qty-input {
    width: 50px;
    height: 44px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
}
.btn-buy {
    flex: 1;
    padding: 14px 24px;
    background: var(--mango);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-buy:hover { background: var(--mango-dark); }
.guarantee-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 16px;
    background: #F9FAFB;
    border-radius: var(--radius-sm);
}
.guarantee-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
}
.guarantee-item svg { width: 18px; height: 18px; color: var(--green); }
.detail-back {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
    text-decoration: none;
}
.detail-back:hover { color: var(--mango); }

/* ===== About ===== */
.about-hero, .contact-hero {
    background: linear-gradient(135deg, var(--mango-bg), #FFF0D0);
    padding: 60px 20px;
    text-align: center;
}
.about-hero h1, .contact-hero h1 {
    font-size: 40px;
    color: var(--mango);
    font-weight: 900;
}

/* ===== Footer ===== */
.site-footer {
    background: #1A1A1A;
    color: #CCCCCC;
    padding: 30px 20px;
    text-align: center;
    font-size: 13px;
}
.site-footer a { color: var(--mango); text-decoration: none; }

/* ===== Cart Sidebar ===== */
.cart-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}
.cart-overlay.open { display: block; }
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100%;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 2001;
    display: flex;
    flex-direction: column;
}
.cart-overlay.open .cart-sidebar { right: 0; }
.cart-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.cart-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
}
.cart-item img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}
.cart-item-info { flex: 1; }
.cart-item-name { font-size: 14px; font-weight: 600; }
.cart-item-price { font-size: 14px; color: var(--red); font-weight: 700; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cart-item-qty button {
    width: 24px; height: 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
}
.cart-remove { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 16px; }
.cart-footer {
    padding: 20px;
    border-top: 1px solid #eee;
}
.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}
.cart-total { color: var(--red); font-size: 24px; }
.cart-empty { text-align: center; padding: 40px; color: var(--text-light); }
.cart-footer .btn { width: 100%; text-align: center; }

/* ===== Filter Tabs ===== */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}
.filter-tab {
    padding: 10px 24px;
    border-radius: 22px;
    border: 1px solid #ddd;
    background: var(--white);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.filter-tab.active {
    background: var(--mango);
    color: var(--white);
    border-color: var(--mango);
}
.product-card.hidden { display: none; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--green);
    color: var(--white);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s;
}
.toast.show { opacity: 1; }

/* ===== WeChat Browser Fixes ===== */
@supports (-webkit-overflow-scrolling: touch) {
    body { -webkit-text-size-adjust: 100%; }
    input, button, textarea { -webkit-appearance: none; border-radius: 0; }
}
/* Fixed bottom contact bar */
.bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    z-index: 1500;
    gap: 8px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.bottom-bar .btn { flex:1; text-align:center; padding: 10px 12px; font-size: 14px; }
.bottom-bar .btn-wechat { background: #07C160; color: var(--white); border-radius: 20px; text-decoration: none; font-weight: 700; }
.bottom-bar .btn-tel { background: var(--white); color: var(--mango); border: 1px solid var(--mango); border-radius: 20px; text-decoration: none; }
body { padding-bottom: 70px; }
/* WeChat share tips overlay */
.share-tip {
    position: fixed; top: 0; right: 10px; z-index: 9999;
    background: rgba(0,0,0,0.75); color: #fff; padding: 8px 16px;
    border-radius: 0 0 8px 8px; font-size: 13px;
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.share-tip.show { opacity: 1; }
/* Product share card */
.share-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; max-width: 400px;
}
.share-card img { width: 100%; height: 220px; object-fit: cover; }
.share-card-body { padding: 16px; }
.share-card-price { font-size: 24px; font-weight: 900; color: var(--red); }
/* Order preview */
.order-preview {
    background: #FFF9C4; border-left: 4px solid #FFD600;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; line-height: 2; margin: 12px 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-inner { height: 52px; }
    .nav { display: none; }
    .nav.open { display: flex; flex-direction: column; position: absolute; top: 52px; left: 0; right: 0; background: var(--white); padding: 16px; box-shadow: var(--shadow); }
    .menu-toggle { display: block; }
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 15px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-card img { height: 180px; }
    .features { grid-template-columns: repeat(2, 1fr); }
    .detail-image { height: 280px; }
    .detail-name { font-size: 22px; }
    .detail-price { font-size: 28px; }
    .buy-section { flex-direction: column; }
    .cart-sidebar { width: 100%; right: -100%; }
    .section { padding: 40px 16px; }
    .section-title { font-size: 24px; }
}
