/* ==========================================================================
   JD Marine Machinery — Shared Stylesheet
   Industrial Navy / Steel Blue theme
   ========================================================================== */

:root {
  --navy-900: #071a2e;
  --navy-800: #0a2540;
  --navy-700: #113764;
  --steel-600: #1e4d8b;
  --steel-500: #2563a6;
  --cyan-500: #2ea3d8;
  --cyan-400: #4fc3e7;
  --gray-900: #1a1a1a;
  --gray-700: #3f4a58;
  --gray-500: #6b7787;
  --gray-300: #c4ccd6;
  --gray-200: #e3e8ef;
  --gray-100: #f1f4f8;
  --gray-50:  #f8fafc;
  --white:    #ffffff;
  --accent-gold: #d4a84b;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 3px rgba(7, 26, 46, 0.08);
  --shadow-md: 0 4px 14px rgba(7, 26, 46, 0.10);
  --shadow-lg: 0 12px 32px rgba(7, 26, 46, 0.14);

  --container-max: 1240px;

  --font-sans: "Inter", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--steel-500);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--cyan-500);
}

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

/* -------- Top bar -------- */
.topbar {
  background: var(--navy-900);
  color: var(--gray-300);
  font-size: 13px;
  padding: 8px 0;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar a {
  color: var(--gray-300);
}

.topbar a:hover {
  color: var(--cyan-400);
}

/* -------- Header / Nav -------- */
.site-header {
  background: var(--navy-800);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 700;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-500), var(--steel-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name-en {
  font-size: 16px;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.brand-name-sub {
  font-size: 12px;
  color: var(--gray-300);
  font-weight: 400;
}

.primary-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.primary-nav a {
  color: rgba(255, 255, 255, 0.88);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a.active {
  background: rgba(255, 255, 255, 0.10);
  color: var(--white);
}

.primary-nav a.active {
  box-shadow: inset 0 -2px 0 var(--cyan-400);
}

/* Language switcher */
.lang-switch {
  position: relative;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.10);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.20);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.lang-btn::after {
  content: "▾";
  font-size: 10px;
  opacity: 0.7;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  color: var(--gray-900);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 6px;
  display: none;
  list-style: none;
}

.lang-menu.open {
  display: block;
}

.lang-menu li button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--gray-900);
  font-family: inherit;
}

.lang-menu li button:hover {
  background: var(--gray-100);
}

.lang-menu li button.active {
  background: var(--navy-800);
  color: var(--white);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

/* -------- Hero -------- */
.hero {
  position: relative;
  min-height: 520px;
  color: var(--white);
  display: flex;
  align-items: center;
  background:
    linear-gradient(to right, rgba(7, 26, 46, 0.88), rgba(7, 26, 46, 0.55)),
    url("https://images.unsplash.com/photo-1605281317010-fe5ffe798166?auto=format&fit=crop&w=2000&q=70") center/cover no-repeat;
  padding: 100px 0;
}

.hero-inner {
  max-width: 780px;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(46, 163, 216, 0.20);
  border: 1px solid rgba(79, 195, 231, 0.40);
  color: var(--cyan-400);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.hero p.lead {
  font-size: clamp(16px, 1.3vw, 19px);
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 32px;
  max-width: 640px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease;
  font-family: inherit;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--cyan-400);
  color: var(--white);
  transform: translateY(-1px);
}

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

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

.btn-dark {
  background: var(--navy-800);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--navy-700);
  color: var(--white);
  transform: translateY(-1px);
}

/* -------- Page header (non-home pages) -------- */
.page-header {
  background:
    linear-gradient(to right, rgba(7, 26, 46, 0.85), rgba(30, 77, 139, 0.65)),
    url("https://images.unsplash.com/photo-1519914884020-ba17c1e0cdb3?auto=format&fit=crop&w=2000&q=70") center/cover no-repeat;
  color: var(--white);
  padding: 90px 0 70px;
  text-align: left;
}

.page-header h1 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.page-header p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 720px;
}

.breadcrumb {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin-bottom: 18px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}

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

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

.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-eyebrow {
  color: var(--cyan-500);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 700;
  color: var(--navy-800);
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}

.section-head p {
  color: var(--gray-500);
  max-width: 700px;
  margin: 0 auto;
  font-size: 16px;
}

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

.section-dark {
  background: var(--navy-800);
  color: var(--white);
}

.section-dark .section-head h2 {
  color: var(--white);
}

.section-dark .section-head p {
  color: rgba(255, 255, 255, 0.75);
}

/* -------- Card grids -------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--cyan-500);
}

.card-img {
  aspect-ratio: 16 / 10;
  background: var(--gray-100);
  overflow: hidden;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.card:hover .card-img img {
  transform: scale(1.04);
}

.card-body {
  padding: 22px 24px 26px;
}

.card-body h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.card-body p {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.card-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--steel-500);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

/* -------- Feature blocks -------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.feature {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 30px 26px;
  border-radius: var(--radius);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.feature:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-500);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--steel-600), var(--cyan-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 18px;
}

.feature h3 {
  font-size: 17px;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.feature p {
  color: var(--gray-500);
  font-size: 14px;
}

/* -------- Stats -------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  padding: 48px 0;
}

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stat {
  text-align: center;
}

.stat-num {
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 800;
  color: var(--cyan-500);
  line-height: 1;
  letter-spacing: -1px;
}

.stat-label {
  margin-top: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.section-dark .stat-num { color: var(--cyan-400); }

/* -------- Split (image + text) -------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.split.reverse > :first-child { order: 2; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split.reverse > :first-child { order: 0; }
}

.split-media {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.split-media img,
.split-media video {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.split-text h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  color: var(--navy-800);
  margin-bottom: 16px;
}

.split-text p {
  color: var(--gray-700);
  margin-bottom: 14px;
  font-size: 16px;
}

.bullets {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.bullets li {
  padding: 10px 0 10px 32px;
  position: relative;
  color: var(--gray-700);
  border-bottom: 1px dashed var(--gray-200);
}

.bullets li:last-child { border-bottom: none; }

.bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 9px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cyan-500);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------- Gallery -------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 240px;
  gap: 18px;
}

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .gallery { grid-template-columns: 1fr; }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-item .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px;
  background: linear-gradient(to top, rgba(7, 26, 46, 0.85), rgba(7, 26, 46, 0));
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
}

.gallery-tall  { grid-row: span 2; }
.gallery-wide  { grid-column: span 2; }

@media (max-width: 900px) {
  .gallery-tall, .gallery-wide { grid-row: auto; grid-column: auto; }
}

/* -------- Video -------- */
.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy-900);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-wrap video,
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -------- Process timeline -------- */
.timeline {
  position: relative;
  padding: 10px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding: 0 0 30px 72px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-num {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--steel-600), var(--cyan-500));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  box-shadow: 0 6px 14px rgba(46, 163, 216, 0.35);
}

.timeline-item h3 {
  color: var(--navy-800);
  font-size: 19px;
  margin-bottom: 6px;
  padding-top: 14px;
}

.timeline-item p {
  color: var(--gray-700);
  margin-bottom: 6px;
}

/* -------- Product tables -------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
}

table.spec {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 14px;
}

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

table.spec thead th {
  background: var(--navy-800);
  color: var(--white);
  font-weight: 600;
  font-size: 13px;
}

table.spec tbody tr:nth-child(even) {
  background: var(--gray-50);
}

/* -------- Contact form -------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
}

@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
}

.contact-info {
  background: var(--navy-800);
  color: var(--white);
  padding: 40px 36px;
  border-radius: var(--radius-lg);
}

.contact-info h3 {
  color: var(--white);
  margin-bottom: 22px;
  font-size: 22px;
}

.contact-info .info-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.contact-info .info-row:last-child { border-bottom: none; }

.info-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(46, 163, 216, 0.25);
  color: var(--cyan-400);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.info-text b {
  display: block;
  color: var(--cyan-400);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  font-weight: 600;
}

.info-text span {
  color: var(--white);
  font-size: 15px;
  line-height: 1.5;
}

.contact-form {
  background: var(--white);
  border: 1px solid var(--gray-200);
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.contact-form h3 {
  color: var(--navy-800);
  margin-bottom: 8px;
}

.contact-form .lead {
  color: var(--gray-500);
  margin-bottom: 22px;
  font-size: 15px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

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

label {
  display: block;
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
  margin-bottom: 6px;
}

input,
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--cyan-500);
  box-shadow: 0 0 0 3px rgba(46, 163, 216, 0.18);
}

textarea {
  resize: vertical;
  min-height: 130px;
}

/* -------- Footer -------- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  padding: 60px 0 24px;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-col h4 {
  color: var(--white);
  font-size: 15px;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  padding: 4px 0;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.72);
}

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

.footer-about p {
  color: rgba(255, 255, 255, 0.72);
  margin-top: 14px;
  line-height: 1.7;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255, 255, 255, 0.50);
  font-size: 13px;
}

/* -------- Responsive nav -------- */
@media (max-width: 1024px) {
  .primary-nav { gap: 0; }
  .primary-nav a { padding: 10px 10px; font-size: 13.5px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-800);
    flex-direction: column;
    gap: 0;
    padding: 10px 0;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a {
    padding: 12px 24px;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-wrap { position: relative; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
