/* Catalogue, related products, product secondary actions and cart. */
/* Subtle catalogue colours. Keep existing card dimensions and positioning. */
body.tt-modern #main ul.products li.product {
    background: #ffffff !important;
    border-color: #dce4e8 !important;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(16, 45, 66, 0.04);
    transition: box-shadow 0.2s ease;
}

body.tt-modern #main ul.products li.product .woocommerce-loop-product__title,
body.tt-modern #main ul.products li.product .woocommerce-loop-category__title {
    background: #ffffff !important;
    color: #102d42 !important;
    border-color: transparent !important;
    font-weight: 600;
}

body.tt-modern #main ul.products li.product .price {
    background: #f1f4f5 !important;
    color: #374b59 !important;
    border-color: transparent !important;
}

body.tt-modern #main ul.products li.product .price * {
    color: inherit !important;
}

body.tt-modern #main ul.products li.product a.button {
    background: #237e2b !important;
    color: #ffffff !important;
    border-color: transparent !important;
    border-radius: 4px;
}

body.tt-modern #main ul.products li.product a.button:hover,
body.tt-modern #main ul.products li.product a.button:focus-visible {
    background: #1b6422 !important;
    color: #ffffff !important;
}

@media (hover: hover) {
    body.tt-modern #main ul.products li.product:hover {
        transform: none !important;
        box-shadow: 0 7px 20px rgba(16, 45, 66, 0.09);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.tt-modern #main ul.products li.product {
        transition: none;
    }
}

/* Shared card controls; position is supplied once by the flow layout below. */
body.tt-modern #main ul.products li.product a.button {
    height: 44px;
    min-height: 42px;
    padding: 10px 14px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px !important;
    box-sizing: border-box;
}
/* Let each product card fit its contents */
body.tt-modern #page #main ul.products li.type-product {
    height: auto !important;
    padding: 0 !important;
    overflow: hidden;
}

/* Stack title, picture and price */
body.tt-modern #page #main ul.products li.type-product
a.woocommerce-loop-product__link {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
}

/* Keep the title above the picture */
body.tt-modern #page #main ul.products li.type-product
.woocommerce-loop-product__title {
    position: static !important;
    order: -1;
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
}

/* Remove the old image offsets */
body.tt-modern #page #main ul.products li.type-product
img.attachment-woocommerce_thumbnail {
    position: static !important;
    transform: none !important;
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
}

/* 10px between picture and price */
body.tt-modern #page #main ul.products li.type-product .price {
    position: static !important;
    width: 100% !important;
    margin: 10px 0 0 !important;
    padding: 10px !important;
}

/* 10px between price and button */
body.tt-modern #page #main ul.products li.type-product a.button {
    position: static !important;
    width: calc(100% - 20px) !important;
    margin: 10px !important;
}
/* Wishlist: left half */
body.tt-modern.single-product .summary > .yith-wcwl-add-to-wishlist {
    float: left !important;
    width: calc(50% - 6px) !important;
    margin: 0 0 16px !important;
    padding: 0;
}

/* Compare: right half */
body.tt-modern.single-product .summary > a.compare.button {
    float: right !important;
    clear: none !important;
    width: calc(50% - 6px) !important;
    margin: 0 0 16px !important;
}

/* Matching appearance */
body.tt-modern.single-product .summary .yith-wcwl-add-to-wishlist a,
body.tt-modern.single-product .summary > a.compare.button {
    position: static !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 52px;
    padding: 8px 10px !important;
    background: #fff !important;
    color: #102d42 !important;
    border: 1px solid #dce4e8 !important;
    border-radius: 6px !important;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transform: none !important;
}

body.tt-modern.single-product .summary .add_to_wishlist {
    width: 100% !important;
}

body.tt-modern.single-product .summary .add_to_wishlist svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Keep product information below both buttons */
body.tt-modern.single-product .summary .product_meta {
    clear: both;
    padding-top: 8px;
}
/* Keep the admin Edit link below both buttons */
body.tt-modern.single-product .summary .edit-link,
body.tt-modern.single-product .summary a.post-edit-link {
    display: block !important;
    clear: both !important;
    width: 100%;
}

/* Contain the side-by-side buttons */
body.tt-modern.single-product .summary::after {
    content: "";
    display: table;
    clear: both;
}

/* Breadcrumb-to-grid spacing and correctly aligned cart thumbnails. */
body.tt-modern #main.site-main ul.products { margin-top: 0 !important; }
body.tt-modern.woocommerce-cart td.product-thumbnail img {
    position: static !important;
    top: auto !important;
    transform: none !important;
    display: block;
    width: 70px;
    height: auto;
    margin: 0 auto !important;
}
body.tt-modern.woocommerce-cart .cart_item td { vertical-align: middle; }
