/* Edible picture templates ([diy_edible_templates]) */

.diy-templates__steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin: 0 0 24px !important;
	padding: 0 !important;
	list-style: none !important;
}
.diy-templates__steps li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border-radius: 10px;
	background: #fff5f9;
	font-weight: 600;
	line-height: 1.3;
}
.diy-templates__steps li span {
	flex: 0 0 32px;
	height: 32px;
	border-radius: 50%;
	background: #ff7aa4;
	color: #fff;
	text-align: center;
	line-height: 32px;
}

/* Category filter */
.diy-templates__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
}
.diy-templates__filters button {
	padding: 8px 16px;
	border: 1px solid #f0c9d7;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}
.diy-templates__filters button:hover {
	border-color: #ff7aa4;
}
.diy-templates__filters button.is-active {
	border-color: #ff7aa4;
	background: #ff7aa4;
	color: #fff;
}

/* Grid of designs */
.diy-templates__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}
.diy-template {
	display: flex;
	flex-direction: column;
	padding: 10px 10px 14px;
	border: 1px solid #f0c9d7;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	font: inherit;
	text-align: center;
	cursor: pointer;
	transition: box-shadow 0.15s, transform 0.15s;
}
.diy-template[hidden] {
	display: none;
}
.diy-template:hover,
.diy-template:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(255, 122, 164, 0.2);
}
.diy-template__img {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	border-radius: 8px;
	background: #faf7f8;
	overflow: hidden;
}
.diy-template__img img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}
.diy-template__title {
	margin-top: 10px;
	font-weight: 700;
	line-height: 1.3;
}
.diy-template__price {
	margin-top: 2px;
	font-size: 14px;
	opacity: 0.8;
}
.diy-template__cta {
	margin-top: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	background: #ff7aa4;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

/* "DIY Icing Centre" watermark over previews */
.diy-wm {
	position: relative;
}
.diy-wm::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='140'%3E%3Ctext x='10' y='90' transform='rotate(-25 110 70)' font-family='Arial,sans-serif' font-size='20' font-weight='700' fill='%23ffffff' fill-opacity='0.55' stroke='%23000000' stroke-opacity='0.12' stroke-width='0.6'%3EDIY Icing Centre%3C/text%3E%3C/svg%3E");
	background-repeat: repeat;
}
.diy-wm img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

/* Design pop-up */
.diy-tpl-modal[hidden] {
	display: none;
}
.diy-tpl-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.6);
}
.diy-tpl-modal__box {
	position: relative;
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 24px;
	width: 100%;
	max-width: 920px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 24px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}
.diy-tpl-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	z-index: 2;
	border: 0;
	background: none;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}
.diy-tpl-modal__preview {
	display: flex;
	align-items: center;
	justify-content: center;
	align-self: start;
	border-radius: 10px;
	background: #faf7f8;
	overflow: hidden;
}
.diy-tpl-modal__preview img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 100px);
	object-fit: contain;
}
.diy-tpl-modal__form h3 {
	margin: 0 0 14px;
	padding: 0 30px 0 0;
	font-size: 24px;
	line-height: 1.25;
}
.diy-tpl-sizes {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}
.diy-tpl-sizes legend,
.diy-tpl-field label {
	display: block;
	margin-bottom: 6px;
	font-weight: 700;
}
.diy-tpl-sizes label {
	display: inline-flex;
	margin: 0 8px 8px 0;
	cursor: pointer;
}
.diy-tpl-sizes input {
	position: absolute;
	opacity: 0;
}
.diy-tpl-sizes label span {
	padding: 10px 16px;
	border: 2px solid #f0c9d7;
	border-radius: 8px;
	line-height: 1.2;
}
.diy-tpl-sizes input:checked + span {
	border-color: #ff7aa4;
	background: #fff5f9;
}
.diy-tpl-sizes input:focus-visible + span {
	outline: 2px solid #409af9;
	outline-offset: 2px;
}
.diy-tpl-field {
	margin: 0 0 12px !important;
	padding: 0 !important;
}
.diy-tpl-field small {
	font-weight: 400;
	opacity: 0.7;
}
.diy-tpl-field input,
.diy-tpl-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font: inherit;
	box-sizing: border-box;
}
.diy-tpl-hint {
	margin: 0 0 14px !important;
	font-size: 14px;
	opacity: 0.8;
}
.diy-tpl-modal .diy-tpl-add {
	width: 100%;
	padding: 12px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: #ff7aa4 !important;
	color: #fff !important;
	font-size: 18px !important;
	cursor: pointer;
}
.diy-tpl-modal .diy-tpl-add::after {
	display: none !important;
}
.diy-tpl-modal .diy-tpl-add[disabled] {
	opacity: 0.6;
}
.diy-tpl-status {
	margin: 12px 0 0 !important;
	padding: 0 !important;
}
.diy-tpl-status:empty {
	display: none;
}
.diy-tpl-status.is-ok,
.diy-tpl-status.is-error {
	padding: 10px 12px !important;
	border-radius: 6px;
}
.diy-tpl-status.is-ok {
	background: #e9f7ef;
}
.diy-tpl-status.is-error {
	background: #fdecec;
}
.diy-tpl-status a {
	font-weight: 700;
	text-decoration: underline;
}
body.diy-tpl-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.diy-templates__steps {
		grid-template-columns: repeat(2, 1fr);
	}
	.diy-templates__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
	.diy-tpl-modal__box {
		grid-template-columns: 1fr;
		padding: 16px;
	}
	.diy-tpl-modal__preview img {
		max-height: 40vh;
	}
}
