/*
 * global.css — Site-Wide Global Styles
 * Contains CSS Reset, Design Tokens, Typography, Shared Components, and Utility Classes
 * Used across all landing pages and sections
 */
/* ── DESIGN TOKENS ── */
:root {
  --navy:     #0d2f4e;
  --navy2:    #163d61;
  --gold:     #38bdf8; 
  --gold-lt:  #7dd3fc;
  --white:    #ffffff;
  --offwhite: #f7f9fc;
  --muted:    #64748b;
  --border:   #dde5ee; 
  --orange:   #f97316;
  --orange-h: #ea6c0a;
  --shadow:   0 4px 20px rgba(13,47,78,0.10);
  --shadow-lg:0 12px 40px rgba(13,47,78,0.16);
}

/* ── CSS RESET ── */
/* Universal box-sizing reset to ensure consistent layout calculations across all elements */
*, *::before, *::after {
  box-sizing: border-box; /* Include padding and border in element's total width and height */
  margin: 0; /* Remove default margins */
  padding: 0; /* Remove default padding */
}

/* ── BASE STYLES ── */
/* HTML document base styles */
html { 
  scroll-behavior: smooth; /* Enable smooth scrolling for anchor links */
  overflow-x: clip; /* Prevent horizontal scrollbars caused by overflowing content */
}

/* Body element base styles - typography, background, and line-height */
body {
  font-family: 'DM Sans', sans-serif; /* Default body font */
  background: var(--offwhite); /* Default page background */
  color: var(--navy); /* Default text color */
  line-height: 1.6; /* Optimal line height for readability */
}

/* Heading elements - all use Sora font family for brand consistency */
h1, h2, h3, h4 {
  font-family: 'Sora', sans-serif;
}

/* Responsive images - never overflow their container, maintain aspect ratio */
img { max-width: 100%; display: block; }

/* Links inherit color from parent element by default */
a { color: inherit; }

/* Form elements inherit font from body for visual consistency */
button, input, select, textarea {
  font-family: inherit;
}

/* ── GOOGLE MATERIAL ICONS SETUP ── */
/* Default Material Symbols icon configuration - standard outlined icons */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;

  /* Web font rendering optimization for smooth icons */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Variable font settings for icon customization */
  font-variation-settings:
    'FILL' 0,    /* 0 = outlined, 1 = filled */
    'wght' 400,  /* Weight: 100-700 */
    'GRAD' 0,    /* Grade: -50 to 200 */
    'opsz' 24;   /* Optical size: 20-48 */
}

/* Filled icon variant - add .fill-icon class to Material Symbols element to use */
.material-symbols-outlined.fill-icon {
  font-variation-settings:
    'FILL' 1,    /* Enable filled mode */
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* ── MOBILE BOTTOM NAVIGATION ── */
/* Hidden by default on desktop, only visible on mobile devices (768px and below) */
.mobile-bottom-nav {
  display: none; 
}

/* Mobile bottom navigation - fixed at bottom of screen on mobile devices */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
    background: var(--navy, #0a1628);
    border-top: 2px solid rgba(200,150,62,0.3);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    padding-bottom: env(safe-area-inset-bottom); /* iPhone notch/safe area support for bottom padding */
  }

  /* Navigation items (links and buttons) - flex items with equal width */
  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,0.6);
    font-family: 'Sora', 'Plus Jakarta Sans', sans-serif;
    font-size: 0.62rem; font-weight: 600;
    letter-spacing: 0.04em; text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent; /* Remove gray tap highlight on mobile browsers */
  }

  /* Hover/focus state for navigation items */
  .mobile-bottom-nav a:hover,
  .mobile-bottom-nav button:hover { color: #fff; }

  /* Icon size in navigation items */
  .mobile-bottom-nav .nav-icon {
    font-size: 1.3rem; line-height: 1;
  }

  /* CTA button variant - orange high-contrast button */
  .mobile-bottom-nav .nav-cta {
    background: #e8620a;
    color: #fff !important;
    border-radius: 0;
  }
  .mobile-bottom-nav .nav-cta:hover { background: #d4550a; }

  /* WhatsApp button variant - green color to match WhatsApp brand */
  .mobile-bottom-nav .nav-wa {
    color: #4ade80;
  }

  /* Add bottom padding to body to prevent content from being hidden under the navigation */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* On mobile, reposition WhatsApp float to right side instead of bottom */
  .wa-float {
    bottom: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 0 !important;
    border-radius: 8px 0 0 8px !important;
    width: 44px !important;
    height: 44px !important;
    animation: none !important;
    box-shadow: -3px 0 12px rgba(37,211,102,0.35) !important;
  }
}

/* ── SHARED: WhatsApp Floating Button ── */
/* Fixed floating WhatsApp contact button - desktop positioning */
.wa-float {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  width: 48px; height: 48px; border-radius: 50%;
  background: #25d366; /* WhatsApp brand green */
  box-shadow: 0 4px 20px rgba(37,211,102,0.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
}
/* WhatsApp SVG icon size and color */
.wa-float svg { width: 20px; height: 20px; fill: white; }
/* Bounce keyframe animation for WhatsApp button to draw user attention */
@keyframes wa-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* ── SHARED: Footer Meta Section ── */
/* Common footer copyright and links container - used across all pages */
.site-footer-meta {
  text-align: center; padding: 20px 5%; font-size: 0.78rem;
}

/* ── SHARED: Scroll Animation ── */
/* Base class for elements that animate when scrolling into view (Animate On Scroll) */
.animate-on-scroll {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
/* Visible state - added via JavaScript when element enters viewport */
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ── SHARED: Pulse Dot Animation ── */
/* Reusable pulsing animation - used for header phone availability indicator */
@keyframes pulse-dot {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.5; transform:scale(1.4); }
}

/* ── BACK TO TOP ── */
/* Floating "back to top" button - appears when user scrolls down the page */
.back-to-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 998;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--navy);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(10,22,40,0.18);
  backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s, box-shadow 0.2s;
  pointer-events: none; /* Disable clicks when button is invisible */
}
/* Visible state - added via JavaScript when scroll position exceeds threshold */
.back-to-top.visible {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
/* Hover state for back-to-top button */
.back-to-top:hover {
  background: #fff;
  box-shadow: 0 6px 20px rgba(10,22,40,0.22);
  transform: translateY(-2px);
}
/* Back-to-top icon styling */
.back-to-top .material-symbols-outlined {
  font-size: 1.3rem; color: var(--navy);
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* Position WhatsApp button above back-to-top button (desktop only) */
.wa-float {
  bottom: 78px !important; /* 24px base + 44px button height + 10px gap = 78px */
}

/* Mobile-specific positioning for back-to-top and WhatsApp buttons */
@media (max-width: 768px) {
  /* Back-to-top button - positioned vertically on right side, below WhatsApp button */
  .back-to-top {
    bottom: auto !important;
    top: calc(50% + 116px) !important; /* Position below WhatsApp button with increased distance */
    right: 0 !important;
    width: 36px !important; height: 36px !important;
    border-radius: 8px 0 0 8px !important;
    background: rgba(255,255,255,0.9) !important;
    box-shadow: -2px 0 10px rgba(10,22,40,0.15) !important;
    backdrop-filter: blur(6px);
  }
  /* Smaller icon for mobile back-to-top button */
  .back-to-top .material-symbols-outlined {
    font-size: 1.1rem;
  }
 .wa-float { display: none !important; }
  /* WhatsApp button - centered vertically on right side */
}
/* ── EMAIL FLOAT ── */
/* Floating email button — above WhatsApp, shares same right-side stack */
.email-float {
  position: fixed; bottom: 142px; right: 24px; z-index: 998;
  /* 78px (wa-float) + 56px (wa height) + 8px gap = 142px */
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--orange, #f97316);
  box-shadow: 0 4px 16px rgba(249,115,22,0.4);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  animation: wa-bounce 3s ease-in-out infinite;
}
.email-float:hover {
  background: var(--orange-h, #ea6c0a);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249,115,22,0.5);
}
.email-float .material-symbols-outlined {
  font-size: 1.4rem; color: #fff;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
 
@media (max-width: 768px) {
  .email-float {
    bottom: auto !important;
    top: calc(50% - 58px) !important; /* WhatsApp 上方 50px+间距 */
    right: 0 !important;
    width: 36px !important; height: 36px !important;
    border-radius: 8px 0 0 8px !important;
    box-shadow: -2px 0 10px rgba(249,115,22,0.35) !important;
  }
  .email-float .material-symbols-outlined {
    font-size: 1.1rem;
  }
}