/* ============================================================================
 * MAREX Global 自定义工业海工样式系统
 * 配合 Tailwind CSS CDN 使用：聚焦蓝图纹理、视差叠加、现货脉冲徽章、
 * Scroll-Reveal 动画与阿拉伯语 RTL 布局适配。
 * ============================================================================ */

:root {
  --navy-950: #061326;
  --navy-900: #0b1f3a;
  --navy-800: #122b4d;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --canvas: #f8fafc;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --teal-500: #0ea5e9;
}

html {
  scroll-behavior: smooth;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--canvas);
  color: #0f172a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: "Space Grotesk", "Inter", sans-serif;
}

/* 顶部导航滚动后的磨砂玻璃与阴影状态 */
.site-header {
  transition: background-color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.site-header.is-scrolled {
  background-color: rgba(11, 31, 58, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px -10px rgba(6, 19, 38, 0.55);
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

/* 工业海工蓝图网格背景纹理 */
.bg-blueprint {
  background-image:
    linear-gradient(to right, rgba(14, 165, 233, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14, 165, 233, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.bg-blueprint-light {
  background-image:
    linear-gradient(to right, rgba(11, 31, 58, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(11, 31, 58, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* Hero 背景微妙视差与高对比度渐变遮罩 */
.hero-bg-layer {
  background-size: cover;
  background-position: center 40%;
  will-change: transform;
  transition: transform 0.2s ease-out;
}

.hero-overlay {
  background:
    linear-gradient(110deg, rgba(6, 19, 38, 0.94) 0%, rgba(11, 31, 58, 0.84) 48%, rgba(11, 31, 58, 0.58) 100%),
    linear-gradient(to top, rgba(6, 19, 38, 0.95) 0%, rgba(6, 19, 38, 0) 35%);
}

/* 现货脉冲绿点动画 */
@keyframes stockPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.72);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.ready-stock-dot {
  animation: stockPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Scroll-Reveal 进场动效（IntersectionObserver 触发） */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ready-stock-dot {
    animation: none;
  }
}

/* 2 步选型器激活按钮高亮 */
.finder-option {
  transition: all 0.22s ease;
}

.finder-option.is-active {
  border-color: var(--amber-500);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(14, 165, 233, 0.08));
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.55), 0 12px 24px -10px rgba(245, 158, 11, 0.28);
}

/* 筛选标签页切换 */
.filter-tab {
  transition: all 0.2s ease;
}

.filter-tab.is-active {
  background-color: var(--navy-900);
  color: #ffffff;
  border-color: var(--navy-900);
  box-shadow: 0 6px 16px -6px rgba(11, 31, 58, 0.45);
}

.filter-tab-dark.is-active {
  background-color: var(--amber-500);
  color: #0b1f3a;
  border-color: var(--amber-500);
}

/* 卡片图片缩放动效 */
.card-media img {
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.group:hover .card-media img {
  transform: scale(1.06);
}

/* 表单聚焦环样式 */
.industrial-input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.industrial-input:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

/* 悬浮 WhatsApp 按钮呼吸光环 */
@keyframes waFloatGlow {
  0%, 100% {
    box-shadow: 0 12px 28px -6px rgba(34, 197, 94, 0.52);
  }
  50% {
    box-shadow: 0 14px 36px -4px rgba(34, 197, 94, 0.75);
  }
}

.wa-floating-btn {
  animation: waFloatGlow 3s ease-in-out infinite;
}

/* 模态框动画 */
.modal-backdrop {
  transition: opacity 0.22s ease;
}

.modal-panel {
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

/* ============================================================================
 * 阿拉伯语 RTL 镜像布局专项微调
 * ============================================================================ */
[dir="rtl"] .rtl-flip-icon {
  transform: scaleX(-1);
}

[dir="rtl"] .hero-overlay {
  background:
    linear-gradient(250deg, rgba(6, 19, 38, 0.94) 0%, rgba(11, 31, 58, 0.84) 48%, rgba(11, 31, 58, 0.58) 100%),
    linear-gradient(to top, rgba(6, 19, 38, 0.95) 0%, rgba(6, 19, 38, 0) 35%);
}

[dir="rtl"] .wa-floating-wrap {
  right: auto;
  left: 1.25rem;
}

/* 阿拉伯语 RTL 模式下保护品牌名、电话、邮箱与工程数值不被双向文本算法倒序 */
.ltr-isolate {
  direction: ltr;
  unicode-bidi: isolate;
}

/* 自定义深海滚动条 */
::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: #0b1f3a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0ea5e9;
}
