/* Responsive Styles */

/* 全局移动端优化 */
@media (max-width: 767px) {
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  body, html {
    overflow-x: hidden;
    width: 100%;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  :root {
    --font-size-3xl: 36px;
    --font-size-2xl: 32px;
    --font-size-xl: 24px;
    --font-size-lg: 20px;
    --spacing-2xl: 48px;
    --spacing-xl: 32px;
    --spacing-lg: 24px;
  }

  /* Navbar Mobile */
  .navbar-toggle {
    display: flex;
  }

  .navbar-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-brand-blue);
    flex-direction: column;
    padding: var(--spacing-md);
    gap: var(--spacing-md);
    transform: translateY(-100%);
    opacity: 0;
    transition: all var(--transition-normal);
    pointer-events: none;
    width: 100%;
    box-sizing: border-box;
  }

  .navbar-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  /* Hero Mobile */
  .hero {
    min-height: 80vh;
    padding-top: 60px;
    width: 100%;
    overflow: hidden;
  }

  .hero-container {
    width: 100%;
    padding: 0 var(--spacing-md);
    box-sizing: border-box;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 64px);
    padding: 0 var(--spacing-md);
    line-height: 1.3;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
    width: 100%;
    max-width: 100%;
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
    width: 100%;
  }

  /* Hero Stats Mobile */
  .hero-stats {
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  /* Products Grid Mobile */
  .products-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    width: 100%;
  }

  .product-card {
    padding: var(--spacing-md);
    width: 100%;
  }

  /* Pricing Grid Mobile */
  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    padding: 0 var(--spacing-sm);
    width: 100%;
  }

  .pricing-card {
    padding: var(--spacing-md);
    width: 100%;
    max-width: 100%;
  }

  /* Section Spacing Mobile */
  section {
    padding: var(--spacing-xl) 0;
    width: 100%;
    overflow: hidden;
  }

  /* Product Detail Sections Mobile */
  .product-detail-section {
    padding: 100px 0 var(--spacing-2xl);
    width: 100%;
    overflow: hidden;
  }

  .product-detail-container {
    width: 100%;
    padding: 0 var(--spacing-md);
    box-sizing: border-box;
  }

  .product-detail-header-row {
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-2xl);
    padding: 6px 16px;
    border-radius: 30px;
    max-width: 100%;
  }

  .product-detail-number-large {
    font-size: 32px;
    letter-spacing: -0.8px;
  }

  .product-detail-tagline-large {
    font-size: 14px;
    letter-spacing: 0.6px;
  }
  
  /* 确保所有媒体元素不超出视口 */
  .product-media-wrapper-large,
  .hero-showcase,
  .hero-showcase-frame,
  img, video {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --font-size-3xl: 48px;
    --font-size-2xl: 40px;
    --spacing-2xl: 72px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop (>= 1024px) */
@media (min-width: 1024px) {
  .container {
    max-width: 1440px;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Large Desktop (>= 1440px) */
@media (min-width: 1440px) {
  .container {
    max-width: 1440px;
  }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
  .hero {
    min-height: auto;
    padding: var(--spacing-2xl) 0;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
