/* Hidden when attribute has a single fixed value */
.novashop-storefront .variations tr.ns-variation-row--fixed,
.novashop-storefront .variations .ns-variation-row--fixed {
	display: none !important;
}

.novashop-storefront .variations select option[hidden] {
	display: none;
}

/* Amazon-style variation UI */
.novashop-storefront .variations_form.ns-amazon-variations-ready > .variations {
	display: none !important;
}

.novashop-storefront .ns-amazon-variations {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin: 0 0 1rem;
}

.novashop-storefront .ns-amazon-attr {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

/* Multi-option attrs (Colore, Applicazione…) stay visible even if WC filters <option>s */
.novashop-storefront .ns-amazon-attr:not([data-ns-single="1"]) {
	display: flex !important;
}

.novashop-storefront .ns-amazon-attr[data-ns-single="1"] {
	display: none !important;
}

.novashop-storefront .ns-amazon-attr__label {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.3;
	color: #0f1111;
}

.novashop-storefront .ns-amazon-attr__label-name {
	font-weight: 400;
}

.novashop-storefront .ns-amazon-attr__label-value {
	font-weight: 700;
}

.novashop-storefront .ns-amazon-attr__label-value.is-empty {
	font-weight: 400;
	color: #565959;
}

/* Color / image tiles */
.novashop-storefront .ns-amazon-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
	gap: 0.5rem;
	max-width: 100%;
}

.novashop-storefront .ns-amazon-tile {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	padding: 0;
	margin: 0;
	border: 1px solid #d5d9d9;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	overflow: hidden;
	text-align: center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
	font: inherit;
	color: inherit;
}

.novashop-storefront .ns-amazon-tile:hover:not(:disabled) {
	border-color: #879596;
}

.novashop-storefront .ns-amazon-tile.is-selected {
	border-color: #007185;
	border-width: 2px;
	box-shadow: 0 0 0 1px #007185;
}

.novashop-storefront .ns-amazon-tile:disabled,
.novashop-storefront .ns-amazon-tile.is-disabled {
	opacity: 0.4;
	cursor: pointer;
	filter: grayscale(0.35);
}

.novashop-storefront .ns-amazon-tile__media {
	aspect-ratio: 1 / 1;
	background: #f3f3f3;
	overflow: hidden;
}

.novashop-storefront .ns-amazon-tile__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.novashop-storefront .ns-amazon-tile__price {
	border-top: 1px solid #e7e7e7;
	padding: 0.35rem 0.25rem;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.2;
	color: #0f1111;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.novashop-storefront .ns-amazon-tile__swatch {
	aspect-ratio: 1 / 1;
	width: 100%;
}

/* Pagination for many color tiles */
.novashop-storefront .ns-amazon-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin-top: 0.35rem;
	flex-wrap: wrap;
}

.novashop-storefront .ns-amazon-pager__btn {
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.45rem;
	border: 1px solid #d5d9d9;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	font-size: 0.85rem;
	line-height: 1;
	color: #0f1111;
}

.novashop-storefront .ns-amazon-pager__btn:hover:not(:disabled) {
	background: #f7fafa;
	border-color: #007185;
}

.novashop-storefront .ns-amazon-pager__btn.is-active {
	border-color: #007185;
	box-shadow: 0 0 0 1px #007185;
	font-weight: 700;
}

.novashop-storefront .ns-amazon-pager__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

/* Size / text chips */
.novashop-storefront .ns-amazon-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.novashop-storefront .ns-amazon-chip {
	min-width: 2.75rem;
	padding: 0.55rem 0.85rem;
	border: 1px solid #d5d9d9;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.2;
	color: #0f1111;
	appearance: none;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.novashop-storefront .ns-amazon-chip:hover:not(:disabled) {
	border-color: #879596;
}

.novashop-storefront .ns-amazon-chip.is-selected {
	border-color: #007185;
	border-width: 2px;
	background: #e7f4f5;
	box-shadow: 0 0 0 1px #007185;
	padding: calc(0.55rem - 1px) calc(0.85rem - 1px);
}

.novashop-storefront .ns-amazon-chip:disabled,
.novashop-storefront .ns-amazon-chip.is-disabled {
	opacity: 0.4;
	cursor: pointer;
	text-decoration: line-through;
}

.novashop-storefront .ns-amazon-reset {
	margin: 0.25rem 0 0;
	font-size: 0.85rem;
}

.novashop-storefront .ns-amazon-reset a {
	color: #007185;
	text-decoration: none;
}

.novashop-storefront .ns-amazon-reset a:hover {
	text-decoration: underline;
	color: #c7511f;
}

.novashop-storefront .ns-amazon-chip {
	white-space: normal;
	text-align: center;
	max-width: 100%;
	overflow-wrap: anywhere;
}

@media (max-width: 720px) {
	.novashop-storefront .ns-amazon-variations {
		gap: 1rem;
		min-width: 0;
		max-width: 100%;
	}

	.novashop-storefront .ns-amazon-attr {
		min-width: 0;
	}

	.novashop-storefront .ns-amazon-attr__label {
		font-size: 0.9rem;
		line-height: 1.35;
		overflow-wrap: anywhere;
	}

	.novashop-storefront .ns-amazon-tiles {
		grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
		gap: 0.4rem;
	}

	.novashop-storefront .ns-amazon-tile {
		border-radius: 6px;
		min-width: 0;
	}

	.novashop-storefront .ns-amazon-tile__price {
		font-size: 0.7rem;
		padding: 0.3rem 0.2rem;
	}

	.novashop-storefront .ns-amazon-chips {
		gap: 0.35rem;
	}

	.novashop-storefront .ns-amazon-chip {
		flex: 0 1 auto;
		min-width: min(100%, 7.5rem);
		padding: 0.55rem 0.65rem;
		font-size: 0.82rem;
		border-radius: 6px;
		line-height: 1.25;
	}

	.novashop-storefront .ns-amazon-pager {
		gap: 0.3rem;
	}

	.novashop-storefront .ns-amazon-pager__btn {
		min-width: 2.25rem;
		height: 2.25rem;
	}
}

@media (max-width: 420px) {
	.novashop-storefront .ns-amazon-tiles {
		grid-template-columns: repeat(auto-fill, minmax(4rem, 1fr));
		gap: 0.35rem;
	}

	.novashop-storefront .ns-amazon-chip {
		min-width: min(100%, 6.5rem);
		font-size: 0.8rem;
		padding: 0.5rem 0.55rem;
	}
}
