/* ============================================================
   主样式文件 - 礼品箱包贸易公司B2B独立站
   Main Stylesheet - Gift & Luggage B2B Website
   ============================================================ */

/* ---- Tailwind CSS CDN 已在HTML中引入 ---- */

/* ---- 自定义CSS变量 / Custom CSS Variables ---- */
:root {
  --primary: #1a3a5c;
  --primary-light: #2c5f8a;
  --primary-dark: #0f2440;
  --accent: #c8943e;
  --accent-light: #e0b860;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --transition: 0.3s ease;
}

/* ---- 全局基础 / Global Base ---- */
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 中文环境字体优化 */
[lang="zh"] body,
body.zh {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, sans-serif;
}

/* ---- 导航栏 / Navigation ---- */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow-lg);
}

.navbar .nav-link {
  color: var(--gray-700);
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--primary);
  transition: transform 0.3s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--primary);
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* 移动端菜单 */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.mobile-menu.open {
  max-height: 400px;
}

/* ---- 轮播 / Banner Carousel ---- */
.carousel {
  position: relative;
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  transition: transform 0.6s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  height: 500px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .carousel-slide img { height: 320px; }
}

@media (max-width: 480px) {
  .carousel-slide img { height: 240px; }
}

.carousel-slide .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%);
}

.carousel-content {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: white;
  z-index: 10;
  width: 90%;
  max-width: 800px;
}

@media (max-width: 768px) {
  .carousel-content { bottom: 40px; }
}

.carousel-indicators {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicators button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
}

.carousel-indicators button.active {
  background: white;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.carousel-btn:hover { background: rgba(255,255,255,0.4); }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

@media (max-width: 768px) {
  .carousel-btn { width: 36px; height: 36px; font-size: 16px; }
}

/* ---- 产品卡片 / Product Card ---- */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.35s ease;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.product-card .card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.product-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .card-img img {
  transform: scale(1.08);
}

.product-card .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  z-index: 2;
}

.badge-new { background: #10b981; color: white; }
.badge-hot { background: #ef4444; color: white; }

/* ---- 价格表 / Price Table ---- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.price-table th {
  background: var(--primary);
  color: white;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
}

.price-table td {
  padding: 10px 16px;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 500;
}

.price-table tr:hover td {
  background: var(--gray-50);
}

.price-table td.price-col {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
}

/* ---- 产品详情图片画廊 / Product Gallery ---- */
.gallery-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--gray-100);
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.gallery-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  flex-shrink: 0;
}

.gallery-thumb.active { border-color: var(--primary); }

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- 分类标签 / Category Tabs ---- */
.category-tab {
  padding: 8px 20px;
  border-radius: 30px;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}

.category-tab:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.category-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ---- 表单 / Form ---- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.form-group label .required {
  color: #ef4444;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--white);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

.form-control.error {
  border-color: #ef4444;
}

.form-control.valid {
  border-color: #10b981;
}

.error-message {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 4px;
  display: none;
}

.error-message.show {
  display: block;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ---- 按钮 / Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-accent:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-outline-white {
  background: transparent;
  color: white;
  border-color: white;
}

.btn-outline-white:hover {
  background: white;
  color: var(--primary);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ---- 动画 / Animations ---- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ---- 页脚 / Footer ---- */
.site-footer {
  background: var(--gray-900);
  color: #94a3b8;
}

.site-footer a {
  color: #94a3b8;
  transition: var(--transition);
}

.site-footer a:hover {
  color: var(--accent-light);
}

.site-footer h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.site-footer h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent);
}

/* ---- 回到顶部 / Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 999;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
}

/* ---- 语言切换按钮 / Language Switcher ---- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  color: var(--gray-700);
}

.lang-switch:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ---- 留言成功弹窗 / Success Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-box {
  transform: scale(1);
}

.modal-box .check-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

/* ---- 搜索框 / Search Box ---- */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 48px 12px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 30px;
  font-size: 0.95rem;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.08);
}

.search-box .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-600);
}

/* ---- 面包屑 / Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.breadcrumb a {
  color: var(--gray-600);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator { color: var(--gray-600); }
.breadcrumb .current { color: var(--primary); font-weight: 600; }

/* ---- 优势卡片 / Advantage Card ---- */
.advantage-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.35s ease;
}

.advantage-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.advantage-card .icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* ---- 页面标题区 / Page Header ---- */
.page-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  padding: 60px 0;
  text-align: center;
}

@media (max-width: 768px) {
  .page-header { padding: 40px 0; }
}

/* ---- 标签提示 / Toast ---- */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 24px;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  z-index: 3000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.4s ease;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.success { background: #10b981; }
.toast.error { background: #ef4444; }

/* ---- 响应式微调 / Responsive Tweaks ---- */
@media (max-width: 768px) {
  .price-table { font-size: 0.8rem; }
  .price-table th,
  .price-table td { padding: 8px 10px; }
}
