/*
Theme Name: CNC Sourcing
Theme URI: https://www.cncsourcing.com
Description: CNC Sourcing - Electronic Components & CNC Parts Sourcing Platform. Professional B2B sourcing theme with built-in SEO optimization.
Version: 1.0.0
Author: CNC Sourcing Team
Author URI: https://www.cncsourcing.com
License: GNU General Public License v2+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cncsourcing
Tags: one-column, two-columns, custom-menu, custom-logo, featured-images, translation-ready

CNC Sourcing Theme - Based on ChainTech professional design.
Primary Color: #0B3D6B (Corporate Blue)
*/

/* ===========================
   CSS Variables
   =========================== */
:root {
  --primary-blue: #0B3D6B;
  --secondary-blue: #1a5f9a;
  --accent-blue: #2d8bc9;
  --light-bg: #f8f9fa;
  --dark-text: #1a1a2e;
  --body-text: #444;
  --muted-text: #666;
  --border-color: #e9ecef;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.3s ease;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body-text);
  line-height: 1.7;
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--primary-blue);
}

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

ul, ol {
  list-style: none;
}

/* ===========================
   Typography
   =========================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--dark-text);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }
h5 { font-size: 1rem; }

p { margin-bottom: 1rem; }

/* ===========================
   Layout
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

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

/* ===========================
   Header / Navigation
   =========================== */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  background: var(--primary-blue);
  color: white;
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.header-top-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main {
  padding: 1rem 0;
}

.header-main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-blue);
}

.site-logo img {
  height: 48px;
  width: auto;
}

.site-logo:hover {
  color: var(--primary-blue);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: var(--dark-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-blue);
  transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav .current-menu-item a::after {
  width: 100%;
}

.main-nav a:hover {
  color: var(--primary-blue);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 80px 0;
  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,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  color: white;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--light-bg);
  color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: white;
}

.btn-accent {
  background: var(--primary-blue);
  color: white;
}

.btn-accent:hover {
  background: var(--secondary-blue);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===========================
   Stats Bar
   =========================== */
.stats-bar {
  background: var(--light-bg);
  padding: 2.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.stat-item .stat-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary-blue);
  display: block;
}

.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

/* ===========================
   Services Section
   =========================== */
.services-section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  color: var(--dark-text);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--muted-text);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-blue);
}

.service-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--primary-blue);
}

.service-card ul {
  list-style: none;
}

.service-card ul li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--body-text);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.service-card ul li:last-child {
  border-bottom: none;
}

.service-card ul li::before {
  content: '✓';
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 0.8rem;
}

/* ===========================
   Brand Logos Section
   =========================== */
.brands-section {
  background: var(--light-bg);
  padding: 4rem 0;
}

.brands-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}

.brand-item {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 160px;
}

.brand-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.brand-item img {
  max-height: 40px;
  width: auto;
}

.brand-item span {
  font-weight: 600;
  color: var(--dark-text);
  font-size: 0.9rem;
}

/* ===========================
   CTA Section
   =========================== */
.cta-section {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
  border-radius: var(--radius-lg);
  margin: 3rem 0;
}

.cta-section h2 {
  color: white;
  margin-bottom: 1rem;
}

.cta-section p {
  opacity: 0.9;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ===========================
   Page Header
   =========================== */
.page-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}

.page-header h1 {
  color: white;
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.9;
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
}

/* ===========================
   Content Area
   =========================== */
.content-area {
  padding: 4rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.content-grid.reverse {
  direction: rtl;
}

.content-grid.reverse > * {
  direction: ltr;
}

.content-block h2 {
  color: var(--primary-blue);
  margin-bottom: 1rem;
}

.content-block p {
  color: var(--body-text);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ===========================
   Product / Category Cards
   =========================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  text-decoration: none;
  color: var(--dark-text);
}

.category-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  color: var(--primary-blue);
  transform: translateY(-3px);
}

.category-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--muted-text);
  margin: 0;
}

/* ===========================
   Contact Section
   =========================== */
.contact-section {
  background: var(--primary-blue);
  color: white;
  padding: 5rem 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info h2 {
  color: white;
  margin-bottom: 1.5rem;
}

.contact-info p {
  opacity: 0.85;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.8;
}

.contact-info strong {
  color: white;
}

.contact-map {
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.6;
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  background: var(--dark-text);
  color: rgba(255,255,255,0.75);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col ul li a:hover {
  color: white;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-brand img {
  max-height: 40px;
}

.footer-brand span {
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

.footer-bottom a {
  color: rgba(255,255,255,0.6);
  margin-right: 1rem;
}

.footer-bottom a:hover {
  color: white;
}

/* ===========================
   Forms
   =========================== */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
}

.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(45, 139, 201, 0.15);
}

/* ===========================
   Back to Top
   =========================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--secondary-blue);
  transform: translateY(-3px);
}

/* ===========================
   RFQ Button (Floating)
   =========================== */
.rfq-float {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 999;
}

.rfq-float .btn {
  box-shadow: var(--shadow-lg);
  font-size: 1rem;
  padding: 1rem 1.75rem;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-main-inner {
    flex-direction: column;
    gap: 1rem;
  }
  .main-nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .content-grid {
    grid-template-columns: 1fr;
    direction: ltr !important;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .hero {
    padding: 60px 0;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .section {
    padding: 3rem 0;
  }
}

/* ===========================
   Utility Classes
   =========================== */
.text-center { text-align: center; }
.text-primary { color: var(--primary-blue); }
.bg-light { background: var(--light-bg); }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
