/**
 * Default styling: the full front-end look for the assortment views
 * (category archive, single product, shortcode embed) — layout plus the
 * Dutchmed brand palette, type scale, spacing and elevation baked straight
 * in. This is what the plugin ships with; a site no longer needs to layer a
 * per-site re-skin on top via wp_add_inline_style().
 *
 * Colours/spacing/radii are written as literal values (the Dutchmed Brand
 * Book palette, p.22) rather than theme design tokens, so the file renders
 * identically regardless of which stylesheet the active theme loads.
 *
 * The one runtime-configurable touch, --em-assortment-accent, is still
 * honoured wherever the plain mint accent is used (eyebrow, PDF button,
 * bullet markers): it is fed from Settings::get( 'accent_color' ) via
 * Render/Assets.php (falls back to Settings::DEFAULT_ACCENT_COLOR), and the
 * var() fallback below is the brand mint so an unset option still looks
 * right.
 *
 * A site that still wants to override any of this can add its own CSS via
 * wp_add_inline_style( 'em-assortment', ... ) after this stylesheet — it is
 * printed last and wins the cascade.
 *
 * @package EnMasse\Assortment
 */

/* Page width: mirrors the Dutchmed theme's .container ladder (--container-max
   with Bootstrap-style breakpoints) so the assortment lines up with the rest
   of the site's content, and renders at the same width on any other theme.
   The single-product page follows the theme's narrow container. */
.em-assortment,
.em-assortment-product {
	width: 100%;
	max-width: 1180px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 0.75rem;
	padding-right: 0.75rem;
	box-sizing: border-box;
}

.em-assortment *,
.em-assortment *::before,
.em-assortment *::after,
.em-assortment-product *,
.em-assortment-product *::before,
.em-assortment-product *::after {
	box-sizing: border-box;
}

@media (min-width: 576px) {
	.em-assortment,
	.em-assortment-product {
		max-width: 540px;
	}
}

@media (min-width: 768px) {
	.em-assortment,
	.em-assortment-product {
		max-width: 720px;
	}
}

@media (min-width: 992px) {
	.em-assortment {
		max-width: 960px;
	}

	.em-assortment-product {
		max-width: 760px;
	}
}

@media (min-width: 1200px) {
	.em-assortment {
		max-width: 1140px;
	}
}

@media (min-width: 1620px) {
	.em-assortment {
		max-width: 1560px;
	}
}

/* When a theme template already drops the view inside its own centred
   container (the Dutchmed archive/product overrides wrap it in .container),
   don't constrain or pad a second time — let the theme's container win. */
.container .em-assortment {
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

/* --------------------------------------------------------------------------
   Header block
   -------------------------------------------------------------------------- */
.em-assortment-header {
	position: relative;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 2rem;
	background: #eef2fb;
	border-radius: 28px;
	padding: clamp(1.5rem, 4vw, 2.75rem);
	margin-bottom: 2rem;
}

.em-assortment-header__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.875rem;
	font-weight: 900;
	color: var(--em-assortment-accent, #49b8ab);
	margin: 0 0 0.75rem;
}

.em-assortment-header__eyebrow::before {
	content: "";
	width: 1.15em;
	height: 1.15em;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 441.88 438.14'%3E%3Cpath transform='translate(-60,474.097) scale(0.1,-0.1)' d='M789 4726 c-87 -31 -149 -93 -177 -175 -9 -25 -12 -332 -12 -1157 l0 -1124 408 0 c224 0 446 -5 492 -10 670 -83 1104 -495 1254 -1190 30 -141 53 -344 62 -553 l6 -157 997 2 c991 3 996 3 1042 24 55 26 108 77 135 130 18 37 19 69 22 642 2 572 1 605 -16 646 -27 59 -72 107 -129 136 l-48 25 -734 5 -733 5 353 360 c194 198 453 461 576 585 253 256 268 279 267 395 0 60 -4 79 -29 123 -43 74 -810 827 -871 854 -66 29 -131 33 -200 13 -66 -19 -34 12 -887 -851 l-366 -372 -3 722 -3 721 -28 57 c-34 70 -94 124 -161 143 -69 21 -1160 21 -1217 1z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 441.88 438.14'%3E%3Cpath transform='translate(-60,474.097) scale(0.1,-0.1)' d='M789 4726 c-87 -31 -149 -93 -177 -175 -9 -25 -12 -332 -12 -1157 l0 -1124 408 0 c224 0 446 -5 492 -10 670 -83 1104 -495 1254 -1190 30 -141 53 -344 62 -553 l6 -157 997 2 c991 3 996 3 1042 24 55 26 108 77 135 130 18 37 19 69 22 642 2 572 1 605 -16 646 -27 59 -72 107 -129 136 l-48 25 -734 5 -733 5 353 360 c194 198 453 461 576 585 253 256 268 279 267 395 0 60 -4 79 -29 123 -43 74 -810 827 -871 854 -66 29 -131 33 -200 13 -66 -19 -34 12 -887 -851 l-366 -372 -3 722 -3 721 -28 57 c-34 70 -94 124 -161 143 -69 21 -1160 21 -1217 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.em-assortment-header__title {
	font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.25rem);
	color: #263977;
	margin-bottom: 0.75rem;
}

.em-assortment-header__intro {
	color: #5b6789;
	font-size: 1.0625rem;
	line-height: 1.7;
	max-width: 52ch;
}

.em-assortment-header__intro p + p {
	margin-top: 0.75rem;
}

.em-assortment-header__image {
	flex: none;
	width: clamp(160px, 22vw, 260px);
}

.em-assortment-header__image img {
	max-width: 100%;
	height: auto;
	border-radius: 18px;
	box-shadow: 0 6px 18px rgba(38, 57, 119, 0.10);
}

/* --------------------------------------------------------------------------
   Toolbar: count line, grid/list toggle, PDF download
   -------------------------------------------------------------------------- */
.em-assortment-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0 0 3rem;
}

.em-assortment-toolbar__count {
	color: #5b6789;
	font-size: 0.875rem;
}

.em-assortment-toolbar__actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.em-assortment-toggle {
	display: inline-flex;
	background: #f5f7fb;
	border: 1px solid #e3e8f2;
	border-radius: 999px;
	padding: 0.25rem;
	gap: 0.25rem;
}

.em-assortment-toggle__btn {
	border: 0;
	background: transparent;
	color: #5b6789;
	font-size: 0.875rem;
	font-weight: 700;
	padding: 0.45rem 1.1rem;
	border-radius: 999px;
	transition: background 180ms cubic-bezier(0.4, 0, 0.2, 1), color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.em-assortment-toggle__btn:hover {
	color: #263977;
}

.em-assortment-toggle__btn[aria-pressed="true"] {
	background: #fff;
	color: #263977;
	box-shadow: 0 1px 2px rgba(38, 57, 119, 0.06), 0 1px 3px rgba(38, 57, 119, 0.08);
}

.em-assortment-toolbar__pdf {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 1.2rem;
	font-size: 0.875rem;
	font-weight: 700;
	color: #263977;
	background: transparent;
	border: 2px solid #b9c7e7;
	border-radius: 8px;
	text-decoration: none;
	transition: background 180ms cubic-bezier(0.4, 0, 0.2, 1), border-color 180ms cubic-bezier(0.4, 0, 0.2, 1), color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.em-assortment-toolbar__pdf::before {
	content: "";
	width: 1em;
	height: 1em;
	flex: none;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M6 11l6 6 6-6'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='M6 11l6 6 6-6'/%3E%3Cpath d='M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;
}

.em-assortment-toolbar__pdf:hover {
	background: #eef2fb;
	border-color: #b9c7e7;
	color: #263977;
}

/* --------------------------------------------------------------------------
   Grid view
   -------------------------------------------------------------------------- */
.em-assortment-grid__group {
	margin-bottom: 4rem;
}

.em-assortment-grid__group-title {
	font-size: 1.875rem;
	color: #263977;
	margin-bottom: 0.5rem;
}

.em-assortment-grid__group-description {
	color: #5b6789;
	max-width: 62ch;
	margin-bottom: 1.5rem;
}

.em-assortment-grid__cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}

.em-assortment-card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid #e3e8f2;
	border-radius: 18px;
	padding: 1rem;
	box-shadow: 0 1px 2px rgba(38, 57, 119, 0.06), 0 1px 3px rgba(38, 57, 119, 0.08);
	transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1), border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.em-assortment-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 6px 18px rgba(38, 57, 119, 0.10);
	border-color: #b9c7e7;
}

.em-assortment-card__image {
	margin-bottom: 0.75rem;
	border-radius: 10px;
	overflow: hidden;
	background: #f5f7fb;
}

.em-assortment-card__image img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: contain;
	background: #f5f7fb;
}

/* Holds the same box as a photo would, so a card without one keeps its
   proportions and the row stays level. Labelled rather than blank: an empty
   grey panel reads as an image that failed to load. */
.em-assortment-card__image--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
}

.em-assortment-image-placeholder {
	font-size: 0.8125rem;
	color: #8a93ab;
}

.em-assortment-card__title {
	font-weight: 700;
	color: #263977;
	line-height: 1.25;
	margin: 0 0 0.25rem;
}

.em-assortment-card__descriptor {
	color: #5b6789 !important;
	font-size: 0.875rem !important;
	margin: 0 0 0.5rem;
}

.em-assortment-card__art-nr,
.em-assortment-product__art-nr {
	display: inline-flex;
	font-weight: 700;
	letter-spacing: 0.04em;
	background: #e7f5f3;
	border-radius: 999px;
}

.em-assortment-card__art-nr {
	font-size: 0.75rem !important;
	color: #318a7e !important;
	padding: 0.2rem 0.55rem;
}

/* --------------------------------------------------------------------------
   List view / table
   -------------------------------------------------------------------------- */
.em-assortment-list__table-wrap {
	overflow-x: auto;
	border: 1px solid #e3e8f2;
	border-radius: 18px;
}

.em-assortment-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
}

.em-assortment-table thead th {
	position: sticky;
	top: 0;
	background: #eef2fb;
	color: #263977;
	font-weight: 700;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	text-align: left;
	padding: 0.75rem 1rem;
}

.em-assortment-table th,
.em-assortment-table td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #e3e8f2;
	vertical-align: top;
}

.em-assortment-table tbody tr:hover {
	background: #f5f7fb;
}

.em-assortment-table tbody tr:last-child td {
	border-bottom: 0;
}

.em-assortment-table img {
	border-radius: 6px;
}

.em-assortment-table__bullets {
	margin: 0;
	padding-left: 1.1em;
	list-style: disc;
	color: #5b6789;
}

/* --------------------------------------------------------------------------
   Single product page
   -------------------------------------------------------------------------- */
.em-assortment-product__back {
	display: inline-block;
	font-size: 0.875rem;
	font-weight: 700;
	margin-bottom: 1.5rem;
}

.em-assortment-product__title {
	font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.25rem);
	margin-bottom: 0.5rem;
}

.em-assortment-product__descriptor {
	color: #5b6789;
	font-size: 1.25rem;
	margin: 0.5rem 0 1rem;
}

.em-assortment-product__art-nr {
	font-size: 0.75rem;
	color: #318a7e;
	padding: 0.25rem 0.7rem;
	margin-bottom: 2rem;
}

.em-assortment-product__image {
	margin-bottom: 2rem;
	border-radius: 18px;
	overflow: hidden;
	background: #f5f7fb;
}

.em-assortment-product__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 0.75rem;
	margin-bottom: 2rem;
}

.em-assortment-product__gallery img {
	border-radius: 10px;
	border: 1px solid #e3e8f2;
}

.em-assortment-product__bullets {
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.em-assortment-product__bullets li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.5rem;
	color: #263977;
}

.em-assortment-product__bullets li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: var(--em-assortment-accent, #49b8ab);
}

.em-assortment-product__attributes {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e3e8f2;
	border-radius: 18px;
	overflow: hidden;
}

.em-assortment-product__attributes th,
.em-assortment-product__attributes td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #e3e8f2;
	text-align: left;
	font-size: 0.875rem;
}

.em-assortment-product__attributes th {
	width: 40%;
	color: #263977;
	font-weight: 700;
	background: #f5f7fb;
}

.em-assortment-product__attributes tr:last-child th,
.em-assortment-product__attributes tr:last-child td {
	border-bottom: 0;
}

@media (max-width: 1024px) {
	.em-assortment-grid__cards {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.em-assortment-grid__cards {
		grid-template-columns: 1fr;
	}

	.em-assortment-header {
		flex-direction: column;
		padding: 1.5rem;
	}

	.em-assortment-header__image {
		width: 100%;
	}

	.em-assortment-toolbar {
		flex-direction: column;
		align-items: flex-start;
	}
}
