/* Earring Builder — front-end styles (single page, button groups) */

.eb-builder {
	--eb-accent: #1a1a2e;
	--eb-accent-2: #b8860b;
	--eb-border: #e6e6ea;
	--eb-muted: #6b7280;
	--eb-bg: #fff;
	--eb-radius: 12px;
	max-width: 1120px;
	margin: 0 auto;
	color: #1a1a1a;
	font-size: 15px;
	line-height: 1.45;
}

.eb-builder *,
.eb-builder *::before,
.eb-builder *::after { box-sizing: border-box; }

/* Tabs: Build your own / Our earrings */
.eb-tabs {
	display: flex;
	gap: 6px;
	border-bottom: 1px solid var(--eb-border);
	margin-bottom: 24px;
}
.eb-tab {
	appearance: none;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	padding: 10px 18px;
	font: inherit;
	font-weight: 600;
	font-size: 16px;
	color: var(--eb-muted);
	cursor: pointer;
	margin-bottom: -1px;
}
.eb-tab.is-active { color: var(--eb-accent); border-bottom-color: var(--eb-accent); }
.eb-tab-panel { display: none; }
.eb-tab-panel.is-active { display: block; }

/* Diamond Studs heading */
.eb-studs-title { margin: 0 0 4px; font-size: 24px; }
.eb-studs-note { margin: 0 0 20px; color: var(--eb-muted); font-size: 14px; }

/* Diamond Studs filters (chips + size slider) */
.eb-regular-filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }

/* Size (carat) range slider */
.eb-range { position: relative; width: 240px; max-width: 100%; height: 28px; }
.eb-range-input {
	position: absolute;
	left: 0;
	top: 8px;
	width: 100%;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.eb-range-input::-webkit-slider-runnable-track { height: 4px; background: var(--eb-border); border-radius: 4px; }
.eb-range-input::-moz-range-track { height: 4px; background: var(--eb-border); border-radius: 4px; }
.eb-range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 18px;
	height: 18px;
	margin-top: -7px;
	border-radius: 50%;
	background: var(--eb-accent);
	cursor: pointer;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--eb-accent);
}
.eb-range-input::-moz-range-thumb {
	pointer-events: auto;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--eb-accent);
	cursor: pointer;
	border: 2px solid #fff;
}
.eb-range-out { font-size: 13px; color: var(--eb-muted); margin-left: 10px; white-space: nowrap; }
.eb-dot {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 1px solid rgba( 0, 0, 0, .18 );
	vertical-align: middle;
	margin-right: 6px;
}

/* Ready-made earrings grid */
.eb-regular {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 18px;
}
.eb-product-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--eb-border);
	border-radius: var(--eb-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow .15s, transform .15s;
}
.eb-product-card:hover { box-shadow: 0 6px 20px rgba( 0, 0, 0, .08 ); transform: translateY( -2px ); }
.eb-product-media { aspect-ratio: 1 / 1; background: #f7f7f9; }
.eb-product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eb-product-name { font-weight: 600; padding: 12px 12px 2px; }
.eb-product-price { padding: 0 12px; color: var(--eb-accent); font-weight: 600; }
.eb-product-btn { margin: 12px; text-align: center; }

/* Sort toolbar */
.eb-toolbar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.eb-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--eb-muted); }
.eb-sort select {
	font: inherit;
	font-size: 13px;
	padding: 6px 10px;
	border: 1px solid var(--eb-border);
	border-radius: 8px;
	background: #fff;
	color: #1a1a1a;
	cursor: pointer;
}

/* Compact 2-column grid on phones */
@media ( max-width: 600px ) {
	.eb-regular { grid-template-columns: repeat( 2, 1fr ); gap: 10px; }
	.eb-product-name { font-size: 13px; padding: 8px 8px 2px; }
	.eb-product-price { font-size: 13px; padding: 0 8px; }
	.eb-product-btn { margin: 8px; }
	.eb-product-btn.eb-btn { padding: 8px 10px; font-size: 13px; }
	.eb-toolbar { justify-content: stretch; }
	.eb-sort { width: 100%; justify-content: space-between; }
	.eb-sort select { flex: 1 1 auto; max-width: 60%; }
}

/* Layout */
.eb-layout {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 28px;
	align-items: start;
}
@media ( max-width: 840px ) {
	.eb-layout { grid-template-columns: 1fr; }
}

/* Groups */
.eb-group { margin-bottom: 30px; }
.eb-group-title {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 600;
}
.eb-options { display: flex; flex-wrap: wrap; gap: 12px; }

/* Shape buttons: compact pills */
.eb-options--shape .eb-opt { min-width: 110px; }

/* Setting buttons: card-like with image */
.eb-options--setting { display: grid; grid-template-columns: repeat( auto-fill, minmax( 150px, 1fr ) ); }

/* Metal buttons: pills with swatch */
.eb-options--metal .eb-opt { min-width: 140px; }

/* The option button */
.eb-opt {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border: 1px solid var(--eb-border);
	border-radius: var(--eb-radius);
	background: #fff;
	cursor: pointer;
	font: inherit;
	color: inherit;
	text-align: center;
	transition: box-shadow .15s, border-color .15s, transform .15s;
}
.eb-opt:hover { box-shadow: 0 6px 18px rgba( 0, 0, 0, .08 ); transform: translateY( -2px ); }
.eb-opt:focus-visible { outline: 2px solid var(--eb-accent); outline-offset: 2px; }
.eb-opt.is-selected { border-color: var(--eb-accent); box-shadow: 0 0 0 2px var(--eb-accent); }

.eb-opt-media {
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f7f7f9;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.eb-opt-media img { width: 100%; height: 100%; object-fit: cover; }

.eb-opt-swatch {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px rgba( 0, 0, 0, .18 );
}

.eb-opt-label { font-weight: 600; }
.eb-opt-price { color: var(--eb-accent); font-weight: 600; font-size: 14px; }
.eb-opt-price del { color: var(--eb-muted); font-weight: 400; margin-right: 4px; }

.eb-opt-check {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--eb-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	opacity: 0;
	transform: scale( .6 );
	transition: .15s;
}
.eb-opt.is-selected .eb-opt-check { opacity: 1; transform: scale( 1 ); }

.eb-empty, .eb-loading { color: var(--eb-muted); padding: 10px 0; }

/* Group hint */
.eb-group-hint { margin: -6px 0 14px; color: var(--eb-muted); font-size: 14px; }

/* Diamond filters */
.eb-dia-filters { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 16px; }
.eb-filter-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.eb-filter-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.eb-chip {
	padding: 6px 12px;
	border: 1px solid var(--eb-border);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
.eb-chip.is-active { background: var(--eb-accent); color: #fff; border-color: var(--eb-accent); }

.eb-opt-meta { font-size: 12px; color: var(--eb-muted); }

/* Top compact selectors (Setting + Metal) */
.eb-top-selectors {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	padding-bottom: 20px;
	margin-bottom: 22px;
	border-bottom: 1px solid var(--eb-border);
}
.eb-group--compact { margin-bottom: 0; flex: 1 1 240px; }
.eb-group--type { margin-bottom: 18px; flex-basis: 100%; }
.eb-mini-title {
	margin: 0 0 8px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--eb-muted);
}
.eb-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Selectable chip (Setting + Metal), styled like the Lab/Natural toggle */
.eb-chip--select {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--eb-border);
}
.eb-chip--select.is-selected {
	border-color: var(--eb-accent);
	box-shadow: 0 0 0 2px var(--eb-accent);
}
.eb-chip-price { font-size: 12px; opacity: .8; }

/* Metal chip: the whole tab takes the metal colour */
.eb-metal-chip {
	border: 1px solid rgba( 0, 0, 0, .18 );
	font-weight: 600;
}
.eb-metal-chip.is-selected {
	border-color: var(--eb-accent);
	box-shadow: 0 0 0 2px var(--eb-accent);
}

/* Lab / Natural toggle */
.eb-type-toggle { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* Diamond grid: one row per carat size, quality tiers across */
.eb-rows { display: flex; flex-direction: column; gap: 18px; }
.eb-row {
	border: 1px solid var(--eb-border);
	border-radius: var(--eb-radius);
	padding: 14px;
	background: #fff;
}
.eb-row-size {
	font-weight: 700;
	font-size: 15px;
	margin-bottom: 12px;
	letter-spacing: .02em;
}
.eb-row-items {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 12px;
}
@media ( max-width: 560px ) {
	.eb-row-items { grid-template-columns: 1fr; }
}
.eb-opt--empty {
	cursor: default;
	opacity: .5;
	justify-content: center;
}
.eb-opt--empty:hover { box-shadow: none; transform: none; }

/* Buttons */
.eb-btn {
	appearance: none;
	border: 1px solid var(--eb-accent);
	background: var(--eb-accent);
	color: #fff;
	padding: 13px 22px;
	border-radius: 10px;
	font-weight: 600;
	cursor: pointer;
	font-size: 15px;
}
.eb-btn:disabled { opacity: .45; cursor: not-allowed; }
.eb-btn--block { width: 100%; }
.eb-btn--ghost { background: #fff; color: var(--eb-accent); }
.eb-btn--primary:hover:not(:disabled) { filter: brightness( 1.12 ); }

/* Summary sidebar */
.eb-summary {
	border: 1px solid var(--eb-border);
	border-radius: var(--eb-radius);
	padding: 20px;
	position: sticky;
	top: 24px;
	background: #fbfbfc;
}
.eb-summary h4 { margin: 0 0 14px; font-size: 16px; }
.eb-summary-list { list-style: none; margin: 0 0 14px; padding: 0; }
.eb-summary-list li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px dashed var(--eb-border);
	font-size: 14px;
}
.eb-summary-list li span { color: var(--eb-muted); }
.eb-summary-list li em { font-style: normal; text-align: right; }
.eb-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 6px 0 16px;
	font-size: 18px;
}
.eb-summary-total strong { color: var(--eb-accent); font-size: 22px; }

/* Admin notice (shop managers only) */
.eb-admin-notice {
	border: 1px solid #f0c36d;
	background: #fff8e5;
	padding: 14px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 14px;
}
.eb-admin-notice em { color: var(--eb-muted); font-style: italic; }
