.hx-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 2px;
    overflow: hidden;
    transition:
        transform .28s ease,
        box-shadow .28s ease,
        border-color .28s ease;
}

.hx-product-card:hover {
    transform: translateY(-3px);
    border-color: #d8d8d8;
    box-shadow: 0 14px 35px rgba(0,0,0,.08);
}

.hx-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f3;
}

.hx-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.hx-card-image {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center;
    transition: transform .45s ease;
}

.hx-product-card:hover .hx-card-image {
    transform: scale(1.025);
}

.hx-card-badges {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.hx-card-badge,
.hx-card-discount {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hx-card-badge {
    background: #151515;
    color: #fff;
}

.hx-card-badge.hx-sale,
.hx-card-discount {
    background: #b51f24;
    color: #fff;
}

.hx-card-wishlist {
    position: absolute;
    z-index: 4;
    top: 12px;
    right: 12px;
}

.hx-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 17px 18px 18px;
}

.hx-card-heading-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hx-card-title {
    flex: 1;
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 500;
    color: #161616;
}

.hx-card-title a {
    color: inherit;
    text-decoration: none;
}

.hx-card-spec {
    min-height: 38px;
    margin-top: 8px;
    color: #727272;
    font-size: 13px;
    line-height: 1.45;
}

.hx-card-dot {
    display: inline-block;
    margin: 0 6px;
    color: #aaa;
}

.hx-card-commerce {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 13px;
}

.hx-card-price {
    color: #151515;
    font-size: 15px;
    font-weight: 600;
}

.hx-card-price del {
    color: #999;
    font-size: 12px;
    font-weight: 400;
}

.hx-card-price ins {
    text-decoration: none;
}

.hx-card-rating .star-rating {
    margin: 0;
}

.hx-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid #e8e8e8;
    color: #151515;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .055em;
    text-decoration: none;
    text-transform: uppercase;
}

.hx-card-action span {
    transition: transform .2s ease;
}

.hx-card-action:hover span {
    transform: translateX(4px);
}

@media (max-width: 767px) {

    .hx-card-content {
        padding: 12px 12px 14px;
    }

    .hx-card-title {
        font-size: 14px;
    }

    .hx-card-spec {
        min-height: 34px;
        font-size: 11px;
    }

    .hx-card-price {
        font-size: 13px;
    }

    .hx-card-action {
        font-size: 10px;
    }

    .hx-card-badges {
        top: 9px;
        left: 9px;
    }

    .hx-card-wishlist {
        top: 8px;
        right: 8px;
    }
}

/* M3 visual refinement — premium catalogue sample */
.hx-card-media {
    aspect-ratio: 4 / 3;
}

.hx-card-title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 46px;
    max-height: 46px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.hx-card-spec {
    display: -webkit-box;
    overflow: hidden;
    min-height: 20px;
    max-height: 38px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.hx-card-content {
    padding: 15px 16px 16px;
}

.hx-card-commerce {
    padding-top: 10px;
}

.hx-card-action {
    margin-top: 12px;
    padding-top: 11px;
}

@media (max-width: 767px) {
    .hx-card-media {
        aspect-ratio: 1 / 1;
    }

    .hx-card-title {
        min-height: 38px;
        max-height: 38px;
    }
}

/* HX_M3_MOBILE_POLISH_V1
   Small-mobile catalogue polish only.
*/
@media (max-width: 480px) {

    body.tax-product_cat {
        overflow-x: hidden;
    }

    /* Product grid: one comfortable card per row on narrow phones */
    body.tax-product_cat .elementor-loop-container.elementor-grid,
    body.tax-product_cat .elementor-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        --grid-columns: 1 !important;
    }

    body.tax-product_cat .e-loop-item {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Results / sorting toolbar */
    body.tax-product_cat .woocommerce-result-count {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 0 10px !important;
        white-space: normal !important;
    }

    body.tax-product_cat .woocommerce-ordering {
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 0 0 100% !important;
        margin: 0 0 18px !important;
        text-align: right;
    }

    body.tax-product_cat .woocommerce-ordering__button {
        max-width: 100% !important;
        white-space: nowrap;
    }

    body.tax-product_cat .woocommerce-ordering__button-label {
        max-width: calc(100vw - 40px);
    }

    /* Mobile filter trigger */
    body.tax-product_cat .elementor-element-709f18bb {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 24px !important;
    }

    /* Card text stability */
    body.tax-product_cat .woocommerce-loop-product__title,
    body.tax-product_cat .hx-product-card__title,
    body.tax-product_cat [class*="product-card"] h2,
    body.tax-product_cat [class*="product-card"] h3 {
        display: -webkit-box !important;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.25 !important;
        max-height: 2.5em;
    }

    body.tax-product_cat img {
        max-width: 100%;
    }
}

/* HX_M3_MOBILE_POLISH_V2 */
@media (max-width: 480px) {

    html,
    body {
        max-width: 100%;
        overflow-x: hidden !important;
    }

    /* Main catalogue containers */
    .elementor-1024748,
    .elementor-1024748 .e-con-inner,
    .elementor-1024748 .elementor-widget-container {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Product grid: one card per row on narrow phones */
    .elementor-1024748 .elementor-loop-container.elementor-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        --grid-columns: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .elementor-1024748 .elementor-loop-container > .e-loop-item {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* Results + Sort container */
    .elementor-1024748 .elementor-element-64031025 > .e-con-inner {
        display: flex !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    /* Remove Elementor absolute positioning */
    .elementor-1024748 .elementor-element-2dedcd2e {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 0 10px !important;
    }

    .elementor-1024748 .woocommerce-result-count {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        white-space: normal !important;
    }

    /* Sort gets its own full row */
    .elementor-1024748 .elementor-element-18c4b76b {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin: 0 0 18px !important;
        text-align: right !important;
    }

    .elementor-1024748 .woocommerce-ordering,
    .elementor-1024748 .woocommerce-ordering__button,
    .elementor-1024748 .woocommerce-ordering__button-label {
        width: auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .elementor-1024748 .woocommerce-ordering {
        float: none !important;
        display: flex !important;
        justify-content: flex-end !important;
    }

    /* Premium card */
    .elementor-1024748 .hx-product-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .elementor-1024748 .hx-card-title {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        overflow: hidden !important;
        line-height: 1.3 !important;
        max-height: 2.6em !important;
    }
}
