/* =============================================================
   Guangrong Foods — Bilingual Cross-Border Candy Brand Site
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap');

:root {
  --color-primary:    #E8546A;
  --color-primary-dk: #C0394F;
  --color-accent:     #F4A340;
  --color-accent-lt:  #FDE8D0;
  --color-purple:     #8E5CC6;
  --color-cream:      #FFF8F0;
  --color-cream-dk:   #F5E8D8;
  --color-warm-bg:    #FFFCF8;
  --color-text:       #2B1A1F;
  --color-text-lt:    #5C4650;
  --color-text-muted: #9C8690;
  --color-border:     #E5E0D8;
  --color-white:      #FFFFFF;
  --color-success:    #2D7D46;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --section-gap: 80px;
  --content-max: 1200px;
  --nav-height:  72px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-white); line-height: 1.7; font-size: 16px; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* Typography */
h1,h2,h3,h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px; border-radius: 8px; font-family: var(--font-body); font-size: .95rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s ease; }
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-dk); }
.btn-outline { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: var(--color-white); }
.btn-accent { background: var(--color-accent); color: var(--color-white); }
.btn-accent:hover { background: #D88D2A; }
.btn-white { background: var(--color-white); color: var(--color-primary); }
.btn-white:hover { background: var(--color-cream); }

/* Container */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-bottom: 1px solid var(--color-border); height: var(--nav-height); }
.nav .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.nav-logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; color: var(--color-primary); text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--color-text); transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--color-primary); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
/* Language toggle buttons */
.nav-lang { background: none; border: 1px solid var(--color-border); padding: 4px 14px; border-radius: 20px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--color-text-muted); font-family: var(--font-body); transition: all .2s; line-height: 1.5; }
.nav-lang + .nav-lang { margin-left: 6px; }
.nav-lang.active { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }
.nav-lang:hover:not(.active) { border-color: var(--color-primary); color: var(--color-primary); }

/* Language visibility: show/hide based on html lang */
.lang-zh { display: none; }
html[lang="zh"] .lang-zh { display: flex; }
html[lang="zh"] .lang-en { display: none; }
html[lang="en"] .lang-en { display: flex; }
.nav-cart { position: relative; padding: 6px; cursor: pointer; background: none; border: none; }
.nav-cart-icon { width: 22px; height: 22px; stroke: var(--color-text); }
.nav-cart-count { position: absolute; top: 0; right: -4px; background: var(--color-primary); color: white; font-size: .65rem; font-weight: 700; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); margin: 5px 0; transition: .3s; }

/* Footer */
.footer { background: #2B1A1F; color: #B0A0A5; padding: 64px 0 40px; margin-top: var(--section-gap); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer h4 { font-family: var(--font-heading); color: var(--color-white); font-size: 1.05rem; margin-bottom: 16px; }
.footer p, .footer a { font-size: .88rem; line-height: 2; }
.footer a { color: #B0A0A5; transition: color .2s; }
.footer a:hover { color: var(--color-white); }
.footer-logo { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 800; color: var(--color-white); margin-bottom: 12px; }
.footer-bottom { padding-top: 24px; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-social { display: flex; gap: 16px; margin-top: 16px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; transition: all .2s; }
.footer-social a:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* Section Headers */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 4px; color: var(--color-accent); margin-bottom: 12px; }
.section-header h2 { margin-bottom: 10px; }
.section-header p { max-width: 560px; margin: 0 auto; color: var(--color-text-lt); }

/* Hero */
.hero { background: linear-gradient(135deg, #E8546A 0%, #D9405A 30%, #8E5CC6 100%); color: var(--color-white); min-height: 80vh; display: flex; align-items: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 80%, rgba(244,163,64,.25), transparent 60%), radial-gradient(circle at 80% 20%, rgba(255,255,255,.08), transparent 50%); }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; position: relative; }
.hero-content h1 { margin-bottom: 20px; }
.hero-content .hero-subtitle { font-size: 1.15rem; color: rgba(255,255,255,.75); max-width: 480px; margin-bottom: 36px; }
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-image { aspect-ratio: 1; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 8rem; background: rgba(255,255,255,.12); backdrop-filter: blur(4px); }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; }
.product-card { background: var(--color-white); border-radius: 12px; overflow: hidden; transition: all .3s ease; border: 1px solid var(--color-border); }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card-image { aspect-ratio: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.product-card-body { padding: 20px; }
.product-card-body .category { font-size: .75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--color-accent); font-weight: 600; margin-bottom: 6px; }
.product-card-body h3 { font-size: 1.15rem; margin-bottom: 6px; }
.product-card-body .desc { font-size: .88rem; color: var(--color-text-lt); margin-bottom: 14px; }
.product-card-body .price { font-size: 1.2rem; font-weight: 700; color: var(--color-primary); }

/* Story Banner */
.story-banner { background: var(--color-cream-dk); padding: 80px 0; }
.story-banner .container { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.story-image { aspect-ratio: 4/3; border-radius: 12px; background: linear-gradient(135deg, var(--color-primary), var(--color-purple)); display: flex; align-items: center; justify-content: center; font-size: 5rem; }

/* Features */
.features { padding: 72px 0; background: var(--color-warm-bg); }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.feature-item { text-align: center; padding: 24px; }
.feature-icon { width: 56px; height: 56px; margin: 0 auto 16px; background: var(--color-accent-lt); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.feature-item h4 { font-size: 1rem; margin-bottom: 8px; }
.feature-item p { font-size: .88rem; color: var(--color-text-lt); }

/* Newsletter */
.newsletter { background: var(--color-purple); color: var(--color-white); padding: 64px 0; text-align: center; }
.newsletter h2 { margin-bottom: 12px; }
.newsletter p { color: rgba(255,255,255,.75); margin-bottom: 28px; }
.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.newsletter-form input { flex: 1; padding: 14px 20px; border-radius: 6px; border: none; font-size: .95rem; font-family: var(--font-body); }
.newsletter-form .btn { background: var(--color-accent); }
.newsletter-form .btn:hover { background: #D88D2A; }

/* Shop Page */
.shop-header { background: var(--color-warm-bg); padding: 64px 0 48px; text-align: center; }
.shop-filters { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 36px 0; }
.filter-chip { padding: 8px 20px; border-radius: 100px; font-size: .85rem; font-weight: 500; cursor: pointer; border: 1px solid var(--color-border); background: var(--color-white); transition: all .2s; }
.filter-chip.active, .filter-chip:hover { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); }

/* Product Detail */
.product-detail { padding: 72px 0; }
.product-detail .container { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
.pd-image { aspect-ratio: 1; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 8rem; }
.pd-info h1 { margin-bottom: 8px; }
.pd-price { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); margin: 16px 0 24px; }
.pd-desc { color: var(--color-text-lt); margin-bottom: 24px; line-height: 1.8; }
.pd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 32px; }
.pd-meta-item { padding: 12px 16px; background: var(--color-cream); border-radius: 8px; }
.pd-meta-item .label { font-size: .75rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 1px; }
.pd-meta-item .value { font-weight: 600; margin-top: 2px; }
.pd-qty { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.pd-qty button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-white); font-size: 1.1rem; cursor: pointer; }
.pd-qty span { font-size: 1.1rem; font-weight: 600; min-width: 40px; text-align: center; }
.pd-actions { display: flex; gap: 14px; }

/* About Page */
.about-hero { background: linear-gradient(135deg, var(--color-primary), var(--color-purple)); color: var(--color-white); padding: 80px 0; text-align: center; }
.about-hero p { color: rgba(255,255,255,.75); max-width: 600px; margin: 16px auto 0; }
.about-section { padding: 72px 0; }
.about-section .container { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.about-section.alt { background: var(--color-warm-bg); }
.about-image { aspect-ratio: 4/3; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 5rem; }

/* Contact */
.contact-section { padding: 80px 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 64px; }
.contact-info h2 { margin-bottom: 20px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-start; }
.contact-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--color-accent-lt); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 14px 18px; border-radius: 8px; border: 1px solid var(--color-border); font-family: var(--font-body); font-size: .95rem; background: var(--color-white); }
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(244,163,64,.15); }

/* OEM Section */
.oem-section { padding: 80px 0; background: linear-gradient(135deg, #2B1A1F, #3D252A); color: var(--color-white); text-align: center; }
.oem-section h2 { margin-bottom: 16px; }
.oem-section p { color: rgba(255,255,255,.7); max-width: 700px; margin: 0 auto 32px; font-size: 1.1rem; }
.oem-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; max-width: 900px; margin: 0 auto 40px; }
.oem-feat { text-align: center; }
.oem-feat .icon { font-size: 2.5rem; margin-bottom: 16px; }
.oem-feat h4 { font-family: var(--font-body); font-size: 1.05rem; margin-bottom: 8px; }
.oem-feat p { font-size: .9rem; }

/* Stats Banner */
.stats { padding: 48px 0; background: var(--color-cream-dk); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; text-align: center; }
.stat-item .num { font-family: var(--font-heading); font-size: 2.8rem; font-weight: 800; color: var(--color-primary); }
.stat-item .label { font-size: .9rem; color: var(--color-text-lt); margin-top: 4px; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 200; background: var(--color-success); color: white; padding: 14px 28px; border-radius: 8px; font-weight: 500; box-shadow: var(--shadow-lg); transform: translateY(120%); opacity: 0; transition: all .35s ease; }
.toast.show { transform: translateY(0); opacity: 1; }


@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeUp .6s ease forwards; }

/* Responsive */
@media (max-width: 900px) {
  :root { --section-gap: 56px; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: var(--nav-height); left: 0; right: 0; background: var(--color-white); padding: 24px; gap: 16px; border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md); }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero-content .hero-subtitle { max-width: 100%; }
  .hero-btns { justify-content: center; }
  .hero-image { max-width: 280px; margin: 0 auto; font-size: 5rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .story-banner .container { grid-template-columns: 1fr; }
  .product-detail .container { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .about-section .container { grid-template-columns: 1fr; }
  .about-section .about-image { order: -1; }
  .oem-features { grid-template-columns: 1fr; gap: 32px; }
  .stats-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding: 80px 0; }
  .newsletter-form { flex-direction: column; }
}

/* =============================================================
   Accessibility — focus-visible styles
   ============================================================= */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* =============================================================
   Form validation states
   ============================================================= */
.was-validated input:invalid,
.was-validated select:invalid,
.was-validated textarea:invalid {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(232,84,106,.15);
}
.was-validated input:invalid:focus,
.was-validated select:invalid:focus,
.was-validated textarea:invalid:focus {
  box-shadow: 0 0 0 3px rgba(232,84,106,.25);
}
input:disabled, button:disabled { cursor: not-allowed; }

/* =============================================================
   Product 404 page
   ============================================================= */
.pd-not-found { padding: 80px 0; text-align: center; }
.pd-not-found h2 { margin-bottom: 12px; }
.pd-not-found p { max-width: 480px; margin-left: auto; margin-right: auto; line-height: 1.7; color: var(--color-text-lt); }
.pd-not-found .btn { margin-top: 24px; }

/* =============================================================
   Print styles
   ============================================================= */
@media print {
  .nav, .hero, .newsletter, .footer, .toast, .shop-filters,
  .product-detail .pd-qty, .product-detail .pd-actions,
  .nav-toggle, .nav-actions, .oem-section { display: none !important; }
  body { font-size: 12pt; line-height: 1.5; color: #000; background: #fff; }
  .container { max-width: 100%; padding: 0 20px; }
  h1 { font-size: 24pt; }
  h2 { font-size: 18pt; }
  h3 { font-size: 14pt; }
  h4 { font-size: 12pt; }
  .product-card { break-inside: avoid; border: 1px solid #ccc; }
  .btn { background: none !important; color: #000 !important; border: 1px solid #000 !important; }
  .footer-bottom { border-top: 1px solid #000; padding-top: 16px; }
  a[href]::after { content: " (" attr(href) ")"; font-size: .8em; color: #666; }
  .about-image, .hero-image { max-width: 200px; }
  .contact-grid { display: block !important; }
  .features-grid, .stats-grid, .product-grid, .footer-grid { grid-template-columns: 1fr 1fr; }
  @page { margin: 2cm; }

/* ---- Real Product Images ---- */
.product-card-image img,
.pd-image img,
.hero-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-card-image img { border-radius: 12px 12px 0 0; }
.pd-image img { border-radius: 14px; }
.hero-image img { border-radius: 24px; }

}
