/* ========================================
   LUXE COLLECTION - LUXURY STYLING
   ======================================== */

/* CSS Variables for Luxury Theme */
:root {
    /* Luxury Colors */
    --luxury-gold: #D4AF37;
    --luxury-dark-gold: #B8941F;
    --luxury-light-gold: #F4E8B8;
    --luxury-black: #1A1A1A;
    --luxury-dark-gray: #2D2D2D;
    --luxury-gray: #6B6B6B;
    --luxury-light-gray: #F8F9FA;
    --luxury-white: #FFFFFF;
    --luxury-cream: #FDF8F0;
    
    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    
    /* Spacing */
    --section-padding: 5rem 0;
    --container-max-width: 1400px;
    
    /* Effects */
    --luxury-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --luxury-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 移动端优先的基础样式 */
html {
  font-size: 16px; /* 基础字体大小 */
  -webkit-text-size-adjust: 100%;
}

body {
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation; /* 优化触摸体验 */
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--luxury-black);
    background-color: var(--luxury-white);
    overflow-x: hidden;
}

/* 容器间距优化 */
.container {
  padding-left: 15px;
  padding-right: 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }

/* Container */
.container {
    max-width: var(--container-max-width);
}

/* ========================================
   ANNOUNCEMENT BAR - 修复版本
   ======================================== */
.announcement-bar {
    background: linear-gradient(135deg, var(--luxury-gold), var(--luxury-dark-gold));
    color: var(--luxury-white);
    padding: 12px 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 100;
    /* 确保在导航栏下方显示 */
    margin-top: 0;
}

.announcement-content {
    color: var(--luxury-white) !important; /* 强制白色文字 */
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

#announcement-text {
    color: var(--luxury-white) !important; /* 确保文字可见 */
    font-weight: 500;
    margin-left: 5px;
}

.announcement-bar i {
    color: var(--luxury-white) !important; /* 确保图标可见 */
    margin-right: 8px;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
    z-index: 1;
}

.announcement-content {
    position: relative;
    z-index: 2; /* 确保内容在闪光效果之上 */
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 移动端公告栏优化 */
@media (max-width: 768px) {
    .announcement-bar {
        padding: 10px 0;
        font-size: 0.85rem;
    }
    
    .announcement-content {
        font-size: 0.85rem;
        padding: 0 10px;
    }
    
    .announcement-bar i {
        font-size: 0.9rem;
        margin-right: 6px;
    }
}

/* 确保公告栏在导航栏后显示 */
.navbar {
    z-index: 1030;
}

.announcement-bar {
    position: relative;
    z-index: 1020;
}

/* 修复可能的颜色变量问题 */
:root {
    /* 确保这些颜色变量存在 */
    --luxury-gold: #D4AF37;
    --luxury-dark-gold: #B8941F;
    --luxury-white: #FFFFFF;
    --luxury-black: #1A1A1A;
    --luxury-text: #333333;
    --luxury-dark: #2D2D2D;
    --luxury-light: #F8F9FA;
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    padding: 1rem 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: var(--luxury-shadow);
}

.navbar-brand {
    text-decoration: none;
    color: var(--luxury-black) !important;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--luxury-gold);
    display: block;
    line-height: 1;
}

.brand-subtitle {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: var(--luxury-gray);
    display: block;
    margin-top: -2px;
}

.nav-link {
    font-weight: 500;
    color: var(--luxury-black) !important;
    position: relative;
    transition: var(--transition);
    margin: 0 1rem;
}

.nav-link:hover {
    color: var(--luxury-gold) !important;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--luxury-gold);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* 移动端导航优化 */
.navbar {
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        var(--luxury-cream) 0%, 
        var(--luxury-light-gold) 50%, 
        var(--luxury-gold) 100%);
    z-index: -2;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="luxury-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(212,175,55,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23luxury-pattern)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(26, 26, 26, 0.8) 0%, 
        rgba(26, 26, 26, 0.4) 50%, 
        rgba(26, 26, 26, 0.2) 100%);
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--luxury-white);
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.text-luxury {
    color: var(--luxury-gold);
    display: inline-block;
    position: relative;
}

.text-elegant {
    color: var(--luxury-white);
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    margin-bottom: 3rem;
    line-height: 1.8;
    opacity: 0.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Hero Section 移动端优化 */
.hero-section {
  padding: 60px 0 40px;
  min-height: auto;
}

.hero-content h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-content .lead {
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-luxury {
    background: linear-gradient(135deg, var(--luxury-gold), var(--luxury-dark-gold));
    border: none;
    color: var(--luxury-white);
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-luxury::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.btn-luxury:hover::before {
    left: 100%;
}

.btn-luxury:hover {
    transform: translateY(-3px);
    box-shadow: var(--luxury-shadow-hover);
    color: var(--luxury-white);
}

.btn-outline-luxury {
    background: transparent;
    border: 2px solid var(--luxury-gold);
    color: var(--luxury-gold);
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.btn-outline-luxury:hover {
    background: var(--luxury-gold);
    color: var(--luxury-white);
    transform: translateY(-3px);
    box-shadow: var(--luxury-shadow);
}

/* 按钮移动端优化 */
.btn-luxury {
  background: linear-gradient(135deg, var(--luxury-gold), #f4e5c2);
  border: none;
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 25px;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  width: 100%;
  touch-action: manipulation;
}

.btn-luxury:hover,
.btn-luxury:active {
  background: linear-gradient(135deg, #f4e5c2, var(--luxury-gold));
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
}

/* ========================================
   SECTIONS
   ======================================== */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--luxury-black);
    margin-bottom: 1rem;
    position: relative;
}

.section-divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(135deg, var(--luxury-gold), var(--luxury-dark-gold));
    margin: 0 auto 2rem;
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--luxury-gray);
    line-height: 1.7;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   ABOUT SECTION
   ======================================== */
.about-section {
    background: var(--luxury-light-gray);
    padding: var(--section-padding);
}

.intro-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--luxury-gray);
}

.intro-text p {
    margin-bottom: 1.5rem;
}

/* ========================================
   PRODUCTS SECTION
   ======================================== */
.products-section {
    padding: var(--section-padding);
    background: var(--luxury-white);
}

/* 调整商品区域的间距 */
.products-section {
  padding: 2rem 0 4rem; /* 减少上方间距，增加下方间距 */
}

/* Category Filter */
.category-filter {
    margin-bottom: 3rem;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--luxury-gray);
    color: var(--luxury-gray);
    padding: 0.6rem 1.2rem;
    margin: 0.3rem;
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--luxury-gold);
    border-color: var(--luxury-gold);
    color: var(--luxury-white);
    transform: translateY(-2px);
}

/* 商品分类过滤器移动端优化 */
.category-filter {
  margin-bottom: 2rem;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 10px;
}

.category-filter .d-flex {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px;
  justify-content: center;
  padding: 0 15px;
}

.filter-btn {
  white-space: nowrap;
  padding: 8px 16px;
  font-size: 0.75rem;
  border-radius: 20px;
  border: 2px solid var(--luxury-gold);
  background: transparent;
  color: var(--luxury-gold);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  min-width: auto;
  flex-shrink: 0;
  touch-action: manipulation;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--luxury-gold);
  border-color: var(--luxury-gold);
  color: var(--luxury-white);
  transform: scale(1.05);
}

/* Product Cards */
.product-card {
    background: var(--luxury-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    height: 100%;
    cursor: pointer;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

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

.product-image {
    position: relative;
    overflow: hidden;
    height: 280px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(212, 175, 55, 0.8), 
        rgba(26, 26, 26, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-overlay i {
    font-size: 2rem;
    color: var(--luxury-white);
}

.product-info {
    padding: 1.5rem;
}

.product-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--luxury-black);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--luxury-gold);
    margin-bottom: 1rem;
}

.product-description {
    font-size: 0.95rem;
    color: var(--luxury-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 商品卡片移动端优化 */
.products-section {
  padding: 40px 0;
}

.product-card {
  margin-bottom: 2rem;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background: var(--luxury-white);
  touch-action: manipulation;
}

.product-card:active {
  transform: scale(0.98);
}

.product-image {
  position: relative;
  height: 220px;
  overflow: hidden;
}

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

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-overlay i {
  color: white;
  font-size: 2rem;
}

.product-card:hover .product-overlay {
  opacity: 1;
}

.product-info {
  padding: 1.5rem;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--luxury-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--luxury-gold);
  margin-bottom: 0.75rem;
}

.product-description {
  color: var(--luxury-text);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-actions {
  text-align: center;
}

/* View Details 按钮样式调整 */
.btn-product-detail {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.75rem !important;
  white-space: nowrap;
  min-width: auto;
}

.btn-product-detail i {
  font-size: 0.7rem;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
  z-index: 1055; /* 确保模态框在合适的层级 */
}

.modal-backdrop {
  z-index: 1050; /* 背景层级 */
}

.modal-dialog {
  margin: 1.75rem auto;
  max-width: 800px;
  max-height: calc(100vh - 3.5rem); /* 确保不超出视口 */
}

.modal-content {
  border: none;
  border-radius: 15px;
  overflow: hidden;
  max-height: calc(100vh - 3.5rem); /* 限制最大高度 */
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: linear-gradient(135deg, var(--luxury-gold), #f4e5c2);
  color: var(--luxury-white);
  flex-shrink: 0; /* 防止头部被压缩 */
  padding: 1rem 1.5rem;
}

.modal-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
}

.modal-body {
  flex: 1 1 auto; /* 允许内容区域伸缩 */
  overflow-y: auto; /* 内容过多时显示滚动条 */
  padding: 0;
  max-height: calc(100vh - 200px); /* 限制内容区域高度 */
}

.product-detail-content {
  padding: 1.5rem;
}

.product-detail-images {
  position: relative;
  margin-bottom: 1.5rem;
}

/* 图片导航按钮容器 */
.image-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  z-index: 5;
}

/* 图片导航按钮 */
.image-nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: all 0.3s ease;
  opacity: 0.8;
}

.image-nav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: scale(1.1);
  color: var(--luxury-gold);
}

.image-nav-btn:focus {
  box-shadow: 0 0 0 3px rgba(var(--luxury-gold-rgb), 0.3);
  outline: none;
}

/* 在移动设备上隐藏导航按钮，因为可以滑动 */
@media (max-width: 768px) {
  .image-navigation {
    display: none;
  }
}

/* ========================================
   图片查看器样式
   ======================================== */
.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.viewer-container {
  position: relative;
  width: 90%;
  height: 90%;
  max-width: 1200px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  color: white;
  z-index: 10;
}

.viewer-counter {
  font-size: 1.1rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.viewer-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.viewer-content {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.viewer-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.viewer-image.active {
  display: block;
}

/* 图片查看器动画效果 */
.image-viewer {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.image-viewer.show {
  opacity: 1;
  transform: scale(1);
}

.viewer-navigation {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
  z-index: 10;
}

.viewer-nav {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 1.2rem;
}

.viewer-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.viewer-nav:active {
  transform: scale(0.95);
}

/* 移动端图片查看器优化 */
@media (max-width: 768px) {
  .viewer-container {
    width: 100%;
    height: 100%;
  }
  
  .viewer-header {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    position: relative;
    z-index: 10;
  }
  
  .viewer-counter {
    font-size: 1rem;
    color: white;
    font-weight: 600;
  }
  
  .viewer-close {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
  }
  
  .viewer-content {
    padding: 0 1rem;
  }
  
  .viewer-image {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
    object-fit: contain;
    touch-action: pan-x pan-y pinch-zoom;
  }
  
  /* 移动端隐藏导航按钮，使用滑动操作 */
  .viewer-navigation {
    display: none;
  }
  
  /* Add mobile swipe hint */
  .viewer-container::after {
    content: "Swipe left/right to switch · Tap to close";
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    pointer-events: none;
    animation: fadeInOut 4s ease-in-out;
  }
  
  @keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
  }
}

.product-detail-image {
  width: 100%;
  height: 300px; /* 减小图片高度 */
  object-fit: cover;
  border-radius: 10px;
  transition: var(--transition);
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y; /* 允许垂直滑动但限制水平滑动 */
  position: relative;
}

/* Click to zoom hint */
.product-detail-image::after {
  content: "📱 Tap to zoom";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
}

/* Mobile touch area optimization */
@media (max-width: 768px) {
  .product-detail-image {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
  }
  
  .product-detail-image:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

@media (min-width: 769px) {
  .product-detail-image::after {
    content: "🖱️ Click to zoom";
  }
}

.product-detail-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0.7;
}

.thumbnail:hover,
.thumbnail.active {
  border-color: var(--luxury-gold);
  opacity: 1;
  transform: scale(1.05);
}

.product-detail-info h3 {
  font-family: var(--font-heading);
  color: var(--luxury-dark);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.product-detail-price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--luxury-gold);
  margin-bottom: 1.25rem;
}

.product-detail-description {
  color: var(--luxury-text);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  max-height: 150px; /* 限制描述高度 */
  overflow-y: auto; /* 描述过长时显示滚动条 */
}

/* 移动端模态框优化 */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
  
  .modal-content {
    max-height: calc(100vh - 1rem);
  }
  
  .modal-body {
    max-height: calc(100vh - 150px);
  }
  
  .product-detail-content {
    padding: 1rem;
  }
  
  .product-detail-image {
    height: 200px; /* 移动端进一步减小图片高度 */
  }
  
  .product-detail-info h3 {
    font-size: 1.25rem;
  }
  
  .product-detail-price {
    font-size: 1.5rem;
  }
  
  .product-detail-description {
    font-size: 0.9rem;
    max-height: 100px;
  }
  
  .thumbnail {
    width: 40px;
    height: 40px;
  }
}

/* 平板设备适配 */
@media (min-width: 768px) and (max-width: 1024px) {
  .modal-dialog {
    margin: 1rem auto;
    max-width: 90%;
  }
  
  .product-detail-image {
    height: 250px;
  }
  
  .product-detail-info h3 {
    font-size: 1.4rem;
  }
  
  .product-detail-price {
    font-size: 1.6rem;
  }
}

/* 大屏幕设备适配 */
@media (min-width: 1025px) {
  .modal-dialog {
    max-width: 900px;
  }
  
  .product-detail-image {
    height: 350px;
  }
  
  .product-detail-info h3 {
    font-size: 1.6rem;
  }
  
  .product-detail-price {
    font-size: 1.8rem;
  }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 600px) {
  .modal-dialog {
    margin: 0.25rem auto;
    max-height: calc(100vh - 0.5rem);
  }
  
  .modal-content {
    max-height: calc(100vh - 0.5rem);
  }
  
  .modal-body {
    max-height: calc(100vh - 120px);
  }
  
  .product-detail_image {
    height: 180px;
  }
  
  .product-detail-content .row {
    align-items: flex-start;
  }
}

/* 确保模态框不会影响页面滚动 */
body.modal-open {
  overflow: hidden;
  padding-right: 0 !important; /* 移除Bootstrap默认的padding */
}

/* 搜索模态框也需要相同的处理 */
#searchModal .modal-dialog {
  margin: 1.75rem auto;
  max-width: 500px;
  max-height: calc(100vh - 3.5rem);
}

#searchModal .modal-content {
  max-height: calc(100vh - 3.5rem);
}

#searchModal .modal-body {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* 搜索结果区域 */
#searchResults {
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.search-result-item:hover {
  background-color: var(--luxury-light);
  border-color: var(--luxury-gold);
  transform: translateX(3px);
}

.search-result-item:last-child {
  margin-bottom: 0;
}

/* Footer确保不被遮挡 */
.footer {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
  background: var(--luxury-dark);
  color: white;
  margin-top: 3rem;
}

/* 页面内容与Footer的间距 */
.products-section {
  padding-bottom: 3rem;
  margin-bottom: 2rem;
}

/* 滚动条样式优化 */
.modal-body::-webkit-scrollbar,
.product-detail-description::-webkit-scrollbar,
#searchResults::-webkit-scrollbar {
  width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.product-detail-description::-webkit-scrollbar-track,
#searchResults::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb,
.product-detail-description::-webkit-scrollbar-thumb,
#searchResults::-webkit-scrollbar-thumb {
  background: var(--luxury-gold);
  border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover,
.product-detail-description::-webkit-scrollbar-thumb:hover,
#searchResults::-webkit-scrollbar-thumb:hover {
  background: #b8860b;
}

/* 调整各个section之间的间距 */
section {
  position: relative;
}

/* 滚动到section时的偏移量 */
section[id] {
  scroll-margin-top: 80px; /* 考虑固定导航栏的高度 */
}

/* 响应式间距微调 */
@media (max-width: 576px) {
  .products-section {
    padding: 1rem 0 2.5rem;
  }
  
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  .category-filter {
    margin-bottom: 0.75rem;
  }
  
  .product-card {
    margin-bottom: 1rem;
  }
  
  .footer {
    margin-top: 2.5rem;
    padding: 1.5rem 0;
  }
}

/* 确保页面内容有足够的底部空间 */
.main-content {
  min-height: calc(100vh - 200px); /* 确保内容区域有最小高度 */
}

/* 网格间距调整 */
.row.g-4 {
  --bs-gutter-y: 1.5rem; /* 减少Bootstrap网格的垂直间距 */
}

@media (max-width: 768px) {
  .row.g-4 {
    --bs-gutter-y: 1rem;
  }
  
  .category-filter .filter-btn {
    padding: 6px 12px;
    font-size: 0.7rem;
    margin: 0.2rem;
    border-radius: 18px;
  }
  
  .category-filter .d-flex {
    gap: 6px;
    padding: 0 10px;
  }
  
  /* 双列布局优化 */
  .product-image {
    height: 200px;
  }
  
  .product-info {
    padding: 1rem 0.8rem;
  }
  
  .product-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }
  
  .product-price {
    font-size: 1rem;
  }
  
  /* View Details 按钮移动端优化 */
  .btn-product-detail {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.6rem !important;
  }
  
  .btn-product-detail i {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .category-filter .filter-btn {
    padding: 5px 10px;
    font-size: 0.65rem;
    margin: 0.15rem;
    border-radius: 15px;
  }
  
  .category-filter .d-flex {
    gap: 4px;
    padding: 0 5px;
  }
  
  /* 小屏幕双列布局优化 */
  .product-image {
    height: 180px;
  }
  
  .product-info {
    padding: 0.8rem 0.6rem;
  }
  
  .product-title {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    line-height: 1.3;
  }
  
  .product-price {
    font-size: 0.9rem;
  }
  
  /* View Details 按钮小屏幕优化 */
  .btn-product-detail {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.5rem !important;
  }
  
  .btn-product-detail i {
    font-size: 0.6rem;
  }
}
