/* Archive Page Container */
.woocommerce-products-header {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem 8px;
    text-align: center;
}

/* Page Title */
.woocommerce-products-header__title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    position: relative;
}

.woocommerce-products-header__title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #333;
}

/* Subcategories Section - Hidden on archive pages */
.subcategories-section,
.woocommerce-loop-product__category,
.product-category,
.woocommerce ul.products li.product-category {
    display: none !important;
}

.subcategories-title {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
    font-style: italic;
}

.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    background: #fff;
}

.category-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-card img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: contain;
    background: #f8f8f8;
}

.woocommerce-loop-category__title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
}

/* Filter System */
.woocommerce-filter {
    max-width: 1440px;
    margin: 2rem auto;
    padding: 1.5rem 8px;
    background: #f8f8f8;
    border-radius: 2px;
}

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

.filter-title {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

.filter-toggle {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.filter-toggle:hover {
    color: #333;
}

.filter-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked {
    background: #333;
    border-color: #333;
}

.filter-checkbox label {
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
}

.filter-price-range {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filter-price-range input[type="number"] {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.filter-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.filter-button.apply {
    background: #333;
    color: #fff;
}

.filter-button.reset {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.filter-button:hover {
    opacity: 0.9;
}

/* Custom Ordering */
.custom-ordering {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 8px;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 769px) {
    .custom-ordering {
        margin-top: 2rem;
    }
}

.ordering-form {
    display: flex;
    justify-content: flex-end;
}

.orderby {
    padding: 0.5rem 2rem 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1em;
}

.orderby:focus {
    outline: none;
    border-color: #333;
}

/* Pagination */
.woocommerce-pagination {
    max-width: 1440px;
    margin: 3rem auto;
    padding: 0 8px;
    text-align: center;
    width: 100%;
}

.page-numbers {
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    width: auto;
    max-width: 100%;
}

.page-numbers li {
    margin: 0;
}

.page-numbers a,
.page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 6px;
    background: transparent;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.page-numbers a:hover {
    background: #f5f5f5;
    color: #333;
}

.page-numbers .current {
    background: #333;
    color: #fff;
}

.page-numbers .prev,
.page-numbers .next {
    font-size: 0.9rem;
    padding: 0 1.25rem;
    position: relative;
}

.page-numbers .prev::before,
.page-numbers .next::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
}

.page-numbers .prev::before {
    transform: rotate(-135deg);
}

.page-numbers .next::after {
    transform: rotate(45deg);
}

.page-numbers .prev:hover::before,
.page-numbers .next:hover::after {
    border-color: #333;
}

.page-numbers .dots {
    color: #999;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .woocommerce-pagination {
        margin: 2.5rem auto;
    }

    .page-numbers {
        gap: 0.4rem;
        padding: 0.4rem;
    }

    .page-numbers a,
    .page-numbers span {
        min-width: 38px;
        height: 38px;
        font-size: 0.92rem;
    }
}

@media (max-width: 768px) {

    .filter-actions {
        flex-direction: row;
    }

    .woocommerce-pagination {
        margin: 2rem auto;
        padding: 0 12px;
    }

    .page-numbers {
        padding: 0.35rem;
        gap: 0.35rem;
        width: 100%;
        max-width: 400px;
    }

    .page-numbers a,
    .page-numbers span {
        min-width: 35px;
        height: 35px;
        font-size: 0.9rem;
        padding: 0 0.5rem;
    }

    .page-numbers .prev,
    .page-numbers .next {
        padding: 0 0.75rem;
    }

    .page-numbers .prev::before,
    .page-numbers .next::after {
        width: 5px;
        height: 5px;
        margin: 0 0.35rem;
    }
}

@media (max-width: 480px) {
    .woocommerce-pagination {
        margin: 1.5rem auto;
        padding: 0 8px;
    }

    .page-numbers {
        padding: 0.25rem;
        gap: 0.25rem;
        max-width: 320px;
    }

    .page-numbers a,
    .page-numbers span {
        min-width: 32px;
        height: 32px;
        font-size: 0.85rem;
        padding: 0 0.4rem;
    }

    .page-numbers .prev,
    .page-numbers .next {
        padding: 0 0.6rem;
        font-size: 0.85rem;
    }

    .page-numbers .prev::before,
    .page-numbers .next::after {
        width: 4px;
        height: 4px;
        margin: 0 0.25rem;
    }

    /* Hide some page numbers on very small screens */
    .page-numbers li:not(.prev):not(.next):not(.current):not(:first-child):not(:last-child) {
        display: none;
    }

    /* Always show first and last page numbers */
    .page-numbers li:first-child,
    .page-numbers li:last-child {
        display: flex;
    }
}

@media (max-width: 360px) {
    .page-numbers {
        max-width: 280px;
    }

    .page-numbers a,
    .page-numbers span {
        min-width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .woocommerce-products-header {
        padding: 1.5rem 1rem;
    }

    .woocommerce-products-header__title {
        font-size: 1.5rem;
    }

    .subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .category-card img {
        height: 150px;
    }

    .filter-content {
        grid-template-columns: 1fr;
    }

    .ordering-form {
        justify-content: flex-start;
    }
    
    .orderby {
        width: 100%;
        max-width: 300px;
    }
} 