/**
 * 促销页面样式
 * 左侧分类，右侧促销列表布局
 * 兼容移动端，卡片立体效果
 * 创建时间：2026-02-05
 */

/* ========== 页面布局 ========== */

.promotion-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 30px;
    min-height: 80vh;
}

/* 左侧分类栏 */
.promotion-sidebar {
    width: 280px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.promotion-sidebar h3 {
    color: #2C2C2C;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #C9A96E;
    position: relative;
}

.promotion-sidebar h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #B8860B;
}

/* 分类列表 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: block;
    padding: 12px 16px;
    color: #4A4A4A;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

/* 支持span元素的样式 */
span.category-link {
    cursor: default;
}

.category-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #C9A96E, #B8860B);
    transition: width 0.3s ease;
    z-index: -1;
}

.category-link:hover {
    color: #ffffff;
    transform: translateX(5px);
}

/* 只对链接元素应用悬停效果 */
a.category-link:hover::before {
    width: 100%;
}

/* active状态不应用悬停效果 */
span.category-link:hover {
    transform: none;
}

.category-link.active {
    background: linear-gradient(135deg, #C9A96E, #B8860B);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
}

/* 右侧内容区域 */
.promotion-content {
    flex: 1;
    min-width: 0;
}

.promotion-header {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin-bottom: 30px;
    text-align: center;
}

.promotion-header h1 {
    color: #2C2C2C;
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #B8860B, #C9A96E);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.promotion-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* ========== 促销卡片网格 ========== */

.promotion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 促销卡片样式 */
.promotion-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
}

/* 桌面端隐藏移动端Tab */
.mobile-tabs {
    display: none;
}

.promotion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.05), rgba(184, 134, 11, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.promotion-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
}

.promotion-card:hover::before {
    opacity: 1;
}

/* 卡片图片 */
.promotion-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.promotion-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.promotion-card:hover .promotion-card-image img {
    transform: scale(1.05);
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: block;
    z-index: 1;
}

.video-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 视频播放按钮 - 确保完美居中 */
.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.video-container:hover .video-play-button {
    background: rgba(212, 175, 55, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button svg {
    margin-left: 4px;
}

/* 促销标签 */
.promotion-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    pointer-events: none;
}

/* 卡片内容 */
.promotion-card-content {
    padding: 25px;
    position: relative;
    z-index: 2;
}

.promotion-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 10px;
    line-height: 1.3;
    /* 一行显示，超出显示省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    position: relative;
}

/* 鼠标hover显示完整标题 */
.promotion-card-title:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-top: 5px;
    line-height: 1.4;
}

.promotion-card-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 价格信息 */
.promotion-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 16px;
}

.sale-price {
    color: #B8860B;
    font-size: 20px;
    font-weight: 700;
}

.discount-percent {
    background: linear-gradient(135deg, #C9A96E, #B8860B);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* 卡片按钮 */
.promotion-card-button {
    width: 100%;
    margin: 0 auto;
    display: block;
    background: linear-gradient(135deg, #C9A96E, #B8860B);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-align: center;
}

.promotion-card-button:hover {
    background: linear-gradient(135deg, #B8860B, #A0522D);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

/* ========== 响应式设计 ========== */

/* 平板设备 */
@media screen and (max-width: 1024px) {
    .promotion-container {
        gap: 20px;
        padding: 15px;
    }

    .promotion-sidebar {
        width: 240px;
    }

    .promotion-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* 移动端 */
@media screen and (max-width: 768px) {
    .promotion-container {
        flex-direction: column;
        gap: 20px;
        padding: 10px;
    }

    .promotion-sidebar {
        width: 100%;
        position: static;
        order: 1;
        margin-bottom: 20px;
        padding: 0;
        background: transparent;
        box-shadow: none;
    }

    .promotion-content {
        order: 2;
    }

    .promotion-header {
        padding: 20px;
        margin-bottom: 20px;
    }

    .promotion-header h1 {
        font-size: 24px;
    }

    .promotion-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .promotion-card {
        border-radius: 12px;
    }

    .promotion-card-content {
        padding: 20px;
    }

    .promotion-card-image {
        height: 180px;
    }

    /* 移动端Tab样式 */
    .mobile-tabs {
        display: block;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        margin-bottom: 20px;
        position: relative;
    }

    .mobile-tabs-header {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        background: #f8f9fa;
        padding: 6px;
        scroll-behavior: smooth;
    }

    .mobile-tabs-header::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab-button {
        flex: 0 0 auto;
        padding: 14px 18px;
        background: transparent;
        border: none;
        color: #666;
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.3s ease;
        border-radius: 8px;
        min-width: 100px;
        text-align: center;
        margin: 0 3px;
        position: relative;
        /* 增加触摸区域 */
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        /* 防止文本选择 */
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        /* 改善触摸响应 */
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-tab-button.active {
        color: #B8860B;
        background: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(184, 134, 11, 0.2);
        transform: translateY(-1px);
    }

    .mobile-tab-button:hover:not(.active) {
        color: #C9A96E;
        background: rgba(201, 169, 110, 0.1);
    }

    /* 移动端触摸反馈 */
    .mobile-tab-button:active {
        transform: translateY(0);
        background: rgba(201, 169, 110, 0.2);
    }

    .mobile-tab-button.active:active {
        transform: translateY(-1px) scale(0.98);
    }

    /* 隐藏桌面端分类列表 */
    .promotion-sidebar h3,
    .category-list {
        display: none;
    }

    /* 移动端分类切换按钮移除 */
    .mobile-category-toggle {
        display: none;
    }

    /* Tab指示器动画 */
    .mobile-tab-button::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: #B8860B;
        transition: all 0.3s ease;
        transform: translateX(-50%);
    }

    .mobile-tab-button.active::after {
        width: 80%;
    }
}

/* 小屏手机 */
@media screen and (max-width: 480px) {
    .promotion-container {
        padding: 5px;
    }

    .promotion-header {
        padding: 15px;
    }

    .promotion-header h1 {
        font-size: 20px;
    }

    .promotion-card-content {
        padding: 15px;
    }

    .promotion-card-image {
        height: 160px;
    }

    .promotion-grid {
        gap: 10px;
    }
}

/* ========== 加载动画 ========== */

.promotion-card {
    animation: fadeInUp 0.6s ease-out;
}

.promotion-card:nth-child(2) { animation-delay: 0.1s; }
.promotion-card:nth-child(3) { animation-delay: 0.2s; }
.promotion-card:nth-child(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Tab切换动画 */
@keyframes tabSlideIn {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-tab-button.active {
    animation: tabSlideIn 0.3s ease-out;
}

/* 空状态 */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state-icon {
    font-size: 48px;
    color: #C9A96E;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #2C2C2C;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
    line-height: 1.6;
}

/* ========== 滚动条美化 ========== */

.promotion-sidebar::-webkit-scrollbar {
    width: 6px;
}

.promotion-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.promotion-sidebar::-webkit-scrollbar-thumb {
    background: #C9A96E;
    border-radius: 3px;
}

.promotion-sidebar::-webkit-scrollbar-thumb:hover {
    background: #B8860B;
}
