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


/* ---------- Tablet/Narrow desktop: 769px - 1280px ---------- */
@media (min-width: 769px) and (max-width: 1280px) {
  .header-brand-text,
  .top-menu-btn-text {
    display: none !important;
  }

  /* Scroll/click must not expand inline desktop nav (min content ~870px) */
  .header.cur .nav,
  .header.cur .header-actions {
    display: none !important;
  }

  .header .nav {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-lg);
    gap: var(--spacing-xs);
    height: auto !important;
    transform: translateX(100%) !important;
    transition: transform var(--transition-base);
    z-index: var(--z-overlay);
    overflow-y: auto;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .header .nav:not(.active) {
    display: none !important;
  }

  .header .nav.active {
    display: flex !important;
    transform: translateX(0) !important;
  }

  .header .nav a {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-md);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.85);
    opacity: 1 !important;
    transition-delay: 0s !important;
  }

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

  .header .nav a.active::after {
    display: none;
  }

  .nav-dropdown {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-dropdown > a {
    width: 100%;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.85) !important;
    justify-content: flex-start;
  }

  .nav-dropdown > a .dropdown-arrow {
    display: none;
  }

  .dropdown-menu {
    display: none;
  }

  .top-menu-btn {
    flex-shrink: 0;
    padding: 8px 10px;
  }
}


/* ---------- Tablet: 768px - 1024px ---------- */
@media (max-width: 1024px) {
  .header .nav a {
    padding: 8px 10px;
    font-size: 15px;
  }


  .header-brand-text {
    display: none;
  }

  .top-menu-btn-text {
    display: none;
  }

  .top-menu-btn {
    flex-shrink: 0;
    padding: 8px 10px;
  }

  .header-brand-text {
    font-size: 12px;
    letter-spacing: 1px;
    padding-left: 8px;
  }

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

  .product-layout {
    grid-template-columns: 180px 1fr;
    gap: var(--spacing-lg);
  }

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

  .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
  }

  .product-category-card {
    flex-direction: column;
  }

  .product-category-image {
    width: 100%;
    height: 200px;
  }

  .news-list-item {
    flex-direction: column;
  }

  .news-list-item-image {
    width: 100%;
    height: 220px;
  }

  .news-skeleton {
    flex-direction: column;
  }

  .skeleton-image {
    width: 100%;
    height: 220px;
  }

  .about-grid,
  .about-intro {
    grid-template-columns: 1fr;
  }

  .about-image img {
    height: 300px;
  }

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

/* ---------- Mobile: < 768px ---------- */
@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
    --spacing-4xl: 48px;
    --spacing-3xl: 40px;
  }

  .header-inner {
    height: 64px;
    padding: 0 var(--container-padding);
  }

  .header .logo img {
    height: 36px;
  }

  .header .logo-text {
    font-size: var(--font-size-sm);
  }

  .header-brand-text {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    border-left: 2px solid rgba(255,255,255,0.25);
    padding-left: 8px;
    margin-left: 4px;
  }

  .top-menu-btn-text {
    font-size: 11px;
    letter-spacing: 1.5px;
  }

  /* Mobile nav - slide in from right */
  .header .nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-lg);
    gap: var(--spacing-xs);
    height: auto !important;
    transform: translateX(100%) !important;
    transition: transform var(--transition-base);
    z-index: var(--z-overlay);
    overflow-y: auto;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .header .nav.active {
    transform: translateX(0) !important;
  }

  .header .nav a {
    width: 100%;
    padding: 12px 16px;
    font-size: var(--font-size-md);
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.85);
    opacity: 1 !important;
    transition-delay: 0s !important;
  }

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

  .header .nav a.active::after {
    display: none;
  }

  .nav-dropdown {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-dropdown > a {
    width: 100%;
    background: transparent !important;
    color: rgba(255,255,255,0.85) !important;
    justify-content: flex-start;
  }

  .nav-dropdown > a .dropdown-arrow {
    display: none;
  }

  .dropdown-menu {
    display: none;
  }

  .top-menu-btn {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* Mobile: keep hamburger visible even when header not .cur */
  .header:not(.cur) .header-actions {
    display: flex !important;
  }

  .header .nav.active {
    display: flex !important;
  }



  /* 移动端：header-actions 始终可见，但隐藏联系图标和搜索 */
  .header-actions {
    opacity: 1;
    pointer-events: auto;
  }

  .header-contact-icons,
  .header-divider,
  .search-btn {
    display: none;
  }

  .banner {
    margin-top: 0;
    height: 280px;
  }

  .banner-slide-content {
    padding-top: 80px;
  }

  .banner-slide-content h1 {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
    letter-spacing: 1px;
  }

  .banner-slide-content p {
    font-size: 13px;
    margin-bottom: 16px;
  }

  .banner-slide-content .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .banner-arrows {
    display: none;
  }

  .section-padding {
    padding: var(--spacing-2xl) 0;
  }

  .section-title h2 {
    font-size: var(--font-size-lg);
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .product-grid .product-card-image {
    aspect-ratio: 1;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .about-features {
    grid-template-columns: 1fr;
  }

  .product-categories {
    grid-template-columns: 1fr;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .product-sidebar {
    position: static;
    padding: var(--spacing-md);
  }

  .sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
  }

  .sidebar-link {
    padding: 8px 12px;
    font-size: var(--font-size-xs);
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .sidebar-link:hover,
  .sidebar-link.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-primary);
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .product-grid .product-card-image {
    aspect-ratio: 1;
  }

  .product-card-body .product-desc {
    -webkit-line-clamp: 2;
  }

  .contact-info-cards {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .footer-col ul {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs) var(--spacing-sm);
  }

  .footer-col ul li {
    margin-bottom: 0;
  }

  .footer-col ul li a {
    white-space: nowrap;
    font-size: var(--font-size-xs);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }

  .page-banner {
    margin-top: 0;
    height: 200px;
  }

  .page-banner-content h1 {
    font-size: var(--font-size-xl);
  }

  .cta-section h2 {
    font-size: var(--font-size-lg);
  }

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

  .clients-grid {
    gap: var(--spacing-md);
  }

  .client-logo {
    width: 110px;
    height: 55px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd) {
    flex-direction: row;
  }

  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    text-align: left;
    padding-left: var(--spacing-xl);
    padding-right: 0;
  }

  .timeline-dot {
    left: 20px;
  }

  .timeline-content {
    margin-left: 48px;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
  }
}

/* ---------- Small Mobile: < 480px ---------- */
@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
  }

  .product-grid .product-card-image {
    aspect-ratio: 1;
  }

  .product-card-body h3 {
    font-size: var(--font-size-xs);
  }

  .banner {
    height: 300px;
  }

  .banner-slide-content h1 {
    font-size: var(--font-size-lg);
  }

  .banner-slide-content p {
    font-size: var(--font-size-sm);
  }

  .stat-item .stat-number {
    font-size: var(--font-size-xl);
  }

  .detail-overview {
    flex-direction: column;
  }

  .detail-image-slider {
    width: 100%;
  }

  .detail-main-image {
    height: 250px;
  }

  .detail-thumbnail {
    width: 50px;
    height: 50px;
  }

  .detail-skeleton {
    flex-direction: column;
  }

  .detail-skeleton .skeleton-image.large {
    width: 100%;
    height: 200px;
  }

  .detail-features-grid {
    grid-template-columns: 1fr;
  }

  .detail-applications {
    grid-template-columns: 1fr;
  }

  .spec-row {
    flex-direction: column;
  }

  .spec-label {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding-bottom: var(--spacing-xs);
  }

  .spec-value {
    padding-top: var(--spacing-xs);
  }

  .news-detail-layout {
    flex-direction: column;
  }

  .news-detail-sidebar {
    width: 100%;
    position: static;
  }

  .news-detail-image img {
    height: 250px;
  }

  .news-detail-grid {
    grid-template-columns: 1fr;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-loading {
    grid-template-columns: 1fr;
  }
}
