/* ============================================
   APA TRADE — Design System
   Inspired by Dropship.io (Awwwards Honorable Mention)
   ============================================ */

:root {
  /* Colors */
  --brand: #225AEA;
  --brand-hover: #1a4bc4;
  --brand-light: #e8eeff;
  --brand-subtle: #f0f4ff;
  --bg: #ffffff;
  --bg-alt: #f8f9fc;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --success: #10b981;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --max-width: 1200px;
  --nav-height: 72px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: 3.5rem; letter-spacing: -0.03em; }
h2 { font-size: 2.5rem; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }

p { margin: 0; color: var(--text-secondary); }
a { color: var(--brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-hover); }

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow 0.3s;
}

.site-header.sticky-menu {
  box-shadow: var(--shadow);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo a {
  display: flex;
  align-items: center;
}

.brand-logo img {
  height: 32px;
  width: auto;
}

.menu-block-wrapper {
  display: flex;
  align-items: center;
}

.site-menu-main {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 4px;
}

.nav-item .nav-link-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-item .nav-link-item:hover {
  color: var(--text);
  background: var(--bg-alt);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-brand {
  background: var(--brand);
  color: #fff;
}

.btn-brand:hover {
  background: var(--brand-hover);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-alt);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--brand-subtle) 0%, var(--bg) 100%);
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(34,90,234,0.04) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 30%, rgba(34,90,234,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 20px;
  font-size: 3.5rem;
  line-height: 1.15;
}

.hero p {
  font-size: 1.125rem;
  max-width: 520px;
  margin: 0 auto 36px;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Search field */
.search-field-wrap {
  display: flex;
  align-items: center;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.search-field-wrap:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34,90,234,0.1);
}

.search-field-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}

.search-field-wrap input::placeholder {
  color: var(--text-muted);
}

.search-field-wrap .btn {
  border-radius: var(--radius-sm);
  padding: 10px 20px;
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 56px;
}

.section-header h2 {
  margin-bottom: 16px;
}

.section-header p {
  font-size: 1.0625rem;
}

/* ============================================
   Features Grid
   ============================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s;
}

.feature-card:hover {
  border-color: var(--brand-light);
  box-shadow: var(--shadow-md);
}

.feature-card img {
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
}

.feature-card h4 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.feature-card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ============================================
   Split Sections (Customers / Suppliers)
   ============================================ */
.split-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.split-content h2 {
  margin-bottom: 16px;
}

.split-content > p {
  font-size: 1.0625rem;
  margin-bottom: 36px;
}

.split-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-image img {
  max-width: 100%;
  border-radius: var(--radius);
}

/* Icon list */
.icon-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.icon-list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.icon-list-item img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  margin-top: 2px;
}

.icon-list-item h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.icon-list-item p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CTA box */
.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding: 32px 36px;
  background: var(--brand-subtle);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.cta-box p {
  color: var(--text);
  font-weight: 500;
  font-size: 1.0625rem;
}

.cta-box .search-field-wrap {
  margin: 0;
  min-width: 320px;
}

/* ============================================
   Partners / Logo Bar
   ============================================ */
.partners-section {
  padding: 60px 0;
  overflow: hidden;
}

.brand-slider {
  display: flex;
  gap: 48px;
  animation: scroll-ltr 30s linear infinite;
  padding: 20px 0;
}

.brand-slider:hover {
  animation-play-state: paused;
}

@keyframes scroll-ltr {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.brand-slider img {
  height: 32px;
  width: auto;
  opacity: 0.45;
  transition: opacity 0.3s;
  flex-shrink: 0;
}

.brand-slider img:hover {
  opacity: 0.75;
}

/* ============================================
   About / Stats
   ============================================ */
.about-section {
  background: var(--text);
  color: #fff;
  padding: 100px 0;
  position: relative;
  overflow: hidden;
}

.about-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(34,90,234,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.about-section h2 {
  color: #fff;
  margin-bottom: 24px;
}

.about-text {
  max-width: 640px;
  margin-bottom: 56px;
}

.about-text p {
  color: rgba(255,255,255,0.7);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.about-text p + p {
  margin-top: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}

.stat-item h2 {
  font-size: 2.5rem;
  margin-bottom: 4px;
  color: var(--brand);
}

.stat-item p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}

/* ============================================
   Contact Form
   ============================================ */
.contact-section {
  padding: 100px 0;
  text-align: center;
}

.contact-section h2 {
  margin-bottom: 40px;
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.form-group {
  margin-bottom: 16px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34,90,234,0.1);
}

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

.contact-form .btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

/* Contact info */
.contact-info {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.contact-info-item img {
  width: 32px;
  height: 32px;
}

.contact-info-item h5 {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 2px;
}

.contact-info-item p,
.contact-info-item a {
  font-size: 0.9375rem;
  color: var(--text);
  font-weight: 500;
}

/* Map */
.map-wrap {
  margin-top: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.map-wrap iframe {
  display: block;
  width: 100%;
  height: 400px;
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border-light);
  padding: 24px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ============================================
   GroupAuto Section
   ============================================ */
.groupauto-section {
  background: var(--bg-alt);
  padding: 80px 0;
  text-align: center;
}

.groupauto-section h2 {
  margin: 16px 0 48px;
}

.groupauto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}

.groupauto-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  text-align: left;
  transition: box-shadow 0.25s;
}

.groupauto-card:hover {
  box-shadow: var(--shadow-md);
}

.groupauto-card h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

.groupauto-card p {
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ============================================
   Preloader
   ============================================ */
.sofax-preloader-wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sofax-preloader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   Progress bar
   ============================================ */
.progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 1001;
  background: transparent;
}

.progress-bar {
  height: 100%;
  background: var(--brand);
  width: 0%;
  transition: width 0.1s;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 991px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }
  .hero { padding: 100px 0 60px; }
  .split-layout { grid-template-columns: 1fr; gap: 40px; }
  .split-image { order: -1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .groupauto-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.625rem; }
  .hero { padding: 90px 0 48px; }
  .section { padding: 56px 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .contact-info { flex-direction: column; align-items: center; gap: 24px; }
  .cta-box { flex-direction: column; text-align: center; padding: 24px; }
  .cta-box .search-field-wrap { min-width: auto; width: 100%; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }

  /* Mobile nav */
  .menu-block-wrapper {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.3s;
  }

  .menu-block-wrapper.is-open {
    transform: translateX(0);
  }

  .site-menu-main {
    flex-direction: column;
    gap: 4px;
  }

  .header-btn { display: none; }
  .mobile-menu-trigger { display: flex; }
}

@media (max-width: 479px) {
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* Mobile menu trigger */
.mobile-menu-trigger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}

.mobile-menu-trigger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-menu-trigger.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-trigger.is-active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-trigger.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Header btns */
.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Groupauto logo inline */
.groupauto-logo-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.groupauto-logo-inline img {
  height: 24px;
}

/* Hidden elements from old theme - hide them via design system */
.sofax-header-section .d-none { display: none; }
.d-xs-inline-flex { display: none; }
