/* =============================================================================
 * Mashin Irani — Full-card click target
 *
 * Product cards used to be clickable on the title only. This stretches that same
 * title anchor across the whole card (the "stretched link" pattern) so a click
 * anywhere on the card opens the product page. No markup or JS is involved: the
 * anchor keeps its real href, so crawlers, middle-click, ctrl+click, "open in new
 * tab" and keyboard focus all keep working exactly as before.
 *
 * Real controls (wishlist, add-to-cart, view buttons) are lifted above the overlay
 * so they keep receiving their own clicks.
 *
 * Card families covered:
 *   .prod                    frozen cards — home, brand, category, vehicle, related rails
 *   ul.products li.product   WooCommerce shop / search / taxonomy archives
 *   .mi-xsell__card          cart cross-sell suggestions
 * ========================================================================== */

/* --------------------------------------------------------- frozen .prod cards */

.prod {
	position: relative;
	cursor: pointer;
}

.prod h3 > a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Keyboard focus draws the ring around the whole card, not just the title text. */
.prod h3 > a:focus-visible {
	outline: none;
}
.prod h3 > a:focus-visible::after {
	outline: 2px solid var(--gold-500, #896f3d);
	outline-offset: -3px;
	border-radius: var(--radius-lg, 12px);
}

/*
 * Controls that must stay clickable. `.wish` is already absolutely positioned by
 * the card CSS, so it only needs the z-index — re-declaring `position` here would
 * pull it out of its corner.
 */
.prod .wish {
	z-index: 2;
}
.prod .actions,
.prod button:not(.wish),
.prod .btn,
.prod select,
.prod input,
.prod label {
	position: relative;
	z-index: 2;
}

/* ------------------------------------------ WooCommerce archive cards (li.product) */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
	position: relative;
	cursor: pointer;
}

.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link::after,
.woocommerce-page ul.products li.product > a.woocommerce-LoopProduct-link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link:focus-visible,
.woocommerce-page ul.products li.product > a.woocommerce-LoopProduct-link:focus-visible {
	outline: none;
}
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link:focus-visible::after,
.woocommerce-page ul.products li.product > a.woocommerce-LoopProduct-link:focus-visible::after {
	outline: 2px solid var(--gold-500, #896f3d);
	outline-offset: -3px;
	border-radius: var(--radius-lg, 12px);
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product a.added_to_cart,
.woocommerce-page ul.products li.product .button,
.woocommerce-page ul.products li.product a.added_to_cart {
	position: relative;
	z-index: 2;
}

/* --------------------------------------------- cart cross-sell suggestion cards */

.mi-xsell__card {
	position: relative;
	cursor: pointer;
}

.mi-xsell__card .mi-xsell__name > a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.mi-xsell__card .mi-xsell__name > a:focus-visible {
	outline: none;
}
.mi-xsell__card .mi-xsell__name > a:focus-visible::after {
	outline: 2px solid var(--gold-500, #896f3d);
	outline-offset: -3px;
	border-radius: var(--radius-lg, 12px);
}

.mi-xsell__card .mi-xsell__add,
.mi-xsell__card button,
.mi-xsell__card .btn {
	position: relative;
	z-index: 2;
}
