/**
 * TT Products grid layout and theme-independent defaults.
 *
 * Elementor controls write the --tt-products-* variables and the colour,
 * typography and spacing overrides; the fallbacks here match the control
 * defaults. Defaults use single-class selectors so the controls always win.
 * The add-to-cart button and stars keep WooCommerce/theme shop styling.
 *
 * @package TT_Flux_Addon
 * @since 1.8.0
 */

/* Grid */
.tt-products__grid {
    display: grid;
    grid-template-columns: repeat(var(--tt-products-columns, 4), minmax(0, 1fr));
    column-gap: var(--tt-products-column-gap, 24px);
    row-gap: var(--tt-products-row-gap, 32px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Card: button sits at the bottom so cards in a row line up. */
.tt-products__item {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Image */
.tt-products__image {
    position: relative;
    display: block;
    margin-bottom: 16px;
    overflow: hidden;
}

.tt-products__image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    transition: transform 0.4s ease;
}

.tt-products--zoom-yes .tt-products__item:is(:hover, :focus-within) .tt-products__image img {
    transform: scale(1.05);
}

/* Sale badge */
.tt-products__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    padding: 4px 10px;
    border-radius: 3px;
    background-color: #1a1a1a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.tt-products--badge-right .tt-products__badge {
    right: 10px;
    left: auto;
}

/* Text */
.tt-products__category {
    margin-bottom: 4px;
    font-size: 0.85em;
    opacity: 0.75;
}

.tt-products__category a {
    color: inherit;
    text-decoration: none;
}

.tt-products__title {
    margin: 0 0 8px;
    padding: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.tt-products__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tt-products__rating {
    margin-bottom: 8px;
}

/* WooCommerce floats the stars right; keep them in the text flow so alignment applies. */
.tt-products .tt-products__rating .star-rating {
    float: none;
    display: inline-block;
    margin: 0;
}

.tt-products__price {
    margin-bottom: 0;
    font-weight: 600;
}

.tt-products__price del {
    margin-right: 6px;
    font-weight: 400;
    opacity: 0.6;
}

.tt-products__price ins {
    text-decoration: none;
}

/* Button */
.tt-products__actions {
    margin-top: auto;
    padding-top: 12px;
}

.tt-products--button-full-yes .tt-products__actions .button {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.tt-products__empty {
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tt-products__item,
    .tt-products__image img,
    .tt-products__title a {
        transition: none;
    }

    .tt-products--zoom-yes .tt-products__item:is(:hover, :focus-within) .tt-products__image img {
        transform: none;
    }
}
