/**
 * Pelagia Book Store — Product Card (Apple-style Minimalist Redesign - Fixed)
 *
 * Philosophy:
 *   - Minimalist editorial bookstore aesthetic.
 *   - Strong whitespace usage, focus on book cover imagery.
 *   - Elegant typography hierarchy and left-aligned text.
 *   - 1:1 image area ratio to perfectly frame 3D book mockups without cropping.
 *
 * @package Pelagia
 */

/* ════════════════════════════════════════════════════
   CARD CONTAINER
════════════════════════════════════════════════════ */

.product-card {
	display: flex;
	flex-direction: column;
	background: var(--color-white, #ffffff);
	border-radius: 10px;
	border: none; /* Seamless floating aesthetic */
	box-shadow: 0 8px 30px rgba(0,0,0,0.05);
	position: relative;
	overflow: visible;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	height: 100%;
}

.product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 48px rgba(0,0,0,0.08); /* Deeper, softer hover shadow */
}

.product-card__image-link {
	display: block;
	text-decoration: none;
	border-radius: 9px 9px 0 0;
	overflow: hidden; /* Ensure images don't break the rounded corners when padding is removed */
}

/* ════════════════════════════════════════════════════
   BADGES & WISHLIST BUTTON (FLOATING)
════════════════════════════════════════════════════ */

.product-card__badge {
	position: absolute;
	top: 16px;
	left: 16px;
	padding: 4px 10px;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #fff;
	border-radius: 4px;
	z-index: 2;
	background-color: #000;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-card__badge--sale {
	background-color: #d9534f;
}

.product-card__wishlist {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ECECEC;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	z-index: 2;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	transition: transform 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	padding: 0;
}

.product-card__wishlist svg {
	width: 14px;
	height: 14px;
	stroke-width: 2px;
}

.product-card__wishlist:hover {
	transform: scale(1.1);
	color: #d9534f;
	box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

/* ════════════════════════════════════════════════════
   BOOK COVER IMAGE AREA (1:1 Square Fix)
════════════════════════════════════════════════════ */

.product-card__image-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1; /* Square area to fit 3D mockups beautifully */
	background: transparent;
	padding: 0; /* Removed padding to tighten vertical height and reduce white space */
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	align-items: center;
}

.product-card__image {
	width: 100%;
	height: 100%;
	object-fit: contain; /* Full 3D cover visible, no cropping */
	display: block;
	transition: transform 0.3s ease;
}

.product-card:hover .product-card__image {
	transform: scale(1.03);
}

/* ════════════════════════════════════════════════════
   CARD CONTENT LAYOUT
════════════════════════════════════════════════════ */

.product-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px; /* Reduced padding to tighten white space */
	text-align: left;
}

/* ── Title ── */
.product-card__title {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 1rem; /* Reduced to 16px */
	font-weight: 600; /* Semi-bold */
	line-height: 1.3;
	color: var(--color-dark, #1a1a1a);
	margin: 0 0 4px 0; /* Reduced bottom margin */
	word-break: break-word; /* Ensure long titles like VINDICATION don't overflow */
}

.product-card__title a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2; /* Maximum 2 lines */
	overflow: hidden;
	transition: color 0.2s ease;
}

.product-card__title a:hover {
	color: #d9534f;
}

/* ── Author ── */
.product-card__author {
	font-size: 0.85rem;
	font-weight: 400;
	color: #777777; /* Muted gray text */
	margin: 0 0 6px 0; /* Reduced bottom margin */
	line-height: 1.4;
}

.product-card__author a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.product-card__author a:hover {
	color: var(--color-dark, #1a1a1a);
}

/* ── Rating Section ── */
.product-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 12px; /* Reduced bottom margin */
	flex-wrap: wrap;
}

/* HIDE WooCommerce Default Rating Text elegantly */
.product-card__rating .star-rating {
	font-size: 0.65rem; /* Reduced star size */
	color: #d4af37; /* Muted gold */
	width: 5.4em; /* Switched to em so width scales with font-size */
	height: 1em;
	line-height: 1;
	font-family: star;
	position: relative;
	overflow: hidden; /* Hide the text inside */
}

.product-card__rating .star-rating::before {
	content: '\73\73\73\73\73';
	color: #e0dadf;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
}

.product-card__rating .star-rating span {
	overflow: hidden;
	float: left;
	top: 0;
	left: 0;
	position: absolute;
	padding-top: 1.5em; /* This trick hides the "Rated 5.00 out of 5" text */
}

.product-card__rating .star-rating span::before {
	content: '\53\53\53\53\53';
	top: 0;
	position: absolute;
	left: 0;
}

.product-card__review-count,
.product-card__no-reviews {
	font-size: 0.65rem; /* Reduced review count text */
	color: #999;
}

/* ── Price and Add to Cart Section ── */
.product-card__price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	gap: 8px; /* Ensure gap between price and button */
}

.product-card__price {
	font-size: 0.95rem; /* Reduced for better balance */
	font-weight: 600;
	color: #d9534f; /* Theme accent color for active price */
	line-height: 1.2;
	flex: 1; /* Takes up remaining space */
	min-width: 0; /* Prevents overflow */
}

.product-card__price del {
	color: #a1a1a1;
	font-weight: 400;
	font-size: 0.8rem;
	margin-right: 6px;
	text-decoration: line-through;
	display: inline-block; /* Helps with wrapping */
}

.product-card__price ins {
	text-decoration: none;
	display: inline-block;
}

/* ── Add to Cart Button ── */
.product-card__atc--icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex-shrink: 0; /* Don't shrink the button */
	background: #fff;
	color: var(--color-dark, #1a1a1a);
	border: 1px solid #ECECEC; /* Thin border */
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 4px 12px rgba(0,0,0,0.03); /* Soft shadow */
	transition: all 0.25s ease;
}

.product-card__atc--icon svg {
	width: 16px;
	height: 16px;
	stroke-width: 1.5px;
}

.product-card__atc--icon:hover {
	background: #d9534f !important;
	color: #fff !important;
	border-color: #d9534f !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(217, 83, 79, 0.2);
}

/* ════════════════════════════════════════════════════
   RESPONSIVE SCALING
════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
	.product-card__image-wrapper {
		padding: 0; /* Maintained zero padding on tablet */
	}

	.product-card__body {
		padding: 12px;
	}

	.product-card__title {
		font-size: 0.95rem; /* Adjusted for tablet */
	}

	.product-card__author {
		margin-bottom: 6px;
	}

	.product-card__rating {
		margin-bottom: 10px;
	}
}

@media (max-width: 767px) {
	.product-card {
		border-radius: 8px;
	}

	.product-card__image-wrapper {
		padding: 0;
	}

	.product-card__badge {
		top: 12px;
		left: 12px;
		font-size: 0.55rem;
	}
	
	.product-card__wishlist {
		top: 12px;
		right: 12px;
		width: 28px;
		height: 28px;
	}
	.product-card__wishlist svg {
		width: 12px;
		height: 12px;
	}

	.product-card__body {
		padding: 10px;
	}

	.product-card__title {
		font-size: 0.85rem; /* Adjusted for mobile */
		margin-bottom: 2px;
	}

	.product-card__author {
		font-size: 0.75rem;
		margin-bottom: 4px;
	}

	.product-card__rating {
		margin-bottom: 8px;
	}

	.product-card__price {
		font-size: 0.875rem; /* Adjusted for mobile */
	}
	.product-card__price del {
		font-size: 0.75rem;
	}

	.product-card__atc--icon {
		width: 32px;
		height: 32px;
	}
	.product-card__atc--icon svg {
		width: 14px;
		height: 14px;
	}
}

/* ════════════════════════════════════════════════════
   LIST VIEW OVERRIDES (Untouched structure, aligned colors)
════════════════════════════════════════════════════ */

.shop-card-list {
	background: var(--color-white, #ffffff);
	border-radius: 10px;
	overflow: hidden;
	border: none;
	box-shadow: 0 4px 20px rgba(0,0,0,0.04);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 1025px) {
	.shop-card-list:hover {
		box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
		transform: translateY(-2px);
	}
}

.shop-card-list__title a {
	color: var(--color-dark, #1a1a1a);
	font-weight: 600;
}

.shop-card-list__author {
	color: #777777;
}

.shop-card-list__price {
	color: #d9534f;
	font-weight: 600;
}

.shop-card-list__rating {
	color: #d4af37;
}

.shop-card-list__add {
	background: #f5f5f7;
	color: var(--color-dark, #1a1a1a);
	border-radius: var(--radius-md);
	border: none;
}

.shop-card-list__add:hover {
	background: #d9534f;
	color: #fff;
}
