:root {
  --brand: #1f6feb; --brand-dark: #144a9e; --ink: #1a2230; --muted: #6b7585;
  --bg: #ffffff; --bg-soft: #f5f7fa; --line: #e6eaf0; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 18px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .inner { max-width: 1180px; margin: 0 auto; padding: 12px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 20px; color: var(--brand); white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 16px; font-weight: 600; }
.nav a { color: var(--ink); }
.dropdown { position: relative; }
.dropbtn { cursor: pointer; }
.dropdown-menu { display: none; position: absolute; top: 120%; left: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; min-width: 220px; max-height: 360px; overflow: auto; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 6px 10px; border-radius: 6px; }
.dropdown-menu a:hover { background: var(--bg-soft); }
.search { margin-left: auto; display: flex; gap: 6px; }
.search input { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; width: 200px; }
.search button, .btn { background: var(--brand); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; font-weight: 600; }
.lang-switch { padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line); max-width: 240px; }

/* Hero */
.hero { text-align: center; padding: 56px 18px; background: linear-gradient(135deg, #eef4ff, #f7fbff); border-radius: var(--radius); margin: 22px 0; }
.hero h1 { font-size: 40px; margin: 0 0 10px; color: var(--brand-dark); }
.hero .tagline { font-size: 18px; color: var(--muted); margin: 0 0 18px; }
.hero .cta, .btn.primary { display: inline-block; background: var(--brand); color: #fff; padding: 12px 28px; border-radius: 999px; font-weight: 700; }
.section-title { font-size: 26px; margin: 30px 0 16px; }

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover { box-shadow: 0 12px 30px rgba(0,0,0,.08); transform: translateY(-3px); }
.card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: var(--bg-soft); }
.card h3 { font-size: 16px; margin: 12px 14px 6px; }
.card h3 a { color: var(--ink); }
.card .meta { display: flex; justify-content: space-between; padding: 0 14px; color: var(--muted); font-size: 14px; }
.card .price { color: #e4393c; font-weight: 700; }
.card .btn { margin: 12px 14px 16px; text-align: center; }
.card .thumb { position: relative; display: block; }
.badge-stock { position: absolute; top: 8px; left: 8px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; z-index: 2; }
.badge-stock.in { background: #1a9e5f; }
.badge-stock.out { background: #e4393c; }
.stock-warn { display: block; width: 100%; box-sizing: border-box; padding: 10px 12px; margin-bottom: 10px; background: #fdeaea; color: #c0392b; border-radius: 8px; font-size: 14px; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; margin: 24px 0; }
.product-detail .gallery img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
.product-detail h1 { font-size: 30px; margin-top: 0; }
.product-detail .meta { font-size: 20px; margin: 12px 0; }
.product-detail .price { color: #e4393c; font-weight: 800; margin-right: 18px; }
.product-detail .specs { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 14px; }
.product-detail .spec { color: #38415a; font-size: 14px; }
.product-detail .spec b { color: #1f2937; }
.product-detail .desc { color: #38415a; }
.breadcrumb { color: var(--muted); font-size: 14px; margin-top: 16px; }
.cat-desc { color: var(--muted); }
.count { color: var(--muted); }

/* Static */
.contact-info { list-style: none; padding: 0; }
.contact-info li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.inquiry-form { display: grid; gap: 12px; max-width: 520px; }
.inquiry-form input, .inquiry-form textarea { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.inquiry-form textarea { min-height: 110px; }
.form-msg { font-weight: 600; }
.faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq-item h3 { margin: 0 0 6px; }

/* Footer */
.site-footer { background: var(--bg-soft); margin-top: 50px; border-top: 1px solid var(--line); }
.site-footer .inner { max-width: 1180px; margin: 0 auto; padding: 28px 18px; display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.site-footer .copy { width: 100%; color: var(--muted); font-size: 13px; }

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: min(460px, 92vw); }
.modal h3 { margin-top: 0; }
.modal .field { display: grid; gap: 6px; margin-bottom: 10px; }
.modal input, .modal textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font: inherit; width: 100%; }
.modal textarea { min-height: 90px; }
.modal .row { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 760px) {
  .product-detail { grid-template-columns: 1fr; }
  .search input { width: 130px; }
  .nav { order: 3; width: 100%; }
}

/* Account area */
.account-area { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.account-area .acc-link { color: var(--ink); white-space: nowrap; }
.account-area .acc-link:hover { color: var(--brand); }
.auth-box { max-width: 460px; margin: 20px auto; }
.auth-box .alt { text-align: center; color: var(--muted); margin-top: 14px; }
.dash-table { width: 100%; border-collapse: collapse; }
.dash-table th, .dash-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 14px; }
.dash-table th { background: var(--bg-soft); }

/* RFQ / buy actions */
.buy-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.btn.deposit { background: #ffb300; color: #1a2230; }
.rfq-hint { color: var(--muted); font-size: 14px; max-width: 520px; }
.rfq-sub { color: var(--brand); font-size: 13px; margin: -4px 0 12px; font-weight: 600; }
.simple-msg { max-width: 560px; margin: 40px auto; text-align: center; padding: 30px; border-radius: var(--radius); }
.simple-msg.ok { background: #e7f8ef; color: #1a9e5f; }
.simple-msg.err { background: #fdeaea; color: #e4393c; }

/* AI chat widget */
.ai-chat { position: fixed; right: 20px; bottom: 20px; z-index: 200; }
.ai-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.ai-panel { position: absolute; right: 0; bottom: 70px; width: 340px; max-width: 92vw; height: 460px; max-height: 80vh; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; }
.ai-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--brand); color: #fff; font-weight: 700; }
.ai-close { background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.ai-body { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg-soft); }
.ai-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 2px; }
.ai-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 2px; }
.ai-input { display: flex; border-top: 1px solid var(--line); }
.ai-input input { flex: 1; border: 0; padding: 12px; font: inherit; outline: none; }
.ai-input button { border: 0; background: var(--brand); color: #fff; padding: 0 16px; font-weight: 700; cursor: pointer; }
