/* ============================================
   BMW Sales Consultant - 林正嵐
   Dark Luxury One-Page Website
   ============================================ */

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

:root {
  --black: #0a0a0a;
  --dark: #1a1a1a;
  --dark-gray: #2a2a2a;
  --gray: #888;
  --light-gray: #ccc;
  --white: #ffffff;
  --bmw-blue: #1c69d4;
  --bmw-blue-light: #4a90e2;
  --line-green: #06c755;
  --gold: #c9a84c;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--black);
  color: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Preloader --- */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--black);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

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

.bmw-logo-loader {
  margin-bottom: 24px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--dark-gray);
  border-top-color: var(--bmw-blue);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Announcement Bar --- */
.announcement-bar {
  background: var(--bmw-blue);
  color: var(--white);
  text-align: center;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.98);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text {
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-menu a {
  font-size: 14px;
  font-weight: 400;
  color: var(--light-gray);
  letter-spacing: 0.5px;
  position: relative;
  padding: 8px 0;
}

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

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

.nav-menu a:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: all var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero Banner --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-slider {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    rgba(0, 0, 0, 0.6) 80%,
    rgba(10, 10, 10, 1) 100%
  );
}

.hero-content {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  width: 90%;
  max-width: 800px;
  z-index: 2;
}

.hero-title {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: 4px;
  margin-bottom: 16px;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: clamp(12px, 2vw, 15px);
  color: var(--light-gray);
  margin-bottom: 32px;
  letter-spacing: 1px;
  line-height: 1.8;
}

.hero-indicators {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 2;
}

.indicator {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  transition: all var(--transition);
}

.indicator.active {
  background: var(--white);
  width: 60px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--bmw-blue-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(28, 105, 212, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.btn-line {
  background: var(--line-green);
  color: var(--white);
}

.btn-line:hover {
  background: #05b34a;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(6, 199, 85, 0.3);
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.section-header.light h2 {
  color: var(--white);
}

.header-line {
  width: 60px;
  height: 3px;
  background: var(--bmw-blue);
  margin: 0 auto 20px;
}

.section-subtitle {
  font-size: 15px;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

/* --- Brand Philosophy --- */
.brand-philosophy {
  padding: 100px 0 80px;
  background: var(--black);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.philosophy-card {
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 48px 36px;
  transition: all var(--transition);
}

.philosophy-card:hover {
  border-color: rgba(28, 105, 212, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.philosophy-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(28, 105, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 22px;
  color: var(--bmw-blue);
}

.philosophy-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.philosophy-card p {
  font-size: 15px;
  color: var(--gray);
  line-height: 1.9;
}

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

/* --- Photo Gallery --- */
.photo-gallery {
  padding: 80px 0;
  background: var(--dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4/3;
  cursor: pointer;
}

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

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 105, 212, 0.0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--white);
  opacity: 0;
  transition: all var(--transition);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
  background: rgba(28, 105, 212, 0.3);
}

/* --- Personal Introduction --- */
.personal-intro {
  padding: 100px 0;
  background: var(--black);
}

.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.intro-image-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3/4;
}

.intro-image-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(28, 105, 212, 0.2);
  border-radius: 8px;
  pointer-events: none;
}

.intro-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--bmw-blue);
  text-transform: uppercase;
  margin-bottom: 16px;
  font-weight: 500;
}

.intro-content h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 24px;
}

.highlight {
  color: var(--bmw-blue);
}

.intro-content p {
  font-size: 16px;
  color: var(--gray);
  line-height: 2;
  margin-bottom: 32px;
}

/* --- Services --- */
.services {
  padding: 100px 0;
  background: var(--dark);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.service-card {
  background: var(--dark-gray);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 36px 20px;
  text-align: center;
  transition: all var(--transition);
}

.service-card:hover {
  background: rgba(28, 105, 212, 0.08);
  border-color: rgba(28, 105, 212, 0.3);
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.service-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(28, 105, 212, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px;
  color: var(--bmw-blue);
  transition: all var(--transition);
}

.service-card:hover .service-icon {
  background: var(--bmw-blue);
  color: var(--white);
}

.service-card h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 1px;
}

.services-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* --- Test Drive Booking --- */
.testdrive-booking {
  padding: 100px 0;
  background: var(--black);
  position: relative;
}

.testdrive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.testdrive-image {
  border-radius: 8px;
  overflow: hidden;
}

.testdrive-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

.testdrive-content h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
}

.testdrive-content p {
  font-size: 16px;
  color: var(--gray);
  line-height: 1.9;
  margin-bottom: 32px;
}

.testdrive-info {
  margin-bottom: 32px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.info-item i {
  font-size: 20px;
  color: var(--bmw-blue);
  width: 24px;
  text-align: center;
}

.info-label {
  display: block;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.info-item a, .info-item span {
  font-size: 16px;
  font-weight: 500;
}

.info-item a:hover {
  color: var(--bmw-blue);
}

/* --- Vehicle Gallery --- */
.vehicle-gallery {
  padding: 80px 0;
  background: var(--dark);
  overflow: hidden;
}

.vehicle-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 20px;
}

.vehicle-scroll::-webkit-scrollbar {
  display: none;
}

.vehicle-track {
  display: flex;
  gap: 16px;
  width: max-content;
}

.vehicle-item {
  width: 280px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/10;
}

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

.vehicle-item:hover img {
  transform: scale(1.05);
}

/* --- Deals Gallery --- */
.deals-gallery {
  padding: 100px 0;
  background: var(--black);
}

.deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.deal-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 1;
  cursor: pointer;
}

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

.deal-item:hover img {
  transform: scale(1.08);
}

.deal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--white);
  opacity: 0;
  transition: all var(--transition);
}

.deal-item:hover .deal-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.4);
}

/* --- Contact --- */
.contact {
  padding: 100px 0;
  background: var(--dark);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: start;
}

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

.avatar-frame {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 3px solid rgba(28, 105, 212, 0.3);
}

.avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-avatar h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.contact-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.contact-item i {
  font-size: 20px;
  color: var(--bmw-blue);
  width: 24px;
  text-align: center;
}

.contact-label {
  display: block;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.contact-item a:hover {
  color: var(--bmw-blue);
}

.contact-social {
  display: flex;
  gap: 16px;
  padding-top: 28px;
}

.contact-social a {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dark-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--light-gray);
  transition: all var(--transition);
}

.contact-social a:hover {
  background: var(--bmw-blue);
  color: var(--white);
  transform: translateY(-3px);
}

/* --- Footer --- */
.footer {
  padding: 40px 0;
  background: var(--black);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: 13px;
  color: var(--gray);
  letter-spacing: 0.5px;
}

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

.footer-seo {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 12px;
  line-height: 1.8;
}

.footer-copyright {
  font-size: 13px;
  color: var(--gray);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  cursor: zoom-out;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: var(--white);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

/* --- Floating CTA --- */
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 999;
}

.float-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all var(--transition);
}

.float-btn:hover {
  transform: scale(1.1);
}

.phone-btn {
  background: var(--bmw-blue);
}

.line-btn {
  background: var(--line-green);
}

/* --- Back to Top --- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--dark-gray);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

/* --- Scroll Animations --- */
[data-aos] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-right"] {
  transform: translateX(-30px);
}

[data-aos="fade-left"] {
  transform: translateX(30px);
}

[data-aos="zoom-in"] {
  transform: scale(0.9);
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* ============================================
   Responsive
   ============================================ */

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

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .deals-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 0;
    transform: translateY(-120%);
    transition: transform 0.4s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-menu.active {
    transform: translateY(0);
  }

  .nav-menu a {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 16px;
  }

  .intro-grid,
  .testdrive-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .intro-image {
    max-width: 400px;
    margin: 0 auto;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .deals-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .vehicle-item {
    width: 240px;
  }

  .hero-content {
    bottom: 20%;
  }
}

@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .service-card {
    padding: 24px 12px;
  }

  .philosophy-card {
    padding: 32px 24px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }

  .services-cta {
    flex-direction: column;
    align-items: center;
  }

  .floating-cta {
    bottom: 16px;
    right: 16px;
  }

  .float-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
}
