/* Archive container and main layout */
.archive-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 30px 0;
}

body.tax-machine_categories > .site-main {
    max-width: unset;
}

.archive .site-main {
    padding: 30px 0;
}

.machine-list-wrapper article {
    background: white;
    border-radius: 10px;
	height: fit-content;
    width: calc(33% - 6px );
}

.archive .content-area {
    background-color: #f7f7f7;
}

body.tax-machine_categories div .site-main {
    max-width: 1280px;
    padding: 0 20px;
    margin: 0 auto;
}

.machine-categories-list .category-item  {
    width: 100%;
    border-radius: 0;
}



.machine-sidebar-wrapper {
    max-width: 400px;
    height: fit-content;
    width: calc(25% - 20px);
    background: white;
}

.machine-list-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 40px;
    width: calc(75% - 40px);
    min-width: 0;
}

/* Sidebar */
.machine-sidebar-wrapper h2 {
    font-size: 14px;
    margin: 0;
    padding: 12px 8px;
    color: #ffffff;
    background: #D85658;
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
}

.machine-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}


.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Montserrat, sans-serif;
    font-size: 1em;
    font-weight: 500;
    text-decoration: none;
    color: #333333;
    padding: 8px;
    transition: all 0.3s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 10px 50px;

}

.category-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.4s ease;
}

.category-link:hover::before {
    left: 100%;
}

.category-link:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #0088cc, #0073aa);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.category-link.active {
    background: linear-gradient(135deg, #D85658, #b94446);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(0);
}

.toggle-icon {
    font-size: 1.1em;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.category-link.active .toggle-icon {
    transform: rotate(180deg);
}

/* Subcategories */
.sub-list {
    max-height: 0;
    overflow: hidden;
    padding-left: 20px;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, visibility 0.4s ease;
}

.sub-list.active {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
}

.sub-list .machine-categories-list {
    display: none;
}

.sub-list.active .machine-categories-list {
    display: block;
}

.sub-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Inter, sans-serif;
    font-size: 0.95em;
    font-weight: 500;
    text-decoration: none;
    color: #ffffff;
    background: #555;
    padding: 10px 14px;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.sub-category-link:hover {
    background: #666;
    transform: translateX(4px);
}

.sub-category-link.active {
    background: #D85658;
    color: #ffffff;
}

/* Main content product list */
.tax-machine_categories .machine-item {
    width: calc(33% - 6px);
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 0;
    background: #fff;
    border-radius: 20px;
    box-shadow: rgba(17, 12, 46, 0.15) 0px 48px 100px 0px;
}


.machine-thumbnail {
	position: relative;
}

.tax-secondhand_machine_categories .machine-thumbnail img {
    width: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    box-sizing: border-box;
    padding: 0;
    height: 200px;
}

.machine-thumbnail img {
    width: 100%;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-sizing: border-box;
}

.machine-content {
    padding: 0 20px 8px 20px;
}

.machine-content .entry-title {
    padding: 10px 0;
    border-bottom: 1px solid #e7e7e7;
    font-family: Montserrat;
    font-weight: 500;
    margin: 0;
    line-height: 1;
}

.machine-list-wrapper .page-header {
    width: 100%;
}

.machine-list-wrapper .page-header h1 {
    padding: 0;
    margin: 0;
}

.machine-list-wrapper .entry-title a {
    font-family: Poppins, sans-serif;
    font-size: 16px;
    line-height: 1;
    color: #333333;
    text-decoration: none;
    font-weight: bold;
}

article.machine-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.entry-summary p {
    font-size: 14px;
    color: #333333;
    font-family: Inter, sans-serif;
}

.machine-button-wrapper {
    display: flex;
    margin-top: 20px;
}

.machine-button {
    align-items: center;
    background-color: #fee6e3;
    border: 2px solid #111;
    border-radius: 8px;
    box-sizing: border-box;
    color: #111;
    cursor: pointer;
    display: flex;
    font-family: Inter, sans-serif;
    font-size: 16px;
    height: 48px;
    justify-content: center;
    line-height: 24px;
    max-width: 100%;
    padding: 0 25px;
    position: relative;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.machine-button:after {
    background-color: #111;
    border-radius: 8px;
    content: "";
    display: block;
    height: 48px;
    left: 0;
    width: 100%;
    position: absolute;
    top: -2px;
    transform: translate(8px, 8px);
    transition: transform .2s ease-out;
    z-index: -1;
}

.machine-button:hover:after {
    transform: translate(0, 0);
}

.machine-button:active {
    background-color: #ffdeda;
    outline: 0;
}

.machine-button:hover {
    outline: 0;
}

.machine-situtaion {
    padding: 8px 30px;
    font-size: 30px;
    font-weight: bold;
    position: absolute;
    top: 19px;
    left: -20px;
    background: #D85658;
    color: white;
    rotate: -45deg;
}

.machine-situtaion p {
    margin: 0;
}

.pagination-wrapper {
    margin-top: 30px;
    text-align: center;
    clear: both;
    width: 100%;
}

.pagination-wrapper .pagination {
    justify-content: center;
}


.pagination-wrapper .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 4px;
    background: #f1f1f1;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.pagination-wrapper .page-numbers.current {
    background: #D85658;
    color: white;
}

.pagination-wrapper .page-numbers:hover:not(.current) {
    background: #ddd;
}


@media (max-width: 1200px) {
    .machine-list-wrapper article {
     
        width: calc(50% - 10px );
    }

       .machine-list-wrapper {
        width: 68%;
    }

    .machine-sidebar-wrapper {
        width: 30%;
    }

    .archive-container {
        gap: 10px;
    }

    .archive .site-main {
        max-width: unset;
        padding: 0 20px;
    }

}

@media (max-width: 1024px) {
    .machine-list-wrapper .entry-title a {
        font-size: 14px;
    }

    
}

/* Responsive */
@media (max-width: 768px) {

    .machine-list-wrapper .machine-item {
        width: 100%;
    }

    .archive-container {
        flex-direction: column;
    }

    .machine-list-wrapper {
        width: 100%;
    }

    .machine-sidebar-wrapper {
        width: 100%;
        max-width: unset;
    }

}

@media (max-width: 576px) {
    .machine-list-wrapper .machine-item {
        width: 100%;
    }

    .pagination-wrapper .page-numbers {
        display: inline-block;
        padding: 8px 8px;
        margin: 0 4px;
        background: #f1f1f1;
        color: #333;
        text-decoration: none;
        border-radius: 4px;
        font-size: 12px;
    }
}