/**
 * Student Cap 3D Configurator - Authentic ABC Gruppen Studio Stylesheet
 */

:root {
	--cap3d-gold: #c5a059;
	--cap3d-gold-dark: #a88438;
	--cap3d-gold-light: #f6ebd2;
	--cap3d-navy: #0f172a;
	--cap3d-navy-light: #1e293b;
	--cap3d-bg: #f8fafc;
	--cap3d-border: #e2e8f0;
	--cap3d-text: #0f172a;
	--cap3d-muted: #64748b;
}

.cap3d-root {
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--cap3d-text);
	background: #ffffff;
	position: relative;
	-webkit-font-smoothing: antialiased;
}

.cap3d-root *,
.cap3d-root *::before,
.cap3d-root *::after {
	box-sizing: inherit;
}

/* Full Width Override */
.cap3d-root.cap3d-fullwidth {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
}

/* TOP HEADER BAR (ABC Gruppen Style) */
.cap3d-header-bar {
	height: 64px;
	background: #ffffff;
	border-bottom: 1px solid var(--cap3d-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	z-index: 30;
	position: relative;
}

.cap3d-header-left {
	display: flex;
	align-items: center;
	gap: 28px;
}

.cap3d-brand-logo {
	display: flex;
	align-items: baseline;
	gap: 6px;
	text-decoration: none;
	color: var(--cap3d-navy);
}

.cap3d-brand-abc {
	font-family: Georgia, "Playfair Display", serif;
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.5px;
	color: var(--cap3d-navy);
}

.cap3d-brand-sub {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1.5px;
	color: #475569;
}

.cap3d-brand-pill {
	display: inline-block;
	background: #f1f5f9;
	color: #475569;
	font-size: 10px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 4px;
	letter-spacing: 0.5px;
	margin-left: 8px;
}

.cap3d-header-nav {
	display: none;
	align-items: center;
	gap: 20px;
}

@media (min-width: 900px) {
	.cap3d-header-nav {
		display: flex;
	}
}

.cap3d-header-nav a {
	font-size: 13px;
	font-weight: 600;
	color: #475569;
	text-decoration: none;
	letter-spacing: 0.5px;
	transition: color 0.15s;
}

.cap3d-header-nav a:hover,
.cap3d-header-nav a.active {
	color: var(--cap3d-navy);
}

.cap3d-header-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.cap3d-currency-switch {
	display: flex;
	align-items: center;
	background: #f1f5f9;
	border-radius: 20px;
	padding: 3px;
}

.cap3d-curr-btn {
	border: none;
	background: transparent;
	padding: 4px 10px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 700;
	color: #64748b;
	cursor: pointer;
	transition: all 0.15s;
}

.cap3d-curr-btn.active {
	background: #ffffff;
	color: var(--cap3d-navy);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cap3d-badge-studio {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var(--cap3d-gold-light);
	color: var(--cap3d-gold-dark);
	font-size: 11px;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 20px;
	letter-spacing: 0.5px;
}

.cap3d-badge-studio::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cap3d-gold);
	animation: cap3d-pulse-dot 1.8s infinite ease-in-out;
}

@keyframes cap3d-pulse-dot {
	0% { transform: scale(0.9); opacity: 0.6; }
	50% { transform: scale(1.3); opacity: 1; }
	100% { transform: scale(0.9); opacity: 0.6; }
}

/* MAIN STUDIO WORKSPACE LAYOUT */
.cap3d-main-stage {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 130px);
	background: #f8fafc;
	position: relative;
}

@media (min-width: 1024px) {
	.cap3d-main-stage {
		flex-direction: row;
		height: calc(100vh - 130px);
		min-height: 640px;
		overflow: hidden;
	}
}

/* 1. LEFT STEP NAVIGATION BAR */
.cap3d-steps-sidebar {
	width: 100%;
	background: #ffffff;
	border-bottom: 1px solid var(--cap3d-border);
	display: flex;
	flex-direction: row;
	overflow-x: auto;
	padding: 8px 12px;
	gap: 4px;
	z-index: 20;
	flex-shrink: 0;
}

@media (min-width: 1024px) {
	.cap3d-steps-sidebar {
		width: 220px;
		border-bottom: none;
		border-right: 1px solid var(--cap3d-border);
		flex-direction: column;
		overflow-x: hidden;
		overflow-y: auto;
		padding: 16px 12px;
		gap: 4px;
	}
}

.cap3d-step-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid transparent;
	background: transparent;
	color: #475569;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s ease;
	text-align: left;
	width: 100%;
}

.cap3d-step-item:hover {
	background: #f1f5f9;
	color: var(--cap3d-navy);
}

.cap3d-step-item.active {
	background: var(--cap3d-navy);
	color: #ffffff;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.cap3d-step-num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #475569;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	flex-shrink: 0;
	transition: all 0.15s;
}

.cap3d-step-item.active .cap3d-step-num {
	background: var(--cap3d-gold);
	color: #ffffff;
}

.cap3d-step-label {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 2. STEP OPTIONS PANEL (Sub-panel on left) */
.cap3d-options-pane {
	width: 100%;
	background: #ffffff;
	border-bottom: 1px solid var(--cap3d-border);
	padding: 20px 24px;
	overflow-y: auto;
	flex-shrink: 0;
	z-index: 15;
}

@media (min-width: 1024px) {
	.cap3d-options-pane {
		width: 380px;
		border-bottom: none;
		border-right: 1px solid var(--cap3d-border);
		height: 100%;
	}
}

.cap3d-pane-header {
	margin-bottom: 18px;
}

.cap3d-pane-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--cap3d-navy);
	margin: 0 0 4px 0;
}

.cap3d-pane-desc {
	font-size: 13px;
	color: var(--cap3d-muted);
	margin: 0;
	line-height: 1.4;
}

/* Step Content Sections */
.cap3d-step-section {
	display: none;
}

.cap3d-step-section.active {
	display: block;
}

/* PRESETS GRID (Step 1) */
.cap3d-preset-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cap3d-preset-card {
	border: 2px solid var(--cap3d-border);
	border-radius: 10px;
	padding: 14px 16px;
	background: #ffffff;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
}

.cap3d-preset-card:hover {
	border-color: #94a3b8;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.cap3d-preset-card.active {
	border-color: var(--cap3d-gold);
	background: #fffdfa;
	box-shadow: 0 4px 16px rgba(197, 160, 89, 0.16);
}

.cap3d-preset-badge {
	position: absolute;
	top: -10px;
	right: 12px;
	background: #ef4444;
	color: #ffffff;
	font-size: 10px;
	font-weight: 800;
	padding: 2px 8px;
	border-radius: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cap3d-preset-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 4px;
}

.cap3d-preset-name {
	font-size: 15px;
	font-weight: 700;
	color: var(--cap3d-navy);
}

.cap3d-preset-price {
	font-size: 15px;
	font-weight: 800;
	color: var(--cap3d-gold-dark);
}

.cap3d-preset-sub {
	font-size: 12px;
	color: var(--cap3d-muted);
	line-height: 1.4;
	margin-bottom: 8px;
}

.cap3d-preset-more-btn {
	font-size: 12px;
	font-weight: 600;
	color: var(--cap3d-gold-dark);
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.cap3d-custom-start-box {
	margin-top: 18px;
	padding-top: 18px;
	border-top: 1px dashed var(--cap3d-border);
	text-align: center;
}

.cap3d-or-divider {
	display: flex;
	align-items: center;
	text-align: center;
	color: #94a3b8;
	font-size: 11px;
	font-weight: 700;
	margin: 12px 0;
}

.cap3d-or-divider::before,
.cap3d-or-divider::after {
	content: "";
	flex: 1;
	border-bottom: 1px solid var(--cap3d-border);
}

.cap3d-or-divider span {
	padding: 0 10px;
}

.cap3d-btn-custom-start {
	width: 100%;
	padding: 12px;
	background: var(--cap3d-navy);
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.cap3d-btn-custom-start:hover {
	background: var(--cap3d-navy-light);
	transform: translateY(-1px);
}

/* PASSFORM / SIZE SELECTOR (Step 2) */
.cap3d-size-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 14px 0;
}

.cap3d-size-chip {
	padding: 10px 6px;
	border: 1px solid var(--cap3d-border);
	border-radius: 8px;
	background: #ffffff;
	font-size: 13px;
	font-weight: 600;
	color: var(--cap3d-navy);
	cursor: pointer;
	text-align: center;
	transition: all 0.15s;
}

.cap3d-size-chip:hover {
	border-color: #94a3b8;
}

.cap3d-size-chip.active {
	border-color: var(--cap3d-gold);
	background: var(--cap3d-gold-light);
	color: var(--cap3d-gold-dark);
	font-weight: 700;
}

.cap3d-cushion-card {
	background: #f8fafc;
	border: 1px solid var(--cap3d-border);
	border-radius: 8px;
	padding: 14px;
	margin-top: 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.cap3d-cushion-info h4 {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: var(--cap3d-navy);
}

.cap3d-cushion-info p {
	margin: 0;
	font-size: 12px;
	color: var(--cap3d-muted);
}

/* SWATCHES & TILES (Steps 3-8) */
.cap3d-field-group {
	margin-bottom: 20px;
}

.cap3d-field-label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--cap3d-navy);
	margin-bottom: 8px;
}

.cap3d-input-text {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 14px;
	color: var(--cap3d-navy);
	background: #ffffff;
	outline: none;
	transition: border-color 0.15s;
}

.cap3d-input-text:focus {
	border-color: var(--cap3d-gold);
	box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.15);
}

.cap3d-font-chips {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.cap3d-font-chip {
	padding: 6px 12px;
	border: 1px solid var(--cap3d-border);
	border-radius: 6px;
	background: #ffffff;
	font-size: 12px;
	color: #475569;
	cursor: pointer;
	transition: all 0.15s;
}

.cap3d-font-chip.active {
	border-color: var(--cap3d-gold);
	background: var(--cap3d-gold-light);
	color: var(--cap3d-gold-dark);
	font-weight: 700;
}

.cap3d-swatches-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 8px;
}

.cap3d-swatch-card {
	padding: 10px 8px;
	background: #ffffff;
	border: 1px solid var(--cap3d-border);
	border-radius: 8px;
	cursor: pointer;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: all 0.15s ease;
}

.cap3d-swatch-card:hover {
	border-color: #94a3b8;
}

.cap3d-swatch-card.active {
	border-color: var(--cap3d-gold);
	background: var(--cap3d-gold-light);
	box-shadow: 0 0 0 1px var(--cap3d-gold);
}

.cap3d-circle-color {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	margin-bottom: 6px;
	border: 1px solid rgba(0,0,0,0.12);
	box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}

.cap3d-swatch-title {
	font-size: 11px;
	font-weight: 600;
	color: var(--cap3d-navy);
	line-height: 1.2;
}

.cap3d-swatch-extra {
	font-size: 10px;
	font-weight: 700;
	color: var(--cap3d-gold-dark);
	margin-top: 2px;
}

/* 3. CENTRAL 3D VIEWPORT */
.cap3d-viewport-stage {
	flex: 1;
	position: relative;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	min-height: 400px;
	overflow: hidden;
}

@media (min-width: 1024px) {
	.cap3d-viewport-stage {
		height: 100%;
	}
}

.cap3d-canvas-wrapper {
	position: relative;
	width: 100%;
	height: 100%;
	flex: 1;
	overflow: hidden;
	touch-action: none;
}

.cap3d-threejs-canvas {
	width: 100%;
	height: 100%;
	display: block;
	outline: none;
}

/* 3D Floating Action Tools */
.cap3d-floating-bar {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 10;
}

.cap3d-icon-btn {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(4px);
	border: 1px solid #cbd5e1;
	color: #334155;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0,0,0,0.06);
	transition: all 0.15s;
}

.cap3d-icon-btn:hover {
	background: #ffffff;
	color: var(--cap3d-gold-dark);
	border-color: var(--cap3d-gold);
	transform: scale(1.05);
}

.cap3d-icon-btn.active {
	background: var(--cap3d-navy);
	color: #ffffff;
}

/* Quick Camera Angle Chips */
.cap3d-angle-bar {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(4px);
	padding: 4px;
	border-radius: 30px;
	border: 1px solid #cbd5e1;
	z-index: 10;
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.cap3d-angle-btn {
	padding: 5px 12px;
	border-radius: 20px;
	border: none;
	background: transparent;
	color: #475569;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s;
}

.cap3d-angle-btn.active,
.cap3d-angle-btn:hover {
	background: var(--cap3d-navy);
	color: #ffffff;
}

.cap3d-hint-text {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 11px;
	color: #94a3b8;
	pointer-events: none;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

/* BOTTOM FIXED CHECKOUT & NAVIGATION BAR */
.cap3d-footer-bar {
	height: 66px;
	background: #ffffff;
	border-top: 1px solid var(--cap3d-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 24px;
	z-index: 25;
	box-shadow: 0 -2px 10px rgba(0,0,0,0.03);
}

.cap3d-footer-nav {
	display: flex;
	align-items: center;
	gap: 12px;
}

.cap3d-btn-nav {
	padding: 8px 16px;
	border-radius: 8px;
	border: 1px solid var(--cap3d-border);
	background: #ffffff;
	font-size: 13px;
	font-weight: 600;
	color: var(--cap3d-navy);
	cursor: pointer;
	transition: all 0.15s;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.cap3d-btn-nav:hover:not(:disabled) {
	background: #f1f5f9;
	border-color: #94a3b8;
}

.cap3d-btn-nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.cap3d-footer-actions {
	display: flex;
	align-items: center;
	gap: 20px;
}

.cap3d-price-block {
	text-align: right;
}

.cap3d-price-label {
	display: block;
	font-size: 11px;
	color: var(--cap3d-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.cap3d-price-val {
	font-size: 20px;
	font-weight: 800;
	color: var(--cap3d-navy);
}

.cap3d-btn-breakdown {
	font-size: 11px;
	color: var(--cap3d-gold-dark);
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	text-decoration: underline;
}

.cap3d-btn-add-cart {
	background: var(--cap3d-navy);
	color: #ffffff;
	padding: 12px 24px;
	border-radius: 8px;
	border: none;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.2s;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.cap3d-btn-add-cart:hover:not(:disabled) {
	background: var(--cap3d-navy-light);
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
}

.cap3d-btn-add-cart:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* PRICE BREAKDOWN POPOVER */
.cap3d-breakdown-modal {
	position: absolute;
	bottom: 74px;
	right: 24px;
	width: 320px;
	background: #ffffff;
	border: 1px solid var(--cap3d-border);
	border-radius: 10px;
	padding: 16px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	z-index: 40;
	display: none;
}

.cap3d-breakdown-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	padding: 5px 0;
	color: #475569;
}

.cap3d-breakdown-total {
	border-top: 1px solid var(--cap3d-border);
	margin-top: 8px;
	padding-top: 8px;
	font-weight: 700;
	color: var(--cap3d-navy);
}

/* LOADING OVERLAY */
.cap3d-loader-overlay {
	position: absolute;
	inset: 0;
	background: rgba(248, 250, 252, 0.95);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 35;
	transition: opacity 0.3s;
}

.cap3d-spinner {
	width: 44px;
	height: 44px;
	border: 3px solid #e2e8f0;
	border-top-color: var(--cap3d-gold);
	border-radius: 50%;
	animation: cap3d-spin 0.8s linear infinite;
}

@keyframes cap3d-spin {
	to { transform: rotate(360deg); }
}

.cap3d-loader-msg {
	margin-top: 14px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cap3d-navy);
}
