.product-main-wrap {
    margin: 0 auto;
    padding: 0 12px 36px 12px;
    max-width: 1366px;
    padding-top: 65px;
}

.product-title-bar {
    background: linear-gradient(90deg, #b700ff 0%, #a6a1ff 100%);
    color: #fff;
    padding: 32px 24px 18px 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 1.6rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.product-title-bar small {
    display: block;
    font-size: 1.1rem;
    margin-top: 6px;
    opacity: 0.9;
    font-weight: normal;
}

.product-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 20px;
}

/* 左侧按钮组容器 */
.filter-buttons-group {
    display: flex;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.product-filter-btn {
    background: transparent;
    color: #666;
    border: none;
    border-radius: 20px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 100px;
}

.product-filter-btn.active {
    background: #b700ff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(183, 0, 255, 0.3);
}

.product-filter-btn:hover:not(.active) {
    background: rgba(183, 0, 255, 0.1);
    color: #b700ff;
}

/* 右侧控制组容器 */
.filter-controls-group {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 25px;
    padding: 8px 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    gap: 16px;
}

.product-select {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    outline: none;
    appearance: none;
    position: relative;
    min-width: 120px;
}

.product-select:focus {
    color: #333;
}

/* 下拉箭头 */
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #999;
    pointer-events: none;
}

/* 搜索按钮 */
.search-button {
    background: #b700ff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.search-button:hover {
    background: #9500dd;
    transform: scale(1.05);
}

.product-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px 18px;
    margin-bottom: 32px;
}

.product-card.recommend-style {
    border-radius: 26px;
    background: #f5f5f7;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border: none;
}

.product-card.recommend-style .img {
    width: calc(100% + 40px);
    height: 220px;
    margin: -20px -20px 12px;
    border-radius: 26px 26px 0 0;
    overflow: hidden;
    background: #eee;
}

.product-card.recommend-style .teacher-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.product-card.recommend-style .teacher-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-card.recommend-style .teacher-info .avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #eee;
    flex-shrink: 0;
}

.product-card.recommend-style .teacher-info .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card.recommend-style .teacher-info .name {
    font-weight: 600;
    color: #222;
    font-size: 1rem;
}

.product-card.recommend-style .tags {
    display: flex;
    gap: 6px;
}

.product-card.recommend-style .tag-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    background: #e8e8e8;
    white-space: nowrap;
}

.product-card.recommend-style .tag-pill.purple {
    background: #d8b4fe;
    color: #5a00a1;
}

.product-card.recommend-style .tag-pill.blue {
    background: #bae6fd;
    color: #035082;
}

.product-card.recommend-style .title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.4;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card.recommend-style .price-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #666;
}

.product-card.recommend-style .old-price {
    text-decoration: line-through;
    color: #aaa;
}

.product-card.recommend-style .course-hours {
    font-weight: 600;
    color: #444;
}

.product-card.recommend-style .main-price {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ff8c00;
}

.product-card.recommend-style .add-cart-btn {
    width: calc(100% + 40px);
    margin: 8px -20px -20px;
    border-radius: 0 0 26px 26px;
    background: #d8b4fe;
    border: none;
    color: #2e1065;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.product-card.recommend-style .add-cart-btn:hover {
    background: #c084fc;
}

.product-card:not(.recommend-card) {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    margin-bottom: 24px;
}

.product-card:not(.recommend-card):hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card:not(.recommend-card) .img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}

.product-card:not(.recommend-card) .avatar {
    position: absolute;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    left: 16px;
    top: 168px;
    /* 貼近課程圖片底部，參考 member_course 的浮動頭像效果 */
    z-index: 2;
}

.product-card:not(.recommend-card) .teacher {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: bold;
    margin: 48px 16px 8px 16px;
    color: #333;
}

.product-card.textbook-card .teacher {
    margin: 18px 16px 8px 16px;
}

.product-card:not(.recommend-card) .tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin: 0 4px;
    background: #e0e0e0;
    /* color: #666; */
    font-weight: normal;
}

.product-card:not(.recommend-card) .tag.blue {
    background: #4a90e2;
    color: #fff;
}

.product-card:not(.recommend-card) .tag.purple {
    background: #b700ff;
}

.product-card:not(.recommend-card) .tag.green {
    background: #7ed957;
}

.product-card:not(.recommend-card) .title {
    font-size: 1rem;
    font-weight: bold;
    margin: 12px 16px;
    color: #333;
    line-height: 1.4;
}

.product-card:not(.recommend-card) .info {
    font-size: 0.9rem;
    color: #666;
    margin: 8px 16px;
}

.product-card:not(.recommend-card) .price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin: 0 16px;
}

.product-card:not(.recommend-card) .price-new {
    color: #ff6b00;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 8px;
}

.product-card:not(.recommend-card) .add-cart-btn {
    width: calc(100% + 32px);
    margin: 18px -16px 0px -16px;
    padding: 14px 0;
    border: none;
    /* border-radius: 18px; */
    /* background: linear-gradient(90deg, #b700ff 0%, #c24bff 100%); */
    background: rgb(216, 180, 254);
    color: rgb(46, 16, 101);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 20px rgba(183, 0, 255, 0.28);
}

.product-card:not(.recommend-card) .add-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(183, 0, 255, 0.35);
    background: #c084fc;
}

.product-card:not(.recommend-card) .add-cart-btn i {
    margin-right: 0;
    color: #2e1065;
}

/* 推薦課程標題：超過兩行以省略號顯示 */
.product-card:not(.recommend-card) .title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* 限制顯示兩行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-more-bar {
    text-align: center;
    margin: 32px 0 0 0;
}
.price-info{
    height:25.5px;
}

.product-more-btn {
    background: #b700ff;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 48px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.product-more-btn:hover {
    background: #a100e6;
}

/* 分頁（取代「更多」按鈕） */
.product-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 24px 0 0 0;
}

.product-pagination .page-btn,
.product-pagination .page-num {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f1f3f5;
    color: #1d1d1d;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: background .18s ease, transform .18s ease;
}

.product-pagination .page-num.active {
    background: #b700ff;
    color: #fff;
    box-shadow: 0 6px 16px rgba(183, 0, 255, 0.25);
}

.product-pagination .page-btn:hover:not(.disabled),
.product-pagination .page-num:hover:not(.active) {
    background: #e9ecef;
    transform: translateY(-1px);
}

.product-pagination .page-btn.disabled {
    opacity: .45;
    pointer-events: none;
}

.product-pagination .page-ellipsis {
    color: #999;
    font-weight: 700;
    padding: 0 2px;
}

@media (max-width: 900px) {
    .product-list {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .product-card.recommend-style {
        padding: 16px;
        border-radius: 22px;
    }

    .product-card.recommend-style .img {
        width: calc(100% + 32px);
        margin: -16px -16px 10px;
        height: 200px;
        border-radius: 22px 22px 0 0;
    }

    .product-card.recommend-style .add-cart-btn {
        width: calc(100% + 32px);
        margin: 10px -16px -16px;
        border-radius: 0 0 22px 22px;
    }

    .product-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .product-search-bar {
        margin-left: 0;
        margin-top: 8px;
    }

    /* 防止橫向捲動與統一內距 */
    html, body{
        overflow-x: hidden;
    }
    .product-main-wrap{
        padding: 0 8px 24px 8px;
    }

    /* 標題文字縮小 */
    .product-title-bar{
        padding: 95px 16px 14px 16px;
        font-size: 1.25rem;
    }
    .product-title-bar small{
        font-size: .95rem;
    }

    /* 左側切換鈕占滿一行 */
    .filter-buttons-group{
        width: 100%;
        justify-content: space-between;
        overflow: hidden;
    }
    .product-filter-btn{
        padding: 10px 12px;
        min-width: 0;
        font-size: 14px;
        flex: 1 1 auto;
    }

    /* 右側條件控件換行，避免超出螢幕 */
    .filter-controls-group{
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        box-sizing: border-box;
    }
    .select-wrapper{
        flex: 1 1 calc(33.33% - 8px);
        min-width: 0;
    }
    .product-select{
        min-width: 0;
        width: 100%;
        padding: 10px 28px 10px 12px;
        border-radius: 12px;
        background: #f8f9fa;
        box-sizing: border-box;
    }
    .search-button{
        width: 40px;
        height: 40px;
    }

    /* 卡片調整，避免溢出 */
    .product-card:not(.recommend-card) .img{
        height: 180px;
    }
    .product-card:not(.recommend-card) .avatar{
        width: 56px;
        height: 56px;
        left: 12px;
        top: 152px;
    }
    .product-card:not(.recommend-card) .teacher{
        margin: 44px 12px 6px 12px;
        font-size: .95rem;
    }
    .product-card:not(.recommend-card) .title{
        margin: 10px 12px;
        font-size: .95rem;
    }
    .product-card:not(.recommend-card) .info{
        margin: 6px 12px;
        font-size: .9rem;
    }
    .product-card:not(.recommend-card) .price-new{
        font-size: 1.2rem;
    }
    .product-card:not(.recommend-card) .add-cart-btn{
        /* width: calc(100% - 24px);
        margin: 12px; */
        padding: 10px 0;
        font-size: .95rem;
    }
}