/* 假设你有一个 --danger-color 变量，如果没有，请定义或使用具体的颜色值 */
:root {
    --danger-color: #dc3545; /* 例如，红色 */
    /* ... 其他颜色变量 ... */
}

/* Product Detail Page Styles */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background-color: var(--light-gray);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
}

.breadcrumb ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
}

.breadcrumb li {
    font-size: 0.9rem;
    color: var(--gray-color);
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: var(--gray-color);
}

.breadcrumb li:last-child {
    color: var(--dark-color);
    font-weight: 600;
}

.breadcrumb a {
    color: var(--gray-color);
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* Product Detail Layout */
.product-detail {
    padding: 2rem 0 4rem;
}

.product-detail .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* Product Gallery */
.product-gallery {
    position: relative;
    width: 34vw;
    /* width: 500px; */
}


.main-image {
    width: 100%;
    height: 500px;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}


.main-image:active {
    cursor: grabbing;
}



.image-track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}




.image-track img {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: center;
    /* object-fit: contain; */
}


/* 新增：图片轨道导航按钮样式 */
.image-track-nav-button {
    position: absolute; /* 绝对定位 */
    top: 50%; /* 垂直居中 */
    transform: translateY(-50%);
    font-size: 24px; /* 图标大小 */
    background: rgba(0, 0, 0, 0.4); /* 半透明背景 */
    color: white; /* 字体颜色 */
    border: none;
    cursor: pointer; /* 鼠标指针 */
    padding: 10px 15px;
    border-radius: 50%; /* 圆形按钮 */
    z-index: 10; /* 确保按钮在图片上方 */
    align-items: center;
    justify-content: center;
    opacity: 0; /* 默认隐藏 */
    transition: opacity 0.3s ease; /* 动画效果 */

    /* ⚡️ 关键修改：默认在非PC端隐藏按钮 ⚡️ */
    display: none; /* 在默认情况下（手机端）隐藏按钮 */
}

/* 鼠标悬停在 .main-image 上时显示按钮 */
.main-image:hover .image-track-nav-button {
    opacity: 1;
}

/* 按钮悬停效果 */
.image-track-nav-button:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* 左侧按钮位置 */
.image-track-nav-button.left {
    left: 10px;
}

/* 右侧按钮位置 */
.image-track-nav-button.right {
    right: 10px;
}

/* 确保 image-track 能够被点击到 */
.image-track {
    position: relative; /* 确保 z-index 工作正常 */
}


/* 默认在所有屏幕上隐藏按钮（包括手机） */
.image-track-nav-button {
    display: none; /* 默认隐藏 */
}

.thumbnail-images {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    /* 横向可以滚动 */
    overflow-y: hidden;
    /* 竖向不滚动 */
    white-space: nowrap;
    /* 不换行 */
    padding: 10px 0;
    /* 上下留点空间，看着更舒服 */
    scrollbar-width: none;
    /* Firefox 隐藏滚动条 */
    -webkit-overflow-scrolling: touch;
    width: 100%;
    /* 设置宽度为100% */
    min-width: 100%;
    max-width: 100%;
    /* 防止它被限制宽度 */
    /* width: 90vw; */
    cursor: grab;
    user-select: none;
}


.thumbnail-images.dragging {
    cursor: grabbing;
}

.thumbnail-images img {
    user-select: none;
}

.thumbnail-images::-webkit-scrollbar {
    display: none;
    /* Chrome、Safari 隐藏滚动条 */
}

.thumbnail {
    flex: 0 0 auto;
    /* 防止缩略图被压缩，保持原大小 */
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.thumbnail.active {
    border-color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* 模态框样式 */
.modal {
    display: none;
    /* 默认隐藏 */
    position: fixed;
    z-index: 9999;
    /* 在最上层 */
    padding-top: 150px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(203 203 203 / 90%);
    /* 背景遮罩 */
    text-align: center;
}

/* 模态框图片 */
.modal-content {
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    user-select: none;
    touch-action: manipulation;
}

/* 关闭按钮 */
.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}


.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 10001;
}

#prevImage {
    left: 20px;
}

#nextImage {
    right: 20px;
}

/* Product Info Styles */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-category {
    font-size: 0.85rem;
    color: var(--gray-color);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.product-info h1 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stars {
    color: #ffc107;
}

.product-rating span {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.Browse-bubble { /* 确保这里是 'Browse-bubble' */
    /* ... (气泡主样式保持不变，例如 absolute 定位、透明度、边框等) ... */
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(230, 247, 255, 0.15);
    border: 1px solid rgba(145, 213, 255, 0.3);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #003a8c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    transition: all 0.3s ease-in-out;
}


/* <<<<<<<<<<<<<<<< 新的图标样式（针对 SVG 人物图标） >>>>>>>>>>>>>>>> */
.Browse-bubble .Browse-icon { /* 注意：这里是新的类名 Browse-icon */
    /* SVG 图标通常使用 width 和 height 来控制大小 */
    width: 1rem;   /* 可以根据需要调整图标大小 */
    height: 1rem;  /* 保持与宽度一致，确保比例 */
    color: #1890ff; /* 设置图标颜色。SVG 会通过 fill: currentColor 继承此颜色 */
    display: flex; /* 确保它是一个 flex 容器，方便内部 SVG 对齐 */
    align-items: center; /* 垂直居中 SVG */
    justify-content: center; /* 水平居中 SVG */
}

/* 确保 SVG 元素继承父级的颜色 */
.Browse-bubble .Browse-icon svg {
    fill: currentColor; /* 让 SVG 填充色继承其父元素 (Browse-icon) 的 color 属性 */
    display: block; /* 移除 SVG 默认的内联元素间距 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .Browse-bubble { /* 确保这里是 'Browse-bubble' */
        top: 10px;
        right: 10px;
        /* 移除 transform 相关调整，因为不再有动画 */
    }
}

.text-sm{
    font-size: 0.875rem;
}

.product-variants {
    margin: 16px 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* 产品描述容器的默认样式（折叠状态）*/
.product-description {
    max-height: 100px; /* 默认显示的高度，您可以根据需要调整 */
    overflow: hidden;
    position: relative; /* 用于渐变遮罩的定位 */
    transition: max-height 0.5s ease-in-out; /* 平滑的展开/折叠过渡效果 */
    margin-bottom: 10px; /* 与按钮的间距 */
}

/* 底部渐变遮罩，指示内容被隐藏 */
.product-description::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px; /* 渐变遮罩的高度 */
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none; /* 允许点击穿透渐变层 */
}

/* 产品描述容器的展开状态 */
.product-description.expanded {
    max-height: 2000px; /* 足够大的高度以显示所有内容，确保能容纳最长描述 */
    /* 或者设置 max-height: none; 如果不需要过渡效果 */
}

/* 展开状态下隐藏渐变遮罩 */
.product-description.expanded::after {
    display: none;
}

/* “阅读更多”按钮的样式 */
.read-more-btn {
    width: fit-content;
    margin: 0 auto;
    background-color: var(--primary-color, #007bff);
    color: var(--white-color, white);
    border: none;
    padding: 5px 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.6rem;
    transition: background-color 0.3s ease;
}

.read-more-btn:hover {
    background-color: var(--dark-primary-color, #0056b3); /* 鼠标悬停时的颜色 */
}



/* 库存信息样式 */
.product-stock-info {
    font-size: 0.8rem;
}

.stock-status {
    font-weight: 600;
    color: var(--gray-color); /* 默认颜色 */
}

/* 低库存时的特殊样式 - 营造紧迫感 */
.stock-status.low-stock {
    color: var(--danger-color); /* 示例：红色 */
    font-weight: 700;
    animation: pulse 1.5s infinite; /* 添加跳动动画 */
}

/* 售罄时的特殊样式 */
.stock-status.out-of-stock {
    color: var(--gray-color);
    font-weight: 600;
    text-transform: uppercase;
}

/* 定义跳动动画 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.02); opacity: 0.9; }
    100% { transform: scale(1); opacity: 1; }
}



.variant-group {
    display: flex;
    align-items: baseline;
    font-size: 14px;
    min-width: 150px;
}

.variant-group label {
    margin-bottom: 4px;
    font-weight: 600;
    color: #444;
}

.variant-group select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.variant-group select:focus {
    border-color: #007BFF;
    outline: none;
}

.current-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.original-price {
    font-size: 1.25rem;
    text-decoration: line-through;
    color: var(--gray-color);
}

.discount-badge {
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    /* text-xs */
    line-height: 1rem;
    font-weight: bold;
    /* 加粗字体 */
    padding: 0.125rem 0.625rem;
    /* py-0.5 px-2.5 */
    border-radius: 0.375rem;
    /* rounded-md */
    border: 1px solid transparent;
    color: rgb(22, 101, 52);
    /* text-green-800 */
    background-color: rgb(220, 252, 231);
    /* bg-green-100 */
    transition: color 150ms, background-color 150ms, border-color 150ms, text-decoration-color 150ms, fill 150ms, stroke 150ms;
    outline: none;
}

/* 可选的交互状态（hover、focus） */
.badge:hover {
    background-color: rgba(229, 246, 233, 0.8);
    /* 近似 hover:bg-secondary/80 */
}

.badge:focus {
    box-shadow: 0 0 0 2px #4ade80;
    /* focus:ring-ring */
}

.product-description p {
    margin-bottom: 1rem;
    line-height: 1.7;
}



/* Product Actions */
.product-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
}

/* 购物车样式 */
.proceed-checkout {
    background-color: #FF6F00;
    /* 明亮橙色 */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.mobile-menu-btn {
    /* display: none; */
    font-size: 1.5rem;
    cursor: pointer;
}

/* Mobile Menu Styles */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 2000;
    padding: 2rem;
    transform: translateX(-100%); /* 默认隐藏在左侧 */
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

/* 当菜单激活时，滑入屏幕 */
.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

.mobile-menu .nav-links {
    display: flex;
    flex-direction: column;
    margin-top: 3rem;
    list-style: none;
    padding: 0;
}

.mobile-menu .nav-links li {
    margin: 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.mobile-menu .nav-links a {
    text-decoration: none;
    color: #333;
    font-size: 0.8rem;
}

.mobile-menu .mobile-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.proceed-checkout:hover {
    background-color: #e65100;
    /* hover 深一点的橙色 */
}

.quantity-selector {
    display: flex;
    align-items: center;
    /* border: 1px solid var(--light-gray); */
    border-radius: 4px;
    overflow: hidden;
}

.quantity-selector button {
    width: 40px;
    height: 40px;
    background-color: var(--light-gray);
    color: var(--dark-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-selector button:hover {
    background-color: var(--gray-color);
    color: white;
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    appearance: textfield;
}

.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.add-to-cart-btn {
    flex-grow: 1;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.wishlist-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--light-gray);
    color: var(--dark-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    /* position: absolute; */
    right: 50px;
    top: 0%;
}

.wishlist-btn:hover {
    background-color: #ffeeee;
    color: #e63946;
    border-color: #ffcccc;
}


.product-meta {
    font-size: 0.875rem;
    color: #4B5563;
    /* text-gray-600 */
    display: flex;
    justify-content: space-around;
}

.product-meta .meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.product-meta .icon {
    width: 24px;
    height: 24px;
    margin-bottom: 0.5rem;
    stroke: currentColor;
}

/* Tabs Section */
.product-details-tabs {
    background-color: var(--light-gray);
    padding: 3rem 0 4rem;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 2rem;
    background-color: white;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab {
    padding: 1rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

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

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0 0 8px 8px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

.tab-pane p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}


.product-video-section {
    padding: 2rem 0;
    text-align: center;
    background-color: var(--white-color); /* 或者其他你想要的背景色 */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem; /* 给下方内容留出空间 */
}

.product-video-section h3 {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.video-wrapper {
    position: relative; /* 为视频预览和播放按钮定位 */
    width: 80%; /* 视频容器的宽度 */
    max-width: 800px; /* 最大宽度 */
    margin: 0 auto 1.5rem; /* 居中并设置下边距 */
    padding-bottom: 45%; /* 16:9 比例的视频高度 (高 / 宽 * 100%)，例如 9/16*100=56.25% */
    height: 0; /* 初始高度为0，由 padding-bottom 控制 */
    overflow: hidden; /* 防止内容溢出 */
    background-color: #000; /* 视频背景色 */
    border-radius: 8px;
}

.video-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.video-preview.hidden {
    opacity: 0;
    pointer-events: none; /* 隐藏时禁用点击事件 */
}

.video-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片覆盖整个区域 */
    display: block;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: rgba(255, 0, 0, 0.8); /* 半透明红色 */
    border-radius: 50%;
    display: flex;
    justify-content: center; /* 使图标在水平方向居中 */
    align-items: center;   /* 使图标在垂直方向居中 */
    cursor: pointer;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.play-button .fas.fa-play {
    color: var(--white-color, #fff); /* 设置图标颜色为白色，确保和你的CSS变量一致 */
    font-size: 28px; /* 调整图标大小 */
    /* Font Awesome 的播放图标本身就带有轻微的右偏移，所以通常不需要额外的 margin-left */
    /* 如果觉得需要微调，可以添加 margin-left: 2px; 等 */
}


.play-button:hover {
    background-color: rgba(255, 0, 0, 1); /* 鼠标悬停时完全不透明 */
}

#youtubeVideo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* display: none; will be set by JS initially */
}

/* 快速结账侧边栏 */
.checkout-sidebar {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 20px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* 启用侧边栏整体滚动 */
  overscroll-behavior: contain; /* 防止滚动穿透 */
}

.checkout-sidebar.active {
  right: 0;
}
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--light-gray);
  flex-shrink: 0; /* 防止头部被压缩 */
}

.sidebar-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.close-sidebar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: #666;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.close-sidebar:hover {
  background: #afafaf;
  color: #e9ecef;
}
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto; /* 确保内容区域可滚动 */
  overscroll-behavior: contain; /* 防止滚动影响主页面 */
}
.cart-items {
  flex: 1;
  margin-bottom: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain; /* 防止滚动穿透 */
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}
.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  font-size: 0.9rem;
  line-height: 1.3;
}

.cart-item-options {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
}

.qty-btn:hover {
  background: var(--light-gray);
  border-color: var(--primary-color);
}

.qty-input {
  width: 50px;
  height: 30px;
  text-align: center;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 0.9rem;
}

.cart-summary {
  border-top: 1px solid #dee2e6;
  padding-top: 1rem;
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.summary-row.total {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-paypal {
  background: #0070ba;
  color: white;
}

.btn-paypal:hover {
  background: #005ea6;
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

/* 遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}


.floating-cart-btn {
    position: fixed;
    bottom: 5%; /* 距离底部 20px */
    right: 5%; /* 距离右边 20px */
    background-color: #d68c45;
    color: white;
    border-radius: 50%;
    width: 55px;
    height: 55px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* 确保按钮在最上层 */
    transition: all 0.3s ease;
}

.floating-cart-btn a {
    color: white;
    font-size: 1.5rem;
    text-decoration: none;
}

.floating-cart-btn .cart-count {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #f00; /* 红色背景 */
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
}
.fa-solid, .fas {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}
/* 悬浮按钮悬停时的效果 */
.floating-cart-btn:hover {
    background-color: #db7515; /* 更改按钮颜色 */
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-widget{
        display: none;
    }
    .product-video-section h3 {
        font-size: 1.5rem;
    }

    .video-wrapper {
        width: 95%; /* 小屏幕上更宽一点 */
    }

    .play-button {
        width: 60px;
        height: 60px;
    }
    .play-button::before {
        border-width: 12px 0 12px 20px;
    }
    .video-caption {
        font-size: 0.9rem;
    }
    .checkout-sidebar{
        width: 100%;
    }
    .cart-items {
        max-height: calc(70vh - 200px); /* 限制商品列表高度，留出空间给头部和底部 */
        overflow-y: auto; /* 确保滚动 */
    }
}

@media (max-width: 480px) {
    .product-video-section {
        padding: 1.5rem 0;
    }
    .video-wrapper {
        padding-bottom: 56.25%; /* 保持 16:9 比例在更小的设备上 */
    }
    .play-button {
        width: 50px;
        height: 50px;
    }
    .play-button::before {
        border-width: 10px 0 10px 17px;
    }
}

@media screen and (min-width: 768px) {
  .floating-cart-btn {
    display: none;
  }
}

/* 加载指示器容器 */
.video-loading-spinner {
    position: absolute; /* 相对于 .video-wrapper 定位 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* 覆盖整个视频区域 */
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: flex; /* 使用 flexbox 居中子元素 */
    justify-content: center;
    align-items: center;
    z-index: 20; /* 确保它在视频预览和视频播放器之上 */
    /* 默认隐藏，JavaScript 会控制显示 */
    display: none; 
}

/* 转圈圈的样式 */
.loader {
    border: 6px solid #f3f3f3; /* 浅灰色背景 */
    border-top: 6px solid var(--primary-color, #ff0000); /* 顶部边框为主题色，例如红色 */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite; /* 旋转动画 */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 确保 iframe 和 video-preview 的父容器 .video-wrapper 具有相对定位 */
.video-wrapper {
    position: relative; 
    width: 100%;
    /* 可以添加一个最小高度以防内容未加载时高度为0 */
    min-height: 200px; /* 示例高度 */
}


/* Feature Highlights */
.feature-highlight {
    display: flex;
    gap: 1rem 1rem;
    align-items: center;
    flex-direction: column;
}


.highlight-image {
    flex: 1;
    max-width: 800px;
}

.highlight-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.highlight-content {
    flex: 2;
}

.highlight-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.highlight-content p {
    margin-bottom: 0;
}

/* Specifications Tab */
.specs-table {
    margin-bottom: 2rem;
}

.specs-row {
    display: flex;
    border-bottom: 1px solid var(--light-gray);
    padding: 0.75rem 0;
}

.specs-label {
    flex: 1;
    font-weight: 600;
}

.specs-value {
    flex: 2;
}

.included-items {
    background-color: var(--light-gray);
    padding: 1.5rem;
    border-radius: 8px;
}

.included-items h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.included-items ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.included-items li {
    margin-bottom: 0.5rem;
}

/* Reviews Tab */
.reviews-summary {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--light-gray);
}

.overall-rating {
    text-align: center;
}

.rating-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rating-stars {
    color: #ffc107;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.total-reviews {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.rating-breakdown {
    flex-grow: 1;
}

.rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.star-label {
    width: 70px;
    font-size: 0.9rem;
}

.progress-bar {
    height: 12px;
    background-color: var(--light-gray);
    border-radius: 6px;
    flex-grow: 1;
    margin: 0 1rem;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: #ffc107;
}

.percent {
    width: 40px;
    font-size: 0.9rem;
    text-align: right;
}

.review-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-dropdown {
    padding: 0.5rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-family: var(--body-font);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.review-item {
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 2rem;
}

.reviewer-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reviewer-name {
    font-weight: 600;
}

.reviewer-info {
    display: flex; /* 让名称和徽章在同一行 */
    align-items: center; /* 垂直居中对齐 */
    gap: 8px; /* 名称和徽章之间的间距 */
    margin-bottom: 5px; /* 与日期之间的距离 */
}

.verified-badge {
    background-color: #4CAF50; /* 绿色背景 */
    color: white; /* 白色文字 */
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em; /* 小一点的字体 */
    font-weight: 600;
    text-transform: uppercase; /* 大写 */
    display: inline-flex; /* 保持内容和背景紧密 */
    align-items: center; /* 文本垂直居中 */
    gap: 4px; /* 如果有图标，图标和文本的间距 */
}

/* 如果你想要一个勾号图标，可以添加伪元素 */
.verified-badge::before {
    content: '✓'; /* Unicode 勾号 */
    font-size: 1em; /* 调整图标大小 */
    line-height: 1; /* 确保垂直对齐 */
}


.review-date {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.review-rating {
    color: #ffc107;
    margin-bottom: 0.75rem;
}

.review-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.review-images {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.review-images img {
    width: 30%;
    /* height: 80px; */
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.review-images img:hover {
    transform: scale(1.05);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: var(--light-gray);
    color: var(--dark-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination a.active {
    background-color: var(--primary-color);
    color: white;
}

.pagination a:hover:not(.active) {
    background-color: var(--gray-color);
    color: white;
}

.pagination a.next {
    width: auto;
    padding: 0 1rem;
}

/* Shipping Tab */
.shipping-info {
    line-height: 1.7;
}

.shipping-info h3 {
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
    color: var(--primary-color);
}

.shipping-info h3:first-child {
    margin-top: 0;
}

.shipping-info p {
    margin-bottom: 1.5rem;
}

.shipping-info ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.shipping-info li {
    margin-bottom: 0.5rem;
}

/* Related Products Section */
.related-products {
    padding: 4rem 2rem;
}

/* Category Navigation */
.category-nav {
    background-color: white;
    border-bottom: 1px solid var(--light-gray);
    margin-bottom: 2rem;
}

/* 购物车样式 */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--accent-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    position: relative;
}

.category-item>a {
    display: block;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.category-item>a:hover {
    color: var(--primary-color);
}

.category-item.active>a {
    color: var(--primary-color);
}

.subcategory-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 4px 4px;
    padding: 1rem 0;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.category-item:hover .subcategory-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.subcategory-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.subcategory-item a {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.subcategory-item a:hover {
    color: var(--primary-color);
    background-color: var(--light-gray);
}

/* Mega Menu for larger categories */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
}

.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-column h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.mega-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mega-menu-item a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mega-menu-item a:hover {
    color: var(--primary-color);
    padding-left: 0.3rem;
}

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


/* 输入框样式 */
.review-form {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    padding: 1rem 1.5rem;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
    font-family: var(--body-font);
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
    }

    to {
        transform: translateX(-50%) translateY(0);
    }
}

.review-form.hidden {
    display: none;
}

.review-form-close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #777;
}

.review-form .form-row {
    margin-bottom: 0.75rem;
}

.review-form .form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.review-form .form-row select,
.review-form .form-row textarea,
.review-form .form-row input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.review-form .form-actions {
    text-align: right;
    margin-top: 0.5rem;
}


/* 模态框样式 */
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    flex-direction: column;
}

.image-preview-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-preview {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
}

#prevImage {
    left: 20px;
}

#nextImage {
    right: 20px;
}


/* Responsive Styles */
@media (max-width: 992px) {
    .product-detail .container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .breadcrumb {
        margin-bottom: 0px;
    }

    .product-detail {
        padding: 0px;
    }

    .main-image {
        height: 400px;
    }

    .feature-highlight {
        flex-direction: column;
    }

    .feature-highlight.reverse {
        flex-direction: column;
    }

    .highlight-image {
        max-width: 100%;
    }

    .reviews-summary {
        flex-direction: column;
        gap: 2rem;
    }

    .mega-menu {
        position: static;
        display: none;
        box-shadow: none;
        padding: 0 0 0 1.5rem;
        transform: none;
    }

    .has-mega-menu.open .mega-menu {
        display: block;
    }

    .mega-menu-column {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 992px) {
    .image-track-nav-button {
        display: flex; /* 在PC端恢复显示 */
        opacity: 0; /* PC端默认隐藏，只在hover时显示 */
    }

    .main-image:hover .image-track-nav-button {
        opacity: 1; /* PC端hover时显示 */
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        flex: 1 0 50%;
        text-align: center;
    }

    .product-meta {
        gap: 1rem;
        margin-bottom: 10px;
    }

    .product-actions {
        flex-wrap: wrap;
    }

    .quantity-selector {
        width: 100%;
        margin-bottom: 1rem;
    }

    .add-to-cart-btn {
        width: 100%;
    }

    .category-list {
        flex-direction: column;
    }

    .subcategory-dropdown {
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0 0 0 1.5rem;
        display: none;
    }

    .category-item.open .subcategory-dropdown {
        display: block;
    }

    .product-header h1 {
        font-size: 15px;
    }

    .wishlist-btn {
        position: absolute;
    }

    .image-track {
        display: flex;
        overflow-x: auto;
        scroll-behavior: smooth;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        /* 优化 iOS 滚动 */
        /* touch-action: pan-x; */
    }




    .thumbnail {
        cursor: pointer;
        user-select: none;
        /* 防止文本选择干扰点击 */
        -webkit-user-select: none;
        /* 兼容 Safari */
        touch-action: manipulation;
        /* 优化触摸点击响应 */
    }

    .thumbnail-images {
        width: 90vw;
    }

    .thumbnail.active {
        border: 2px solid blue;
    }

    .product-description-wrapper {
        position: relative;
        width: 100%;
        /* 你可以根据需要调整宽度 */
    }

    .product-description {
        max-height: 80px;
        /* 限制高度 */
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .product-description.expanded {
        max-height: none;
        /* 展开时取消高度限制 */
    }

    .read-more-btn {
        margin-top: 8px;
        background-color: #000000;
        color: white;
        border: none;
        padding: 3px 6px;
        cursor: pointer;
        border-radius: 4px;
    }

    .read-more-btn:hover {
        background-color: #0056b3;
    }

    .product-gallery {
        width: 100%;
    }

    .tab-pane h2,
    .section-title,
    .newsletter h3 {
        font-size: 1rem;
    }

    .specs-label,
    .specs-value {
        font-size: 0.8rem;
    }

    .breadcrumb-item {
        white-space: nowrap;
        /* 防止文本换行 */
        overflow: hidden;
        /* 隐藏溢出的内容 */
        text-overflow: ellipsis;
        /* 在溢出的文本末尾显示省略号 */
        max-width: 170px;
        /* 设置最大宽度，超出宽度后显示省略号 */
        display: inline-block;
        /* 使元素在一行内显示 */
    }

    .image-track img {
        width: auto;
    }

    /* 评论区 */
    .review-images {
        display: flex;
        gap: 1rem;
        margin-top: 1rem;
        overflow-x: auto;
        /* 允许横向滚动 */
        padding-bottom: 0.5rem;
        /* 给滚动条留空间 */
        scroll-snap-type: x mandatory;
        /* 可选：增强滑动体验 */
    }

    .review-images img {
        flex: 0 0 calc(50% - 0.5rem);
        /* 每行两个图，减去 gap 的一半 */
        max-width: 100%;
        height: auto;
        scroll-snap-align: start;
        /* 滑动对齐 */
        border-radius: 8px;
        /* 可选：圆角美化 */
    }

    /* .image-preview-modal {
        flex-direction: column;
    } */

    /* .nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-size: 30px;
        background: rgba(0,0,0,0.5);
        color: white;
        border: none;
        cursor: pointer;
        padding: 10px;
      }
      
    #prevImage { left: 20px; }
    #nextImage { right: 20px; } */

    .modal {
        padding-top: 50%;
    }
    #color-select{
        margin-left: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .product-info h1 {
        font-size: 1.2rem;
    }

    .current-price {
        font-size: 1.5rem;
    }

    .tab {
        flex: 1 0 100%;
    }

    .thumbnail-images {
        justify-content: left;
    }

    .color-options,
    .size-options {
        justify-content: center;
    }
}














/* 骨架屏 */

/* Skeleton Screen Styles */
.product-skeleton {
    padding: 2rem 0 4rem;
    /* Keep consistent padding with .product-detail */
}

.skeleton-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .skeleton-grid {
        grid-template-columns: 2fr 3fr;
    }
}

.skeleton-image {
    background-color: var(--light-gray); /* 使用你定义好的浅灰色变量 */
    min-height: 300px;
    border-radius: 8px;
    animation: pulse-bg 1.5s infinite;
}

.skeleton-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skeleton-line {
    background-color: var(--light-gray); /* 使用你定义好的浅灰色变量 */
    border-radius: 4px;
    animation: pulse-bg 1.5s infinite;
    height: 20px; /* 默认行高 */
}

.skeleton-title {
    width: 80%;
    height: 30px; /* 标题行高 */
}

.skeleton-rating {
    width: 40%;
    height: 20px;
}

.skeleton-price {
    width: 30%;
    height: 25px;
}

.skeleton-description.short {
    width: 90%;
}

.skeleton-description.long {
    width: 70%;
}

.skeleton-button {
    width: 150px;
    height: 45px;
    margin-top: 1rem;
}

.skeleton-section {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray); /* 与你页面的分割线保持一致 */
}

.skeleton-heading {
    width: 40%;
    height: 25px;
    margin-bottom: 1.5rem;
}

.skeleton-text {
    height: 18px;
    margin-bottom: 0.8rem;
}

.skeleton-text.short {
    width: 95%;
}

.skeleton-text.medium {
    width: 85%;
}

.skeleton-text.long {
    width: 75%;
}

.skeleton-review-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .skeleton-review-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.skeleton-review-card {
    background-color: var(--white-color); /* 骨架卡片背景色 */
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    animation: pulse-bg 1.5s infinite;
}

.skeleton-review-text.short {
    width: 90%;
    height: 18px;
}

.skeleton-review-text.medium {
    width: 70%;
    height: 18px;
}

/* Animation for skeleton screen */
@keyframes pulse-bg {
    0% {
        background-color: #eee; /* 浅灰色 */
    }
    50% {
        background-color: #ddd; /* 稍深一点的灰色 */
    }
    100% {
        background-color: #eee;
    }
}