/*
 * Étiquettes personnalisées : section produit + éditeur.
 * Variables (--eeb-*) définies dans packs.css.
 */

/* -- Boutons du site ------------------------------------------------------
 * ":is(#eeb, …)" donne à ces sélecteurs le poids d'un identifiant : ils passent devant le
 * kit Elementor et le widget "Ajouter au panier" du modèle produit, qui stylisent tous les
 * boutons du formulaire. (#eeb n'existe pas, il ne sert qu'au calcul de priorité.) */

.eeb-btn:is(#eeb, .eeb-btn) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	margin: 0;
	padding: 10px 16px;
	border: 2px solid var(--eeb-line);
	border-radius: 0;
	background: var(--eeb-paper);
	box-shadow: var(--eeb-shadow);
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 14px;
	font-style: normal;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.04em;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: box-shadow 0.15s ease;
}

.eeb-btn:is(#eeb, .eeb-btn):hover:not(:disabled),
.eeb-btn:is(#eeb, .eeb-btn):focus-visible {
	box-shadow: var(--eeb-shadow-hover);
}

.eeb-btn:is(#eeb, .eeb-btn):focus:not(:focus-visible) {
	box-shadow: var(--eeb-shadow);
}

.eeb-btn:is(#eeb, .eeb-btn):disabled {
	box-shadow: none;
	opacity: 0.4;
	cursor: default;
}

.eeb-btn:is(#eeb, .eeb-btn).eeb-btn--primary {
	background: var(--eeb-yellow);
}

.eeb-btn:is(#eeb, .eeb-btn).eeb-btn--danger {
	color: var(--eeb-error);
}

.eeb-btn:is(#eeb, .eeb-btn).eeb-btn--icon {
	width: 40px;
	padding: 0;
	text-transform: none;
}

.eeb-btn:is(#eeb, .eeb-btn).is-active {
	background: var(--eeb-ink);
	color: var(--eeb-white);
}

/* -- Section sur la page produit --------------------------------------- */

.eeb-labels {
	clear: both;
	margin: 1.5em 0 2em;
	padding: 24px;
	border: 2px solid var(--eeb-line);
	background: var(--eeb-white);
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
}

/* Pastille, comme "Depuis 2024 à Sessenheim" sur l'accueil. */
.eeb-labels__badge {
	display: inline-block;
	padding: 3px 14px;
	border: 2px solid var(--eeb-line);
	border-radius: 20px;
	background: var(--eeb-yellow);
	box-shadow: var(--eeb-shadow);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
}

:is(.eeb-labels, .eeb-can) .eeb-labels__title {
	margin: 0.7em 0 0.35em;
	padding: 0;
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.05em;
	text-transform: uppercase;
}

.eeb-labels__intro {
	margin: 0 0 1.25em;
	font-size: 15px;
	font-weight: 300;
	line-height: 1.5;
}

.eeb-labels__slots {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.eeb-slot {
	display: flex;
	flex-direction: column;
	margin: 0;
	border: 2px solid var(--eeb-line);
	background: var(--eeb-white);
}

.eeb-slot.has-label {
	box-shadow: var(--eeb-shadow-hover);
}

.eeb-slot--empty {
	grid-column: 1 / -1;
	padding: 16px;
	border-style: dashed;
	font-size: 15px;
	font-weight: 300;
}

.eeb-slot__preview {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 143 / 80;
	overflow: hidden;
	border-bottom: 2px solid var(--eeb-line);
	background: repeating-linear-gradient(-45deg, var(--eeb-paper) 0 10px, #f0f0f0 10px 20px);
	color: #777;
	font-size: 13px;
	font-weight: 600;
}

.eeb-slot__preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eeb-slot__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 12px;
}

.eeb-slot__num {
	color: var(--eeb-yellow);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.2;
}

.eeb-slot__name {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.03em;
	text-transform: uppercase;
}

.eeb-slot__state {
	margin-top: 2px;
	color: #666;
	font-size: 13px;
	font-weight: 300;
}

.eeb-slot.has-label .eeb-slot__state {
	color: var(--eeb-yellow-dark);
	font-weight: 600;
}

.eeb-slot__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	padding-top: 12px;
}

.eeb-slot__remove:is(#eeb, .eeb-slot__remove) {
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none !important;
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: normal;
	text-decoration: underline;
	text-decoration-color: var(--eeb-yellow);
	text-decoration-thickness: 2px;
	text-transform: none;
	cursor: pointer;
}

/* Étiquette en cours de copie. */
.eeb-slot.is-copy-source {
	box-shadow: 5px 5px 0 0 var(--eeb-yellow);
}

/* -- Choix des bières qui reçoivent la copie ----------------------------- */

.eeb-copy {
	grid-column: 1 / -1;
	padding: 16px;
	border: 2px solid var(--eeb-line);
	border-left-width: 8px;
	border-left-color: var(--eeb-yellow);
	background: var(--eeb-paper);
}

.eeb-copy__title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 700;
}

.eeb-copy__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.eeb-copy__option {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin: 0;
	padding: 10px 12px;
	border: 2px solid var(--eeb-line);
	background: var(--eeb-white);
	font-size: 14px;
	cursor: pointer;
}

.eeb-copy__option:has(input:disabled) {
	opacity: 0.5;
	cursor: default;
}

.eeb-copy__option input {
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--eeb-ink);
}

.eeb-copy__name {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: -0.03em;
}

.eeb-copy__note {
	color: #666;
	font-size: 13px;
	font-weight: 300;
}

.eeb-copy__option.is-replacing .eeb-copy__note {
	color: var(--eeb-error);
	font-weight: 600;
}

.eeb-copy__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* -- Éditeur ------------------------------------------------------------ */

html.eeb-editor-open {
	overflow: hidden;
}

.eeb-editor {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2vh 2vw;
	background: rgba(0, 0, 0, 0.8);
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 15px;
	line-height: 1.4;
}

.eeb-editor[hidden] {
	display: none;
}

.eeb-editor *,
.eeb-editor *::before,
.eeb-editor *::after {
	box-sizing: border-box;
}

.eeb-editor [hidden] {
	display: none !important;
}

.eeb-editor__dialog {
	display: flex;
	flex-direction: column;
	width: min(1200px, 100%);
	max-height: 96vh;
	overflow: hidden;
	border: 2px solid var(--eeb-line);
	background: var(--eeb-white);
	box-shadow: 8px 8px 0 0 var(--eeb-yellow);
}

.eeb-editor__header,
.eeb-editor__footer,
.eeb-editor__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
}

.eeb-editor__header {
	justify-content: space-between;
	border-bottom: 2px solid var(--eeb-line);
	background: var(--eeb-yellow);
}

.eeb-editor .eeb-editor__title {
	margin: 0;
	padding: 0;
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.04em;
	text-transform: uppercase;
}

.eeb-editor .eeb-editor__close.eeb-editor__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--eeb-line);
	border-radius: 0;
	background: var(--eeb-white);
	box-shadow: var(--eeb-shadow);
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.eeb-editor .eeb-editor__close.eeb-editor__close:hover {
	box-shadow: var(--eeb-shadow-hover);
}

.eeb-editor__toolbar {
	border-bottom: 2px solid var(--eeb-line);
}

.eeb-editor__spacer {
	flex: 1;
}

.eeb-editor__main {
	display: flex;
	flex: 1;
	min-height: 0;
	overflow: auto;
}

.eeb-editor__stage {
	flex: 1;
	min-width: 0;
	padding: 24px;
	background: var(--eeb-paper);
}

.eeb-editor__canvas {
	position: relative;
	width: 100%;
	border: 2px solid var(--eeb-line);
	box-shadow: var(--eeb-shadow-hover);
}

.eeb-editor__canvas .canvas-container {
	display: block;
}

/* Marge de sécurité de 3 mm : 3 / 143 en largeur, 3 / 80 en hauteur. */
.eeb-editor__safe {
	position: absolute;
	inset: 3.75% 2.1%;
	border: 2px dashed var(--eeb-yellow);
	pointer-events: none;
}

.eeb-editor__hint {
	margin: 16px 0 0;
	font-size: 13px;
	font-weight: 300;
}

.eeb-editor__panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 300px;
	flex-shrink: 0;
	padding: 16px;
	overflow-y: auto;
	border-left: 2px solid var(--eeb-line);
}

.eeb-editor__panel > div {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.eeb-panel__empty {
	margin: 0;
	padding: 12px;
	border: 2px dashed var(--eeb-line);
	font-size: 14px;
	font-weight: 300;
}

.eeb-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.eeb-field--row,
.eeb-field--inline {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.eeb-field label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.eeb-editor .eeb-field textarea,
.eeb-editor .eeb-field select {
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 2px solid var(--eeb-line);
	border-radius: 0;
	background: var(--eeb-white);
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
	font-size: 15px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
}

.eeb-editor input[type="range"] {
	width: 100%;
	accent-color: var(--eeb-ink);
}

.eeb-field--row input[type="range"] {
	flex: 1;
	width: auto;
}

.eeb-editor input[type="color"] {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 2px;
	border: 2px solid var(--eeb-line);
	border-radius: 0;
	background: var(--eeb-white);
	cursor: pointer;
}

.eeb-editor__footer {
	justify-content: flex-end;
	border-top: 2px solid var(--eeb-line);
}

.eeb-editor__status {
	flex: 1;
	font-size: 14px;
	font-weight: 600;
}

.eeb-editor__status.is-error {
	color: var(--eeb-error);
}

.eeb-editor.is-busy .eeb-editor__canvas {
	opacity: 0.6;
	pointer-events: none;
}

@media (max-width: 800px) {
	.eeb-editor {
		padding: 0;
	}

	.eeb-editor__dialog {
		max-height: 100vh;
		height: 100%;
		border: 0;
		box-shadow: none;
	}

	.eeb-editor__main {
		flex-direction: column;
	}

	.eeb-editor__stage {
		flex: none;
		padding: 12px;
	}

	.eeb-editor__panel {
		width: auto;
		border-top: 2px solid var(--eeb-line);
		border-left: 0;
	}
}

@media (max-width: 480px) {
	.eeb-labels {
		padding: 16px;
	}

	.eeb-labels__slots {
		grid-template-columns: 1fr;
	}
}

/* Choix du logo Elle est bonne : Oui / Non collés, comme un interrupteur. */
.eeb-logo-choice {
	gap: 0;
}

.eeb-logo-choice .eeb-btn:is(#eeb, .eeb-btn) {
	min-width: 56px;
	box-shadow: none;
}

.eeb-logo-choice .eeb-btn:is(#eeb, .eeb-btn):first-of-type {
	margin-left: 8px;
	border-right: 0;
}

.eeb-copy__error {
	margin: 0 0 12px;
	color: var(--eeb-error);
	font-size: 14px;
	font-weight: 600;
}

/* -- Canette personnalisée ------------------------------------------------ */

.eeb-can {
	display: flex;
	flex-direction: column;
	gap: 24px;
	color: var(--eeb-ink);
	font-family: var(--eeb-font);
}

.eeb-can .eeb-labels {
	margin: 0;
}

.eeb-can__step--last .eeb-labels__title {
	margin-bottom: 0;
}

.eeb-can__beers {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}

.eeb-can__beer {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 100%;
	margin: 0;
	padding: 12px 8px;
	border: 2px solid var(--eeb-line);
	background: var(--eeb-white);
	text-align: center;
	cursor: pointer;
	transition: box-shadow 0.15s ease;
}

.eeb-can__beer:hover {
	box-shadow: var(--eeb-shadow);
}

.eeb-can__beer input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.eeb-can__beer:has(input:checked) {
	background: var(--eeb-yellow);
	box-shadow: var(--eeb-shadow-hover);
}

.eeb-can__beer:has(input:focus-visible) {
	outline: 3px solid var(--eeb-ink);
	outline-offset: 2px;
}

.eeb-can__beer.is-sold-out {
	opacity: 0.45;
	cursor: not-allowed;
}

.eeb-can__beer.is-sold-out:hover {
	box-shadow: none;
}

.eeb-can__beer img {
	display: block;
	width: 100%;
	max-width: 110px;
	height: auto;
	margin: 0 auto 8px;
	box-shadow: none !important;
}

.eeb-can__name {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.03em;
	text-transform: uppercase;
}

.eeb-can__stock {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 400;
}

/* Une seule étiquette : l'emplacement prend toute la largeur. */
.eeb-can .eeb-labels__slots {
	grid-template-columns: minmax(0, 1fr);
}

.eeb-can .eeb-slot {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.eeb-can .eeb-slot--empty {
	display: block;
}

.eeb-can .eeb-slot__preview {
	border-right: 2px solid var(--eeb-line);
	border-bottom: 0;
}

.eeb-can__hint {
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 400;
}

@media (max-width: 600px) {
	.eeb-can__beers {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.eeb-can .eeb-slot {
		display: flex;
	}

	.eeb-can .eeb-slot__preview {
		border-right: 0;
		border-bottom: 2px solid var(--eeb-line);
	}
}
