/* AYATOP product cards and grids (PS-03.16, PS-05 CL-08). Tokens only. */

.ak-grid {
	display: grid;
	gap: var(--ak-space-6) var(--ak-space-4);
	margin: 0;
	padding: 0;
	list-style: none;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ak-grid > li { min-width: 0; }

@media (min-width: 48rem) {
	.ak-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.ak-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 47.999rem) {
	.ak-grid--3 { grid-template-columns: minmax(0, 1fr); }
}

.ak-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.ak-card__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--ak-card-ratio, 4 / 5);
	background: var(--ak-color-canvas-secondary);
}

.ak-card__image-link {
	display: block;
	width: 100%;
	height: 100%;
}

.ak-card__image {
	width: 100%;
	height: 100%;
	object-fit: var(--ak-card-fit, cover);
}

/* Packaging and anything whose label must stay whole is contained, never cropped (PS-04 04.15.7) */
.ak-card--contain .ak-card__media { background: var(--ak-color-surface-default); border: var(--ak-border-width) solid var(--ak-color-border-subtle); }
.ak-card--contain .ak-card__image { padding: var(--ak-space-3); }

.ak-card__image--hover {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity var(--ak-motion-duration-standard) var(--ak-motion-ease-standard);
}

/* Second real image on hover only where a precise pointer exists; phones never rely on it. */
@media (hover: hover) and (pointer: fine) {
	.ak-card__media:hover .ak-card__image--hover { opacity: 1; }
}

.ak-card__noimage {
	display: grid;
	place-items: center;
	height: 100%;
	padding: var(--ak-space-4);
	color: var(--ak-color-text-muted);
	font-size: var(--ak-type-body-small);
	text-align: center;
}

.ak-card__badge {
	position: absolute;
	top: var(--ak-space-3);
	inset-inline-start: var(--ak-space-3);
}

.ak-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--ak-space-1);
	padding-top: var(--ak-space-3);
}

.ak-card__title {
	margin: 0;
	font-family: var(--ak-font-body);
	font-size: var(--ak-type-body);
	font-weight: var(--ak-weight-medium);
	line-height: 1.35;
}

.ak-card__title a {
	color: var(--ak-color-text-primary);
	text-decoration: none;
}

.ak-card__title a:hover { text-decoration: underline; }

.ak-card__price,
.ak-card__variants,
.ak-card__stock { margin: 0; }

.ak-card__action {
	margin-top: auto;
	align-self: stretch;
	min-height: var(--ak-target-min);
}

.ak-card__body > .ak-card__price { padding-bottom: var(--ak-space-3); }

/* WooCommerce AJAX add to basket states */
.ak-card__action.loading { cursor: progress; pointer-events: none; opacity: 0.7; }

.ak-card__action.loading::after {
	content: "";
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: ak-spin 0.8s linear infinite;
}

.ak-card .added_to_cart { display: none; }

/* Slot for the wishlist button supplied by the companion plugin (PS-13/18) */
.ak-card__media > .ak-wishlist {
	position: absolute;
	top: var(--ak-space-2);
	inset-inline-end: var(--ak-space-2);
}

/* Listing grid: two columns on phones, three on tablets, four on large screens (provisional until tested on real photography) */
.ak-grid--listing { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ak-space-6) var(--ak-space-3); }
@media (min-width: 40rem) { .ak-grid--listing { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .ak-grid--listing { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Shared section pieces (used on home, department, product and listing pages) ---------- */
.ak-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--ak-space-2) var(--ak-space-5); margin-bottom: var(--ak-space-5); }
.ak-section-head h2 { margin: 0; }
.ak-section-head__link { font-weight: var(--ak-weight-medium); }
.ak-home-products--alt { background: var(--ak-color-canvas-secondary); }
.ak-home-products--tight { padding-top: var(--ak-space-6); }
.ak-prose > * + * { margin-top: var(--ak-space-3); }
.ak-prose h3 { font-size: var(--ak-type-h5); margin-bottom: var(--ak-space-2); }
.ak-prose ul,
.ak-prose ol { padding-inline-start: 1.25rem; }
.ak-prose p { max-width: var(--ak-measure-reading); }

/* Star ratings: real values only. Filled stars are clipped to the exact percentage. */
.ak-stars { position: relative; display: inline-flex; color: var(--ak-color-text-primary); vertical-align: middle; }
.ak-stars__base,
.ak-stars__fill { display: inline-flex; }
.ak-stars__fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; }
.ak-stars svg { flex: none; }
.ak-stars__fill .ak-icon { fill: currentColor; }

/* ---------- Wishlist buttons (printed by the companion plugin) ---------- */
.ak-wishlist-button { display: inline-flex; align-items: center; justify-content: center; gap: var(--ak-space-2); min-width: var(--ak-target-min); min-height: var(--ak-target-min); padding: 0; border: 0; background: transparent; color: var(--ak-color-text-primary); font: inherit; cursor: pointer; }
.ak-wishlist-button .ak-icon { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--ak-motion-duration-fast) var(--ak-motion-ease-standard); }
.ak-wishlist-button:hover .ak-icon { transform: scale(1.08); }
/* Saved: filled heart AND the pressed state in words for screen readers; the fill is a shape change, not colour alone */
.ak-wishlist-button.is-saved .ak-icon { fill: currentColor; }
.ak-wishlist-button--icon { background: var(--ak-color-surface-default); border: var(--ak-border-width) solid var(--ak-color-border-subtle); border-radius: 50%; }
.ak-wishlist-button--text { padding: 0 var(--ak-space-3); border: var(--ak-border-width) solid var(--ak-color-border-strong); border-radius: var(--ak-radius-control); }
.ak-wishlist-button--text:hover { border-color: var(--ak-color-text-primary); }
.ak-wishlist-button--text.is-saved { border-color: var(--ak-color-interactive-primary); border-width: var(--ak-border-width-emphasis); font-weight: var(--ak-weight-bold); }
.ak-card__media > .ak-wishlist-button { position: absolute; top: var(--ak-space-2); inset-inline-end: var(--ak-space-2); }
.ak-wishlist-count[hidden] { display: none; }
.ak-header__wishlist { position: relative; }

/* =====================================================================
 * Phase 7B: refined product card (blueprint: 3:4 image, brand, title, price, 48px button).
 * Light, quiet details: no frame round the photo, a small heart, a small badge, a one-line button.
 * ===================================================================== */
.ak-grid { gap: 2rem 0.875rem; }
@media (min-width: 64rem) { .ak-grid { gap: 2.75rem 1.5rem; } }

.ak-card__media,
.ak-card--contain .ak-card__media { background: var(--ak-color-surface-default); border: 0; }
.ak-card--contain .ak-card__image { padding: var(--ak-space-3); }

.ak-card__body { gap: 0; padding-top: 0.875rem; }
.ak-card__brand { margin: 0 0 0.25rem; font-size: 0.6875rem; letter-spacing: 0.12em; line-height: 1.3; }
.ak-card__title { font-family: var(--ak-font-body); font-size: 0.9375rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ak-card__title a { color: var(--ak-color-text-primary); }
.ak-card__body > .ak-card__price { padding: 0.375rem 0 0.875rem; font-size: 0.9375rem; font-weight: 600; line-height: 1.3; }
.ak-card .ak-price del { font-size: 0.875rem; font-weight: 400; color: var(--ak-color-text-muted); margin-inline-end: 0.5rem; }
.ak-card .ak-price ins { color: var(--ak-color-text-primary); text-decoration: none; }
.ak-card .ak-price .woocommerce-Price-amount { white-space: nowrap; }
.ak-card__variants { margin-top: -0.5rem; padding-bottom: 0.75rem; }

.ak-card__badge { top: 0.625rem; inset-inline-start: 0.625rem; padding: 0.5rem 0.75rem; border: 0; border-radius: 999px; background: rgb(255 255 255 / 0.92); box-shadow: 0 1px 5px rgb(32 33 31 / 0.14); color: var(--ak-color-text-primary); font-size: 0.625rem; font-weight: 640; letter-spacing: 0.12em; line-height: 1; text-transform: uppercase; }
.ak-card__badge[data-badge="sale"] { color: var(--ak-color-sale); }

/* Wishlist heart: 36px circle, 44px touch area, no border */
.ak-card__media > .ak-wishlist-button { top: 0.625rem; inset-inline-end: 0.625rem; width: 2.25rem; height: 2.25rem; min-width: 0; min-height: 0; border: 0; background: rgb(255 255 255 / 0.92); box-shadow: 0 1px 5px rgb(32 33 31 / 0.14); }
.ak-card__media > .ak-wishlist-button::after { content: ""; position: absolute; inset: -0.25rem; }
.ak-card__media > .ak-wishlist-button .ak-icon { width: 1.125rem; height: 1.125rem; stroke-width: 1.4; }

/* Button: one line, 48px, forest */
.ak-card__action,
.ak-card__action.ak-button--secondary { width: 100%; min-height: 3rem; padding: 0 0.75rem; justify-content: center; border-width: 1px; border-color: var(--ak-color-brand-primary); background: var(--ak-color-brand-primary); color: #fff; font-size: 0.875rem; font-weight: 540; letter-spacing: 0.01em; white-space: nowrap; }
.ak-card__action:hover,
.ak-card__action.ak-button--secondary:hover { background: var(--ak-color-text-primary); border-color: var(--ak-color-text-primary); color: #fff; }

.ak-card:hover .ak-art svg { transform: scale(1.03); }
.ak-card--sample .ak-card__image-link { position: relative; }

/* One size for every card photo: 3:4. A whole (contained) photo sits on white with a little air round it. */
.ak-card__media { aspect-ratio: 3 / 4; }
.ak-card--contain .ak-card__image { padding: 0.5rem; }
