.ets-samples-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 30px;
	margin: 20px 0;
}

.ets-samples-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 160px, 1fr ) );
	gap: 16px;
	flex: 1 1 600px;
}

.ets-sample-card {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 14px 10px 10px;
	text-align: center;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	position: relative;
	transition: border-color .15s, box-shadow .15s;
}

.ets-sample-card:hover {
	border-color: #aaa;
}

.ets-sample-card input[type="checkbox"] {
	position: absolute;
	top: 8px;
	left: 8px;
	width: 18px;
	height: 18px;
}

.ets-sample-card input[type="checkbox"]:checked ~ * ,
.ets-sample-card:has( input:checked ) {
	border-color: #2c7c4a;
	box-shadow: 0 0 0 2px #2c7c4a inset;
}

.ets-sample-image img {
	max-width: 100%;
	border-radius: 4px;
	display: block;
}

.ets-sample-name {
	font-weight: 600;
}

.ets-sample-spec {
	font-size: 12px;
	color: #666;
}

.ets-sample-box {
	flex: 0 0 260px;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 16px;
	align-self: flex-start;
}

.ets-sample-box h3 {
	margin-top: 0;
}

.ets-selected-list {
	list-style: none;
	margin: 10px 0;
	padding: 0;
}

.ets-selected-list li {
	padding: 4px 0;
	border-bottom: 1px solid #eee;
}

.ets-request-btn {
	width: 100%;
}

.ets-existing-notice {
	font-size: 12px;
	color: #f59e0b;
	margin: 0 0 12px;
	line-height: 1.4;
}

/* ---- Product page: free sample link ---- */

/* Products not ticked "Available as Sample" must not show a sample link, no
   matter what printed it (the plugin, or a Divi Code module in the template). */
body.ets-no-sample .et-product-sample-wrap,
body.ets-no-sample .et-sample-link-wrap {
	display: none !important;
}

.et-product-sample-wrap {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #e0e0d8;
	/* When the hook prints this inside a flex add-to-cart row (Divi), take a
	   full row so it sits below the buttons, not squeezed beside them. The row
	   itself also has to be allowed to wrap, which the rule below does. */
	flex: 0 0 100%;
	width: 100%;
	box-sizing: border-box;
}

/* Let whatever row holds the sample link wrap, so the link drops under the
   Add to Cart / Fast Quote buttons instead of shrinking them. The JS does the
   same thing for browsers without :has(). */
:has( > .et-product-sample-wrap ) {
	flex-wrap: wrap !important;
}

.et-sample-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #209e2e;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	transition: color .15s;
}

.et-sample-link:hover {
	color: #14691f;
	text-decoration: underline;
}

.et-sample-link svg {
	flex-shrink: 0;
}

.et-sample-sub {
	margin: 4px 0 0;
	padding-left: 22px;
	font-size: 11px;
	color: #999;
}

.et-sample-already {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #209e2e;
	margin: 0;
}

.et-sample-error {
	margin: 6px 0 0;
	font-size: 12px;
	color: #c0392b;
}

.et-sample-link.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ---- Product page: "sample added" popup ---- */
body.ets-modal-open {
	overflow: hidden;
}

.ets-modal-overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 61, 19, 0.55);
	animation: ets-fade-in .18s ease-out;
}

.ets-modal-overlay .ets-modal {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 440px;
	padding: 32px 28px 28px;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	text-align: center;
	animation: ets-pop-in .2s ease-out;
}

.ets-modal-overlay .ets-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #777;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.ets-modal-overlay .ets-modal-close:hover {
	background: #f0f0ea;
	color: #333;
}

.ets-modal-overlay .ets-modal-icon {
	margin: 0 auto 8px;
	color: #209e2e;
	line-height: 0;
}

.ets-modal-overlay .ets-modal-title {
	margin: 0 0 8px;
	padding: 0;
	color: #252525;
	font-size: 22px;
	line-height: 1.25;
	font-family: "Nunito", sans-serif;
	font-weight: 800;
}

.ets-modal-overlay .ets-modal-text {
	margin: 0 0 16px;
	padding: 0;
	color: #666666;
	font-size: 15px;
	line-height: 1.5;
}

.ets-modal-overlay .ets-modal-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin: 0 0 22px;
}

.ets-modal-overlay .ets-dot {
	box-sizing: border-box;
	width: 12px;
	height: 12px;
	border: 2px solid #209e2e;
	border-radius: 50%;
	background: transparent;
}

.ets-modal-overlay .ets-dot.is-filled {
	background: #209e2e;
}

.ets-modal-overlay .ets-modal-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.ets-modal-overlay .ets-btn {
	display: inline-block;
	box-sizing: border-box;
	padding: 13px 26px;
	border: 2px solid transparent;
	border-radius: 30px;
	font-family: "Nunito", sans-serif;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
}

.ets-modal-overlay .ets-btn-primary {
	background: #209e2e;
	border-color: #209e2e;
	color: #fff;
}

.ets-modal-overlay .ets-btn-primary:hover {
	background: #14691f;
	border-color: #14691f;
	color: #fff;
}

.ets-modal-overlay .ets-btn-secondary {
	background: #8fe39a;
	border-color: #8fe39a;
	color: #0f3d13;
}

.ets-modal-overlay .ets-btn-secondary:hover {
	background: #6fd27c;
	border-color: #6fd27c;
}

.ets-modal-overlay .ets-btn:focus-visible,
.ets-modal-overlay .ets-modal-close:focus-visible {
	outline: 3px solid #0f3d13;
	outline-offset: 2px;
}

@keyframes ets-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes ets-pop-in {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ets-modal-overlay,
	.ets-modal-overlay .ets-modal {
		animation: none;
	}
}

@media (max-width: 480px) {
	.ets-modal-overlay .ets-modal {
		padding: 28px 20px 22px;
	}

	.ets-modal-overlay .ets-btn {
		width: 100%;
	}
}

/* ---- Product page: free sample call-to-action banner ---- */
.et-product-sample-wrap {
	border-top: 0;
	padding-top: 0;
	margin-top: 20px;
}

.et-product-sample-wrap .et-sample-link {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 20px 12px 18px;
	background: #e9f9ea;
	border-radius: 60px;
	color: #209e2e;
	font-family: 'Nunito', sans-serif;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
	text-decoration: none;
	transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.et-product-sample-wrap .et-sample-link:hover {
	background: #dcf5de;
	color: #14691f;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(32, 158, 46, .15);
	transform: translateY(-1px);
}

.et-product-sample-wrap .et-sample-link:focus-visible {
	outline: 3px solid #209e2e;
	outline-offset: 3px;
}

.et-product-sample-wrap .et-sample-icon {
	flex: 0 0 auto;
	width: 56px;
	height: auto;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
}

.et-product-sample-wrap .et-sample-divider {
	flex: 0 0 2px;
	align-self: stretch;
	margin: 6px 0;
	background: #209e2e;
	opacity: .55;
}

.et-product-sample-wrap .et-sample-text {
	flex: 1 1 auto;
	min-width: 0;
}

.et-product-sample-wrap .et-sample-chevron {
	flex: 0 0 auto;
	display: inline-flex;
	line-height: 0;
	color: #209e2e;
	transition: transform .2s ease, color .2s ease;
}

.et-product-sample-wrap .et-sample-link:hover .et-sample-chevron {
	color: #14691f;
	transform: translateX(3px);
}

.et-product-sample-wrap .et-sample-sub {
	margin: 8px 0 0;
	padding-left: 24px;
}

/* "Already added" state matches the banner */
.et-product-sample-wrap .et-sample-already {
	padding: 14px 22px;
	background: #e9f9ea;
	border-radius: 60px;
	font-family: 'Nunito', sans-serif;
	font-weight: 800;
	font-size: 16px;
}

@media (max-width: 560px) {
	.et-product-sample-wrap .et-sample-link {
		gap: 12px;
		padding: 12px 16px 12px 14px;
		font-size: 16px;
	}

	.et-product-sample-wrap .et-sample-icon {
		width: 42px;
	}

	.et-product-sample-wrap .et-sample-chevron svg {
		width: 22px;
		height: 22px;
	}
}
