/* ═══════════════════════════════════════════════════════════════════
   Recently Viewed — card-tag styles (v0.3.74+).

   Before v0.3.74 these rules lived inside quick-view.css, which meant
   the on-card "Recently viewed" hanging tag only rendered with proper
   styling when Quick View was also enabled (because that's when its
   stylesheet was enqueued). The tag markup ships on any page with a
   WC product loop — including the homepage, Elementor product
   widgets, shortcode product lists, and theme product sliders — so
   it needed a stylesheet that loads independently of QV.

   This file is enqueued by class-recently-viewed.php's enqueue_assets()
   method, gated only by:
     - plugin_enabled
     - recently_viewed_indicator_enabled
     - WC available
   matching the brand-badge + custom-badges pattern.

   The QV drawer's "Recently viewed" PILL (sibling of the product
   title in the QV drawer body) remains in quick-view.css because it
   only ever renders inside the QV drawer — no need to ship its
   styles globally.

   Position variants are driven by a body class set in
   class-recently-viewed.php::add_body_class() so customers can pick
   top-left / top-right / top-center / full-width without touching CSS.

   ═══════════════════════════════════════════════════════════════════ */

/* Defensive: if the theme sets overflow:hidden on li.product, override
   so the hanging tag isn't clipped. */
body.iwa-recently-viewed-active li.product,
body.iwa-recently-viewed-active .product {
    overflow: visible !important;
}

.iwa-recently-viewed-card-tag {
    position: absolute;
    /* Anchor to the TOP of the card via bottom:100%. The tag's bottom
       edge then sits flush at the card's top edge by default. The
       --iwa-rv-tag-mb variable adds an optional gap (positive value
       pushes the tag up away from the card) or overlap (negative). */
    bottom: 100%;
    margin-bottom: var(--iwa-rv-tag-mb, 0px);

    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--iwa-rv-tag-pv, 3px) var(--iwa-rv-tag-ph, 10px);
    background: var(--iwa-rv-bg, #14130F);
    color:      var(--iwa-rv-fg, #FFFFFF);
    border-radius: 6px 6px 0 0;  /* only top corners rounded */
    font-size: var(--iwa-rv-tag-fs, 11px);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.02em;
    white-space: nowrap;
    z-index: 4;  /* below QV trigger (z-index 5) so they don't fight */
    pointer-events: none;  /* don't intercept clicks on the card */
}
.iwa-recently-viewed-card-tag svg { flex: 0 0 auto; }
.iwa-recently-viewed-card-tag__label { display: inline; }

/* Position variants — driven by body class */
body.iwa-rv-card-pos-top-left   li.product .iwa-recently-viewed-card-tag,
body.iwa-rv-card-pos-top-left   .product   .iwa-recently-viewed-card-tag {
    left: 10px;
    right: auto;
}
body.iwa-rv-card-pos-top-right  li.product .iwa-recently-viewed-card-tag,
body.iwa-rv-card-pos-top-right  .product   .iwa-recently-viewed-card-tag {
    right: 10px;
    left: auto;
}
body.iwa-rv-card-pos-top-center li.product .iwa-recently-viewed-card-tag,
body.iwa-rv-card-pos-top-center .product   .iwa-recently-viewed-card-tag {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
/* Full width — spans the entire top edge */
body.iwa-rv-card-pos-full-width li.product .iwa-recently-viewed-card-tag,
body.iwa-rv-card-pos-full-width .product   .iwa-recently-viewed-card-tag {
    left: 0;
    right: 0;
    text-align: center;
    justify-content: center;
    border-radius: 6px 6px 0 0;
}
