/* ═══════════════════════════════════════════════════════════════════════════
   WC Personnalisation — Styles front-end
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Conteneur principal ─────────────────────────────────────────────────── */
.wcp-personnalisation {
	margin: 28px 0 20px;
	padding: 22px 24px 20px;
	background: #fff;
	border: 1px solid #e9eaec;
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}

.wcp-section-title {
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #6b7280;
	margin: 0 0 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid #f3f4f6;
}

/* ── Groupes de champs ───────────────────────────────────────────────────── */
.wcp-group {
	padding: 16px 0;
	border-bottom: 1px solid #f3f4f6;
}

.wcp-group:first-of-type { padding-top: 0; }
.wcp-group:last-child     { border-bottom: none; padding-bottom: 0; }

.wcp-label {
	display: flex;
	align-items: baseline;
	gap: 7px;
	font-size: 13.5px;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 12px;
}

.wcp-hint {
	font-weight: 400;
	font-size: 12px;
	color: #9ca3af;
}

.wcp-required {
	color: #ef4444;
	font-size: 15px;
	line-height: 1;
}

/* ── Accessibilité ───────────────────────────────────────────────────────── */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Upload fichier
   ═══════════════════════════════════════════════════════════════════════════ */
.wcp-file-zone {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.wcp-file-native { display: none !important; }

.wcp-btn-file {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 18px;
	background: #f9fafb;
	border: 1.5px solid #d1d5db;
	border-radius: 7px;
	color: #374151;
	font-size: 13px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
	white-space: nowrap;
}

.wcp-btn-file:hover {
	background: #f3f4f6;
	border-color: #9ca3af;
	color: #111827;
}

.wcp-btn-file svg { flex-shrink: 0; }

.wcp-file-label {
	font-size: 12.5px;
	color: #9ca3af;
	font-style: italic;
}

.wcp-upload-status {
	width: 100%;
	font-size: 12.5px;
	margin-top: 4px;
}

.wcp-upload-status.wcp-progress { color: #6b7280; }
.wcp-upload-status.wcp-ok       { color: #16a34a; font-weight: 600; }
.wcp-upload-status.wcp-error    { color: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════════════
   Champ texte
   ═══════════════════════════════════════════════════════════════════════════ */
.wcp-textarea {
	display: block;
	width: 100%;
	padding: 10px 13px;
	border: 1.5px solid #d1d5db;
	border-radius: 7px;
	font-size: 13.5px;
	font-family: inherit;
	color: #1f2937;
	resize: vertical;
	box-sizing: border-box;
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
	min-height: 84px;
}

.wcp-textarea:focus {
	border-color: #6b7280;
	outline: none;
	box-shadow: 0 0 0 3px rgba(107, 114, 128, .12);
}

.wcp-textarea::placeholder { color: #c4c9d4; }

/* ═══════════════════════════════════════════════════════════════════════════
   Pastilles couleur + infobulle
   ═══════════════════════════════════════════════════════════════════════════ */
.wcp-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* Wrapper = cible du tooltip CSS */
.wcp-swatch-wrap {
	position: relative;
	cursor: pointer;
	/* espace pour que l'infobulle ne soit pas coupée */
	padding-top: 2px;
}

/* ── Bulle (texte) ── */
.wcp-swatch-wrap::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 11px);
	left: 50%;
	transform: translateX(-50%);
	background: #1f2937;
	color: #fff;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 11.5px;
	font-weight: 500;
	white-space: nowrap;
	letter-spacing: .01em;
	pointer-events: none;
	opacity: 0;
	transition: opacity .18s, transform .18s;
	transform: translateX(-50%) translateY(4px);
	z-index: 200;
}

/* ── Flèche ── */
.wcp-swatch-wrap::before {
	content: '';
	position: absolute;
	bottom: calc(100% + 5px);
	left: 50%;
	transform: translateX(-50%);
	border: 5px solid transparent;
	border-top-color: #1f2937;
	pointer-events: none;
	opacity: 0;
	transition: opacity .18s;
	z-index: 200;
}

.wcp-swatch-wrap:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.wcp-swatch-wrap:hover::before { opacity: 1; }

/* ── Pastille ── */
.wcp-swatch-radio { /* sr-only inline */
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.wcp-swatch {
	display: block;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	transition: transform .15s, box-shadow .18s;
}

.wcp-swatch-wrap:hover .wcp-swatch {
	transform: scale(1.14);
	box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
}

.wcp-swatch-radio:checked ~ .wcp-swatch {
	box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px #1f2937;
	transform: scale(1.1);
}

.wcp-swatch-wrap.wcp-checked {
	position: relative;
	z-index: 2;
}

/* ── Pastille désactivée (max 3 couleurs atteint) ── */
.wcp-swatch-wrap.wcp-swatch-disabled {
	opacity: 0.3;
	pointer-events: none;
}

/* ── Indicateur de sélection ── */
.wcp-color-feedback {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 8px 12px;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 7px;
	font-size: 13px;
	color: #374151;
}

.wcp-color-dots {
	display: flex;
	gap: 4px;
	flex-shrink: 0;
}

.wcp-color-dot {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1.5px solid rgba(0, 0, 0, .12);
	flex-shrink: 0;
}

.wcp-color-chosen { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   Sélecteur de thème
   ═══════════════════════════════════════════════════════════════════════════ */
.wcp-select {
	display: block;
	width: 100%;
	max-width: 400px;
	padding: 10px 38px 10px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 7px;
	font-size: 13.5px;
	font-family: inherit;
	color: #1f2937;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}

.wcp-select:focus {
	border-color: #6b7280;
	outline: none;
	box-shadow: 0 0 0 3px rgba(107, 114, 128, .12);
}

.wcp-select option[value="custom"] { font-style: italic; }

/* Galerie multi-images d'un thème */
.wcp-theme-gallery {
	margin-top: 12px;
}

.wcp-theme-gallery-label {
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 6px;
	font-weight: 500;
}

.wcp-theme-gallery-imgs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wcp-theme-gallery-thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 6px;
	border: 2px solid #e5e7eb;
	cursor: pointer;
	transition: border-color .15s, transform .15s, box-shadow .15s;
}

.wcp-theme-gallery-thumb:hover {
	border-color: #6b7280;
	transform: scale(1.06);
}

.wcp-theme-gallery-thumb.wcp-tgallery-active {
	border-color: #1f2937;
	box-shadow: 0 0 0 2px #1f2937;
}

/* Zone thème personnalisé */
.wcp-custom-theme {
	margin-top: 14px;
	padding: 14px 16px;
	background: #f9fafb;
	border: 1.5px dashed #d1d5db;
	border-radius: 8px;
}

.wcp-custom-theme-intro {
	margin: 0 0 10px;
	font-size: 13px;
	color: #6b7280;
	font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Erreurs formulaire
   ═══════════════════════════════════════════════════════════════════════════ */
.wcp-form-error {
	margin-bottom: 14px;
	padding: 12px 16px;
	background: #fef2f2;
	border-left: 3px solid #ef4444;
	border-radius: 0 6px 6px 0;
	font-size: 13px;
	color: #991b1b;
	list-style: none;
}

.wcp-form-error li { margin: 3px 0; }
.wcp-form-error li::before { content: "· "; }

/* ═══════════════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
	.wcp-personnalisation { padding: 16px; }

	.wcp-swatch {
		width: 30px;
		height: 30px;
	}

	.wcp-swatches { gap: 8px; }

	.wcp-select { max-width: 100%; }

	.wcp-btn-file { width: 100%; justify-content: center; }
}
