/**
 * Product Card Inline Layout
 * Version: 1.0.2
 * Last Updated: 2025-12-10
 *
 * Forces price and add-to-cart button to display inline
 * (price on left, button on right) regardless of column count
 *
 * Target elements:
 * - .wc-block-components-product-price (price)
 * - .wp-block-button (add-to-cart button)
 * - .woocommerce-Price-amount (price styling)
 * - .taxonomy-product_cat (category styling)
 */

/* Make the product card a flex container that allows wrapping */
.products-block-post-template.wp-block-post-template > .wp-block-post {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* Force price to last row, aligned left */
.products-block-post-template.wp-block-post-template > .wp-block-post > .wc-block-components-product-price {
    order: 999 !important;
    flex: 1 1 auto !important;
    text-align: left !important;
    margin: 0 !important;
}

/* Force button to last row, aligned right */
.products-block-post-template.wp-block-post-template > .wp-block-post > .wp-block-button {
    order: 999 !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Override any center alignment from theme */
.products-block-post-template .wc-block-components-product-price.has-text-align-center {
    text-align: left !important;
}

.products-block-post-template .wp-block-button.has-text-align-center {
    text-align: right !important;
}

/* Ensure button content doesn't wrap */
.products-block-post-template .wp-block-button__link {
    white-space: nowrap !important;
}

/* Apply to all column layouts */
.columns-1 .products-block-post-template > .wp-block-post,
.columns-2 .products-block-post-template > .wp-block-post,
.columns-3 .products-block-post-template > .wp-block-post,
.columns-4 .products-block-post-template > .wp-block-post {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* Ensure price and button are on same row for all layouts */
.columns-1 .products-block-post-template .wc-block-components-product-price,
.columns-2 .products-block-post-template .wc-block-components-product-price,
.columns-3 .products-block-post-template .wc-block-components-product-price,
.columns-4 .products-block-post-template .wc-block-components-product-price {
    order: 999 !important;
    flex: 1 1 auto !important;
}

.columns-1 .products-block-post-template .wp-block-button,
.columns-2 .products-block-post-template .wp-block-button,
.columns-3 .products-block-post-template .wp-block-button,
.columns-4 .products-block-post-template .wp-block-button {
    order: 999 !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
}

/* ============================================
 * TYPOGRAPHY & COLOR UPDATES
 * ============================================ */

/* Price amount styling */
.products-block-post-template .woocommerce-Price-amount.amount {
    color: var(--wp--preset--color--gray-100) !important;
    font-weight: 600 !important;
    font-size: 18px !important;
}

/* Product category styling */
.products-block-post-template .taxonomy-product_cat.has-link-color {
    color: var(--wp--preset--color--gray-100) !important;
}

/* Target the specific full class name for category */
.products-block-post-template .taxonomy-product_cat.has-link-color.wp-block-post-terms.has-text-color {
    color: var(--wp--preset--color--gray-100) !important;
}
