/* Asztal Konfigurátor – front-end */
.ak-konfigurator {
	--ak-accent: #fd7c57;
	--ak-send: #fc643a;
	--ak-bg: #d3cec3;
	--ak-panel: #eadfda;
	--ak-radius: 3px;
	--ak-ink: #111827;
	background: var(--ak-bg);
	padding: 24px;
	box-sizing: border-box;
	font-family: inherit;
	color: var(--ak-ink);
}
.ak-konfigurator *,
.ak-konfigurator *::before,
.ak-konfigurator *::after,
.ak-modal *,
.ak-modal *::before,
.ak-modal *::after { box-sizing: border-box; }
.ak-konfigurator button,
.ak-modal button {
	font-family: inherit;
	border: 0;
	cursor: pointer;
	margin: 0;
	line-height: 1.15;
	text-transform: none;
	box-shadow: none;
	min-height: 0;
}
.ak-konfigurator button:focus-visible,
.ak-modal button:focus-visible { outline: 2px solid var(--ak-ink, #111827); outline-offset: 2px; }
.ak-konfigurator img { max-width: none; display: block; }

/* Fülek */
.ak-tabs { display: flex; gap: 12px; padding-top: 4px; flex-wrap: nowrap; position: relative; z-index: 2; }
.ak-tab {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 20px;
	border-radius: var(--ak-radius) var(--ak-radius) 0 0;
	font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
	background: var(--ak-panel); color: #4b5563;
	-webkit-font-smoothing: antialiased;
	transition: background .3s, color .3s;
}
.ak-tab span { font-weight: 800; }
.ak-tab img { width: 20px; height: 20px; }
.ak-tab.is-active { background: var(--ak-accent); color: var(--ak-ink); }
.ak-tab span { line-height: 1.15; }

/* Fő terület */
.ak-main { display: flex; gap: 16px; align-items: flex-start; position: relative; }
.ak-stage-wrap { min-width: 0; flex: 1; overflow: hidden; }
.ak-stage {
	position: relative; width: 100%; aspect-ratio: 16 / 10;
	height: var(--ak-viewer-height, auto);
	overflow: hidden; background: var(--ak-bg);
	border-radius: var(--ak-radius);
	box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.ak-stage-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ak-stage-bg--empty { background: linear-gradient(to bottom, #f9fafb, #f3f4f6); }
.ak-stage-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ak-table { position: absolute; width: 1050px; height: 580px; top: 50%; left: 50%; transform-origin: center center; transition: transform .2s ease-out; }
.ak-table img { position: absolute; height: auto; }
.ak-part-center { width: 190px; left: 50%; transform: translateX(-50%); top: 228px; z-index: 1; }
.ak-part-left   { width: 198px; left: calc(50% - 145px); top: 232px; z-index: 1; }
.ak-part-right  { width: 198px; left: calc(50% + 62px);  top: 232px; z-index: 1; }
.ak-part-top    { width: 450px; left: 50%; transform: translateX(-50%); top: 177px; z-index: 2; }

.ak-icon-btn {
	display: flex; align-items: center; justify-content: center;
	padding: 8px; border-radius: var(--ak-radius);
	background: var(--ak-panel); color: #4b5563;
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.ak-icon-btn:hover { color: var(--ak-ink); }
.ak-zoom { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 12px; }
.ak-topright { position: absolute; top: 8px; right: 8px; display: flex; align-items: stretch; gap: 12px; z-index: 3; }
.ak-share, .ak-dims-btn { background: rgba(234,223,218,.8); }
.ak-share img, .ak-dims-btn img { width: 20px; height: 20px; }
.ak-dims-btn { position: relative; color: #4b5563; }
.ak-dims-btn img { opacity: 0; }
.ak-dims-btn span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #374151; }
.ak-dims-btn[aria-pressed="true"] { background: var(--ak-panel); box-shadow: inset 0 0 0 1px rgba(17,24,39,.25); }
.ak-dims {
	position: absolute; top: 8px; left: 8px; z-index: 3;
	background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	border-radius: var(--ak-radius); padding: 8px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
	font-size: 12px; font-weight: 700; color: #1f2937; line-height: 1.6;
}
.ak-dims[hidden] { display: none; }

.ak-legend { position: absolute; bottom: 8px; left: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.ak-legend-item {
	display: flex; align-items: center; gap: 8px;
	background: rgba(255,255,255,.8); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
	border-radius: var(--ak-radius); padding: 6px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.05);
	font-size: 12px; font-weight: 700; color: #374151; white-space: nowrap;
}
.ak-dot { width: 16px; height: 16px; border-radius: 999px; flex-shrink: 0; }

/* Oldalpanel */
.ak-side { flex-shrink: 0; width: 140px; }
.ak-send {
	width: 100%; margin-bottom: 8px;
	display: flex; align-items: center; justify-content: center; gap: 4px;
	color: #fff; font-weight: 600; font-size: 14px;
	padding: 6px 12px; border-radius: var(--ak-radius);
	background: var(--ak-send); transition: opacity .2s;
}
.ak-send:hover { opacity: .9; }
.ak-panel-head { text-align: right; }
.ak-panel-head .ak-num { font-size: 12px; font-weight: 700; color: #9ca3af; letter-spacing: .1em; }
.ak-panel-head h3 { font-size: 14px; font-weight: 700; color: #1f2937; text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 0; }
.ak-group { display: flex; flex-direction: column; gap: 16px; }
.ak-group + .ak-group { margin-top: 24px; }

.ak-leg-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ak-leg {
	position: relative; aspect-ratio: 4 / 3; padding: 0; overflow: hidden;
	border-radius: var(--ak-radius); background: #fff; transition: box-shadow .3s, background .3s;
}
.ak-leg img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.ak-leg:hover { opacity: .92; }
.ak-leg.is-active { background: var(--ak-panel); box-shadow: 0 0 0 3px var(--ak-panel), 0 10px 15px -3px rgba(0,0,0,.1); }

.ak-opt-list { display: flex; flex-direction: column; gap: 8px; }
.ak-opt {
	padding: 10px 16px; border-radius: var(--ak-radius);
	font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
	background: #f3f4f6; color: #6b7280; transition: background .2s, color .2s;
}
.ak-opt:hover { background: #e5e7eb; }
.ak-opt.is-active { background: #111827; color: #fff; }

.ak-pal-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ak-pal {
	padding: 8px 12px; border-radius: var(--ak-radius); text-align: center;
	font-size: 10px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase;
	background: #f3f4f6; color: #6b7280; transition: background .2s, color .2s;
}
.ak-pal:hover { background: #e5e7eb; }
.ak-pal.is-active { background: #111827; color: #fff; }

.ak-swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; justify-items: center; }
.ak-swatch { position: relative; width: 22px; height: 22px; border-radius: 999px; padding: 0; transition: transform .15s, box-shadow .2s; }
.ak-swatch:hover { transform: scale(1.12); }
.ak-swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1f2937; }
.ak-swatch svg { position: absolute; inset: 0; margin: auto; }

.ak-bg-list { display: flex; flex-direction: column; gap: 12px; }
.ak-bg-thumb { aspect-ratio: 16 / 10; height: 60px; padding: 0; overflow: hidden; border-radius: var(--ak-radius); background: var(--ak-panel); }
.ak-bg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ak-bg-thumb.is-active { box-shadow: 0 0 0 3px #d2ba64, 0 10px 15px -3px rgba(0,0,0,.1); }

/* Modal */
.ak-modal {
	position: fixed; inset: 0; z-index: 100000;
	--ak-accent: #fd7c57; --ak-ink: #111827; --ak-radius: 3px;
	font-family: inherit;
}
.ak-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.ak-modal-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ak-modal-box {
	position: relative; width: 100%; max-width: 448px; background: #fff;
	border-radius: var(--ak-radius); box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
	padding: 24px; max-height: 92vh; overflow: auto;
}
.ak-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.ak-modal-head h2 { font-size: 20px; font-weight: 700; color: #111827; margin: 0; line-height: 1.2; }
.ak-modal-close { color: #9ca3af; padding: 0; background: none; }
.ak-modal-close:hover { color: #4b5563; }
.ak-modal-intro { font-size: 14px; color: #4b5563; margin: 0 0 24px; line-height: 1.5; }
.ak-field { margin-bottom: 16px; }
.ak-field label { display: block; font-size: 14px; font-weight: 500; color: #374151; margin-bottom: 4px; }
.ak-field input[type="text"],
.ak-field input[type="email"] {
	display: block; width: 100%; height: 40px;
	border: 1px solid #e5e7eb; border-radius: var(--ak-radius);
	background: #fff; padding: 8px 12px; font-size: 14px; color: #111827;
}
.ak-field input:focus { outline: 2px solid var(--ak-ink); outline-offset: 1px; }
.ak-check { display: flex; align-items: flex-start; gap: 8px; padding-top: 8px; font-size: 14px; color: #374151; line-height: 1.3; }
.ak-check input { margin: 3px 0 0; width: 16px; height: 16px; flex-shrink: 0; }
.ak-check a { text-decoration: underline; color: inherit; }
.ak-links { color: #6b7280; white-space: nowrap; }
.ak-submit {
	width: 100%; margin-top: 20px; padding: 12px;
	border: 0; border-radius: var(--ak-radius); background: var(--ak-accent);
	color: #fff; font-weight: 700; font-size: 14px;
	display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ak-submit[disabled] { opacity: .55; cursor: not-allowed; }
.ak-msg { font-size: 13px; margin-top: 12px; }
.ak-msg--error { color: #b91c1c; }
.ak-success { text-align: center; padding: 16px 0; }
.ak-success h2 { font-size: 20px; margin: 0 0 12px; }
.ak-success p { font-size: 15px; color: #374151; line-height: 1.55; margin: 0; }
.ak-spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 999px; animation: ak-spin .7s linear infinite; }
@keyframes ak-spin { to { transform: rotate(360deg); } }

/* Mobil */
@media (max-width: 980px) {
	.ak-konfigurator { padding: 12px; }
	.ak-main { flex-direction: column; align-items: stretch; }
	.ak-stage-wrap { width: 100%; flex: 0 0 auto; }
	.ak-side { width: 100%; }
	.ak-stage { aspect-ratio: 4 / 3; }
	.ak-tab span { display: none; }
	.ak-tab { padding: 10px 12px; }
	.ak-leg-grid { grid-template-columns: repeat(3, 1fr); }
	.ak-bg-list { flex-direction: row; overflow-x: auto; }
	.ak-bg-thumb { width: 100px; flex: 0 0 auto; }
	.ak-swatches { grid-template-columns: repeat(8, 1fr); }
	.ak-panel-head { display: none; }
}
