/*
Theme Name: Jinxiang Garlic
Theme URI: https://www.garliclink.com
Description: Custom B2B garlic export theme — product-forward design
Version: 2.0.0
Author: Jinxiang Garlic
*/

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* Colors */
  --green: #1a5632;
  --green-dark: #0f3d22;
  --green-light: #e8f5e9;
  --gold: #c8983c;
  --gold-light: #f5e6c8;
  --white: #ffffff;
  --black: #1a1a1a;

  /* Grays */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --header-height: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

/* ============================================================
   Reset / Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--green);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--green-dark);
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--black);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-md);
}

ul, ol {
  list-style: none;
}

/* ============================================================
   Utility Classes
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  width: 100%;
  max-width: var(--max-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
  color: var(--black);
}

.section-header p {
  color: var(--gray-500);
  font-size: var(--text-lg);
  max-width: 600px;
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.4;
}

.btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--green);
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: #b8872e;
  border-color: #b8872e;
  color: var(--white);
}

.btn-lg {
  font-size: var(--text-lg);
  padding: 1rem 2.25rem;
}

.btn-sm {
  font-size: var(--text-sm);
  padding: 0.5rem 1.25rem;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site-logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

.site-logo:hover {
  color: var(--green-dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--green);
}

.nav-cta {
  margin-left: var(--space-md);
}

/* Dropdown Menu */
.menu-item-has-children {
  position: relative;
}

.menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.6;
}

.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 220px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.5rem 0;
  z-index: 200;
  border: 1px solid var(--gray-200);
}

.menu-item-has-children:hover > .sub-menu {
  display: block;
}

.sub-menu .menu-item {
  display: block;
}

.sub-menu a {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: var(--text-sm);
  white-space: nowrap;
  color: var(--gray-700);
  transition: background var(--transition), color var(--transition);
}

.sub-menu a:hover {
  background: var(--gray-100);
  color: var(--green);
}

/* Open state (click-based toggle, all screen sizes) */
.menu-item-has-children.open > .sub-menu {
  display: block;
}

/* Mobile dropdown */
@media (max-width: 839px) {
  .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    background: transparent;
    display: none;
  }

  .menu-item-has-children.open > .sub-menu {
    display: block;
  }

  .sub-menu a {
    padding: 0.5rem 0;
    font-size: var(--text-sm);
  }
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(
      135deg,
      rgba(26, 86, 50, 0.92) 0%,
      rgba(15, 61, 34, 0.95) 100%
    ),
    var(--gray-100);
  color: var(--white);
  text-align: center;
  padding: var(--space-4xl) var(--space-lg);
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  color: var(--white);
  margin-bottom: var(--space-lg);
}

.hero p {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

/* ============================================================
   Product Cards
   ============================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.product-card-body {
  padding: var(--space-lg);
}

.product-card-body h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-xs);
}

.product-card-body p {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-md);
}

/* ============================================================
   Trust Bar
   ============================================================ */
.trust-bar {
  background: var(--gray-50);
  padding: var(--space-2xl) 0;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
  text-align: center;
}

.trust-item {
  padding: var(--space-lg);
}

.trust-item .number {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--green);
  display: block;
  line-height: 1;
}

.trust-item .label {
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-top: var(--space-sm);
  display: block;
}

/* ============================================================
   Product Detail
   ============================================================ */
.product-detail {
  margin-top: var(--header-height);
  padding: var(--space-3xl) 0;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: start;
}

.product-gallery-main {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: var(--gray-100);
}

.product-gallery-thumbs {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.product-gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), opacity var(--transition);
  opacity: 0.7;
}

.product-gallery-thumb:hover {
  opacity: 1;
}

.product-gallery-thumb.active {
  border-color: var(--green);
  opacity: 1;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-lg);
}

.spec-table th,
.spec-table td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.spec-table th {
  font-weight: 600;
  color: var(--gray-700);
  width: 35%;
  font-size: var(--text-sm);
}

.spec-table td {
  color: var(--black);
  font-size: var(--text-sm);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--black);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  position: relative;
  padding-right: 2rem;
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--green);
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 0;
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--gray-400);
  transition: transform var(--transition);
  line-height: 1;
}

.faq-question.active::after {
  content: '\2212'; /* minus sign */
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.faq-answer.open {
  max-height: 500px;
  padding-bottom: var(--space-lg);
}

.faq-answer p {
  color: var(--gray-600);
  line-height: 1.7;
}

/* ============================================================
   Contact Form
   ============================================================ */
.contact-form {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-xs);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26, 86, 50, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
}

.form-message {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  display: none;
}

.form-message.success {
  display: block;
  background: var(--green-light);
  color: var(--green);
  border: 1px solid var(--green);
}

.form-message.error {
  display: block;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2xl);
}

.footer-col h4 {
  color: var(--white);
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
}

.footer-col p {
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.footer-col a {
  color: var(--gray-400);
  font-size: var(--text-sm);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--white);
}

.footer-col ul li {
  margin-bottom: var(--space-sm);
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  text-align: center;
  font-size: var(--text-xs);
}

/* ============================================================
   Blog Cards
   ============================================================ */
.blog-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

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

.blog-card-body {
  padding: var(--space-lg);
}

.blog-card-body h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.blog-card-body p {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-sm);
}

.blog-card-body .blog-meta {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

/* ============================================================
   Responsive — 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-list {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .product-detail-grid {
    grid-template-columns: 1fr;
  }

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

/* ============================================================
   Responsive — 768px
   ============================================================ */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  .container,
  .container-narrow {
    padding: 0 var(--space-md);
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
    border-top: 1px solid var(--gray-200);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-links a {
    font-size: var(--text-base);
    padding: var(--space-sm) 0;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: var(--space-sm);
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .blog-list {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: calc(100vh - var(--header-height));
    padding: var(--space-2xl) var(--space-md);
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .section-header {
    margin-bottom: var(--space-xl);
  }
}

