﻿/* =====================================================
   web.css — Wufan Website Stylesheet
   Mobile-first, Be Vietnam Pro font
   ===================================================== */

:root {
  --primary: #1a6b4a;
  --primary-dk: #0f4a33;
  --accent: #f4a020;
  --danger-red: #e53e3e;
  --text: #1a202c;
  --text-muted: #718096;
  --bg: #f8faf9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 16px rgba(0, 0, 0, .08);
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---- Topbar ---- */
.topbar {
  background: var(--primary-dk);
  color: #fff;
  padding: 6px 0;
  font-size: .8rem;
}

.topbar a {
  color: #fff;
}

/* ---- Header ---- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  z-index: 1000;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  font-size: 2rem;
  line-height: 1;
}

.brand-text strong {
  display: block;
  font-size: 1.2rem;
  color: var(--primary);
  line-height: 1.2;
}

.brand-text span {
  font-size: .72rem;
  color: var(--text-muted);
}

.main-nav a {
  font-weight: 500;
  font-size: .95rem;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: .2s;
}

.main-nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.cart-btn {
  position: relative;
  font-size: 1.4rem;
  color: var(--text);
  padding: 4px 8px;
  transition: .2s;
}

.cart-btn:hover {
  color: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger-red);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: .65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 60%, #2d9c6e 100%);
  color: #fff;
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, .04);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
}

.hero p {
  font-size: 1.05rem;
  opacity: .9;
  max-width: 520px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  backdrop-filter: blur(4px);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: .8rem;
  margin-bottom: 16px;
}

.hero-img {
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  max-height: 380px;
  object-fit: cover;
}

.trust-badges {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  background: rgba(255, 255, 255, .1);
  border-radius: 8px;
  padding: 6px 12px;
}

/* ---- Buttons ---- */
.btn-primary-web {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary-web:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-outline-web {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 10px;
  padding: 10px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.btn-outline-web:hover {
  background: var(--primary);
  color: #fff;
}

/* ---- Section ---- */
.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 40px;
}

.divider-line {
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 4px;
  margin: 12px 0 40px;
}

/* ---- Product Card ---- */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: .2s;
  border: 1px solid var(--border);
  height: 100%;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

.product-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #f0f4f2;
}

.product-card-img-ph {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5ee, #d4eddf);
  font-size: 4rem;
}

.product-card-body {
  padding: 16px;
}

.product-card-name {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.product-card-price {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--danger-red);
}

.price-original {
  font-size: .85rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.price-discount {
  font-size: .72rem;
  background: #fff0f0;
  color: var(--danger-red);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.product-badge-discount {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--danger-red);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
}

.product-badge-oos {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.badge-out {
  background: #f7f7f7;
  color: var(--text-muted);
  font-size: .7rem;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ---- Product Detail ---- */
.product-gallery {
  position: sticky;
  top: 80px;
}

.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #f8f8f8;
}

.gallery-main img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  cursor: zoom-in;
  transition: .3s;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: .2s;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--primary);
}

.product-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.product-price-big {
  font-size: 2rem;
  font-weight: 800;
  color: var(--danger-red);
}

.product-price-compare {
  font-size: 1rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.product-discount-tag {
  background: var(--danger-red);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
}

/* ---- Variant selector ---- */
.variant-group {
  margin-bottom: 20px;
}

.variant-label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
}

.variant-label span.selected-val {
  color: var(--primary);
}

.variant-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: .2s;
  color: var(--text);
}

.variant-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.variant-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.variant-btn.sold-out {
  opacity: .45;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ---- Add to Cart ---- */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  width: 40px;
  height: 44px;
  background: #f8f8f8;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: .2s;
}

.qty-btn:hover {
  background: var(--primary);
  color: #fff;
}

.qty-val {
  width: 52px;
  height: 44px;
  text-align: center;
  border: none;
  border-left: 2px solid var(--border);
  border-right: 2px solid var(--border);
  font-weight: 700;
  font-size: 1rem;
}

.add-to-cart-btn {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.add-to-cart-btn:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
}

.buy-now-btn {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

/* ---- USP ---- */
.usp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.usp-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 6px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.usp-icon {
  font-size: 2.5rem;
  margin-bottom: 6px;
}

.usp-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.usp-desc {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ---- Reviews ---- */
.review-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}

.stars {
  color: #f4a020;
}

/* ---- Cart ---- */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.cart-img {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f4f2;
  flex-shrink: 0;
}

.cart-info {
  flex: 1;
}

.cart-name {
  font-weight: 600;
  font-size: .95rem;
}

.cart-variant {
  font-size: .82rem;
  color: var(--text-muted);
}

.cart-price {
  font-weight: 800;
  color: var(--danger-red);
}

/* ---- Checkout ---- */
.checkout-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}

.payment-option {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: .2s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.payment-option.active {
  border-color: var(--primary);
  background: #f0faf5;
}

.payment-option input[type=radio] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.payment-icon {
  font-size: 1.8rem;
}

/* ---- Blog ---- */
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: .2s;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.blog-card-body {
  padding: 16px;
}

.blog-title {
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--text);
}

.blog-meta {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---- Footer ---- */
.site-footer {
  background: #0f1a14;
  color: #ccc;
  padding: 50px 0 20px;
  margin-top: 60px;
}

.footer-link {
  color: #aaa;
  font-size: .9rem;
  display: block;
  margin-bottom: 8px;
  transition: .2s;
}

.footer-link:hover {
  color: #fff;
  padding-left: 4px;
}

/* ---- Toast ---- */
.toast-web {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--primary);
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  z-index: 9999;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  animation: slideInUp .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}

.toast-web.error {
  background: #e53e3e;
}

@keyframes slideInUp {
  from {
    transform: translateY(24px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }

  .product-badge-discount {
    font-size: .7rem;
    padding: 3px 6px;
    top: 8px;
    right: 8px;
  }

  .product-badge-oos {
    font-size: .7rem;
    padding: 3px 6px;
    top: 8px;
    left: 8px;
  }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero {
    padding: 40px 0 60px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .gallery-main img {
    height: 280px;
  }

  .product-price-big {
    font-size: 1.6rem;
  }

  .section {
    padding: 30px 0;
  }

  .section-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .section-subtitle {
    font-size: .85rem;
    margin-bottom: 20px;
  }

  .divider-line {
    margin: 8px 0 24px;
  }

  .usp-card {
    padding: 12px;
  }

  .usp-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .usp-title {
    font-size: .85rem;
    margin-bottom: 4px;
    line-height: 1.3;
  }

  .usp-desc {
    font-size: .75rem;
  }

  .blog-card img {
    height: 120px;
  }

  .blog-card-body {
    padding: 12px;
  }

  .blog-title {
    font-size: .85rem;
  }

  .blog-meta {
    font-size: .7rem;
    margin-bottom: 4px;
  }

  .blog-card-body p {
    font-size: .75rem !important;
    margin-top: 6px !important;
  }

  .product-card-img,
  .product-card-img-ph {
    height: 160px;
  }

  .product-card-body {
    padding: 12px;
  }

  .product-card-name {
    font-size: .85rem;
    margin-bottom: 6px;
  }

  .product-card-price {
    gap: 4px;
  }

  .price-current {
    font-size: 1rem;
  }

  .price-original {
    font-size: .8rem;
  }

  .price-discount {
    font-size: .65rem;
  }
}