/**
 * TI WooCommerce Wishlist - button normalisation
 *
 * One source of truth for taming the plugin's loop button, shared by every
 * card that renders one: the Trending Now carousel (.medlife-card), and the
 * shop archive, related products and cross-sells (.ml-card).
 *
 * ---------------------------------------------------------------------------
 * What the plugin actually outputs, per button:
 *
 *   <div class="tinv-wraper …">
 *     <div class="tinv-wishlist-clear"></div>
 *     <a class="tinvwl_add_to_wishlist_button tinvwl-icon-heart …"
 *        aria-label="Add to Wishlist">
 *       <span class="tinvwl_add_to_wishlist-text">Add to Wishlist</span>
 *     </a>
 *     <div class="tinv-wishlist-clear"></div>
 *     <div class="tinvwl-tooltip">Add to Wishlist</div>
 *   </div>
 *
 * Four things the card CSS never accounted for: the `.tinv-wraper` div sitting
 * between our flex item and the button, two clearfix divs, a tooltip div
 * carrying the same text again, and the label itself.
 *
 * The label was being targeted as `.tinvwl-txt`, which does not appear in this
 * plugin's output at all - 0 occurrences on a rendered page against 12 for the
 * real class. So the label was never hidden: it forced the 42px button wider
 * than its slot, pushed it out of the card and over the Add to cart button,
 * and wrapped onto a second line.
 * ---------------------------------------------------------------------------
 */

/* -------------------------------------------------------------------------
 * The wrapper the plugin injects
 * ---------------------------------------------------------------------- */

.medlife-card__wishlist .tinv-wraper,
.ml-card__wishlist .tinv-wraper,
.ml-product__wishlist .tinv-wraper {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
	line-height: 0;
}

/* Clearfix helpers - they only add height inside a flex row. */
.medlife-card__wishlist .tinv-wishlist-clear,
.ml-card__wishlist .tinv-wishlist-clear,
.ml-product__wishlist .tinv-wishlist-clear {
	display: none;
}

/*
 * The plugin's own tooltip is a block element repeating the button's text.
 * The accessible name lives on the anchor's aria-label, which the plugin keeps
 * in sync, so nothing is lost by removing it - and it cannot then push the
 * card's layout around.
 */
.medlife-card__wishlist .tinvwl-tooltip,
.ml-card__wishlist .tinvwl-tooltip,
.ml-product__wishlist .tinvwl-tooltip {
	display: none;
}

/* -------------------------------------------------------------------------
 * Card buttons: icon only
 *
 * The label is visually hidden rather than removed. The plugin rewrites it
 * ("Add to Wishlist" becomes "Browse Wishlist" once added) and screen reader
 * users should still get that change; `display: none` would silence it.
 * ---------------------------------------------------------------------- */

.medlife-card__wishlist .tinvwl_add_to_wishlist-text,
.ml-card__wishlist .tinvwl_add_to_wishlist-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * The heart is a pseudo-element on the anchor, so it survives the label being
 * hidden. Centred explicitly because the plugin's own positioning classes
 * (tinvwl-position-after) assume there is text to sit beside.
 */
.medlife-card__wishlist .tinvwl_add_to_wishlist_button,
.ml-card__wishlist .tinvwl_add_to_wishlist_button {
	position: relative;
	flex: 0 0 auto;
	box-sizing: border-box;
	white-space: nowrap;
	overflow: hidden;
}

/*
 * The glyph ships with `margin-right: 5px` - spacing for the label that is now
 * hidden - which would sit the heart off-centre in a square button.
 *
 * The plugin's own selector is three classes deep
 * (`.tinv-wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart:before`),
 * so `.tinvwl-icon-heart` is repeated here to match it rather than losing on
 * specificity. Both heart variants are covered: the icon changes to
 * `tinvwl-icon-heart-plus` in some plugin configurations.
 */
.medlife-card__wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart::before,
.medlife-card__wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart-plus::before,
.ml-card__wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart::before,
.ml-card__wishlist .tinvwl_add_to_wishlist_button.tinvwl-icon-heart-plus::before {
	margin: 0;
	line-height: 1;
	vertical-align: baseline;
}

/* -------------------------------------------------------------------------
 * Single product page: the label stays
 *
 * That button is a full-width labelled control, not a card icon, so only the
 * structural noise above is removed from it.
 * ---------------------------------------------------------------------- */

.ml-product__wishlist .tinvwl_add_to_wishlist-text {
	line-height: 1.2;
}

/*
 * POINTER FOCUS - ASTRA a:focus { outline: thin dotted } (main.min.css L3).
 * A mouse click leaves :focus set, so every anchor that names no outline of its
 * own kept a thin dotted ring until focus moved. Measured 2026-09-13 by the
 * sitewide anchor sweep (CLAUDE.md, "Anchor pointer-focus sweep").
 *
 * :not(:focus-visible) IS LOAD-BEARING: this only ever applies to pointer focus,
 * so the keyboard ring each family already has is untouched. Outline only -
 * nothing moves, so there is no reduced-motion twin.
 */
a.tinvwl_add_to_wishlist_button:focus:not(:focus-visible) {
	outline: none;
}

/*
 * KEYBOARD RINGS - 2026-09-14. These families had NO focus ring of their own:
 * keyboard focus showed only Astra's a:focus-visible 1px dotted in the text
 * colour, or nothing at all where a theme rule said outline: none. Measured by
 * the sitewide anchor sweep (CLAUDE.md, "Keyboard ring pass").
 *
 * Light surface: 3px --ml-cyan offset 3px. Navy surface: 2px. border-radius is
 * RESTATED on every ring - a rule wins only the properties it names, and a
 * shared focus rule has squared a round control on this site before. Text links
 * take 4px corners; boxed controls keep their own radius.
 *
 * The pointer pin (:focus:not(:focus-visible)) above is untouched - the two
 * selectors can never match the same state. Contrast: cyan on white 2.50:1 is
 * the owner's recorded decision (CLAUDE.md, "THE FOCUS-RING RULE").
 */
a.tinvwl_add_to_wishlist_button:focus-visible {
	outline: 3px solid var(--ml-cyan);
	outline-offset: 3px;
	border-radius: 50%;
}

/* =========================================================================
 * THE WISHLIST PAGE - /wishlist/ (page 48), added 2026-09-18
 *
 * page-wishlist.php renders the policy shell's header band with
 * `layout => app`, so the body sits in .ml-policy__app rather than the prose
 * column. TI's list is re-templated by woocommerce/ti-wishlist.php (the shop
 * card grid) and ti-wishlist-empty.php (the empty state). The cards
 * themselves are styled by shop.css, which this page enqueues - nothing here
 * restyles a card, it only places them and adds the Remove button.
 * ========================================================================= */

.ml-policy__app {
	min-width: 0;
}

/*
 * 1064px is the shop grid's own width at 1440 (three 341px cards) - the same
 * cap the related-products strip uses, so a saved product is the same size
 * here as where it was saved.
 */
.ml-policy__app .ml-wishlist {
	max-width: 1064px;
	/* Left edge shared with the band's h1 - centring it indented the grid. */
	margin: 0;
}

/*
 * (0,4,1): Astra's `.woocommerce ul.products:not(.elementor-grid)` column
 * rules are (0,3,1) at every breakpoint - `:not()` counts its argument.
 */
.ml-policy .ml-wishlist ul.products.ml-wishlist__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-policy .ml-wishlist ul.products.ml-wishlist__grid::before,
.ml-policy .ml-wishlist ul.products.ml-wishlist__grid::after {
	display: none;
}

/* The card's own actions row carries margin-top: auto; Remove sits under it. */
.ml-wishlist .ml-card .ml-wishlist__remove,
.ml-wishlist .ml-card .ml-wishlist__remove:hover,
.ml-wishlist .ml-card .ml-wishlist__remove:focus,
.ml-wishlist .ml-card .ml-wishlist__remove:active {
	background: transparent;
	border-color: var(--ml-line);
	box-shadow: none;
}

.ml-wishlist .ml-card .ml-wishlist__remove {
	/* Above the card's stretched title link (z-index 1). */
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-height: 40px;
	margin: 10px 0 0;
	padding: 0;
	border: 1px solid var(--ml-line);
	border-radius: 8px;
	font-family: var(--ml-font);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ml-muted);
	cursor: pointer;
	transition: color var(--ml-t-base) var(--ml-e-standard),
		border-color var(--ml-t-base) var(--ml-e-standard);
}

/* Pointer focus keeps the rest ink; only hover and keyboard focus darken. */
.ml-wishlist .ml-card .ml-wishlist__remove:focus {
	color: var(--ml-muted);
}

.ml-wishlist .ml-card .ml-wishlist__remove:focus:not(:focus-visible) {
	outline: none;
}

.ml-wishlist .ml-card .ml-wishlist__remove:hover,
.ml-wishlist .ml-card .ml-wishlist__remove:focus-visible {
	color: var(--ml-navy);
	border-color: var(--ml-navy);
}

.ml-wishlist .ml-card .ml-wishlist__remove:focus-visible {
	outline: 3px solid var(--ml-cyan);
	outline-offset: 3px;
	border-radius: 8px;
}

.ml-wishlist .ml-card .ml-wishlist__remove svg {
	flex: 0 0 auto;
}

/*
 * TI's own chrome, hidden on this page only - the plugin's settings are left
 * as they are, so undoing this is a CSS edit, not a settings change:
 *   .tinv-header        "Default wishlist" - repeats the band's h1
 *   .ml-wishlist__foot  Actions select, Apply, Add Selected / Add All to Cart.
 *                       The bulk actions act on per-row checkboxes, which the
 *                       card grid does not render, so they could not work.
 *                       The wishlist_nonce input lives here too and stays.
 *   .social-buttons     "Share on" - unstyled, and a guest's list is private.
 *                       TI prints it AFTER this template, outside
 *                       .ml-wishlist, hence the .ml-policy__app scope
 */
.ml-wishlist .tinv-header,
.ml-wishlist .ml-wishlist__foot > :not(input),
.ml-policy__app .social-buttons {
	display: none;
}

/* -------------------------------------------------------------------------
 * Empty state
 * ---------------------------------------------------------------------- */

.ml-wishlist .ml-wishlist__empty {
	max-width: 560px;
	margin: 0;
	padding: 48px 24px;
	border: 1px solid var(--ml-line);
	border-radius: 14px;
	background: var(--ml-stage-soft);
	text-align: center;
}

.ml-wishlist .ml-wishlist__empty-icon {
	display: block;
	margin: 0 auto 14px;
	color: var(--ml-cyan);
}

.ml-wishlist .ml-wishlist__empty .ml-wishlist__empty-title {
	margin: 0 0 14px;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ml-navy);
}

.ml-wishlist .ml-wishlist__empty .ml-wishlist__empty-text {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--ml-body);
}

/* The site's primary CTA scale: 50px, r8, 15px/600. (0,3,1) clears Astra's
   a:hover / a:focus repaint at (0,1,1). */
.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse,
.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:focus,
.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:active {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 26px;
	border-radius: 8px;
	background: var(--ml-cyan);
	color: var(--ml-white);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
	transform: none;
	transition: background-color var(--ml-t-base) var(--ml-e-standard),
		transform var(--ml-t-base) var(--ml-e-standard);
}

.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:focus:not(:focus-visible) {
	outline: none;
}

.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:hover,
.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:focus-visible {
	background: var(--ml-cyan-dark);
	color: var(--ml-white);
	transform: translateY(-2px);
}

.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:focus-visible {
	outline: 3px solid var(--ml-cyan);
	outline-offset: 3px;
	border-radius: 8px;
}

@media (max-width: 900px) {
	.ml-policy .ml-wishlist ul.products.ml-wishlist__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.ml-policy .ml-wishlist ul.products.ml-wishlist__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ml-wishlist .ml-wishlist__empty {
		padding: 36px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse,
	.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:hover,
	.ml-wishlist .ml-wishlist__empty a.ml-wishlist__browse:focus-visible {
		transition: none;
		transform: none;
	}
}
