/* HPSO Shop Widget Styles */

:root {
	--color-bone: #F1EDDE;      /* Almond */
	--color-lichen: #E0EFBB;    /* Lichen */
	--color-forest-green: #1D3D27;
	--color-text-dark: #333;
	--color-border: #ddd;
	--color-button: #E66A51;
	--color-button-hover: #CF5A43;
	--icon-size: 32px;
	--hpso-tile-width: 240px;
}

/* Wrapper */
.hpso-shop-wrapper {
	 display: flex;
	flex-direction: column;
	gap: 25px;
	padding-bottom: 25px;   
}

/* Section Container: sidebar (header) + product grid */
.hpso-shop-section {
	padding: 40px;
	display: flex;
	flex-direction: row;
	align-items: stretch;
	gap: 30px;
	margin-bottom: 0;
	width: auto;
  	margin: 10px 30px 10px 30px;
    border-radius: 22px;
  	overflow: hidden;	
	box-sizing: border-box;
}

.hpso-shop-section.hpso-section-bone {
	background-color: var(--color-bone);
}

.hpso-shop-section.hpso-section-lichen {
	background-color: var(--color-lichen);
}

/* ------------------------------------------------------------------ */
/* Sidebar / Section Header                                            */
/* Icon ABOVE title, everything clustered and centered vertically      */
/* ------------------------------------------------------------------ */
.hpso-section-header {
	flex: 0 0 clamp(220px, 24%, 300px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;   /* vertical centering within the panel */
	text-align: center;
	gap: 16px;
	margin-bottom: 0;
}

.hpso-section-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--icon-size, 32px);
	color: var(--color-forest-green);
	flex-shrink: 0;
	min-width: calc(var(--icon-size, 32px) + 18px);
	height: calc(var(--icon-size, 32px) + 18px);
	margin: 0 auto;
}

.hpso-section-icon svg {
	width: var(--icon-size, 32px);
	height: var(--icon-size, 32px);
	fill: currentColor;
}

.hpso-section-title-group {
	flex: 0 1 auto;
}

.hpso-section-title {
	margin: 0 0 10px 0;
	font-size: 28px;
	font-weight: 600;
	color: var(--color-forest-green);
	line-height: 1.3;
	font-family: inherit;
}

.hpso-section-description {
	margin: 0;
	font-size: 14px;
	color: var(--color-text-dark);
	line-height: 1.5;
}

/* View All Link — fit-to-content, centered (not full width) */
.hpso-view-all {
	margin: 0;
	display: flex;
	justify-content: center;
	flex-basis: auto;
}

.hpso-view-all-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	padding: 10px 18px;
	background-color: var(--color-button);
	color: white;
	text-decoration: none;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	transition: background-color 0.3s ease;
	cursor: pointer;
	text-align: center;
}

.hpso-view-all-link:hover {
	background-color: var(--color-button-hover);
	color: white;
}

.hpso-view-all-count {
	margin-left: 4px;
	font-weight: 600;
}

/* ------------------------------------------------------------------ */
/* Product Grid — fixed column tracks = consistent tile size           */
/* ------------------------------------------------------------------ */
.hpso-product-grid {
	flex: 1 1 auto;
	min-width: 0;
	display: grid;
	grid-template-columns: repeat(var(--hpso-columns, 4), minmax(0, 1fr));
	gap: 20px;
	align-content: start;
	width: 100%;
}

/* Tablet: use the per-section min-columns track count */
@media (max-width: 1024px) {
	.hpso-product-grid {
		grid-template-columns: repeat(var(--hpso-columns-min, 2), minmax(0, 1fr));
		gap: 15px;
	}
}

/* Mobile: stack sidebar above grid, single column */
@media (max-width: 768px) {
	.hpso-shop-section {
		padding: 30px 20px;
		flex-direction: column;
		gap: 20px;
	}

	.hpso-section-header {
		flex: 0 0 auto;
		width: 100%;
		margin-bottom: 0;
	}

	.hpso-product-grid {
		grid-template-columns: 1fr;
		gap: 15px;
	}

	.hpso-section-title {
		font-size: 22px;
	}
}

/* Product Card */
.hpso-product-card {
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
	box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
	padding: 15px !important;
}

.hpso-product-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/* Product Image */
.hpso-product-image {
	overflow: hidden;
	background-color: #f5f5f5;
	aspect-ratio: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
}

.hpso-product-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.hpso-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.hpso-product-card:hover .hpso-product-image img {
	transform: scale(1.05);
}

/* Product Info */
.hpso-product-info {
	padding: 15px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.hpso-product-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--product-title-color, var(--color-forest-green));
	line-height: 1.4;
	text-align: center;
}

.hpso-product-title a {
	color: var(--product-title-color, var(--color-forest-green));
	text-decoration: none;
	transition: color 0.3s ease;
	line-height: 1.4;
	display: block;
}

.hpso-product-title a:hover {
	color: var(--color-button-hover);
}

.hpso-product-price {
	font-size: 16px;
	font-weight: 400;
	color: var(--color-forest-green);
	margin: 5px 0;
	text-align: center;
}

/* Add to Cart Button — fit-to-content, centered (not full width) */
.hpso-add-to-cart {
	display: inline-block;
	width: auto;
	align-self: center;
	background-color: #1D3D27 !important;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
	text-align: center;
	margin-top: auto;
}

.hpso-add-to-cart:hover {
	background-color: #2C5A3A !important;
}

/* WooCommerce Price HTML */
.hpso-product-price .woocommerce-Price-amount {
	color: var(--color-forest-green);
	font-weight: 400;
}

.hpso-product-price .woocommerce-price-suffix {
	font-size: 13px;
	margin-left: 5px;
	font-weight: 500;
}

/* Remove default WooCommerce product styles that might interfere */
.hpso-product-card .product-add-to-cart {
	display: none;
}

/* Ensure product card links inherit correctly */
.hpso-product-card a {
	color: inherit;
	text-decoration: none;
}
/* Compact bands (1–2 products): band hugs content and centers */
.hpso-shop-section.hpso-section-compact {
	align-self: center;
	width: fit-content;
	max-width: calc(100% - 60px);
}

.hpso-section-compact .hpso-section-header {
	flex: 0 0 260px;
}

.hpso-section-compact .hpso-product-grid {
	flex: 0 0 auto;
	width: auto;
	grid-template-columns: repeat(var(--hpso-columns), var(--hpso-tile-width));
}

@media (max-width: 768px) {
	.hpso-shop-section.hpso-section-compact {
		align-self: stretch;
		width: auto;
		max-width: none;
	}

	.hpso-section-compact .hpso-section-header {
		flex: 0 0 auto;
	}

	.hpso-section-compact .hpso-product-grid {
		width: 100%;
		grid-template-columns: 1fr;
	}
}
/* Small screens */
@media (max-width: 480px) {
	.hpso-section-title {
		font-size: 20px;
	}

	.hpso-section-icon {
		min-width: calc(var(--icon-size, 32px) + 10px);
		height: calc(var(--icon-size, 32px) + 10px);
	}

	.hpso-shop-section {
		padding: 20px 15px;
	}

	.hpso-product-info {
		padding: 12px;
	}

	.hpso-product-title {
		font-size: 14px;
	}
}
