/**
 * Zest Product Grid Styles
 *
 * Styles for the product archive page, product cards,
 * and the [zest_products] shortcode grid.
 *
 * @package BloomStack\Zest
 * @since 1.4.0
 */

/* ==========================================================================
   Archive Layout
   ========================================================================== */

.zest-archive {
	padding: 40px 0 80px;
	font-family: var(--zest-font-body);
	color: var(--zest-text-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.zest-archive__header {
	text-align: center;
	margin-bottom: 48px;
}

.zest-archive__title {
	font-family: var(--zest-font-heading);
	font-size: 36px;
	font-weight: 700;
	color: var(--zest-text-dark);
	margin: 0;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.zest-grid {
	display: grid;
	gap: 24px;
}

.zest-grid--cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.zest-grid--cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.zest-grid--cols-4 {
	grid-template-columns: repeat(4, 1fr);
}

/* Tablet: 3 and 4 col grids collapse to 2 */
@media (max-width: 1024px) {
	.zest-grid--cols-3,
	.zest-grid--cols-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Mobile: all grids collapse to 1 */
@media (max-width: 640px) {
	.zest-grid[class*="zest-grid--cols-"] {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Product Card
   ========================================================================== */

.zest-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--zest-bg-white);
	border: 1px solid var(--zest-border);
	border-radius: var(--zest-radius);
	overflow: hidden;
	transition: box-shadow var(--zest-transition), transform var(--zest-transition);
	box-shadow: var(--zest-shadow-sm);
}

.zest-card:hover {
	box-shadow: var(--zest-shadow-lg);
	transform: translateY(-4px);
}

/* Full-card clickable overlay link */
.zest-card__link {
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* ==========================================================================
   Card Image
   ========================================================================== */

.zest-card__image {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--zest-bg-light);
}

.zest-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform var(--zest-transition-slow);
}

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

/* Fallback placeholder */
.zest-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--zest-text-muted);
	background: var(--zest-bg-light);
}

/* ==========================================================================
   Status Badge
   ========================================================================== */

.zest-card__badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
}

/* ==========================================================================
   Card Body
   ========================================================================== */

.zest-card__body {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	padding: 20px;
}

.zest-card__title {
	font-family: var(--zest-font-heading);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 8px 0;
	color: var(--zest-text-dark);
}

.zest-card__title a {
	position: relative;
	z-index: 2;
	color: inherit;
	text-decoration: none;
	transition: color var(--zest-transition);
}

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

.zest-card__excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: var(--zest-text-light);
	margin: 0 0 16px 0;
	flex-grow: 1;
}

/* ==========================================================================
   Card Footer (Price + CTA)
   ========================================================================== */

.zest-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var(--zest-border-light);
}

.zest-card__price {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.zest-card__current-price {
	font-size: 20px;
	font-weight: 700;
	color: var(--zest-primary);
	line-height: 1;
}

.zest-card__compare-price {
	font-size: 14px;
	color: var(--zest-text-muted);
	text-decoration: line-through;
	line-height: 1;
}

.zest-card__price-from {
	font-size: 12px;
	font-weight: 600;
	color: var(--zest-text-light);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.zest-card__price-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--zest-warning);
}

/* ==========================================================================
   Card CTA Button
   ========================================================================== */

.zest-card__action {
	position: relative;
	z-index: 2;
	flex-shrink: 0;
}

.zest-card__btn {
	padding: 10px 20px;
	font-size: 14px;
	white-space: nowrap;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.zest-pagination {
	margin-top: 48px;
	text-align: center;
}

.zest-pagination ul {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.zest-pagination li {
	margin: 0;
}

.zest-pagination li a,
.zest-pagination li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 500;
	color: var(--zest-text-body);
	background: var(--zest-bg-white);
	border: 1px solid var(--zest-border);
	border-radius: var(--zest-radius-sm);
	text-decoration: none;
	transition: all var(--zest-transition);
}

.zest-pagination li a:hover {
	color: var(--zest-primary);
	border-color: var(--zest-primary);
	background: var(--zest-primary-bg);
	text-decoration: none;
}

.zest-pagination li span.current {
	color: var(--zest-bg-white);
	background: var(--zest-primary);
	border-color: var(--zest-primary);
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.zest-empty-state {
	text-align: center;
	padding: 80px 24px;
}

.zest-empty-state__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	margin: 0 auto 24px;
	background: var(--zest-bg-light);
	border-radius: 50%;
	color: var(--zest-text-muted);
}

.zest-empty-state__title {
	font-family: var(--zest-font-heading);
	font-size: 24px;
	font-weight: 600;
	color: var(--zest-text-dark);
	margin: 0 0 8px 0;
}

.zest-empty-state__message {
	font-size: 16px;
	color: var(--zest-text-light);
	margin: 0;
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   Shortcode Container
   ========================================================================== */

.zest-products-shortcode {
	margin: 32px 0;
}

.zest-products-shortcode .zest-empty-state {
	padding: 48px 24px;
}
