/*
Theme Name: XZDAO Export Homepage
Theme URI: https://www.xzdaograin.com/
Author: Codex
Description: Static bilingual export company homepage for Hefei Xiange Zhengdao Grain Trading Co., Ltd.
Version: 1.0.0
Text Domain: xzdao-export
*/

:root {
  --ink: #20221d;
  --muted: #6f7468;
  --line: #dde1d5;
  --paper: #f7f7f1;
  --white: #ffffff;
  --green: #4c6f31;
  --deep-green: #263e20;
  --gold: #d8a23a;
  --red: #a84332;
  --shadow: 0 20px 50px rgba(32, 34, 29, 0.14);
  --radius: 8px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(247, 247, 241, 0.92);
  border-bottom: 1px solid rgba(76, 111, 49, 0.12);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  position: relative;
  display: block;
  width: 92px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 7px;
  overflow: visible;
  background: #fff;
  box-shadow: 0 6px 18px rgba(32, 34, 29, 0.08);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
}

.registered-mark {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--deep-green);
  border-radius: 50%;
  background: var(--white);
  color: var(--deep-green);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #44493f;
  font-size: 14px;
}

.nav a {
  padding: 8px 0;
}

.lang-toggle,
.carousel-controls button {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--deep-green);
  cursor: pointer;
}

.lang-toggle {
  min-width: 48px;
  height: 38px;
  border-radius: 999px;
  font-weight: 800;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(28px, 5vw, 72px);
  min-height: calc(100vh - 84px);
  padding: clamp(34px, 6vw, 78px) clamp(18px, 5vw, 64px) 48px;
  overflow: hidden;
}

.hero-copy {
  align-self: center;
  max-width: 720px;
}

.hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-copy p {
  max-width: 650px;
  margin: 26px 0 0;
  color: #4d5247;
  font-size: clamp(17px, 1.55vw, 22px);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
}

.button.primary {
  background: var(--deep-green);
  color: #fff;
}

.button.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 44px 0 0;
}

.hero-points div {
  border-top: 1px solid rgba(76, 111, 49, 0.24);
  padding-top: 16px;
}

.hero-points dt {
  font-size: 22px;
  font-weight: 900;
}

.hero-points dd {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.carousel {
  position: relative;
  align-self: stretch;
  min-height: 560px;
  border-radius: 8px 8px 8px 80px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #d7ddcd;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 700ms ease, transform 900ms ease;
}

.slide.active {
  opacity: 1;
  transform: scale(1);
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.3));
}

.slide figcaption {
  position: absolute;
  left: 28px;
  bottom: 28px;
  z-index: 1;
  max-width: calc(100% - 56px);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.36);
}

.carousel-controls {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  gap: 10px;
}

.carousel-controls button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.carousel-controls svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section {
  padding: clamp(54px, 8vw, 104px) clamp(18px, 5vw, 64px);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: end;
  background: var(--white);
}

.intro h2,
.section-heading h2,
.service-content h2,
.contact h2 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.05;
}

.intro p,
.section-heading p,
.service-content > p,
.contact > div > p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.intro-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.intro-list span {
  min-height: 58px;
  padding: 18px;
  border-left: 4px solid var(--gold);
  background: #f4f1e8;
  font-weight: 800;
}

.products {
  background: #eef0e7;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.section-heading p {
  max-width: 520px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(76, 111, 49, 0.12);
  border-radius: var(--radius);
  background: var(--white);
}

.product-card img {
  height: 285px;
}

.product-body {
  padding: 16px 18px 20px;
}

.product-category {
  display: block;
  margin-bottom: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.product-card h3 {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 20px;
}

.product-card p {
  margin-top: 9px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.product-price {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-top: 14px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f4f1e8;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.empty-products {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px dashed rgba(76, 111, 49, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.feature-card {
  grid-column: span 2;
  display: grid;
  grid-template-columns: 0.95fr 1fr;
  align-items: stretch;
}

.feature-card img {
  height: 100%;
}

.feature-card div {
  align-self: center;
  padding: 26px 8px;
}

.services {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: center;
  background: var(--deep-green);
  color: #fff;
}

.service-media {
  height: min(680px, 78vh);
  min-height: 460px;
  border-radius: 8px 70px 8px 8px;
  overflow: hidden;
}

.service-content > p {
  color: rgba(255, 255, 255, 0.78);
}

.service-steps {
  display: grid;
  gap: 14px;
  margin-top: 32px;
}

.service-steps div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px 16px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.service-steps span {
  grid-row: span 2;
  color: var(--gold);
  font-size: 22px;
  font-weight: 900;
}

.service-steps strong {
  font-size: 20px;
}

.service-steps p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.6;
}

.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1fr);
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
  background: var(--white);
}

.contact-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbf7;
  box-shadow: 0 16px 40px rgba(32, 34, 29, 0.08);
}

.contact-panel a,
.contact-panel p {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: start;
  margin: 0;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.contact-panel a:last-of-type {
  border-bottom: 1px solid var(--line);
}

.contact-panel span {
  color: var(--muted);
  font-size: 14px;
}

.contact-panel strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.5;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 5vw, 64px);
  background: #192816;
  color: rgba(255, 255, 255, 0.78);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav {
    display: none;
  }

  .hero,
  .intro,
  .services,
  .contact {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .carousel {
    min-height: 520px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 16px;
  }

  .brand small {
    display: none;
  }

  .brand strong {
    max-width: 172px;
  }

  .brand-logo {
    width: 72px;
    height: 42px;
  }

  .hero {
    padding-top: 28px;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.08;
    max-width: 9.5em;
    word-break: break-all;
  }

  .hero-points,
  .intro-list,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .carousel {
    min-height: 420px;
    border-radius: 8px 8px 8px 44px;
  }

  .section-heading {
    display: block;
  }

  .feature-card {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .feature-card img,
  .product-card img {
    height: 260px;
  }

  .service-media {
    min-height: 340px;
  }

  .contact-panel {
    padding: 16px;
  }

  .contact-panel a,
  .contact-panel p {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .site-footer {
    display: block;
  }

  .site-footer p + p {
    margin-top: 8px;
  }
}
