/**
 * 好物页面插件前端样式 - 完整整合版
 */

/* 基础盒模型 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 分类标题居中，自适应布局 */
.goods-exhibition-category-title {
    width: 100%;
    max-width: 800px;
    margin: 40px auto 20px;
    font-weight: 700;
    font-size: 1.8rem;
    text-align: center;
    word-break: break-word;
    box-sizing: border-box;
    padding: 0 15px;
}

@media (max-width: 600px) {
    .goods-exhibition-category-title {
        font-size: 1.4rem;
        margin: 30px auto 15px;
    }
}

/* 滑动展示框架 */
.goods-exhibition-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: #fdfdfd;
    border-radius: 24px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.07);
}

.goods-exhibition-slider {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    scrollbar-width: none;
}
.goods-exhibition-slider::-webkit-scrollbar {
    display: none;
}

/* 单个商品卡片 */
.goods-exhibition-item {
    flex: 0 0 33.3333%;
    margin: 0 12px;
    min-width: 280px;
    max-width: 360px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 14px 20px rgba(0, 0, 0, 0.06);
    cursor: default;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: left;
    color: inherit;
    padding-bottom: 20px;
}

.goods-exhibition-item.has-link {
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
}
.goods-exhibition-item.has-link:hover,
.goods-exhibition-item.has-link:focus {
    text-decoration: none;
}

.goods-exhibition-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 30px rgba(0, 0, 0, 0.12);
}

/* 文字部分 */
.goods-exhibition-content {
    padding: 20px 20px 8px 20px;
    flex-shrink: 0;
    min-height: 100px;
}

/* 标题和NEW标签 */
.goods-exhibition-content > h3.goods-exhibition-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5em !important;
    margin: 0 0 6px !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    letter-spacing: -0.03em !important;
    color: #000 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.goods-exhibition-new-badge-svg {
    display: inline-block !important;
    width: 48px !important;
    height: 24px !important;
    vertical-align: text-bottom !important;
    margin-left: 0.3em !important;
    user-select: none !important;
    pointer-events: none !important;
}

/* 描述和价格 */
.goods-exhibition-description {
    font-size: 14px;
    line-height: 1.4;
    color: #444;
    margin-bottom: 8px;
    max-height: 3.6em;  /* 约2行 */
    overflow: hidden;
    text-overflow: ellipsis;
}

.goods-exhibition-price {
    font-weight: 600;
    font-size: 16px;
    color: #666;
}

/* 图片容器 - PC端默认最大宽度500px，比例固定 */
.goods-exhibition-image-container {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px auto;
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    background-color: #fff;
    box-sizing: border-box;
}

/* 图片 - 铺满容器，裁剪 */
.goods-exhibition-image-container img.goods-exhibition-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    display: block;
    user-select: none;
}

/* 箭头按钮样式 */
.goods-exhibition-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    cursor: pointer;
    color: #666;
    font-size: 24px;
    line-height: 1;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease;
}
.goods-exhibition-arrow:hover {
    background: #e5e5e7;
    color: #000;
}
.goods-exhibition-arrow:focus {
    outline: none;
    box-shadow: 0 0 4px 2px rgba(0,0,0,0.25);
}

.goods-exhibition-arrow-left {
    left: 0;
}
.goods-exhibition-arrow-right {
    right: 0;
}

/* 空状态 */
.goods-exhibition-empty {
    text-align: center;
    padding: 30px;
    font-size: 14px;
    color: #86868b;
}

/* 平板端调整 */
@media (max-width: 1024px) and (min-width: 481px) {
    .goods-exhibition-item {
        flex: 0 0 50%;
        min-width: auto;
        max-width: none;
    }
    .goods-exhibition-image-container {
        max-width: 400px;
    }
}

/* ===== 下面是强制覆盖移动端图片尺寸，避免第三方覆盖 ===== */
@media (max-width: 480px) {
  /* 商品卡片容器宽度固定 */
  .goods-exhibition-item {
    flex: 0 0 auto !important;
    width: 320px !important;
    max-width: 320px !important;
    min-width: 320px !important;
    margin: 0 8px 0 0 !important;
  }

  /* 图片容器固定宽高300px 正方形 */
  .goods-exhibition-image-container {
    width: 300px !important;
    height: 300px !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: unset !important;
    margin: 0 auto 16px auto !important;
    border-radius: 24px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
    background-color: #fff !important;
  }

  /* 图片铺满容器且裁剪 */
  .goods-exhibition-image-container img.goods-exhibition-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 24px !important;
    display: block !important;
    user-select: none !important;
    max-width: none !important;
    max-height: none !important;
  }

  /* 隐藏箭头 */
  .goods-exhibition-arrow {
    display: none !important;
  }
}
