/*
Theme Name: SENOT Theme
Template: astra
Description: SENOT Smart Energy B2B 独立站子主题（基于 Astra）。支持中/英/俄/阿四语言、RTL 自动镜像、产品目录/RFQ/定制/解决方案模块。
Version: 1.0.0
Text Domain: senot
*/

/* ========== 基础变量 ========== */
:root {
  --gw-primary: #0b3d91;
  --gw-primary-dark: #082c69;
  --gw-accent: #f5a623;
  --gw-text: #1f2937;
  --gw-muted: #6b7280;
  --gw-bg: #f8fafc;
  --gw-green: #16a34a;
  --gw-orange: #ea8600;
  --gw-gray: #9ca3af;
  --gw-radius: 8px;
}

body { color: var(--gw-text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--gw-primary); }

/* ========== 首页 ========== */
.gw-hero { position: relative; min-height: 70vh; display: flex; align-items: center; background: linear-gradient(120deg, var(--gw-primary-dark), var(--gw-primary)); color: #fff; }
.gw-hero__inner { max-width: 1200px; margin: 0 auto; padding: 64px 24px; }
.gw-hero h1 { font-size: clamp(28px, 4vw, 48px); margin: 0 0 16px; }
.gw-hero p { font-size: 18px; opacity: .9; max-width: 640px; }
.gw-btn { display: inline-block; padding: 12px 28px; border-radius: var(--gw-radius); background: var(--gw-accent); color: #111; font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.gw-btn--outline { background: transparent; color: #fff; border: 2px solid #fff; margin-inline-start: 12px; }

.gw-section { max-width: 1200px; margin: 0 auto; padding: 64px 24px; }
.gw-section h2 { font-size: 28px; margin-bottom: 8px; }
.gw-section .gw-sub { color: var(--gw-muted); margin-bottom: 32px; }

.gw-grid { display: grid; gap: 24px; }
.gw-grid--3 { grid-template-columns: repeat(3, 1fr); }
.gw-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .gw-grid--4 { grid-template-columns: repeat(2, 1fr); } .gw-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .gw-grid--4, .gw-grid--3 { grid-template-columns: 1fr; } }

.gw-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--gw-radius); padding: 24px; transition: box-shadow .2s; }
.gw-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.gw-card img { max-width: 100%; border-radius: var(--gw-radius); }

/* ========== 产品目录 ========== */
.gw-filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.gw-filters select, .gw-search-input { padding: 10px 12px; border: 1px solid #d1d5db; border-radius: var(--gw-radius); min-width: 160px; }
.gw-product-card { display: flex; flex-direction: column; }
.gw-product-card .gw-thumb { aspect-ratio: 1/1; object-fit: contain; background: var(--gw-bg); }
.gw-product-card h3 { font-size: 16px; margin: 12px 0 4px; }
.gw-product-card .gw-mpn { color: var(--gw-muted); font-size: 13px; }

/* 库存标签（6.2） */
.gw-stock { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-top: 8px; }
.gw-stock--in { background: #dcfce7; color: var(--gw-green); }
.gw-stock--low { background: #ffedd5; color: var(--gw-orange); }
.gw-stock--out { background: #f3f4f6; color: var(--gw-gray); }

.gw-btn--rfq { margin-top: auto; margin-top: 12px; background: var(--gw-primary); color: #fff; text-align: center; }
.gw-btn--rfq[disabled], .gw-btn--rfq.is-disabled { background: #d1d5db; color: #6b7280; cursor: not-allowed; pointer-events: none; }

/* ========== 询盘表单 ========== */
.gw-form { max-width: 640px; }
.gw-form label { display: block; font-weight: 600; margin: 16px 0 6px; }
.gw-form input, .gw-form select, .gw-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: var(--gw-radius); }
.gw-form .gw-required { color: #dc2626; }
.gw-form-msg { margin-top: 12px; padding: 12px; border-radius: var(--gw-radius); display: none; }
.gw-form-msg.is-ok { display: block; background: #dcfce7; color: #166534; }
.gw-form-msg.is-err { display: block; background: #fee2e2; color: #991b1b; }

/* ========== 工序展示（8.2） ========== */
.gw-process { counter-reset: step; }
.gw-process .gw-step { position: relative; padding-inline-start: 56px; }
.gw-process .gw-step::before { counter-increment: step; content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--gw-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ========== 错误页（11.2） ========== */
.gw-error-page { text-align: center; padding: 96px 24px; }
.gw-error-page h1 { font-size: 64px; color: var(--gw-primary); margin-bottom: 8px; }

/* ========== RTL（5.4） ========== */
[dir="rtl"] .gw-hero__inner { text-align: right; }
/* 其余布局依赖 CSS 逻辑属性（margin-inline-start / padding-inline-start）自动镜像 */

/* ========== 分页 ========== */
.gw-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.gw-pagination a, .gw-pagination span { padding: 8px 14px; border: 1px solid #d1d5db; border-radius: var(--gw-radius); }
.gw-pagination .current { background: var(--gw-primary); color: #fff; border-color: var(--gw-primary); }
