/* ============================================
   SUNREX - LAYOUT CSS (布局组件)
   包含: 导航、页脚、网格系统
   带页面前缀: .home- .products- .solutions- 等
   ============================================ */

/* ─── 01 · 导航栏 (通用基础) ─────────────── */

.sr-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.sr-nav-inner {
  max-width: var(--sr-container);
  margin: 0 auto;
  padding: 0 var(--sr-space-lg);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sr-nav-logo img {
  height: 32px;
}

.sr-nav-links {
  display: flex;
  align-items: center;
  gap: var(--sr-space-xl);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sr-nav-links li {
  display: flex;
  align-items: center;
}

.sr-nav-item {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  color: var(--sr-text-white);
  transition: color 0.2s ease;
}

.sr-nav-item:hover {
  color: var(--sr-primary);
}

/* 下拉箭头 */
.sr-nav-arrow {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.sr-nav-chevron {
  width: 10px;
  height: 10px;
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.sr-nav-item.has-dropdown:hover .sr-nav-arrow,
.sr-nav-item.has-dropdown:hover .sr-nav-chevron {
  transform: rotate(180deg);
}

.sr-nav-dropdown {
  position: relative;
}

/* 导航链接样式 */
.sr-nav-links a {
  color: var(--sr-text-white);
  transition: color 0.2s ease;
}

.sr-nav-links a:hover {
  color: var(--sr-primary);
}

/* 语言选择器 */
/* 语言选择器下拉菜单 */
.sr-lang-dropdown {
  position: relative;
}

.sr-nav-lang {
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--sr-radius-md);
  color: var(--sr-text-white);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sr-nav-lang:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sr-lang-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.sr-lang-dropdown:hover .sr-lang-arrow {
  transform: rotate(180deg);
}

.sr-lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(30, 41, 59, 0.98);
  border-radius: var(--sr-radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: 8px 0;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.sr-lang-dropdown:hover .sr-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sr-lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sr-lang-item:hover {
  background: rgba(249, 115, 22, 0.15);
  color: var(--sr-primary);
}

.sr-lang-item.active {
  background: rgba(249, 115, 22, 0.2);
  color: var(--sr-primary);
  font-weight: 600;
}

/* 滚动后导航栏整体样式 - 已移至 sunrex-animations.css */

/* 滚动后语言选择器样式 */
.sr-nav-scrolled .sr-nav-lang {
  color: var(--sr-text-dark);
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

.sr-nav-scrolled .sr-nav-lang:hover {
  background: rgba(0, 0, 0, 0.1);
}

.sr-nav-scrolled .sr-lang-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.sr-nav-scrolled .sr-lang-item {
  color: var(--sr-text-dark);
}

.sr-nav-scrolled .sr-lang-item:hover {
  background: rgba(249, 115, 22, 0.1);
}

.sr-nav-right {
  display: flex;
  align-items: center;
  gap: var(--sr-space-md);
  position: relative;
  z-index: 1002;
}

/* CTA按钮 */
.sr-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--sr-primary);
  color: var(--sr-text-white);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--sr-radius-md);
  transition: all 0.2s ease;
}

.sr-nav-cta:hover {
  background: var(--sr-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.sr-nav-lang {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--sr-radius-md);
}

/* 下拉菜单 - 深色主题 */
.sr-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(30, 41, 59, 0.98);
  border-radius: var(--sr-radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  padding: var(--sr-space-sm) 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1001;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.sr-dropdown a {
  display: block;
  padding: 8px var(--sr-space-md);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
}

.sr-dropdown a:hover {
  background: rgba(249, 115, 22, 0.15);
  color: var(--sr-primary);
}

.sr-dropdown-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--sr-space-xs) var(--sr-space-md);
  margin-bottom: var(--sr-space-xs);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sr-nav-item.has-dropdown {
  position: relative;
}

.sr-nav-item.has-dropdown:hover .sr-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 宽版下拉菜单（两列） */
.sr-dropdown-wide {
  display: flex;
  gap: var(--sr-space-xl);
  min-width: 520px;
  padding: var(--sr-space-lg);
  left: 0;
  transform: translateY(8px);
}

.sr-nav-item.has-dropdown:hover .sr-dropdown-wide {
  transform: translateY(0);
}

.sr-dropdown-col {
  flex: 1;
}

.sr-dropdown-col .sr-dropdown-title {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 0 var(--sr-space-sm) 0;
  margin-bottom: var(--sr-space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sr-dropdown-col a {
  display: block;
  padding: 5px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  line-height: 1.4;
}

.sr-dropdown-col a:hover {
  color: var(--sr-primary);
  background: transparent;
  padding-left: 4px;
}

/* ─── 02 · 页脚 (通用) ───────────────────── */

.sr-footer {
  width: 100%;
  background: var(--sr-bg-dark);
  color: var(--sr-text-light);
  padding: var(--sr-space-4xl) 0 var(--sr-space-xl);
}

/* 页脚内部容器 */
.sr-footer-inner {
  max-width: var(--sr-container);
  margin: 0 auto;
  padding: 0 var(--sr-space-lg);
}

/* 页脚网格（sr-footer-grid = WordPress 输出结构） */
.sr-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--sr-space-3xl);
}

/* 品牌区域 */
.sr-footer-brand {
  display: flex;
  flex-direction: column;
  max-width: 320px;
}

.sr-footer-logo {
  height: auto;
  width: 100px;
  max-width: 100%;
  margin-bottom: var(--sr-space-lg);
  filter: brightness(0) invert(1);
  object-fit: contain;
}

.sr-footer-logo img {
  width: 100%;
  height: auto;
}

.sr-footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin: 0;
}

/* 链接区域 */
.sr-footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-sm);
}

.sr-footer-col h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--sr-text-white);
  margin-bottom: var(--sr-space-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sr-footer-col a,
.sr-footer-col p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
}

.sr-footer-col a:hover {
  color: var(--sr-text-white);
}

.sr-footer-links h4,
.sr-footer-contact h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--sr-text-white);
  margin-bottom: var(--sr-space-lg);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sr-footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--sr-space-sm);
  padding-left: 0 !important;
  margin-left: 0 !important;
  list-style: none !important;
}

.sr-footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s ease;
}

.sr-footer-links a:hover {
  color: var(--sr-primary);
}

/* 联系区域 */
.sr-footer-contact p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: var(--sr-space-sm);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.sr-footer-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.6;
}

.sr-footer-address span:last-child {
  word-break: normal;
  hyphens: none;
}

.sr-footer-contact a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s ease;
}

.sr-footer-contact a:hover {
  color: var(--sr-primary);
}

/* 页脚底部 */
.sr-footer-bottom {
  max-width: var(--sr-container);
  margin: var(--sr-space-3xl) auto 0;
  padding: var(--sr-space-xl) var(--sr-space-lg) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

.sr-footer-bottom p {
  margin: 0;
}

.sr-footer-bottom a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.sr-footer-bottom a:hover {
  color: var(--sr-primary);
}

/* 页脚响应式 */
@media (max-width: 1024px) {
  .sr-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: var(--sr-space-xl);
  }
  
  .sr-footer-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .sr-footer {
    padding: var(--sr-space-md) 0;
  }

  /* 移动端隐藏footer内容区（品牌+链接+联系），只保留底部版权 */
  html body .sr-footer > .sr-container > *:not(.sr-footer-bottom) {
    display: none !important;
  }

  /* 只保留底部版权 */
  .sr-footer-bottom {
    margin-top: 0;
    padding-top: 0;
    font-size: 12px;
    text-align: center;
  }
}

/* ─── 03 · Hero区域 (通用基础) ───────────── */

.sr-hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* 有背景图/全屏 Hero：首页等 */
.sr-hero.sr-bg-image,
.sr-hero[class*="hero-img"] {
  min-height: 520px;
  padding: var(--sr-space-3xl) 0;
}

/* 纯文字紧凑 Hero：cases/news/about/contact/service 等二级页 */
.sr-hero:not(.sr-bg-image):not([class*="hero-img"]) {
  min-height: 520px;
  padding: var(--sr-space-3xl) 0;
}

/* Hero 内部容器 — 通用基础（居中+宽度限制，无grid） */
.sr-hero-inner {
  max-width: var(--sr-container);
  margin: 0 auto;
  padding: 0 var(--sr-space-lg);
  width: 100%;
}

/* Contact Hero — 紧凑型（类似 Service/Cases 页） */
.sr-contact-hero {
  min-height: 420px;
  display: flex;
  align-items: center;
  padding: var(--sr-space-4xl) 0;
}

/* 强制 Hero 容器与导航 sr-nav-inner 完全一致的盒模型 */
.sr-contact-hero > .sr-container,
.sr-contact-hero > div[class*="container"] {
  max-width: 1280px;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

.sr-contact-hero-content {
  /* 内容自然填充容器宽度 */
}

.sr-contact-hero-content .sr-hero-tag {
  display: inline-block;
  padding: var(--sr-space-xs) var(--sr-space-md);
  background: var(--sr-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-md, 16px);
}

.sr-contact-hero-content .sr-hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--sr-text-white, #fff);
  line-height: 1.15;
  margin-bottom: var(--space-md, 16px);
}

.sr-contact-hero-content .sr-hero-desc {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

.sr-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.sr-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sr-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,30,34,0.95) 0%, rgba(15,30,34,0.7) 50%, rgba(15,30,34,0.3) 100%);
  z-index: 1;
}

.sr-hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--sr-container);
  margin: 0 auto;
  padding: 0 var(--sr-space-lg);
  width: 100%;
}

.sr-hero-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--sr-primary);
  margin-bottom: var(--sr-space-lg);
}

.sr-hero-title {
  font-size: 56px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--sr-text-white);
  margin-bottom: var(--sr-space-lg);
}

.sr-hero-desc {
  font-size: 18px;
  color: var(--sr-text-light);
  margin-bottom: var(--sr-space-xl);
}

.sr-hero-btns {
  display: flex;
  gap: var(--sr-space-md);
}

/* ─── 04 · 响应式 ────────────────────────── */

@media (max-width: 1024px) {
  .sr-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .sr-hero-title {
    font-size: 42px;
  }
}

/* ─── 04.5 · 移动端抽屉菜单 ──────────────────── */

.sr-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 5px;
}

.sr-hamburger-line {
  width: 22px;
  height: 2px;
  background: var(--sr-text-white);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.sr-nav-scrolled .sr-hamburger-line {
  background: var(--sr-text-dark);
}

.sr-nav-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: var(--sr-bg-dark);
  z-index: 2000;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
}

.sr-nav-drawer.open {
  right: 0;
}

.sr-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sr-drawer-header .sr-nav-logo img {
  height: 28px;
}

.sr-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--sr-text-white);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}

.sr-drawer-close:hover {
  color: var(--sr-primary);
}

.sr-drawer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sr-drawer-menu > li > a {
  display: block;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

.sr-drawer-menu > li > a:hover {
  background: rgba(249, 115, 22, 0.1);
  color: var(--sr-primary);
  padding-left: 24px;
}

.sr-drawer-menu .has-submenu > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sr-drawer-menu .has-submenu > a::after {
  content: '+';
  font-size: 18px;
  opacity: 0.6;
}

.sr-drawer-menu .has-submenu.open > a::after {
  content: '-';
}

.sr-submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.2);
}

.sr-drawer-menu .has-submenu.open > .sr-submenu {
  display: block;
}

.sr-submenu li a {
  display: block;
  padding: 10px 20px 10px 32px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  transition: all 0.2s;
}

.sr-submenu li a:hover {
  color: var(--sr-primary);
  padding-left: 36px;
}

.sr-submenu .submenu-title {
  padding: 12px 20px 6px 32px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
}

.sr-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sr-drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* 移动端遮罩层滚动禁止 */
body.drawer-open {
  overflow: hidden;
}

/* ─── 04.6 · 桌面端隐藏hamburger ────────────── */

@media (min-width: 769px) {
  .sr-hamburger {
    display: none !important;
  }
  .sr-nav-drawer,
  .sr-drawer-overlay {
    display: none !important;
  }
}

/* ─── 05 · 响应式 ────────────────────────── */

@media (max-width: 768px) {
  .sr-hamburger {
    display: flex;
  }

  .sr-nav-right .sr-lang-dropdown,
  .sr-nav-right .sr-btn {
    display: none;
  }

  .sr-nav-links {
    display: none;
  }
  
  .sr-footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sr-space-xl);
  }
  
  .sr-footer-bottom {
    flex-direction: column;
    gap: var(--sr-space-md);
    text-align: center;
  }
  
  .sr-hero-title {
    font-size: 32px;
  }
  
  .sr-hero-btns {
    flex-direction: column;
  }
}

/* ===== WordPress Container Override ===== */

/* 强制 body 和 html 全宽（覆盖 Astra 容器限制） */
html, body {
  width: 100% !important;
  min-width: 100% !important;
  overflow-x: hidden;
}

/* 强制 #main 全宽 */
#main {
  width: 100% !important;
  max-width: 100% !important;
}

#main .sr-container {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 确保 footer 在任何情况下都撑满全宽（覆盖所有WordPress/Astra包装器） */
html body .sr-footer,
html body .sr-footer > .sr-container,
#page .sr-footer,
#page .sr-footer > .sr-container,
.site .sr-footer,
.site .sr-footer > .sr-container {
  width: 100% !important;
  max-width: 100% !important;
  position: relative !important;
}

/* 确保 footer 内容网格正确显示（外层全宽，内容限制在容器宽度） */
html body .sr-footer-inner,
#page .sr-footer-inner,
.site .sr-footer-inner {
  max-width: var(--sr-container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: grid !important;
  grid-template-columns: 2fr 1fr 1fr 1.5fr !important;
  gap: var(--sr-space-3xl) !important;
}

#main .sr-container > * {
  max-width: var(--sr-container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--sr-space-lg) !important;
  padding-right: var(--sr-space-lg) !important;
}

/* 确保 FAQ 区域在 WordPress 中宽度充足 */
.page-template-template-mobile-jaw-crusher-plant #main .sr-faq-list {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: 100% !important;
}

/* ===== WordPress Section Title Alignment Fix ===== */
#main .sr-container .sr-section-tag,
#main .sr-container .sr-section-title {
  display: block !important;
  width: 100% !important;
  max-width: var(--sr-container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--sr-space-lg) !important;
  padding-right: var(--sr-space-lg) !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

/* 确保 FAQ 问题左对齐 */
#main .sr-faq-q {
  text-align: left !important;
  direction: ltr !important;
}

/* 覆盖 RTL 语言下的 FAQ 对齐 */
html[dir="rtl"] #main .sr-faq-q,
html[lang="ar"] #main .sr-faq-q {
  text-align: left !important;
  direction: ltr !important;
}
