/*
Theme Name: Transformer Export
Theme URI: https://www.chuangxing-electric.com
Description: SEO-optimized WordPress theme for transformer manufacturers targeting overseas B2B buyers. Built around a clean URL structure, Schema.org structured data, fast-loading responsive layout, product/applications/projects/resource custom post types, and a lead-generation focused homepage.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Author: WorkBuddy
Author URI: https://www.chuangxing-electric.com
License: MIT
License URI: https://opensource.org/licenses/MIT
Text Domain: transformer-export
Tags: custom-colors, custom-logo, custom-menu, editor-style, featured-images, rtl-language-support, translation-ready, grid-layout, one-column, two-columns, footer-widgets, blog, portfolio
*/

/* =========================================================
   0. Design tokens
   ========================================================= */
:root {
  --c-brand:        #0b2e59;   /* deep industrial blue */
  --c-brand-dark:   #071f3d;
  --c-brand-light:  #16467f;
  --c-accent:       #ff7a1a;   /* amber / safety orange for CTAs */
  --c-accent-dark:  #e9650a;
  --c-ink:          #1c2733;
  --c-body:         #475569;
  --c-muted:        #7c8aa0;
  --c-line:         #e2e8f0;
  --c-bg:           #ffffff;
  --c-bg-soft:      #f4f7fb;
  --c-bg-dark:      #0b2e59;
  --c-ok:           #1f9d55;
  --radius:         14px;
  --radius-sm:      8px;
  --shadow-sm:      0 1px 2px rgba(15,30,55,.06), 0 4px 14px rgba(15,30,55,.06);
  --shadow-md:      0 10px 30px rgba(15,30,55,.12);
  --maxw:           1200px;
  --font:           "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --container-pad:  clamp(16px, 4vw, 40px);
  --section-y:      clamp(48px, 7vw, 96px);
}

/* =========================================================
   1. Reset / base
   ========================================================= */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--c-body);
  background: var(--c-bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-brand-light); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--c-accent); }
h1,h2,h3,h4,h5,h6 { color: var(--c-ink); line-height: 1.2; margin: 0 0 .55em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 46px); }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: clamp(18px, 2.2vw, 22px); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--container-pad); }
.section { padding-block: var(--section-y); }
.section--soft { background: var(--c-bg-soft); }
.section--dark { background: var(--c-bg-dark); color: #cdd9e8; }
.section--dark h1,.section--dark h2,.section--dark h3 { color: #fff; }
.section--dark p { color: #aebfd4; }
.text-center { text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); margin-bottom: 10px; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--c-body); }
.muted { color: var(--c-muted); }

/* =========================================================
   2. Buttons
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 2px solid transparent; cursor: pointer; line-height: 1; white-space: nowrap;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); color: #fff; }
.btn--primary { background: var(--c-accent); color: #fff; box-shadow: 0 8px 20px rgba(255,122,26,.28); }
.btn--primary:hover { background: var(--c-accent-dark); }
.btn--ghost { background: transparent; color: var(--c-brand); border-color: var(--c-line); }
.btn--ghost:hover { border-color: var(--c-brand); background: rgba(11,46,89,.04); }
.btn--light { background: #fff; color: var(--c-brand); }
.btn--light:hover { background: #eef3fa; }
.btn--lg { padding: 16px 30px; font-size: 16px; }

/* =========================================================
   3. Header / nav
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; color: var(--c-ink); font-size: 18px; }
.brand img { height: 38px; width: auto; }
.brand__mark { width: 38px; height: 38px; border-radius: 9px; background: var(--c-brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.brand__sub { font-size: 11px; font-weight: 600; color: var(--c-muted); letter-spacing: .08em; text-transform: uppercase; display: block; }
.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { padding: 10px 14px; border-radius: 8px; font-weight: 600; color: var(--c-ink); font-size: 15px; }
.main-nav a:hover { background: var(--c-bg-soft); color: var(--c-brand); }
.main-nav .has-children { position: relative; }
.main-nav .sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: #fff; border: 1px solid var(--c-line); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 8px; display: none; z-index: 50;
}
.main-nav .has-children:hover .sub-menu,
.main-nav .has-children:focus-within .sub-menu { display: block; }
.main-nav .sub-menu a { display: block; padding: 9px 12px; font-weight: 500; }
.header-cta { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--c-ink); margin: 5px 0; transition: .2s; }

/* =========================================================
   4. Hero
   ========================================================= */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--c-brand-dark); }
.hero::after { content:""; position: absolute; inset: 0; background:
   radial-gradient(900px 400px at 85% -10%, rgba(255,122,26,.25), transparent 60%),
   linear-gradient(180deg, rgba(7,31,61,.2), rgba(7,31,61,.85)); pointer-events: none; }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; }
.hero .container { position: relative; z-index: 2; padding-block: clamp(64px, 11vw, 140px); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p.lead { color: #d7e2f1; max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero__badges { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 40px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.18); }
.hero__badge { display: flex; align-items: center; gap: 10px; color: #cdd9e8; font-size: 14px; }
.hero__badge strong { color: #fff; display: block; font-size: 20px; }

/* =========================================================
   5. Section heading
   ========================================================= */
.section-head { max-width: 720px; margin: 0 auto clamp(28px,4vw,48px); text-align: center; }
.section-head--left { margin-inline: 0; text-align: left; }

/* =========================================================
   6. Cards & grids
   ========================================================= */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cdd9e8; }
.card__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--c-bg-soft); color: var(--c-brand); margin-bottom: 16px; font-size: 22px; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--c-body); margin: 0; }
.card a.card__link { color: var(--c-brand-light); font-weight: 600; display: inline-block; margin-top: 12px; }

/* Product card */
.product-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.product-card__media { aspect-ratio: 4/3; background: var(--c-bg-soft); position: relative; overflow: hidden; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__media--placeholder { display: grid; place-items: center; color: var(--c-muted); font-size: 13px; }
.product-card__body { padding: 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card__cat { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); }
.product-card h3 { font-size: 18px; margin: 0; }
.product-card__spec { font-size: 14px; color: var(--c-muted); margin: 0; }
.product-card__foot { margin-top: auto; padding-top: 14px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 20px; }
.stat { text-align: center; }
.stat__num { font-size: clamp(30px, 4vw, 46px); font-weight: 800; color: #fff; line-height: 1; }
.stat__label { color: #aebfd4; font-size: 14px; margin-top: 8px; }

/* =========================================================
   7. Breadcrumbs
   ========================================================= */
.breadcrumbs { font-size: 13px; color: var(--c-muted); padding-block: 16px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-brand); }
.breadcrumbs .sep { margin: 0 8px; opacity: .6; }

/* =========================================================
   8. Layout: content + sidebar
   ========================================================= */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start; }
.page-title { padding-block: clamp(28px,4vw,44px) 0; }
.page-title--hero { background: var(--c-bg-soft); }

/* Product single */
.product-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.product-gallery { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--c-line); background: var(--c-bg-soft); aspect-ratio: 4/3; }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--c-line); font-size: 14px; vertical-align: top; }
.spec-table th { width: 42%; color: var(--c-ink); font-weight: 600; background: var(--c-bg-soft); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--c-bg-soft); color: var(--c-brand); font-size: 13px; font-weight: 600; }

/* =========================================================
   9. Forms / inquiry
   ========================================================= */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--c-ink); }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px 14px; border: 1px solid var(--c-line); border-radius: var(--radius-sm);
  background: #fff; color: var(--c-ink); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c-brand-light); box-shadow: 0 0 0 3px rgba(22,70,127,.15); }
.field textarea { min-height: 130px; resize: vertical; }
.form-note { font-size: 13px; color: var(--c-muted); }
.form-success { background: #eafaf0; border: 1px solid #b9e8cd; color: #1f7a45; padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; }

.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: start; }
.contact-info li { list-style: none; margin-bottom: 14px; }
.contact-info ul { padding: 0; }
.contact-info strong { color: var(--c-ink); display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.contact-info span { color: var(--c-body); }

/* =========================================================
   10. Calculator widget
   ========================================================= */
.calc { background: var(--c-bg-soft); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 26px; }
.calc__result { margin-top: 18px; padding: 16px; border-radius: var(--radius-sm); background: var(--c-brand); color: #fff; font-size: 18px; font-weight: 700; }
.calc__result small { display: block; font-weight: 500; font-size: 13px; opacity: .85; }

/* =========================================================
   11. Footer
   ========================================================= */
.site-footer { background: var(--c-bg-dark); color: #aebfd4; padding-top: clamp(48px,6vw,72px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 16px; }
.site-footer a { color: #aebfd4; display: block; padding: 5px 0; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-brand p { color: #8aa0bd; font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 40px; padding-block: 22px; font-size: 13px; color: #8aa0bd; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-social { display: flex; gap: 12px; margin-top: 16px; }
.footer-social a { width: 36px; height: 36px; border-radius: 9px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #fff; }

/* =========================================================
   12. Utilities / misc
   ========================================================= */
.divider { height: 1px; background: var(--c-line); border: 0; margin: 0; }
.logo-strip { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: center; opacity: .8; }
.logo-strip span { font-weight: 700; color: var(--c-muted); letter-spacing: .04em; }
.faq-item { border: 1px solid var(--c-line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 12px; }
.faq-item h3 { font-size: 16px; margin: 0 0 6px; }
.feature-list { list-style: none; padding: 0; margin: 0; }
.feature-list li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--c-line); }
.feature-list li::before { content: "✓"; color: var(--c-ok); font-weight: 800; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 14px; border-radius: 8px; z-index: 200; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* =========================================================
   13. Responsive
   ========================================================= */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .product-hero { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .main-nav { position: fixed; inset: 72px 0 0 0; background: #fff; padding: 20px; transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; }
  .main-nav.open { transform: translateX(0); }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav a { padding: 14px; border-bottom: 1px solid var(--c-line); }
  .main-nav .sub-menu { position: static; box-shadow: none; border: 0; padding-left: 14px; }
  .nav-toggle { display: block; }
  .header-cta .btn--ghost { display: none; }
  .grid--3, .grid--4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
}
