/* ==========================================
   XIAMACH Machinery Equipment - Global Styles
   Color: Deep Blue #1a3a5c | White #fff | Orange #f47920
   ========================================== */

:root {
  --deep-blue: #1a3a5c;
  --deep-blue-dark: #122a44;
  --deep-blue-light: #234b70;
  --orange: #f47920;
  --orange-hover: #d96518;
  --orange-light: #fff5ed;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f0f1f3;
  --gray-200: #e2e4e7;
  --gray-300: #ced1d5;
  --gray-400: #9ea3aa;
  --gray-500: #6c7279;
  --gray-600: #4a4f54;
  --gray-700: #2d3135;
  --gray-800: #1a1d20;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 36px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.25s ease;
  --max-width: 1200px;
  --nav-height: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--orange-hover);
}

ul, ol {
  list-style: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--deep-blue);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
h4 { font-size: 1.1rem; }

.section-title {
  text-align: center;
  margin-bottom: 8px;
}
.section-subtitle {
  text-align: center;
  color: var(--gray-500);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--orange-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--orange);
  border: 2px solid var(--orange);
}
.btn-outline:hover {
  background: var(--orange);
  color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--deep-blue);
}
.btn-white:hover {
  background: var(--gray-100);
  color: var(--deep-blue);
}

.btn-lg {
  padding: 16px 40px;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* ---------- Navigation ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--deep-blue);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}
.nav-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--white);
  font-weight: 800;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-menu a {
  color: rgba(255,255,255,0.85);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-menu a:hover,
.nav-menu a.active {
  color: var(--orange);
  background: rgba(255,255,255,0.08);
}

.nav-cta {
  background: var(--orange) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
}
.nav-cta:hover {
  background: var(--orange-hover) !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-dark) 100%);
  color: var(--white);
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.03)" d="M0,160L48,176C96,192,192,224,288,213.3C384,203,480,149,576,138.7C672,128,768,160,864,186.7C960,213,1056,235,1152,218.7C1248,203,1344,149,1392,122.7L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"/></svg>') no-repeat bottom;
  background-size: cover;
  opacity: 0.4;
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero h1 {
  color: var(--white);
  margin-bottom: 16px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 36px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Features ---------- */
.features {
  padding: 80px 0;
  background: var(--white);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all var(--transition);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--orange-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.8rem;
}
.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}
.feature-card p {
  color: var(--gray-500);
  font-size: 0.92rem;
}

/* ---------- Product Categories ---------- */
.categories {
  padding: 80px 0;
  background: var(--gray-50);
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 48px;
}
.cat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.cat-img {
  height: 200px;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}
.cat-img .placeholder-label {
  position: absolute;
  font-weight: 500;
  font-size: 0.85rem;
}
.cat-body {
  padding: 24px;
}
.cat-body h3 {
  margin-bottom: 12px;
}
.cat-body .product-list-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.cat-body .product-list-mini span {
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--gray-600);
}
.cat-body .btn {
  width: 100%;
}

/* ---------- Trust Bar ---------- */
.trust-bar {
  padding: 48px 0;
  background: var(--deep-blue);
  color: var(--white);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.trust-item .trust-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--orange);
  margin-bottom: 4px;
}
.trust-item .trust-label {
  font-size: 0.95rem;
  opacity: 0.85;
}

/* ---------- CTA Section ---------- */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-hover) 100%);
  text-align: center;
  color: var(--white);
}
.cta-section h2 {
  color: var(--white);
  margin-bottom: 12px;
}
.cta-section p {
  opacity: 0.9;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Products Page ---------- */
.products-page {
  padding: 64px 0;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 40px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.product-card-img {
  height: 220px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}
.product-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-card-body .model {
  font-size: 0.8rem;
  color: var(--orange);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.product-card-body h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}
.product-card-body p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 16px;
  flex: 1;
}
.product-card-body .btn-row {
  display: flex;
  gap: 10px;
}

/* ---------- Product Detail ---------- */
.product-detail {
  padding: 64px 0;
}
.product-header {
  margin-bottom: 40px;
}
.product-header .model-tag {
  display: inline-block;
  background: var(--orange);
  color: var(--white);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.product-header h1 {
  margin-bottom: 8px;
}
.product-header .subtitle {
  color: var(--gray-500);
  font-size: 1.1rem;
}

.product-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 250px 250px;
  gap: 12px;
  margin-bottom: 48px;
}
.product-gallery .gallery-main {
  grid-row: 1 / 3;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.9rem;
}
.product-gallery .gallery-item {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.85rem;
}

.product-content-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  margin-bottom: 48px;
}

.product-description h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
}
.product-description p {
  margin-bottom: 16px;
  color: var(--gray-600);
  line-height: 1.75;
}
.product-description ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 24px;
}
.product-description ul li {
  margin-bottom: 8px;
  color: var(--gray-600);
}

/* Specs Table */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
}
.specs-table th,
.specs-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}
.specs-table th {
  background: var(--deep-blue);
  color: var(--white);
  font-weight: 600;
  font-size: 0.9rem;
}
.specs-table tr:nth-child(even) td {
  background: var(--gray-50);
}
.specs-table td:first-child {
  font-weight: 600;
  color: var(--gray-700);
  width: 35%;
}

/* Sidebar */
.product-sidebar {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
}
.product-sidebar h4 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}
.product-sidebar .btn {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}
.sidebar-contact-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.sidebar-contact-info p {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-bottom: 8px;
}

/* ---------- About Page ---------- */
.about-page {
  padding: 64px 0;
}
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 64px;
}
.about-intro .about-text h1 {
  margin-bottom: 20px;
}
.about-intro .about-text p {
  color: var(--gray-600);
  margin-bottom: 14px;
  line-height: 1.75;
}
.about-img-placeholder {
  height: 380px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.95rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 64px;
}
.stat-card {
  background: var(--deep-blue);
  color: var(--white);
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius-lg);
}
.stat-card .stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--orange);
}
.stat-card .stat-label {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 4px;
}

.advantages {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}
.adv-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--gray-50);
  padding: 20px;
  border-radius: var(--radius-md);
}
.adv-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--orange-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.adv-text h4 {
  margin-bottom: 4px;
  font-size: 1rem;
}
.adv-text p {
  font-size: 0.88rem;
  color: var(--gray-500);
}

/* ---------- Contact Page ---------- */
.contact-page {
  padding: 64px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 48px;
}

.contact-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.contact-form h2 {
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-group label .required {
  color: var(--orange);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(244,121,32,0.12);
}
.form-group textarea {
  resize: vertical;
  min-height: 120px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.contact-info-panel {
  background: var(--deep-blue);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.contact-info-panel h2 {
  color: var(--white);
  margin-bottom: 24px;
}
.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}
.contact-info-item .ci-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.contact-info-item h4 {
  color: var(--orange);
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.contact-info-item p {
  font-size: 0.9rem;
  opacity: 0.85;
}

.map-placeholder {
  height: 200px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--gray-800);
  color: rgba(255,255,255,0.7);
  padding: 56px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: var(--white);
  margin-bottom: 18px;
  font-size: 1rem;
}
.footer-col p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 8px;
}
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  margin-bottom: 8px;
  transition: color var(--transition);
}
.footer-col a:hover {
  color: var(--orange);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: var(--gray-50);
  padding: 14px 0;
  font-size: 0.88rem;
  color: var(--gray-500);
}
.breadcrumb a {
  color: var(--gray-500);
}
.breadcrumb a:hover {
  color: var(--orange);
}
.breadcrumb span {
  margin: 0 8px;
}

/* ---------- Page Header ---------- */
.page-header {
  background: var(--deep-blue);
  padding: 48px 0;
  text-align: center;
  color: var(--white);
}
.page-header h1 {
  color: var(--white);
  margin-bottom: 8px;
}
.page-header p {
  opacity: 0.8;
  font-size: 1rem;
}

/* ---------- Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features-grid,
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .product-content-grid {
    grid-template-columns: 1fr;
  }
  .product-sidebar {
    position: static;
  }
  .about-intro {
    grid-template-columns: 1fr;
  }
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--deep-blue-dark);
    flex-direction: column;
    padding: 16px 0;
    gap: 4px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
  }
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger {
    display: flex;
  }

  .features-grid,
  .cat-grid {
    grid-template-columns: 1fr;
  }
  .trust-grid {
    grid-template-columns: 1fr;
  }
  .product-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 300px 150px;
  }
  .product-gallery .gallery-main {
    grid-column: 1 / 3;
    grid-row: 1 / 2;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .advantages {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .products-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 0 50px;
  }
  .hero h1 {
    font-size: 1.6rem;
  }
  .hero p {
    font-size: 1rem;
  }
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .specs-table {
    font-size: 0.85rem;
  }
  .specs-table th,
  .specs-table td {
    padding: 8px 10px;
  }
}
