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

:root {
  --bg: #161c24;
  --bg-alt: #1c232d;
  --bg-card: #212836;
  --border: #242d3a;
  --text: #dde4ed;
  --text-dim: #8896a6;
  --gold: #c9a84c;
  --gold-dim: #a68a34;
  --white: #ffffff;
  --max-width: 1200px;
  --transition: 0.25s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

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

/* ===== Buttons ===== */
.btn { display: inline-block; padding: 14px 32px; font-size: 15px; font-weight: 600; border-radius: 0; cursor: pointer; transition: all var(--transition); border: none; letter-spacing: 0.3px; text-transform: uppercase; }
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-dim); }
.btn-outline { background: transparent; border: 1px solid var(--text-dim); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ===== Header ===== */
.header { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background: rgba(22,28,36,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); transition: all var(--transition); }
.header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 20px; font-weight: 700; color: var(--white); letter-spacing: 0.5px; }
.logo span { color: var(--gold); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { color: var(--text-dim); font-size: 14px; transition: color var(--transition); font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); transition: all var(--transition); }

/* ===== Hero ===== */
.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 80px 0; }
.hero .container { position: relative; z-index: 1; max-width: 720px; }
.hero h1 { font-size: 54px; font-weight: 700; color: var(--white); line-height: 1.15; margin-bottom: 20px; letter-spacing: -0.5px; }
.hero h1 span { color: var(--gold); }
.hero p { font-size: 18px; color: var(--text-dim); line-height: 1.7; margin-bottom: 36px; max-width: 560px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===== Section Headers ===== */
.section-intro { text-align: left; margin-bottom: 48px; }
.section-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); margin-bottom: 12px; }
.section-intro h2 { font-size: 36px; font-weight: 700; color: var(--white); line-height: 1.2; margin-bottom: 12px; }
.section-intro p { color: var(--text-dim); font-size: 16px; max-width: 600px; }

/* ===== Who We Are ===== */
.about-section { padding: 100px 0; background: var(--bg); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.about-images { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 240px 180px; gap: 12px; }
.about-images img { width: 100%; height: 100%; object-fit: cover; }
.about-images .img-main { grid-column: 1 / -1; }
.about-text h2 { font-size: 32px; color: var(--white); margin-bottom: 20px; }
.about-text p { color: var(--text-dim); font-size: 15px; line-height: 1.8; margin-bottom: 24px; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.about-stat .num { font-size: 28px; font-weight: 700; color: var(--gold); }
.about-stat .lbl { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ===== Products ===== */
.products-section { padding: 100px 0; background: var(--bg-alt); }
.product-row { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 60px 0; border-top: 1px solid var(--border); }
.product-row:first-of-type { border-top: none; padding-top: 0; }
.product-row.reverse .product-img { order: 1; }
.product-row.reverse .product-info { order: 0; }
.product-img { position: relative; overflow: hidden; aspect-ratio: 4/3; }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.product-row:hover .product-img img { transform: scale(1.04); }
.product-info h3 { font-size: 28px; color: var(--white); margin-bottom: 12px; }
.product-info p { color: var(--text-dim); font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
.spec-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.spec-tag { padding: 6px 14px; font-size: 12px; font-weight: 500; color: var(--gold); border: 1px solid rgba(201,168,76,0.3); letter-spacing: 0.3px; }

/* ===== Numbers ===== */
.numbers-section { padding: 72px 0; background: var(--bg-card); }
.numbers-grid { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.number-item { text-align: center; flex: 1; min-width: 140px; }
.number-item .num { font-size: 48px; font-weight: 800; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.number-item .lbl { font-size: 14px; color: var(--text-dim); }

/* ===== Factory ===== */
.factory-section { padding: 100px 0; background: var(--bg); }
.factory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; max-width: 1100px; margin: 0 auto; }
.factory-item { position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer; }
.factory-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.factory-item:hover img { transform: scale(1.08); }
.factory-item .label { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; background: linear-gradient(transparent, rgba(18,24,32,0.9)); color: var(--white); font-size: 14px; font-weight: 600; letter-spacing: 0.5px; opacity: 0; transition: opacity var(--transition); }
.factory-item:hover .label { opacity: 1; }

/* ===== Certs ===== */
.cert-section { padding: 60px 0; background: var(--bg-alt); }
.cert-grid { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; align-items: center; }
.cert-item { text-align: center; }
.cert-item img { width: 48px; height: 48px; margin: 0 auto 8px; opacity: 0.8; transition: opacity var(--transition); }
.cert-item:hover img { opacity: 1; }
.cert-item span { display: block; font-size: 12px; color: var(--text-dim); font-weight: 500; }
.cert-note { text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-dim); }
.cert-note a { color: var(--gold); }

/* ===== Testimonials Carousel ===== */
.testimonials-section { padding: 100px 0; background: var(--bg); overflow: hidden; }
.testimonial-carousel { position: relative; overflow: hidden; }
.testimonial-track { display: flex; flex-wrap: nowrap; transition: transform 0.5s ease; gap: 24px; }
.testimonial-card { flex: 0 0 calc(33.333% - 16px); min-width: calc(33.333% - 16px); padding: 36px; border: 1px solid var(--border); transition: border-color var(--transition); background: var(--bg-card); }
.testimonial-card:hover { border-color: rgba(201,168,76,0.4); }
.testimonial-card .quote { font-size: 14px; color: var(--text-dim); line-height: 1.8; margin-bottom: 24px; font-style: italic; min-height: 140px; }
.testimonial-card .author { display: flex; align-items: center; gap: 12px; }
.testimonial-card .stars { color: var(--gold); font-size: 13px; margin-bottom: 12px; letter-spacing: 2px; }
.author-avatar { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; color: var(--bg); background: var(--gold); flex-shrink: 0; }
.author-info strong { display: block; font-size: 14px; color: var(--white); }
.author-info span { font-size: 12px; color: var(--text-dim); }
.carousel-dots { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background var(--transition); border: none; padding: 0; }
.carousel-dot.active { background: var(--gold); }
.carousel-arrows { display: flex; justify-content: center; gap: 16px; margin-top: 20px; }
.carousel-arrow { width: 40px; height: 40px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); font-size: 16px; }
.carousel-arrow:hover { border-color: var(--gold); color: var(--gold); }

/* ===== CTA ===== */
.cta-section { padding: 100px 0; background: var(--bg-alt); }
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: start; }
.cta-text h2 { font-size: 32px; color: var(--white); margin-bottom: 16px; }
.cta-text p { color: var(--text-dim); font-size: 15px; line-height: 1.7; }
.cta-form .form-group { margin-bottom: 16px; }
.cta-form label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.cta-form input, .cta-form textarea { width: 100%; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); font-size: 15px; font-family: inherit; outline: none; transition: border-color var(--transition); }
.cta-form input:focus, .cta-form textarea:focus { border-color: var(--gold); }
.cta-form textarea { min-height: 100px; resize: vertical; }
.form-success { display: none; color: var(--gold); font-weight: 600; padding: 24px 0; }

/* ===== Footer ===== */
.footer { padding: 60px 0 32px; background: var(--bg-card); border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; margin-bottom: 40px; }
.footer h3 { color: var(--white); font-size: 15px; margin-bottom: 16px; letter-spacing: 0.5px; }
.footer-about p { font-size: 14px; color: var(--text-dim); line-height: 1.7; opacity: 0.7; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links a { font-size: 14px; color: var(--text-dim); opacity: 0.7; transition: all var(--transition); }
.footer-links a:hover { color: var(--gold); opacity: 1; }
.footer-contact p { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; opacity: 0.7; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 24px; text-align: center; font-size: 13px; color: var(--text-dim); opacity: 0.5; }

/* ===== WhatsApp ===== */
.whatsapp-float { position: fixed; bottom: 28px; right: 28px; width: 52px; height: 52px; background: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 20px rgba(37,211,102,0.35); z-index: 999; transition: transform var(--transition); }
.whatsapp-float:hover { transform: scale(1.12); }
.whatsapp-float svg { width: 26px; height: 26px; fill: #fff; }

/* ===== Toast ===== */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 14px 28px; border-radius: 0; color: #fff; font-size: 14px; z-index: 2000; animation: slideDown 0.3s ease; display: none; }
.toast.success { background: #2e7d32; }
.toast.error { background: #c0392b; }
@keyframes slideDown { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== Page Header (sub-pages) ===== */
.page-header { padding: 120px 0 60px; background: var(--bg); text-align: left; border-bottom: 1px solid var(--border); }
.page-header h1 { color: var(--white); font-size: 36px; margin-bottom: 8px; }
.page-header p { color: var(--text-dim); font-size: 16px; }

/* ===== Blog Grid ===== */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.blog-card { border: 1px solid var(--border); transition: border-color var(--transition); overflow: hidden; }
.blog-card:hover { border-color: rgba(201,168,76,0.4); }
.blog-card-img { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-card); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body { padding: 24px; }
.blog-card-date { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.blog-card h3 { font-size: 18px; color: var(--white); margin-bottom: 8px; line-height: 1.4; }
.blog-card p { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 16px; }
.read-more { font-size: 13px; color: var(--gold); font-weight: 600; transition: color var(--transition); }
.read-more:hover { color: var(--gold-dim); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .hero h1 { font-size: 36px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .product-row { grid-template-columns: 1fr; gap: 32px; }
  .product-row.reverse .product-img { order: 0; }
  .testimonial-card { flex: 0 0 calc(50% - 12px); min-width: calc(50% - 12px); }
  .testimonial-card .quote { min-height: auto; }
  .cta-grid { grid-template-columns: 1fr; gap: 40px; }
  .factory-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .numbers-grid { gap: 28px; }
  .number-item .num { font-size: 36px; }
  .blog-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .nav-links { position: fixed; top: 64px; left: 0; width: 100%; background: rgba(22,28,36,0.98); border-bottom: 1px solid var(--border); flex-direction: column; padding: 20px; gap: 18px; display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .hero { min-height: 80vh; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .about-images { grid-template-rows: 200px 140px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .cert-grid { gap: 28px; }
  .cert-item img { width: 40px; height: 40px; }
  .section-intro h2 { font-size: 26px; }
  .numbers-grid { gap: 20px; }
  .number-item .num { font-size: 28px; }
  .factory-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; }
  .testimonial-card { flex: 0 0 100%; min-width: 100%; }
  .testimonial-card .quote { min-height: auto; }
}
/* ===== Old blog content compatibility (dark theme) ===== */
.page-header + section h2, .page-header + section h3, .page-header + section h4 { color: var(--white) !important; }
.page-header + section p, .page-header + section li { color: var(--text-dim) !important; }
.page-header + section a { color: var(--gold) !important; }
.page-header + section ol, .page-header + section ul { padding-left: 24px; margin: 16px 0; }
.page-header + section blockquote { border-left: 2px solid var(--gold); padding-left: 16px; color: var(--text-dim); margin: 16px 0; }
.page-header + section img { max-width: 100%; height: auto; border-radius: 4px; }

/* Old blog CTA override */
.page-header + section div[style*="gray"] { background: var(--bg-card) !important; }
.page-header + section div[style*="gray"] h3 { color: var(--white) !important; }
.page-header + section div[style*="gray"] p { color: var(--text-dim) !important; }
/* ===== Old pages compatibility ===== */
.custom-order-page, #factoryBoard, .dashboard-page { background: var(--bg); color: var(--text); }
.custom-order-page input, .custom-order-page textarea, .custom-order-page select,
.dashboard-page input, .dashboard-page textarea, .dashboard-page select,
#factoryBoard input, #factoryBoard textarea, #factoryBoard select { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }

/* Force light text on any element with hardcoded dark colors on old pages */
section[style*="padding"] h2, section[style*="padding"] h3 { color: var(--white) !important; }
section[style*="padding"] p, section[style*="padding"] li, section[style*="padding"] td { color: var(--text-dim) !important; }
