/* =========================================================================
   Abufulan Store — product card
   Save as: wp-content/themes/<your-child-theme>/abufulan-product-card.css
   ========================================================================= */

:root {
	--abu-ink:    #0A0A0A;
	--abu-red:    #C8102E;   /* set to your exact brand red */
	--abu-deep:   #083B4E;
	--abu-line:   #E6E2DD;
	--abu-mute:   #6E6862;
	--abu-shell:  #F5F3F0;
	--abu-star:   #F2A413;
	--abu-radius: 10px;
}

/* -------------------------------------------------------------------------
   Grid — grid-auto-rows:1fr is what forces every row to a single height
   ---------------------------------------------------------------------- */

.woocommerce ul.products,
ul.products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: 1fr;
	gap: 12px;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px)  { ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1024px) { ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }

/* Woo and most themes float these and set percentage widths — override hard */
.woocommerce ul.products li.product,
ul.products li.product {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
}

.woocommerce ul.products li.product::before,
.woocommerce ul.products li.product::after { content: none; }

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

.abu-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: #fff;
	border: 1px solid var(--abu-line);
	border-radius: var(--abu-radius);
	overflow: hidden;
	font-family: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	transition: border-color .16s ease, box-shadow .16s ease;
}

.abu-card:hover {
	border-color: #CFC9C2;
	box-shadow: 0 2px 10px rgba(10, 10, 10, .07);
}

/* -------------------------------------------------------------------------
   Media — square well, contain so mixed photography doesn't crop badly
   ---------------------------------------------------------------------- */

.abu-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--abu-shell);
	overflow: hidden;
}

.abu-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
	display: block;
	mix-blend-mode: multiply;   /* hides white JPEG backgrounds against the shell */
}

.abu-card__save {
	position: absolute;
	top: 0;
	left: 0;
	background: var(--abu-red);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 9px;
	border-bottom-right-radius: 8px;
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   Body — every slot has a reserved height so cards align row to row
   ---------------------------------------------------------------------- */

.abu-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 11px 11px 12px;
	gap: 7px;
}

/* Title: clamped to 2 lines, min-height reserves both even for 1-line names */
.abu-card__title {
	margin: 0;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -.005em;
	color: var(--abu-ink);
	min-height: calc(2 * 1.35 * 13.5px);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.abu-card__title a { color: inherit; text-decoration: none; }
.abu-card__title a:hover { color: var(--abu-deep); }

/* Rating */
.abu-card__rating {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 15px;
	font-size: 11.5px;
	line-height: 1;
}

.abu-stars {
	position: relative;
	display: inline-block;
	font-size: 12px;
	line-height: 1;
	letter-spacing: .5px;
	white-space: nowrap;
}

.abu-stars__track { color: #DAD5CF; }

.abu-stars__fill {
	position: absolute;
	inset: 0;
	width: var(--abu-fill, 0%);
	overflow: hidden;
	color: var(--abu-star);
}

.abu-card__score   { font-weight: 700; color: var(--abu-ink); font-variant-numeric: tabular-nums; }
.abu-card__reviews { color: var(--abu-mute); font-variant-numeric: tabular-nums; }

/* Variation select and spec chips share one slot.
   The dropdown appears on single-attribute variable products; spec chips
   fill the same footprint on everything else, so the space isn't dead.
   A product with neither collapses the slot via .is-empty. */

.abu-card__options {
	min-height: var(--abu-option-slot, 32px);
	display: flex;
	align-items: stretch;
}

.abu-card__options.is-empty {
	min-height: 0;
}

/* Spec chips — quiet by design. The select is the interactive control and
   should stay the louder of the two. */
.abu-card__chips {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow: hidden;
}

.abu-card__chip {
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	color: var(--abu-mute);
	background: var(--abu-shell);
	border: 1px solid #EEEBE7;
	border-radius: 5px;
	padding: 6px 8px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.abu-card__variants {
	width: 100%;
	font-family: inherit;
	font-size: 12px;
	font-weight: 600;
	color: var(--abu-ink);
	background-color: #fff;
	border: 1px solid var(--abu-line);
	border-radius: 6px;
	padding: 6px 26px 6px 9px;
	line-height: 1.2;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23083B4E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 8px center;
	background-size: 11px;
	transition: border-color .15s ease;
}

.abu-card__variants:hover  { border-color: #CFC9C2; }
.abu-card__variants:focus-visible {
	outline: 2px solid var(--abu-deep);
	outline-offset: 1px;
	border-color: var(--abu-deep);
}
.abu-card__variants option:disabled { color: #A8A29B; }

/* Price — reserved height so sale and non-sale cards line up */
.abu-card__price {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-height: 40px;
}

.abu-card__now {
	font-size: 17px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: -.015em;
	color: var(--abu-red);
	font-variant-numeric: tabular-nums;
}

.abu-card__now .woocommerce-Price-currencySymbol {
	font-size: .72em;
	font-weight: 700;
	margin-right: 1px;
}

.abu-card__compare {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 11.5px;
	line-height: 1.2;
	flex-wrap: wrap;
}

.abu-card__was    { color: var(--abu-mute); font-variant-numeric: tabular-nums; }
.abu-card__saving { color: var(--abu-deep); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Flag — fixed height, so a card with no flag keeps the same footprint */
.abu-card__flag {
	display: flex;
	align-items: center;
	gap: 5px;
	height: 16px;
	margin: 0;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1;
}

.abu-card__flag-mark {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	flex: none;
	background: currentColor;
}

.abu-card__flag--stock { color: var(--abu-red); }
.abu-card__flag--ship  { color: var(--abu-deep); }
.abu-card__flag--out   { color: var(--abu-mute); }

/* CTA — margin-top:auto pins it to the bottom whatever the title length */
.abu-card__cta {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	background: var(--abu-deep);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .005em;
	padding: 10px 12px;
	border-radius: 7px;
	text-decoration: none;
	transition: background .15s ease;
}

.abu-card__icon {
	width: 14px;
	height: 14px;
	flex: none;
	display: block;
}

.abu-card__cta:hover,
.abu-card__cta:focus-visible { background: #0C5169; color: #fff; }

.abu-card__cta--muted { background: #8C8680; }
.abu-card__cta--muted:hover { background: #7A736D; }

/* -------------------------------------------------------------------------
   Quality floor
   ---------------------------------------------------------------------- */

.abu-card a:focus-visible {
	outline: 2px solid var(--abu-deep);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.abu-card, .abu-card__cta { transition: none; }
}

@media (max-width: 400px) {
	.abu-card__title { font-size: 12.5px; min-height: calc(2 * 1.35 * 12.5px); }
	.abu-card__now   { font-size: 15.5px; }
	.abu-card__body  { padding: 9px 9px 10px; }
}
