/**
 * Theme 7 product cards — shop, category, and homepage grids.
 * Restores native theme7 card styling over shared enhancements and
 * keeps title / SKU / price rows aligned across every breakpoint.
 */

body[class*="theme7-v"] .products-container.grid-view .row {
    margin: 0 -10px;
    row-gap: 20px;
}

body[class*="theme7-v"] .products-container.grid-view .row > .product_item {
    display: flex;
    padding: 0 10px;
    margin-bottom: 0;
}

body[class*="theme7-v"] .products-container.grid-view .product_item .product-card {
    width: 100%;
}

/* Restore theme7 image treatment (storefront-enhancements uses 100% + cover) */
body[class*="theme7-v"] .products-container.grid-view .product_item .product-card-image .img-wrapper {
    padding-top: 90% !important;
    border-radius: 5px;
    background-color: var(--second-color);
    overflow: hidden;
}

body[class*="theme7-v"] .products-container.grid-view .product_item .product-card-image .img-wrapper img,
body[class*="theme7-v"] .products-container.grid-view .product_item .product-card-image .default-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: scale-down !important;
    padding: 10px;
}

/* Quick-view overlay — native top-right slide-in */
body[class*="theme7-v"] .products-container.grid-view .product_item .product-card-image .pro-btn-wrapper {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateX(200%) !important;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

body[class*="theme7-v"] .products-container.grid-view .product_item .product-card:hover .pro-btn-wrapper {
    transform: translateX(0) !important;
    opacity: 1;
    visibility: visible;
}

body[class*="theme7-v"] .products-container.grid-view .product-card-inner .product-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 0 0;
    height: auto;
}

body[class*="theme7-v"] .products-container.grid-view .product-card-inner .product-content .product-content-top {
    flex: 0 0 auto;
    height: auto;
}

body[class*="theme7-v"] .products-container.grid-view .product-card-inner .product-content .product-content-bottom {
    margin-top: auto;
}

/* Equal title rhythm — always reserve two lines */
body[class*="theme7-v"] .products-container.grid-view .product-content-top h3 {
    font: var(--h5);
    margin: 0 0 10px;
    min-height: 2.7em;
}

body[class*="theme7-v"] .products-container.grid-view .product-content-top h3 a {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100% !important;
    width: 100%;
    line-height: 1.35;
    min-height: 2.7em;
    text-overflow: ellipsis;
}

/* SKU row — reserved height even when empty */
body[class*="theme7-v"] .products-container.grid-view .price-wrp > .product-sku {
    display: block;
    min-height: 1.25em;
    margin: 0 0 5px;
    text-transform: capitalize;
    font-weight: 500;
    line-height: 1.25;
    font-size: inherit;
}

body[class*="theme7-v"] .products-container.grid-view .price-wrp > .product-sku--empty {
    visibility: hidden;
}

body[class*="theme7-v"] .products-container.grid-view .cart-btn-wrp {
    gap: 10px;
}

@media (max-width: 991px) {
    body[class*="theme7-v"] .products-container.grid-view .product-content-top h3,
    body[class*="theme7-v"] .products-container.grid-view .product-content-top h3 a {
        min-height: 2.7em;
    }
}

@media (max-width: 575px) {
    body[class*="theme7-v"] .products-container.grid-view .product-card .product-card-inner {
        padding: 10px;
    }

    body[class*="theme7-v"] .products-container.grid-view .product-content-top h3,
    body[class*="theme7-v"] .products-container.grid-view .product-content-top h3 a {
        min-height: 2.7em;
        line-height: 1.35;
    }

    body[class*="theme7-v"] .products-container.grid-view .product-card .pro-btn-wrapper {
        opacity: 1;
        visibility: visible;
        transform: translateX(0) !important;
    }
}

/* Homepage category sections */
body[class*="theme7-v"] .theme7-home-categories {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

body[class*="theme7-v"] .theme7-home-categories .store-home-category {
    max-width: none;
    padding-left: 16px;
    padding-right: 16px;
}

body[class*="theme7-v"] .theme7-home-categories .theme7-home-products {
    padding: 0;
    margin: 0;
}

@media (hover: hover) {
    body[class*="theme7-v"] .theme7-home-categories .product-card .product-card-inner {
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    body[class*="theme7-v"] .theme7-home-categories .product-card:hover .product-card-inner {
        transform: translateY(-4px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    }
}

body[class*="theme7-v"] #product_view .store-home-categories .store-catalog-card {
    display: none;
}
