/* =========================================================================
   Creabais Configurateur — styles autonomes du composant (non éditables
   depuis l'admin WordPress). Mobile-first, curseurs tactiles (zones >= 44px).
   ========================================================================= */

.creabais-configurateur {
	--cc-black: #0a0a0a;
	--cc-white: #ffffff;
	--cc-grey: #6b6b6b;
	--cc-grey-light: #eee;
	--cc-border: #dcdcdc;
	--cc-accent: #0a0a0a;
	font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--cc-black);
	box-sizing: border-box;
}
.creabais-configurateur *, .creabais-configurateur *::before, .creabais-configurateur *::after {
	box-sizing: border-box;
}

.cc-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
}

.cc-panel {
	border: 1px solid var(--cc-border);
	background: var(--cc-white);
	padding: 20px;
}
.cc-panel__title {
	font-size: 1.1rem;
	font-weight: 800;
	margin: 0 0 14px;
	letter-spacing: -0.01em;
}
.cc-group-label {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--cc-grey);
	margin: 18px 0 10px;
}
.cc-group-label:first-child { margin-top: 0; }

/* ---------------- Sélecteur de motifs ---------------- */
.cc-pattern-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.cc-pattern-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 10px 4px;
	border: 1px solid var(--cc-border);
	background: var(--cc-white);
	min-height: 68px;
	min-width: 44px;
	border-radius: 2px;
	transition: border-color 150ms ease, background 150ms ease;
}
.cc-pattern-btn svg { width: 28px; height: 28px; }
.cc-pattern-btn span { font-size: 0.68rem; line-height: 1.15; text-align: center; color: var(--cc-grey); }
.cc-pattern-btn:hover { border-color: var(--cc-black); }
.cc-pattern-btn[aria-pressed="true"] {
	background: var(--cc-black);
	border-color: var(--cc-black);
}
.cc-pattern-btn[aria-pressed="true"] span { color: var(--cc-white); }
.cc-pattern-btn[aria-pressed="true"] svg { stroke: var(--cc-white) !important; }

/* ---------------- Aperçu ---------------- */
.cc-preview-frame {
	width: 100%;
	background: repeating-conic-gradient(#f7f7f7 0% 25%, #ffffff 0% 50%) 50% / 24px 24px;
	border: 1px solid var(--cc-border);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	min-height: 260px;
}
.cc-svg { width: 100%; height: auto; max-height: 70vh; }
.cc-preview-caption {
	text-align: center;
	font-size: 0.85rem;
	color: var(--cc-grey);
	margin: 10px 0 0;
}
.cc-export-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}
.cc-btn {
	flex: 1 1 auto;
	min-height: 46px;
	min-width: 44px;
	padding: 12px 18px;
	border: 2px solid var(--cc-black);
	background: var(--cc-black);
	color: var(--cc-white);
	font-weight: 700;
	font-size: 0.92rem;
	border-radius: 2px;
	transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}
.cc-btn:hover, .cc-btn:focus-visible { transform: translateY(-2px); }
.cc-btn--ghost { background: var(--cc-white); color: var(--cc-black); }
.cc-btn--ghost:hover { background: var(--cc-black); color: var(--cc-white); }

/* ---------------- Réglages / curseurs ---------------- */
.cc-field-group { margin-bottom: 4px; }
.cc-field { margin-bottom: 18px; }
.cc-field label {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.88rem;
	font-weight: 600;
	margin-bottom: 8px;
}
.cc-field output {
	font-weight: 800;
	color: var(--cc-black);
	min-width: 3.5em;
	text-align: right;
}
.cc-field input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 44px; /* zone de tap tactile confortable */
	background: transparent;
	touch-action: none;
}
.cc-field input[type="range"]::-webkit-slider-runnable-track {
	height: 4px;
	background: var(--cc-border);
	border-radius: 2px;
}
.cc-field input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 26px;
	height: 26px;
	margin-top: -11px;
	border-radius: 50%;
	background: var(--cc-black);
	border: 3px solid var(--cc-white);
	box-shadow: 0 0 0 1px var(--cc-black);
	cursor: pointer;
}
.cc-field input[type="range"]::-moz-range-track {
	height: 4px;
	background: var(--cc-border);
	border-radius: 2px;
}
.cc-field input[type="range"]::-moz-range-thumb {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--cc-black);
	border: 3px solid var(--cc-white);
	box-shadow: 0 0 0 1px var(--cc-black);
	cursor: pointer;
}

.is-hidden { display: none !important; }

/* =========================================================================
   Responsive — breakpoint principal ~860px puis 1024/1200/1440 pour la mise
   en page 3 colonnes.
   ========================================================================= */
@media (min-width: 640px) {
	.cc-pattern-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 861px) {
	.cc-layout {
		grid-template-columns: 220px 1fr 320px;
		align-items: start;
	}
	.cc-pattern-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.cc-layout { grid-template-columns: 240px 1fr 340px; }
}

@media (min-width: 1200px) {
	.cc-layout { grid-template-columns: 260px 1fr 360px; gap: 28px; }
	.cc-pattern-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1440px) {
	.cc-layout { grid-template-columns: 280px 1fr 380px; gap: 32px; }
}

/* Dimensions / cotes affichées dans le SVG */
.cc-dim-line { stroke: #c0392b; stroke-width: 1; }
.cc-dim-text { fill: #c0392b; font-size: 13px; font-family: -apple-system, Arial, sans-serif; }
