/* Youzhen Skin — assets/css/diy.css
 * DIY mala / bracelet configurator layout (per-bead model). Mobile-first;
 * the ring preview scales via the SVG viewBox so a full bracelet never overflows
 * on phones. Palette: cream #faf8f4, gold accent #c9a227.
 */

.diy-subtitle {
	margin: 0 0 1.5rem;
	color: #5b5b5b;
	font-size: .95rem;
	line-height: 1.6;
}

.diy-layout {
	display: grid;
	grid-template-columns: minmax(220px, 300px) 1fr;
	gap: 2rem;
	align-items: start;
}

.diy-preview-wrap {
	position: sticky;
	top: 1rem;
	text-align: center;
}

.diy-preview-label {
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #8a8a8a;
	margin-bottom: .5rem;
}

.diy-ring {
	width: 100%;
	max-width: 280px;
	height: auto;
	display: block;
	margin: 0 auto;
}

/* Each bead is a <g> holding the photo + outline + gloss, so all three move
   together when dragged. 1.1.24 */
.diy-bead {
	cursor: grab;
	outline: none;
	/* The bead — not the whole SVG — owns dragging, so the page still scrolls
	   when the finger starts anywhere else on the ring. Declared on every
	   hit-testable descendant too: the touch starts on the <image>, and Chrome
	   only honours touch-action on the element it actually hits. Without this a
	   vertical drag gets stolen as a page scroll and fires pointercancel. */
	touch-action: none;
	-webkit-tap-highlight-color: transparent;
	transition: opacity .12s;
}

.diy-bead-shape,
.diy-bead-outline {
	touch-action: none;
	-webkit-user-drag: none;
	user-select: none;
}

.diy-bead:hover {
	opacity: .85;
}

.diy-bead:active,
.diy-bead.is-dragging {
	cursor: grabbing;
}

/* Detach feedback: everything except the dragged bead fades back. */
.diy-ring.is-reordering .diy-bead:not(.is-dragging) {
	opacity: .5;
}

.diy-bead-shape {
	-webkit-user-drag: none;
	user-select: none;
}

/* Keyboard focus ring, drawn on the bead outline itself. */
.diy-bead:focus-visible .diy-bead-outline {
	stroke: #c9a227;
	stroke-width: 1.1;
}

/* Dashed placeholder showing which slot the dragged bead will land in. */
.diy-drop-marker {
	opacity: 0;
	transition: opacity .12s;
}

.diy-ring.is-reordering .diy-drop-marker {
	opacity: 1;
}

/* Sound toggle — only ever un-hidden by JS (needs a usable AudioContext). */
.diy-sound {
	margin: .7rem auto 0;
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .3rem .7rem;
	border: 1px solid #e2ddd3;
	border-radius: 999px;
	background: #fff;
	color: #8a8a8a;
	font-size: .72rem;
	letter-spacing: .04em;
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}

.diy-sound:hover {
	border-color: #c9a227;
	color: #8a6d12;
}

.diy-sound-icon {
	display: block;
	flex: 0 0 auto;
}

.diy-sound.is-muted {
	color: #b5b5b5;
}

.diy-sound.is-muted .diy-sound-wave,
.diy-sound.is-muted .diy-sound-wave2 {
	opacity: 0;
}

.diy-sound:not(.is-muted) .diy-sound-slash {
	opacity: 0;
}

.diy-price {
	margin-top: 1rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: #2f2f2f;
}

.diy-count {
	margin-top: .25rem;
	font-size: .8rem;
	color: #8a8a8a;
}

.diy-hint {
	margin-top: .35rem;
	font-size: .78rem;
	color: #b08e1f;
	min-height: 1.1em;
}

.diy-form {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}

.diy-group {
	border: 0;
	margin: 0;
	padding: 0;
}

.diy-group legend {
	font-weight: 600;
	font-size: .95rem;
	margin-bottom: .5rem;
	padding: 0;
}

/* Material tabs */
.diy-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.diy-tab {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .45rem .8rem;
	border: 1px solid #e2ddd3;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: .9rem;
	transition: border-color .15s, background .15s;
	user-select: none;
}

.diy-tab:hover {
	border-color: #c9a227;
}

.diy-tab[aria-selected="true"] {
	border-color: #c9a227;
	background: #fbf6ea;
	font-weight: 600;
}

/* Bead cards: 2–4 columns, responsive */
.diy-cards-wrap {
	margin-top: .75rem;
}

.diy-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: .6rem;
}

@media (min-width: 480px) {
	.diy-cards {
		grid-template-columns: repeat(4, 1fr);
	}
}

.diy-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .3rem;
	padding: .7rem .4rem;
	border: 1px solid #e2ddd3;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
	font-size: .85rem;
	transition: border-color .15s, background .15s, transform .1s;
	user-select: none;
}

.diy-card:hover {
	border-color: #c9a227;
	background: #fbf6ea;
}

.diy-card:active {
	transform: scale(.97);
}

.diy-card-size {
	font-weight: 600;
	color: #2f2f2f;
}

.diy-card-price {
	color: #5b5b5b;
	font-size: .8rem;
}

.diy-per {
	color: #8a8a8a;
}

/* Bead card: real circular photo (front-end crops the close-up to a circle) or
   a solid colour fallback when a bead has no featured image. */
.diy-card-img {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(0, 0, 0, .12);
	flex: 0 0 auto;
}

.diy-card-img--color {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, .12);
	flex: 0 0 auto;
}

.diy-card-title {
	font-weight: 600;
	color: #2f2f2f;
	font-size: .85rem;
	line-height: 1.1;
	text-align: center;
}

.diy-card-sku {
	color: #8a8a8a;
	font-size: .68rem;
	letter-spacing: .02em;
}

.diy-swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, .15);
	flex: 0 0 auto;
}

/* Keep the legacy chip radios usable for wrist / finish */
.diy-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.diy-chip {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .45rem .8rem;
	border: 1px solid #e2ddd3;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: .9rem;
	transition: border-color .15s, background .15s;
	user-select: none;
}

.diy-chip input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.diy-chip:hover {
	border-color: #c9a227;
}

.diy-chip:has(input:checked) {
	border-color: #c9a227;
	background: #fbf6ea;
	font-weight: 600;
}

/* Action buttons */
.diy-btn-row {
	display: flex;
	flex-wrap: wrap;
	gap: .6rem;
	align-items: center;
	margin-top: .25rem;
}

.diy-secondary {
	padding: .7rem 1.1rem;
	border: 1px solid #c9a227;
	border-radius: 999px;
	background: #fff;
	color: #8a6d12;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s;
}

.diy-secondary:hover {
	background: #fbf6ea;
}

.diy-add {
	margin-top: .25rem;
	align-self: flex-start;
	padding: .8rem 1.6rem;
	border: 0;
	border-radius: 999px;
	background: #c9a227;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
}

.diy-add:hover {
	background: #b08e1f;
}

.diy-status {
	margin: .25rem 0 0;
	font-size: .85rem;
	color: #3a7d44;
	min-height: 1.1em;
}

@media (max-width: 720px) {
	.diy-layout {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
	.diy-preview-wrap {
		position: static;
		order: -1;
	}
	.diy-ring {
		max-width: 220px;
	}
}

/* Keep the drag micro-interactions from nauseating anyone who asked the OS not
   to animate things. The gesture itself still works. */
@media (prefers-reduced-motion: reduce) {
	.diy-bead,
	.diy-drop-marker,
	.diy-sound {
		transition: none;
	}
}
