/* =========================================
   商品列表頁佈局 (PLP Main Layout)
========================================= */
.plp-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 4rem 6rem;
}

/* 頂部標題區塊 */
.plp-header-banner {
    text-align: center;
    margin-bottom: 4rem;
}
.plp-header-banner .breadcrumbs {
    font-size: 13px;
    color: #888;
    margin-bottom: 1rem;
    justify-content: center;
}
.plp-header-banner .breadcrumbs a {
    color: #555;
    text-decoration: none;
}
.plp-header-banner .breadcrumbs a:hover {
    color: var(--brand-color);
    text-decoration: underline;
}
.plp-header-banner h1 {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    color: var(--text-primary);
}
.plp-header-banner p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* 雙欄排版 (左篩選，右網格) */
.plp-layout {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

/* =========================================
   左側：篩選面板 (Sidebar Filters)
========================================= */
.filter-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 2rem;
    border-bottom: 1px solid #EAEAEA;
    padding-bottom: 1.5rem;
}
.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.filter-title h4 {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.toggle-icon {
    font-size: 18px;
    color: #888;
    transition: transform 0.3s;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /* margin-top 將交由 JS 來控制，這裡先預留即可 */
    margin-top: 1.2rem;
    overflow: hidden;
    /* 將過渡動畫改為 all，讓高度、透明度與外距都能平滑漸變 */
    transition: all 0.3s ease-out;
}

/* 自訂核取方塊 (Custom Checkbox) */
.custom-checkbox {
    display: block;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    user-select: none;
}
.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 1px solid #CCC;
    border-radius: 3px;
    transition: all 0.2s;
}
.custom-checkbox:hover input ~ .checkmark {
    border-color: var(--brand-color);
}
.custom-checkbox input:checked ~ .checkmark {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.custom-checkbox input:checked ~ .checkmark:after {
    display: block;
}
.custom-checkbox .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* =========================================
   右側：商品清單與網格 (Product Grid)
========================================= */
.product-grid-section {
    flex: 1;
}

/* 排序與結果數量列 */
.sort-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #EAEAEA;
}
.results-count {
    font-size: 14px;
    color: var(--text-secondary);
}
.sort-dropdown label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-right: 8px;
}
.sort-dropdown select {
    padding: 8px 12px;
    border: 1px solid #CCC;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

/* PLP 專屬 3 欄網格 */
.plp-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 2rem;
}

/* 覆寫與借用首頁商品卡片樣式 */
.product-card {
    background: transparent;
    box-shadow: none;
}
.product-card .card-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1; 
    overflow: hidden;
    background-color: #F5F5F7;
    position: relative;
    border-radius: 4px;
}
.product-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .card-img img {
    transform: scale(1.08);
}

/* 標籤 (Badge) */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    z-index: 10;
    border-radius: 2px;
    letter-spacing: 1px;
}

.card-info {
    padding: 1.2rem 0;
    text-align: left;
}
.title-link {
    text-decoration: none;
    color: var(--text-primary);
}
.title-link:hover h4 {
    color: var(--brand-color);
}
.card-info h4 {
    font-size: 1.05rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    margin-bottom: 0.4rem;
}
.card-info .price {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}
.old-price {
    text-decoration: line-through;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
    font-size: 0.9rem;
}
.add-to-cart-btn {
    width: 100%;
}

/* =========================================
   分頁導航 (Pagination)
========================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 5rem;
}
.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #DDD;
    background-color: #fff;
    color: var(--text-primary);
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.page-btn:hover {
    border-color: var(--brand-color);
    color: var(--brand-color);
}
.page-btn.active {
    background-color: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
}