/* ============================================
   WANSUN Website - Global Stylesheet
   Color: Primary Blue #144a8e / Accent Orange #f39200
   ============================================ */

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

:root {
  --color-primary: #144a8e;
  --color-primary-dark: #0d3568;
  --color-primary-light: #2a6db5;
  --color-accent: #f39200;
  --color-accent-dark: #d97f00;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #1eb854;
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #ffffff;
  --color-bg-soft: #f5f8fc;
  --color-bg-dark: #0a2540;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --container-width: 1200px;
  --header-height: 72px;
  --topbar-height: 36px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

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

.section {
  padding: 80px 0;
}

.section-sm {
  padding: 48px 0;
}

.text-center {
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  letter-spacing: 0.02em;
}

.btn-primary {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(243, 146, 0, 0.35);
}

.btn-secondary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-secondary:hover {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 74, 142, 0.35);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: #fff;
}
.btn-whatsapp:hover {
  background-color: var(--color-whatsapp-dark);
  transform: translateY(-2px);
}

.btn-arrow::after {
  content: "→";
  font-size: 18px;
  transition: transform var(--transition);
}
.btn:hover .btn-arrow::after {
  transform: translateX(4px);
}

/* ---------- Top Bar ---------- */
.topbar {
  background-color: var(--color-bg-dark);
  color: #fff;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}
.topbar-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-whatsapp);
  font-weight: 600;
}
.topbar-whatsapp .wa-dot {
  width: 8px;
  height: 8px;
  background: var(--color-whatsapp);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.25);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.25); }
  50% { box-shadow: 0 0 0 8px rgba(37, 211, 102, 0.05); }
}

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff;
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
  transition: box-shadow var(--transition);
}
.header.is-scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--color-text);
}
.logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo-text strong {
  color: var(--color-primary);
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-list {
  display: flex;
  gap: 4px;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 15px;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}
.nav-link.active {
  border-bottom: 2px solid var(--color-accent);
  border-radius: 0;
}
.nav-link .caret {
  font-size: 10px;
  transition: transform var(--transition);
}
.nav-item.has-dropdown:hover .caret {
  transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: #fff;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition);
}
.nav-item.has-dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-link {
  display: block;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--color-text);
  transition: all var(--transition);
}
.dropdown-link:hover {
  background-color: var(--color-bg-soft);
  color: var(--color-primary);
  padding-left: 22px;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text);
  transition: all var(--transition);
}
.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Page heading (for inner pages) ---------- */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 64px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.04);
}
.page-header h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
}
.page-header .breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  opacity: 0.9;
  position: relative;
}
.page-header .breadcrumb a:hover {
  color: var(--color-accent);
}
.page-header .breadcrumb .sep {
  opacity: 0.6;
}

/* ---------- Footer ---------- */
.footer {
  background-color: #06182d;
  color: #cfd6e0;
  padding: 64px 0 0;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer .logo {
  color: #fff;
  margin-bottom: 16px;
}
.footer .logo-text strong {
  color: var(--color-accent);
}
.footer-tagline {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
  opacity: 0.8;
}
.footer h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  position: relative;
  padding-bottom: 10px;
}
.footer h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background-color: var(--color-accent);
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  font-size: 14px;
  color: #cfd6e0;
  opacity: 0.85;
  transition: all var(--transition);
}
.footer-links a:hover {
  color: var(--color-accent);
  padding-left: 6px;
  opacity: 1;
}
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.footer-contact-item .icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--color-accent);
  margin-top: 2px;
}
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 14px;
}
.footer-social a:hover {
  background-color: var(--color-accent);
  transform: translateY(-2px);
}
.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  opacity: 0.6;
}

/* ---------- WhatsApp Float ---------- */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: all var(--transition);
}
.whatsapp-float:hover {
  transform: scale(1.08);
  background-color: var(--color-whatsapp-dark);
}
.whatsapp-float svg {
  width: 28px;
  height: 28px;
}

/* ---------- Section title ---------- */
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.section-title .accent-bar {
  display: inline-block;
  width: 56px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
}
.section-title p {
  color: var(--color-text-light);
  font-size: 15px;
  margin-top: 14px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav-list {
    gap: 0;
  }
  .nav-link {
    padding: 10px 12px;
    font-size: 14px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .section-title h2 {
    font-size: 28px;
  }
}

@media (max-width: 860px) {
  :root {
    --header-height: 64px;
  }
  .menu-toggle {
    display: flex;
  }
  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    flex-direction: column;
    padding: 12px;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--color-border);
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-link {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }
  .nav-link.active {
    border-bottom: none;
    background-color: var(--color-bg-soft);
  }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: 16px;
    background: transparent;
  }
  .section {
    padding: 56px 0;
  }
  .page-header {
    padding: 48px 0;
  }
  .page-header h1 {
    font-size: 32px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .whatsapp-float {
    width: 50px;
    height: 50px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
  .btn {
    padding: 12px 22px;
    font-size: 14px;
  }
  .topbar {
    font-size: 12px;
  }
  .topbar-left span:not(.wa-label) {
    display: none;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}
