/* ==========================================================================
   Product card
   Pushed once from frontend/partials/product_card.blade.php, so it applies
   everywhere the card is used (product list + homepage section). Loads after
   main.css via @stack('style') and overrides it at equal specificity.
   ========================================================================== */

/* 5px was the odd one out; the detail page thumb and the theme's badges are 8px */
.product-card__thumb {
    position: relative;
    border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Sale badge
   Sits over the artwork, so it carries its own shadow to stay legible on any
   screenshot. Not inside the thumb's <a>, so it never scales with the image.
   -------------------------------------------------------------------------- */

.product-card__sale {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 6px;
    background-color: hsl(var(--base));
    color: hsl(var(--white));
    font-family: var(--heading-font);
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 2px 8px hsl(var(--black) / .22);
}

@media screen and (max-width: 575px) {
    .product-card__sale {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: .6875rem;
    }
}

/* struck-through original beside the sale price */
.product-card__price del {
    color: hsl(var(--text-mute));
    font-size: .875rem;
    font-weight: 500;
}

.product-card__rating__count {
    color: hsl(var(--text-mute));
    font-size: .875rem;
}

/* --------------------------------------------------------------------------
   Live preview action
   Deliberately not .btn/.btn--gray: .btn forces white text and 19px padding,
   and .btn--gray rotates its icon 45deg, which fights an external-link glyph.
   Sized to sit level with .product-card__badge (0.75rem/600, 8px radius).
   -------------------------------------------------------------------------- */

.product-card__preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    border: 1px solid hsl(var(--border-color));
    background-color: transparent;
    color: hsl(var(--heading-color));
    font-family: var(--heading-font);
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: .2s ease-in-out;
}

.product-card__preview i {
    font-size: .6875rem;
    color: hsl(var(--text-mute));
    transition: color .2s ease-in-out;
}

.product-card__preview:hover,
.product-card__preview:focus-visible {
    border-color: hsl(var(--base));
    background-color: hsl(var(--base) / .06);
    color: hsl(var(--base));
}

.product-card__preview:hover i,
.product-card__preview:focus-visible i {
    color: hsl(var(--base));
}

@media screen and (max-width: 575px) {
    .product-card__preview {
        padding: 6px 11px;
        font-size: .75rem;
    }
}
