/* Layout */
.hcs-shop-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 30px 15px 60px;
}

.hcs-shop-inner {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 30px;
}

/* Sidebar */
.hcs-sidebar {
    font-size: 13px;
}

.hcs-widget {
    border: none;
    border-bottom: 1px solid #eee;
    padding: 18px 0;
    margin-bottom: 20px;
    background: transparent;
}

.hcs-widget-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px;
    text-transform: uppercase;
}

.hcs-checkbox {
    display: block;
    margin-bottom: 6px;
}

.hcs-checkbox input {
    margin-right: 6px;
}

/* Category list with scrollbar */
.hcs-cat-list-wrapper {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 6px;
}

/* Top rated products */
.hcs-top-rated-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hcs-top-rated-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.hcs-top-rated-item img {
    width: 60px;
    height: auto;
}

.hcs-top-rated-title {
    font-size: 13px;
    display: block;
    margin-bottom: 4px;
}

.hcs-top-rated-price {
    font-weight: 700;
    font-size: 13px;
}

/* Main area */
.hcs-main .woocommerce-products-header__title {
    font-size: 22px;
    margin-bottom: 15px;
}

/* Top bar */
.hcs-shop-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 13px;
    flex-wrap: wrap;
}

.hcs-result-count {
    flex: 1 1 auto;
}

/* Show: 9 / 12 / 18 / 24 */
.hcs-show-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.hcs-show-count span {
    font-weight: 600;
}

.hcs-show-count a {
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid transparent;
    text-decoration: none;
}

.hcs-show-count a.active {
    border-color: #e60023;
    color: #e60023;
}

/* Product grid */
.hcs-main ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
    margin: 0;
}

.hcs-main ul.products::before,
.hcs-main ul.products::after {
    content: none !important;
    display: none !important;
}

/* Product card */
.hcs-main ul.products li.product.hcs-card-item {
    width: auto !important;
    margin: 0 !important;
    float: none !important;
    list-style: none;
}

.hcs-card {
    border-radius: 8px;
    border: 1px solid #eee;
    background: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.hcs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.hcs-thumb-link {
    display: block;
}

.hcs-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Sale / HOT / SOLD OUT badges */
.hcs-badge {
    position: absolute;
    top: 10px;
    padding: 4px 9px;
    font-size: 11px;
    border-radius: 999px;
    color: #fff;
    z-index: 3;
}

.hcs-badge-sale {
    left: 10px;
    background: #e60023;
}

.hcs-badge-hot {
    right: 10px;
    background: #ff4a00;
}

.hcs-badge-out {
    right: 10px;
    top: 40px;
    background: #999;
}

/* Card body */
.hcs-body {
    padding: 12px 16px 16px;
    transition: padding-bottom 0.2s ease;
}

.hcs-card:hover .hcs-body {
    padding-bottom: 52px; /* create space only on hover */
}

.hcs-body .woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.hcs-body .woocommerce-loop-product__title a {
    color: inherit;
    text-decoration: none;
}

.hcs-body .woocommerce-loop-product__title a:hover {
    text-decoration: underline;
}

.hcs-product-category {
    font-size: 11px;
    color: #999;
    margin: 0 0 4px;
}

/* Rating + price */
.hcs-body .star-rating {
    float: none;
    display: inline-block;
    margin-left: 4px;
}

.hcs-body .price {
    display: block;
    margin-top: 4px;
    color: #e60023;
    font-weight: 700;
    font-size: 14px;
}

/* Hover actions bar */
.hcs-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hcs-card:hover .hcs-actions {
    transform: translateY(0);
    opacity: 1;
}

/* Buttons */
.hcs-actions .button {
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 4px;
}

/* Pagination */
.woocommerce nav.woocommerce-pagination ul {
    border: none;
}

.woocommerce nav.woocommerce-pagination ul li {
    border: none;
    margin-right: 4px;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    border: 1px solid #ddd;
    padding: 6px 10px;
    display: block;
    font-size: 12px;
}

.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #e60023;
    color: #fff;
    border-color: #e60023;
}

.hcs-sidebar-backdrop {
    display: none;
}

.hcs-sidebar-close {
    display: none;
}

/* Responsive */
@media (max-width: 992px) {
    .hcs-shop-inner {
        grid-template-columns: 1fr;
    }

    .hcs-main ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hcs-sidebar-toggle {
        border: none;
        background: none;
        padding: 4px 0;
        font-size: 14px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }

    .hcs-icon-menu {
        width: 18px;
        height: 14px;
        position: relative;
    }

    .hcs-icon-menu::before,
    .hcs-icon-menu::after,
    .hcs-icon-menu span {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        height: 2px;
        background: #333;
        border-radius: 999px;
    }

    .hcs-icon-menu::before {
        top: 0;
    }

    .hcs-icon-menu::after {
        bottom: 0;
    }

    .hcs-icon-menu span {
        top: 6px;
    }

    /* Turn .hcs-sidebar into off-canvas panel */
    .hcs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80%;
        max-width: 320px;
        background: #fff;
        padding: 20px 20px 30px;
        overflow-y: auto;
        box-shadow: 4px 0 16px rgba(0,0,0,0.18);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 9999;
    }

    body.hcs-sidebar-open .hcs-sidebar {
        transform: translateX(0);
    }

    .hcs-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 9998;
    }

    body.hcs-sidebar-open .hcs-sidebar-backdrop {
        display: block;
    }

    .hcs-sidebar-close {
        display: flex;
        justify-content: flex-end;
        border: none;
        background: none;
        font-size: 14px;
        margin-bottom: 12px;
        cursor: pointer;
    }
}

@media (max-width: 600px) {
    .hcs-main ul.products {
        grid-template-columns: 1fr;
    }
}


/* Desktop: sidebar toggle hidden, close button hidden */
@media (min-width: 993px) {
    .hcs-sidebar-toggle {
        display: none !important;
    }
    .hcs-sidebar-close {
        display: none !important;
    }
    .hcs-sidebar-backdrop {
        display: none !important;
    }
}

/* Base style for toggle (overridden on mobile) */
.hcs-sidebar-toggle {
    display: none;
}

/* Mobile layout refinements */
@media (max-width: 992px) {

    /* In topbar: show toggle + sorting, hide result count & show count */
    .hcs-sidebar-toggle {
        border: none;
        background: none;
        padding: 4px 0;
        font-size: 14px;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }

    .hcs-result-count,
    .hcs-show-count {
        display: none;
    }

    .hcs-shop-topbar {
        justify-content: space-between;
        align-items: center;
    }

    .hcs-ordering {
        margin-left: auto;
    }

    /* 2 columns for products on all mobile widths */
    .hcs-main ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Remove the 1-column rule so mobile stays 2 columns */
/* (override any previous @media (max-width: 600px) rules) */
@media (max-width: 600px) {
    .hcs-main ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
