/*
 * Akire Product IDs Grid
 * All selectors are prefixed with .akpg- to avoid clashes with Elessi, WooCommerce and WPBakery.
 * Columns, gap, ratio and fit are set per instance through CSS custom properties.
 */

.akpg-wrap {
	--akpg-bg: #f9f9f9;
	--akpg-muted: #777;
	--akpg-btn-bg: #fff;
	--akpg-btn-color: #222;
	width: 100%;
	box-sizing: border-box;
}

.akpg-wrap *,
.akpg-wrap *::before,
.akpg-wrap *::after {
	box-sizing: border-box;
}

.akpg-notice {
	padding: 12px 16px;
	background: #fff8e5;
	border-left: 4px solid #dba617;
	font-size: 14px;
}

/* ---------- Grid ---------- */

.akpg-grid {
	display: grid;
	grid-template-columns: repeat(var(--akpg-cols-m, 2), minmax(0, 1fr));
	gap: var(--akpg-gap-m, 12px);
	margin: 0;
	padding: 0;
}

@media (min-width: 768px) {
	.akpg-grid {
		grid-template-columns: repeat(var(--akpg-cols-t-narrow, 2), minmax(0, 1fr));
		gap: var(--akpg-gap-t, 19px);
	}
}

@media (min-width: 900px) {
	.akpg-grid {
		grid-template-columns: repeat(var(--akpg-cols-t, 3), minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.akpg-grid {
		grid-template-columns: repeat(var(--akpg-cols, 4), minmax(0, 1fr));
		gap: var(--akpg-gap, 24px);
	}
}

/* ---------- Card ---------- */

.akpg-grid .akpg-card {
	position: relative;
	min-width: 0;
	margin: 0;
	padding: 0;
	text-align: center;
	background: none;
	border: 0;
	box-shadow: none;
}

.akpg-grid .akpg-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--akpg-ratio, 4 / 5);
	background: var(--akpg-bg);
}

.akpg-grid .akpg-media__link {
	display: block;
	width: 100%;
	height: 100%;
}

.akpg-grid .akpg-media img,
.akpg-grid .akpg-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	padding: 5%;
	object-fit: var(--akpg-fit, contain);
	/* Lets white studio backgrounds blend into the grey frame. */
	mix-blend-mode: multiply;
	transition: transform 0.4s ease;
}

.akpg-grid.akpg-fit-cover .akpg-media img,
.akpg-grid.akpg-fit-cover .akpg-img {
	padding: 0;
	mix-blend-mode: normal;
}

@media (hover: hover) {
	.akpg-grid .akpg-card:hover .akpg-media img {
		transform: scale(1.03);
	}
}

.akpg-grid .akpg-card--soldout .akpg-media img {
	opacity: 0.6;
}

.akpg-grid .akpg-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	padding: 3px 8px;
	background: #fff;
	color: #222;
	font-size: 11px;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* ---------- Wishlist (YITH, used by Elessi) ---------- */

.akpg-grid .akpg-wishlist {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	line-height: 1;
}

.akpg-grid .akpg-wishlist .yith-wcwl-add-to-wishlist {
	margin: 0;
}

/* ---------- Icon buttons over the image ---------- */

.akpg-grid .akpg-actions {
	position: absolute;
	right: 0;
	bottom: 16px;
	left: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 10px;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease;
	pointer-events: none;
}

.akpg-grid .akpg-card:hover .akpg-actions,
.akpg-grid .akpg-card:focus-within .akpg-actions {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* Touch devices have no hover, so keep the buttons visible. */
@media (hover: none) {
	.akpg-grid .akpg-actions {
		bottom: 8px;
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

.akpg-grid .akpg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.akpg-grid .akpg-btn--icon {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--akpg-btn-bg);
	color: var(--akpg-btn-color);
	line-height: 1;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.akpg-grid .akpg-btn--icon:hover,
.akpg-grid .akpg-btn--icon:focus-visible {
	background: #111;
	color: #fff;
}

.akpg-grid .akpg-icon {
	display: block;
	width: 20px;
	height: 20px;
}

/* ---------- Text button ---------- */

.akpg-grid .akpg-btn--text {
	margin-top: 10px;
	padding: 10px 22px;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.akpg-grid .akpg-btn--text:hover,
.akpg-grid .akpg-btn--text:focus-visible {
	background: #111;
	border-color: #111;
	color: #fff;
}

/* ---------- Loading / added states (WooCommerce AJAX) ---------- */

.akpg-grid .akpg-btn.loading {
	opacity: 0.55;
	pointer-events: none;
}

.akpg-grid .akpg-btn.loading::after,
.akpg-grid .akpg-btn.added::after {
	content: none;
	display: none;
}

.akpg-grid .akpg-btn.akpg-added {
	background: #111;
	color: #fff;
}

/* Hide WooCommerce's injected "View cart" link; the theme mini-cart already updates. */
.akpg-grid .added_to_cart {
	display: none;
}

/* ---------- Text ---------- */

.akpg-grid .akpg-info {
	padding-top: 16px;
}

.akpg-grid .akpg-title {
	margin: 0 0 6px;
	padding: 0;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: 0.01em;
	text-transform: none;
}

.akpg-grid .akpg-title a {
	color: inherit;
	text-decoration: none;
}

.akpg-grid .akpg-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.akpg-grid .akpg-id {
	margin: 0 0 4px;
	color: var(--akpg-muted);
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.akpg-grid .akpg-price {
	font-size: 18px;
	line-height: 1.3;
}

.akpg-grid .akpg-price del {
	margin-right: 0.4em;
	opacity: 0.5;
}

.akpg-grid .akpg-price ins {
	background: none;
	text-decoration: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
	.akpg-grid .akpg-btn--icon {
		width: 36px;
		height: 36px;
	}

	.akpg-grid .akpg-icon {
		width: 17px;
		height: 17px;
	}

	.akpg-grid .akpg-wishlist {
		top: 6px;
		right: 6px;
	}

	.akpg-grid .akpg-info {
		padding-top: 10px;
	}

	.akpg-grid .akpg-title {
		font-size: 13px;
		margin-bottom: 4px;
	}

	.akpg-grid .akpg-price {
		font-size: 15px;
	}

	.akpg-grid .akpg-btn--text {
		width: 100%;
		padding: 9px 10px;
		font-size: 12px;
	}
}

/* ---------- Utilities ---------- */

.akpg-grid .akpg-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

@media (prefers-reduced-motion: reduce) {
	.akpg-grid .akpg-media img,
	.akpg-grid .akpg-actions,
	.akpg-grid .akpg-btn {
		transition: none;
	}
}
