﻿/* ============================================================
   AuraBricks Theme — WooCommerce CSS
   Section : 04. Product Card
   Source  : assets/css/woocommerce.css (lines 575–1002)
   ============================================================ */

/* ============================================================
   04. Product Card
   (Populated in Part 4 — woocommerce/content-product.php)
   ============================================================ */

/* ── Card Container ── */
body.woocommerce ul.products li.product.abr-product-card,
body.woocommerce-page ul.products li.product.abr-product-card,
ul.products li.product.abr-product-card {
	position: relative;
	list-style: none;
	box-sizing: border-box;
	min-width: 0;
	overflow: hidden;
}

body.woocommerce ul.products li.product.abr-product-card .abr-product-card__inner,
body.woocommerce-page ul.products li.product.abr-product-card .abr-product-card__inner,
.abr-product-card__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	background: var(--abr-color-surface, #ffffff);
	border: 1px solid var(--abr-color-border, #f1f5f9);
	border-radius: var(--abr-woo-card-radius, 14px);
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
	            border-color 0.3s ease;
	box-sizing: border-box;
}

body.woocommerce ul.products li.product.abr-product-card:hover .abr-product-card__inner,
body.woocommerce-page ul.products li.product.abr-product-card:hover .abr-product-card__inner {
	transform: translateY(-4px);
	border-color: rgba(99, 102, 241, 0.2);
	box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
}

/* ── Thumbnail & Image ── */
.abr-product-card__thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background-color: var(--abr-color-surface-hover, #f8fafc);
	overflow: hidden;
	box-sizing: border-box;
}

.abr-product-card__thumb-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

body.woocommerce ul.products li.product a img,
body.woocommerce-page ul.products li.product a img,
.abr-product-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	padding: 0;
	transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

body.woocommerce ul.products li.product.abr-product-card:hover .abr-product-card__thumb img,
body.woocommerce-page ul.products li.product.abr-product-card:hover .abr-product-card__thumb img {
	transform: scale(1.06);
}

/* ── Sale Badge ── */
body.woocommerce .abr-product-card .abr-badge--sale,
body.woocommerce-page .abr-product-card .abr-badge--sale,
.abr-badge--sale {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--abr-woo-badge-color, #ffffff);
	background: var(--abr-woo-badge-bg, #ef4444);
	border-radius: 9999px;
	box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
	line-height: 1;
	pointer-events: none;
}

/* ── Content Details & Vertical Spacing Reset ── */
body.woocommerce ul.products li.product .abr-product-card__content,
body.woocommerce-page ul.products li.product .abr-product-card__content {
	padding: 14px 16px 12px;     /* bottom padding — actions is now outside */
	display: flex;
	flex-direction: column;
	gap: 6px;
	row-gap: 6px;
	flex: 1 1 auto;              /* grows to fill available space, pushes actions footer down */
	box-sizing: border-box;
	min-width: 0;
	overflow: visible;
}

/* Fallback for standard WooCommerce loop link */
body.woocommerce ul.products li.product a.woocommerce-LoopProduct-link,
body.woocommerce-page ul.products li.product a.woocommerce-LoopProduct-link {
	display: flex;
	flex-direction: column;
	gap: var(--abr-woo-product-card-gap, 2px);
	row-gap: var(--abr-woo-product-card-gap, 2px);
	margin: 0;
	padding: 0;
}

/* Category */
body.woocommerce ul.products li.product .abr-product-card__cat,
body.woocommerce-page ul.products li.product .abr-product-card__cat,
body.woocommerce ul.products li.product .abr-product-card__category,
body.woocommerce-page ul.products li.product .abr-product-card__category {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--abr-color-text-muted, #94a3b8);
	margin: 0;
	padding: 0;
	line-height: 1.25;
}

.abr-product-card__cat a {
	color: var(--abr-color-text-muted, #94a3b8);
	text-decoration: none;
	transition: color 0.2s ease;
}

.abr-product-card__cat a:hover {
	color: var(--abr-color-primary, #6366f1);
}

/* Product Title */
body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
body.woocommerce ul.products li.product .abr-product-card__title,
body.woocommerce-page ul.products li.product .abr-product-card__title {
	font-size: 0.95rem;
	font-weight: 500;            /* خفيف — ليس bold */
	line-height: 1.4;
	margin: 0;
	padding: 0;
	color: var(--abr-color-heading, #0f172a);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.abr-product-card__title-link {
	color: var(--abr-color-heading, #0f172a);
	text-decoration: none;
	transition: color 0.2s ease;
}

.abr-product-card__title-link:hover {
	color: var(--abr-color-primary, #6366f1);
}

/* Star Rating — Override WooCommerce default margin: 0 0 .5em */
body.woocommerce ul.products li.product .star-rating,
body.woocommerce-page ul.products li.product .star-rating {
	margin: 0;
	padding: 0;
	font-size: 0.85rem;
	color: var(--abr-woo-star-color, #f59e0b);
}

/* Price Wrap & Price — Override WooCommerce default margin-bottom: .5em */
body.woocommerce ul.products li.product .abr-product-card__price-wrap,
body.woocommerce-page ul.products li.product .abr-product-card__price-wrap {
	margin: 0;
	padding: 0;
}

body.woocommerce ul.products li.product .price,
body.woocommerce-page ul.products li.product .price {
	font-size: 1rem;
	font-weight: 500;            /* خفيف — ليس bold */
	color: var(--abr-color-primary, #6366f1);
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0;
	padding: 0;
	flex-wrap: wrap;
	line-height: 1.25;
}

body.woocommerce .abr-product-card .price del,
body.woocommerce-page .abr-product-card .price del {
	font-size: 0.9rem;
	font-weight: 400;
	color: var(--abr-color-muted, #94a3b8);
	opacity: 0.75;
}

body.woocommerce .abr-product-card .price ins,
body.woocommerce-page .abr-product-card .price ins {
	text-decoration: none;
}

/* ── Actions Footer — always pinned to bottom of __inner ── */
body.woocommerce ul.products li.product .abr-product-card__actions,
body.woocommerce-page ul.products li.product .abr-product-card__actions {
	position: relative;
	margin: 0;
	padding: 0;
	width: 100%;                 /* spans full card width since __inner has no padding */
	box-sizing: border-box;
	z-index: 1;
	overflow: hidden;
	flex-shrink: 0;              /* never shrink — always show button */
}

/* زر الإضافة للسلة — ملتصق بأسفل الكارد */
body.woocommerce ul.products li.product .abr-product-card__actions a.button,
body.woocommerce-page ul.products li.product .abr-product-card__actions a.button,
body.woocommerce ul.products li.product a.button,
body.woocommerce-page ul.products li.product a.button {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 11px 16px;
	font-size: 0.875rem;
	font-weight: 500;            /* خفيف — ليس bold */
	color: #ffffff;
	background: var(--abr-color-primary, #6366f1);
	border: none;
	/* زوايا سفلية فقط لتتطابق مع حافة الكارد */
	border-radius: 0 0 var(--abr-woo-card-radius, 12px) var(--abr-woo-card-radius, 12px);
	box-shadow: none;
	text-decoration: none;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
	cursor: pointer;
	margin: 0;
	letter-spacing: 0.01em;
}

body.woocommerce .abr-product-card .abr-product-card__actions a.button:hover,
body.woocommerce-page .abr-product-card .abr-product-card__actions a.button:hover {
	background: var(--abr-color-primary-hover, #4f46e5);
	border-color: var(--abr-color-primary-hover, #4f46e5);
	box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
	transform: translateY(-1px);
}

body.woocommerce .abr-product-card .abr-product-card__actions a.button:active,
body.woocommerce-page .abr-product-card .abr-product-card__actions a.button:active {
	transform: translateY(0);
	box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}

/* Added to cart message link */
body.woocommerce .abr-product-card .abr-product-card__actions a.added_to_cart,
body.woocommerce-page .abr-product-card .abr-product-card__actions a.added_to_cart {
	display: block;
	text-align: center;
	margin-top: 4px;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--abr-color-primary, #6366f1);
	background: var(--abr-color-surface-hover, #f1f5f9);
	padding: 6px 12px;
	border-radius: 6px;
	text-decoration: none;
	transition: color 0.2s ease, background-color 0.2s ease;
}

body.woocommerce .abr-product-card .abr-product-card__actions a.added_to_cart:hover,
body.woocommerce-page .abr-product-card .abr-product-card__actions a.added_to_cart:hover {
	color: var(--abr-color-primary-hover, #4f46e5);
	background: var(--abr-color-border, #e2e8f0);
}

/* ── Mobile / Touch Screen Actions ── */
@media (max-width: 768px), (hover: none) {
	body.woocommerce .abr-product-card .abr-product-card__actions a.button,
	body.woocommerce-page .abr-product-card .abr-product-card__actions a.button {
		padding: 10px 14px;
		font-size: 0.825rem;
	}
}

/* ── Mobile Product Card Compact Styling ── */
@media (max-width: 768px) {
	/* Reduce card content padding on mobile */
	body.woocommerce ul.products li.product .abr-product-card__content,
	body.woocommerce-page ul.products li.product .abr-product-card__content {
		padding: 10px 12px 10px;
		gap: 5px;
	}

	/* Actions: still sits at bottom, no negative margin needed */
	body.woocommerce ul.products li.product .abr-product-card__actions,
	body.woocommerce-page ul.products li.product .abr-product-card__actions {
		margin: 0;
	}

	/* Compact title on mobile */
	body.woocommerce ul.products li.product .woocommerce-loop-product__title,
	body.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
	body.woocommerce ul.products li.product .abr-product-card__title,
	body.woocommerce-page ul.products li.product .abr-product-card__title {
		font-size: 0.875rem;
		margin: 0;
		padding: 0;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		display: -webkit-box;
	}

	/* Compact price */
	body.woocommerce ul.products li.product .price,
	body.woocommerce-page ul.products li.product .price {
		font-size: 0.9rem;
		margin: 0;
		padding: 0;
	}

	/* Compact star rating */
	body.woocommerce ul.products li.product .star-rating,
	body.woocommerce-page ul.products li.product .star-rating {
		font-size: 0.75rem;
		margin: 0;
		padding: 0;
	}

	/* Compact sale badge */
	body.woocommerce ul.products li.product .abr-product-card .abr-badge--sale,
	body.woocommerce-page ul.products li.product .abr-product-card .abr-badge--sale {
		top: 8px;
		left: 8px;
		padding: 3px 8px;
		font-size: 0.7rem;
	}

	body.woocommerce ul.products li.product .abr-product-card__actions a.button,
	body.woocommerce-page ul.products li.product .abr-product-card__actions a.button {
		margin: 0;
		padding: 9px 12px;
		font-size: 0.8rem;
		min-height: 38px;
		border-radius: 0 0 10px 10px;
	}

	/* Disable hover lift on mobile */
	body.woocommerce ul.products li.product.abr-product-card:hover .abr-product-card__inner,
	body.woocommerce-page ul.products li.product.abr-product-card:hover .abr-product-card__inner {
		transform: none;
	}

	/* Card border radius slightly smaller on mobile */
	.abr-product-card__inner {
		border-radius: 10px;
	}

	.abr-product-card__thumb img {
		border-radius: 0;
	}
}

/* ── Extra Small Phone (≤ 480px) — tighter spacing ── */
@media (max-width: 480px) {
	body.woocommerce ul.products li.product .abr-product-card__content,
	body.woocommerce-page ul.products li.product .abr-product-card__content {
		padding: 8px 10px 8px;
		gap: 4px;
		row-gap: 4px;
	}

	body.woocommerce ul.products li.product .abr-product-card__actions,
	body.woocommerce-page ul.products li.product .abr-product-card__actions {
		margin: 0;
	}

	body.woocommerce ul.products li.product .woocommerce-loop-product__title,
	body.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
	body.woocommerce ul.products li.product .abr-product-card__title,
	body.woocommerce-page ul.products li.product .abr-product-card__title {
		font-size: 0.8rem;
		line-height: 1.35;
		margin: 0;
		padding: 0;
	}

	body.woocommerce ul.products li.product .price,
	body.woocommerce-page ul.products li.product .price {
		font-size: 0.875rem;
		margin: 0;
		padding: 0;
	}

	body.woocommerce ul.products li.product .price del,
	body.woocommerce-page ul.products li.product .price del {
		font-size: 0.75rem;
	}

	body.woocommerce ul.products li.product .abr-product-card__actions a.button,
	body.woocommerce-page ul.products li.product .abr-product-card__actions a.button {
		margin: 0;
		padding: 8px 10px;
		font-size: 0.775rem;
		min-height: 34px;
		border-radius: 0 0 8px 8px;
	}
}


