/*


Theme Name: ALL TERRAIN SHOP
Theme Uri: https://allterrainaction.com/
Author: Christopher Baker
Description: Single merged theme (Astra + Child) optimized and slimmed for All Terrain Action.
Version: 1.0.0
Text Domain: all-terrain-shop
Author URI: https://allterrainaction.com/
*/



/* Child overrides */


/* Base sale badge styling (covers Woo + common theme variants) */
.woocommerce span.onsale,
.woocommerce .onsale,
.woocommerce ul.products li.product .onsale,
.woocommerce div.product .onsale,
.badge-sale,
.product .sale-badge,
.product .badge.badge-sale {
    background: #FDDA0D !important;
    color: #000000 !important;
    display: inline-block !important;
    padding: 5px 10px !important;
    border-radius: 14px !important;
    font-weight: 700 !important;
    text-transform: none !important;
    line-height: 1 !important;
    position: absolute !important;  /* keep badge off edges */
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    margin: 0 !important;
}

/* Hide native badge text so we can inject our own */
.woocommerce .onsale,
.badge-sale,
.product .sale-badge,
.product .badge.badge-sale {
    font-size: 0 !important;
}

/* Replace visible label text */
.woocommerce .onsale::before,
.badge-sale::before,
.product .sale-badge::before,
.product .badge.badge-sale::before {
    content: "On Promotion" !important;
    font-size: 14px !important;
}

/* Some themes put nested nodes inside the badge; hide them */
.woocommerce .onsale * {
    display: none !important;
}

/* Product card layout & styling */
.woocommerce ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08) !important;
    padding: 16px !important;
    background: #fff !important;
    transition: all 0.3s ease-in-out !important;
}

/* Hover effect */
.woocommerce ul.products li.product:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-3px) !important;
}

/* Title: clamp to 3 lines */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
    min-height: 4.5em !important;               /* ~3 lines at 1.5em */
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Make the product link area stretch */
.woocommerce ul.products li.product .woocommerce-loop-product__link {
    flex-grow: 1 !important;
}

/* Group price + button at the bottom */
.woocommerce ul.products li.product .price,
.woocommerce ul.products li.product .button {
    margin-top: auto !important;
}

/* Buttons: alignment, size, and shape */
.woocommerce ul.products li.product .button {
    display: inline-block !important;
    width: 100% !important;
    text-align: center !important;
    border-radius: 8px !important;
    font-size: 12px !important;
}

/* Ensure other grid actions match button font size */
.woocommerce ul.products li.product .added_to_cart,
.woocommerce ul.products li.product .out-of-stock {
    font-size: 12px !important;
}

/* One-line, consistent-height product category label */
.woocommerce ul.products li.product .ast-woo-product-category,
.woocommerce ul.products li.product .woocommerce-loop-product__category,
.woocommerce ul.products li.product .woo-entry-category,
.woocommerce ul.products li.product .posted_in,
.woocommerce ul.products li.product .product_meta .posted_in {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.5 !important;
    min-height: 1.5em !important;               /* exactly one line */
}
