/* Drevko Personalizer — product page and order preview.
   Colours follow the theme tokens when present, with wood-toned fallbacks. */

.drvp {
	margin: 22px 0;
	--drvp-ink: var(--dv-ink, #2B2621);
	--drvp-line: var(--dv-line, #E4D9C9);
	--drvp-walnut: var(--dv-walnut, #6B4A32);
	--drvp-walnut-d: var(--dv-walnut-d, #513625);
	--drvp-sand: var(--dv-sand, #F4ECE1);
	--drvp-paper: var(--dv-paper, #FDFAF5);
	--drvp-bark: var(--dv-bark, #857868);
}

.drvp__buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

/* The block has no heading any more: this button is the instruction. */
.drvp__btn {
	flex: 1 1 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 20px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	background: var(--drvp-walnut);
	border: 1px solid var(--drvp-walnut);
	border-radius: 10px;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.drvp__btn:hover {
	background: var(--drvp-walnut-d);
	border-color: var(--drvp-walnut-d);
	color: #fff;
}

.drvp__btn-pencil {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Once filled in, the button steps back: it becomes a quiet "edit" affordance. */
.drvp__btn.is-done {
	background: #F1F5EF;
	border-color: #4E7A46;
	color: #2C4A26;
}

.drvp__btn.is-done:hover { background: #E7EFE4; color: #2C4A26; }

.drvp__btn.is-done .drvp__btn-pencil {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232C4A26' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E");
}

.drvp__check {
	color: #2E7D32;
	font-weight: 700;
}

.drvp__hint {
	font-size: 13px;
	color: var(--drvp-bark);
	margin: 10px 0 0;
}

/* ---------- paid gift box add-on ---------- */
.drvp-addon {
	display: grid;
	grid-template-columns: 132px minmax(0, 1fr);
	gap: 18px;
	align-items: center;
	margin: 18px 0 22px;
	padding: 18px;
	background: var(--dv-sand, #F4ECE1);
	border: 1px solid var(--dv-sand-dk, #E9DCCB);
	border-radius: 14px;
	transition: border-color .25s ease, box-shadow .25s ease;
}

.drvp-addon.is-taken {
	border-color: var(--dv-walnut, #6B4A32);
	box-shadow: 0 0 0 1px var(--dv-walnut, #6B4A32) inset;
}

.drvp-addon__media img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	border-radius: 10px;
	background: #fff;
}

.drvp-addon__title {
	font-family: var(--dv-serif, Georgia, serif);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.25;
	margin: 0 0 6px;
	color: var(--dv-ink, #2B2621);
}

.drvp-addon__text {
	font-size: 13.5px;
	line-height: 1.5;
	color: #574F45;
	margin: 0 0 12px;
}

.drvp-addon__choice {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	color: var(--dv-ink, #2B2621);
}

.drvp-addon__choice input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--dv-walnut, #6B4A32);
	flex: 0 0 auto;
}

.drvp-addon__price {
	margin-left: auto;
	background: var(--dv-walnut, #6B4A32);
	color: #fff;
	border-radius: 999px;
	padding: 5px 14px;
	font-size: 14px;
	font-weight: 700;
	white-space: nowrap;
}

.drvp-addon__price .woocommerce-Price-amount { color: inherit; }

.drvp-addon__note {
	font-size: 13px;
	color: var(--dv-walnut, #6B4A32);
	margin: 10px 0 0;
}

@media (max-width: 560px) {
	.drvp-addon {
		grid-template-columns: 1fr;
		text-align: left;
	}
	.drvp-addon__media { max-width: 132px; }
	.drvp-addon__price { margin-left: 0; }
}

/* ---------- modal ---------- */
.drvp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.drvp-modal[hidden] { display: none; }

.drvp-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(43, 38, 33, .58);
}

.drvp-modal__dialog {
	position: relative;
	background: var(--dv-paper, #FDFAF5);
	border-radius: 14px;
	width: 100%;
	max-width: 460px;
	margin: auto;
	max-height: 90dvh;
	overflow-y: auto;
	padding: 22px;
	box-sizing: border-box;
	box-shadow: 0 18px 50px rgba(43, 38, 33, .28);
}

.drvp-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: var(--dv-bark, #857868);
}

.drvp-modal__close:hover { color: var(--dv-walnut, #6B4A32); }

.drvp-modal__title {
	font-size: 19px;
	font-weight: 600;
	margin: 0 0 14px;
	padding-right: 28px;
	color: var(--dv-ink, #2B2621);
}

/* ---------- preview ---------- */
.drvp-modal__preview {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 10px;
	background: var(--dv-sand, #F4ECE1);
	container-type: inline-size;
}

.drvp-modal__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.drvp-modal__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--dv-bark, #857868);
	font-size: 14px;
	text-align: center;
	padding: 1rem;
}

/* Sized in container query units so the engraving scales with the preview,
   exactly like the Shopify original. */
.drvp-text {
	position: absolute;
	transform: translate(-50%, -50%);
	white-space: nowrap;
	font-size: calc(var(--drvp-size, 4) * 1cqw);
	line-height: 1;
	pointer-events: none;
	text-shadow: 0 0 6px rgba(0, 0, 0, .08);
}

.drvp-font-script-1 { font-family: 'Great Vibes', cursive; }
.drvp-font-script-2 { font-family: 'Dancing Script', cursive; }
.drvp-font-elegant  { font-family: 'Playfair Display', serif; font-style: italic; }

/* ---------- fields ---------- */
.drvp-modal__fields {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.drvp-label {
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0 4px;
	display: block;
	color: var(--dv-ink, #2B2621);
}

.drvp-req { color: #C0392B; }

.drvp-input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--dv-line, #E4D9C9);
	border-radius: 8px;
	background: #fff;
	font-family: inherit;
	font-size: 16px;
	box-sizing: border-box;
}

.drvp-input:focus {
	outline: 2px solid var(--dv-amber, #C8842B);
	outline-offset: -2px;
}

.drvp-input.drvp-invalid { border-color: #C0392B; }

.drvp-modal__error {
	color: #C0392B;
	font-size: 14px;
	margin: 12px 0 0;
}

.drvp-modal__confirm {
	width: 100%;
	margin-top: 18px;
	padding: 14px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	border: 0;
	border-radius: 10px;
	background: var(--dv-walnut, #6B4A32);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease;
}

.drvp-modal__confirm:hover { background: var(--dv-walnut-d, #513625); }

/* ---------- order screen preview ---------- */
.drvp-admin-previews {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin: 10px 0;
}

.drvp-admin-preview {
	margin: 0;
	width: 190px;
}

.drvp-admin-preview figcaption {
	font-size: 12px;
	color: #666;
	margin-top: 4px;
	text-align: center;
}

@media (max-width: 480px) {
	.drvp-modal__dialog { padding: 18px 16px; }
	.drvp__btn { flex: 1 1 100%; }
}
