/* Products Page Specific Styles */
.products-page {
    background: var(--off-white);
}

.products-page-content {
    margin-top: 80px;
}

.products-hero {
    padding: 4rem 0;
    background: url('../images/banner/products-banner.webp') no-repeat scroll center / cover;
}

.products-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.products-hero-inner:hover .product-hero-subtitle {
    color: var(--primary-blue) !important;
}

.products-hero-inner h1 {
    font-size: 2.75rem;
    color: var(--primary-blue);
    font-weight: 700;
}

.product-hero-subtitle {
    font-size: 1.1rem;
    color: var(--primary-blue);
    line-height: 1.8;
    transition: all 0.3s ease;
}

.product-hero-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-weight: 600;
    color: var(--primary-blue);
}

.product-search-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.product-search-controls select,
.product-search-controls input {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    min-width: 220px;
    font-size: 0.95rem;
    background: var(--white);
}

.product-search-controls input {
    min-width: 280px;
}

.product-search-controls button {
    padding: 0.9rem 1.75rem;
    border-radius: 12px;
    border: none;
    background: var(--secondary-blue);
    color: var(--white);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-search-controls button:hover {
    background: var(--primary-blue);
}


.products-content {
    padding: 2rem 0;
}

.products-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.products-sidebar {
    position: sticky;
    top: 120px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-blue);
}

.filter-reset {
    border: none;
    background: transparent;
    color: var(--secondary-blue);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.filter-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 1.25rem;
}

.filter-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.filter-section h4 {
    font-size: 1rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-section a{
    text-decoration: none;
    color: var(--primary-blue);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-gray);
}
.filter-option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Subcategory toggle badge */
.sub-toggle {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--secondary-blue);
    background: var(--white);
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-toggle::before,
.sub-toggle::after {
    content: '';
    position: absolute;
    background: var(--secondary-blue);
    transition: transform 0.25s ease;
}

.sub-toggle::before {
    width: 10px;
    height: 2px;
}

.sub-toggle::after {
    width: 2px;
    height: 10px;
}

.sub-toggle.open::after {
    transform: rotate(90deg);
}

.sub-toggle:hover {
    background: var(--secondary-blue);
}

.sub-toggle:hover::before,
.sub-toggle:hover::after {
    background: var(--white);
}

/* Subcategory list */
.sub-categories {
    display: none;
    padding-left: 1.25rem;
    border-left: 2px solid var(--border-color);
    margin-left: 0.5rem;
    flex-direction: column;
    gap: 0.5rem;
}

.sub-categories.open {
    display: flex;
}

.sub-category {
    padding-left: 0.25rem;
}

.sub-category a {
    font-size: 0.9rem;
    opacity: 0.85;
}

.sub-category a:hover {
    opacity: 1;
}
.filter-option label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.filter-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.filter-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--primary-blue);
    background: var(--white);
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.results-count {
    font-weight: 600;
    color: var(--primary-blue);
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.toolbar-actions select {
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--white);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-toggle button {
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-gray);
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle button.active,
.view-toggle button:hover {
    border-color: var(--secondary-blue);
    color: var(--secondary-blue);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    transition: opacity 0.5s ease;
}

.product-grid.is-fading {
    opacity: 0;
}

.product-grid.list-view {
    display: flex;
    flex-direction: column;
}

.product-grid.list-view .product-list-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
}

.product-grid.list-view .product-card-image {
    flex-shrink: 0;
    width: 200px;
    margin-bottom: 0;
}

.product-grid.list-view .product-card-image a {
    padding-bottom: 75%;
}

.product-list-card {
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    background: var(--white);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-list-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.product-card-image {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.product-card-image a {
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 75%; /* 4:3 比例 */
    position: relative;
    overflow: hidden;
}

.product-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-list-card:hover .product-thumbnail {
    transform: scale(1.05);
}

.product-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    word-break: break-all;
}

.product-card-header h3 {
    font-size: 1.4rem;
    color: var(--primary-blue);
    font-weight: 400;
}

.product-card-header p {
    color: var(--text-gray);
    line-height: 1.6;
}


.product-card-tags{
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0.5rem;
}
.product-card-tags li{
    background: var(--off-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.85rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.product-card-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.product-card-meta div {
    background: var(--off-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.85rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.page-btn {
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--secondary-blue);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.page-btn:hover {
    border-color: var(--secondary-blue);
    color: var(--secondary-blue);
}

.page-btn.active {
    background: var(--secondary-blue);
    color: var(--white);
    border-color: var(--secondary-blue);
    box-shadow: var(--shadow-sm);
}

.page-ellipsis {
    color: var(--text-gray);
    padding: 0 0.35rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-layout {
        grid-template-columns: 260px 1fr;
        gap: 1.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .products-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .products-hero {
        padding: 2rem 1rem;
    }

    .products-hero-inner {
        padding: 2rem 1.5rem;
    }

    .product-hero-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .product-search-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .product-search-controls select,
    .product-search-controls input,
    .product-search-controls button {
        width: 100%;
        min-width: auto;
    }

    .products-layout {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .products-sidebar {
        position: static;
        padding: 1.5rem;
    }

    .products-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-grid.list-view .product-list-card {
        flex-direction: column;
    }

    .product-grid.list-view .product-card-image {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .products-hero-inner h1 {
        font-size: 2rem;
    }

    .product-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}