/* Products Page Specific Styles */

/* Hero section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/hero3.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 200px 0;
    text-align: center;
    margin-bottom: 40px;
}

.products-section {
    padding: 5rem 0;
}

.products-section .card-body {
    padding: 1.5rem;
}

.products-section img {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:root {
        --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        --supermarket-color: #ff6b6b;
        --sports-color: #4ecdc4;
        --school-color: #45b7d1;
        --corporate-color: #96ceb4;
        --promotion-color: #ff9a9e;
        --toy-color: #ffd93d;
        --gift-color: #6bcf7f;
        --mini-color: #ff7eb9;
        --soccer-color: #4ecdc4;
        --basketball-color: #ff6b6b;
        --volleyball-color: #45b7d1;
        --rugby-color: #ffa500;
        --handball-color: #9c27b0;
        --special-color: #96ceb4;
        --accessories-color: #a8e6cf;
        --packaging-color: #dcedc1;
        --custom-color: #b39ddb;
    }

    .section-title {
        text-align: center;
        margin: 3rem 0 2rem;
        position: relative;
    }

    .section-title h2 {
        font-size: 2.5rem;
        color: #333;
        margin-bottom: 1rem;
    }

    .section-title .subtitle {
        color: #666;
        font-size: 1.1rem;
        max-width: 600px;
        margin: 0 auto;
    }

    .category-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
        margin-bottom: 3rem;
    }

    .category-card {
        background: white;
        border-radius: 15px;
        padding: 2rem;
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-top: 5px solid #667eea;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .category-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    }

    .category-card.supermarket { border-top-color: var(--supermarket-color); }
    .category-card.sports_store { border-top-color: var(--sports-color); }
    .category-card.school { border-top-color: var(--school-color); }
    .category-card.corporate { border-top-color: var(--corporate-color); }
    .category-card.promotion { border-top-color: var(--promotion-color); }
    .category-card.toy { border-top-color: var(--toy-color); }
    .category-card.gift { border-top-color: var(--gift-color); }
    .category-card.mini { border-top-color: var(--mini-color); }
    .category-card.soccer { border-top-color: var(--soccer-color); }
    .category-card.basketball { border-top-color: var(--basketball-color); }
    .category-card.volleyball { border-top-color: var(--volleyball-color); }
    .category-card.rugby { border-top-color: var(--rugby-color); }
    .category-card.handball { border-top-color: var(--handball-color); }
    .category-card.special { border-top-color: var(--special-color); }
    .category-card.accessories { border-top-color: var(--accessories-color); }
    .category-card.packaging { border-top-color: var(--packaging-color); }
    .category-card.custom { border-top-color: var(--custom-color); }

     .category-image {
        /* width: 260px; */ /* 移除固定宽度，或根据需要调整 */
        /* height: 100%; */  /* 移除固定高度，或根据需要调整 */
        width: 100%; /* 让图片填满其容器宽度 */
        max-width: 260px; /* 限制图片的最大宽度，例如 200px */
        height: auto; /* 高度自动，保持原始宽高比 */
        /* object-fit: contain; */ /* 如果需要在固定尺寸容器内完整显示，可以使用 contain */
        /* object-fit: cover; */   /* 如果需要填充固定尺寸容器并裁剪，可以使用 cover */

        /* --- 关键：居中图片 --- */
        display: block; /* 将图片变为块级元素 */
        margin-left: auto; /* 自动左边距 */
        margin-right: auto; /* 自动右边距 */
        /* 或者使用 margin: 0 auto; 来同时设置左右自动边距 */
        margin: 0 auto 1.5rem auto; /* 上 右 下 左: 上0, 右左自动(居中), 下1.5rem */

        border-radius: 8px;
        background-color: #f8f9fa;
        padding: 1rem;
    }

    .category-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
        color: #333;
        text-align: center;
        font-weight: 600;
    }

    .category-description {
        color: #666;
        margin-bottom: 1.5rem;
        line-height: 1.6;
        flex-grow: 1;
        text-align: center;
    }

    .category-features {
        margin-bottom: 1.5rem;
        text-align: center; /* Center everything inside */
    }

    .category-features h4 {
        color: #444;
        margin-bottom: 0.75rem;
        font-size: 1.1rem;
    }

    .category-features ul {
        list-style-type: none;
        padding-left: 0;
        margin: 0 auto; /* Center the list */
        display: inline-block; /* Make it respect text-align */
        text-align: left; /* Reset text alignment for list items */
        max-width: 300px; /* Optional: limit width */
    }

    .category-features li {
        padding: 0.3rem 0;
        position: relative;
        padding-left: 1.8rem;
        font-size: 0.95rem;
    }

    .category-features li:before {
        content: "✓";
        color: #4ecdc4;
        position: absolute;
        left: 0;
        font-weight: bold;
        font-size: 1.1rem;
    }

    .btn-primary {
        display: inline-block;
        padding: 0.8rem 1.8rem;
        background: var(--primary-gradient);
        color: white;
        text-decoration: none;
        border-radius: 25px;
        font-weight: 600;
        transition: all 0.3s ease;
        text-align: center;
        border: none;
        cursor: pointer;
        margin-top: auto;
        align-self: center;
        min-width: 140px;
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        color: white;
    }

    .promotion-banner {
        background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
        padding: 3rem 2rem;
        border-radius: 15px;
        text-align: center;
        margin: 3rem 0;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .promotion-banner h2 {
        font-size: 2.2rem;
        color: #333;
        margin-bottom: 1rem;
    }

    .promotion-banner p {
        font-size: 1.1rem;
        color: #555;
        margin-bottom: 2rem;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .section-divider {
        height: 2px;
        background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
        margin: 4rem 0;
        border: none;
    }

    @media (max-width: 768px) {
        .hero-section h1 {
            font-size: 2.2rem;
        }

        .hero-section {
            padding: 2rem 1rem;
        }

        .section-title h2 {
            font-size: 2rem;
        }

        .category-grid {
            grid-template-columns: 1fr;
            gap: 1.5rem;
        }

        .promotion-banner {
            padding: 2rem 1rem;
        }
    }

    /* --- 新增：浮动侧边导航样式 --- */
    .floating-toc {
        position: fixed;
        top: 50%;
        right: 20px; /* 距离右边的距离 */
        transform: translateY(-50%); /* 垂直居中 */
        z-index: 1000; /* 确保在其他元素之上 */
        background-color: rgba(255, 255, 255, 0.9); /* 白色半透明背景 */
        border-radius: 8px; /* 圆角 */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 阴影 */
        padding: 15px 10px; /* 内边距 */
        max-height: 80vh; /* 限制最大高度 */
        overflow-y: auto; /* 超出部分滚动 */
        backdrop-filter: blur(5px); /* 背景模糊效果 (可选，现代浏览器支持) */
        border: 1px solid rgba(0, 0, 0, 0.1); /* 细边框 */
    }

    .toc-title {
        font-size: 1rem; /* 调整标题大小 */
        font-weight: 600; /* 调整标题粗细 */
        color: #495057; /* 设置标题颜色 */
        margin: 0; /* 重置默认 margin */
        padding: 0 10px 10px 10px; /* 添加内边距，底部与列表分开 */
        border-bottom: 1px solid rgba(0, 0, 0, 0.1); /* 添加底部分隔线 */
    }

    .toc-list {
        list-style: none; /* 移除默认列表样式 */
        padding: 0;
        margin: 0;
    }

    .toc-item {
        margin-bottom: 10px; /* 项目间距 */
    }

    .toc-item:last-child {
        margin-bottom: 0; /* 最后一个项目无下边距 */
    }

    .toc-link {
        display: block; /* 使链接占满父元素宽度 */
        padding: 8px 12px; /* 链接内边距 */
        text-decoration: none; /* 移除下划线 */
        color: #495057; /* 链接颜色 */
        border-radius: 5px; /* 链接圆角 */
        transition: all 0.2s ease-in-out; /* 过渡效果 */
        font-size: 0.9rem; /* 字体大小 */
        font-weight: 500; /* 字体粗细 */
    }

    .toc-link:hover,
    .toc-link:focus {
        background-color: #e9ecef; /* 悬停背景色 */
        color: #0d6efd; /* 悬停文字颜色 */
        transform: translateX(3px); /* 悬停时轻微右移 */
    }

    /* 激活状态的链接样式 (可选，需要 JS 实现) */
    .toc-link.active {
        background-color: #0d6efd; /* 激活背景色 */
        color: white; /* 激活文字颜色 */
        font-weight: 600;
    }

    /* 响应式：在小屏幕上隐藏侧边栏 */
    @media (max-width: 991.98px) { /* Bootstrap lg 断点之下 */
        .floating-toc {
            display: none; /* 隐藏 */
        }
    }