/* Fiole Matelot – styles du composeur. Les couleurs se règlent dans Fiole Matelot → Apparence. */
.fm-app {
	--fm-navy: #12304a;
	--fm-gold: #c8a165;
	--fm-bg: #f6f1e7;
	--fm-card: #fff;
	--fm-line: #d9cfbd;
	--fm-on: #fff;
	--fm-cols: 6;
	--fm-cols-md: 4;
	--fm-cols-sm: 2;
	--fm-ratio: 4 / 3;
	--fm-fit: cover;
	--fm-radius: 12px;
	color: var(--fm-navy);
	max-width: 1300px;
	margin: 0 auto;
	box-sizing: border-box;
}
.fm-app *, .fm-app *::before, .fm-app *::after { box-sizing: inherit; }
.fm-app [hidden] { display: none !important; }
.fm-title { text-align: center; margin: 0 0 1.5rem; color: var(--fm-navy); }
.fm-main .fm-title { text-align: left; }

/* Étape 1 : formats */
.fm-formats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.fm-format {
	display: flex; flex-direction: column; align-items: center; gap: .5rem;
	padding: 1rem; background: var(--fm-bg); color: var(--fm-navy); cursor: pointer;
	border: 2px solid var(--fm-line); border-radius: var(--fm-radius);
	transition: transform .15s, border-color .15s, box-shadow .15s;
}
.fm-format:hover, .fm-format:focus-visible { transform: translateY(-3px); border-color: var(--fm-gold); box-shadow: 0 6px 16px rgba(0, 0, 0, .15); }
.fm-format__img { max-width: 100%; height: auto; object-fit: contain; }
.fm-format__label { font-weight: 700; font-size: 1.15rem; }
.fm-format__price { color: var(--fm-gold); font-weight: 600; }

/* Étape 2 : mise en page */
.fm-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (min-width: 900px) {
	.fm-layout { grid-template-columns: minmax(0, 1fr) 320px; }
	.fm-panel { position: sticky; top: 1.5rem; }
	.fm-progress { display: none; }
}

/* Accordéons */
.fm-acc { border: 1px solid var(--fm-line); border-radius: var(--fm-radius); margin-bottom: .75rem; background: var(--fm-card); }
.fm-acc--l1, .fm-acc--l2 { margin: .75rem 0 0; background: var(--fm-bg); }
.fm-acc__head {
	display: flex; justify-content: space-between; align-items: center; width: 100%;
	padding: .8rem 1rem; background: none; border: 0; color: var(--fm-navy); cursor: pointer;
	font: inherit; font-weight: 700; text-align: left;
}
.fm-acc__icon::before { content: "+"; font-size: 1.4rem; line-height: 1; }
.is-open > .fm-acc__head .fm-acc__icon::before { content: "−"; }
.fm-acc__body { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .3s ease, visibility 0s .3s; }
.is-open > .fm-acc__body { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .3s ease, visibility 0s; }
.fm-acc__inner { overflow: hidden; min-height: 0; padding: 0 1rem; }
.is-open > .fm-acc__body > .fm-acc__inner { padding-bottom: 1rem; }
.fm-note { font-size: .85rem; font-style: italic; margin: 0 0 .75rem; }

/* Grille de saveurs */
.fm-grid { display: grid; grid-template-columns: repeat(var(--fm-cols), minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 1099px) { .fm-grid { grid-template-columns: repeat(var(--fm-cols-md), minmax(0, 1fr)); } }
@media (max-width: 599px) { .fm-grid { grid-template-columns: repeat(var(--fm-cols-sm), minmax(0, 1fr)); } }

.fm-flavor {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem;
	padding: .4rem .4rem .5rem; border: 2px solid var(--fm-line); border-radius: var(--fm-radius);
	background: var(--fm-card); text-align: center; overflow: hidden;
}
.fm-flavor.is-active { border-color: var(--fm-gold); box-shadow: 0 0 0 2px var(--fm-gold); }
.fm-flavor__media { width: 100%; }
.fm-flavor__img {
	display: block; width: 100%; height: auto; aspect-ratio: var(--fm-ratio);
	object-fit: var(--fm-fit); border-radius: calc(var(--fm-radius) - 4px);
}
.fm-flavor__name { font-size: .88rem; font-weight: 600; line-height: 1.2; min-height: 2.3em; display: flex; align-items: center; }
.fm-qty { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .25rem; min-height: 2.4rem; margin-top: auto; }
.fm-qty button {
	width: 1.9rem; height: 1.9rem; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--fm-navy); color: var(--fm-on); font-size: 1.15rem; line-height: 1;
}
.fm-qty button:disabled { opacity: .3; cursor: not-allowed; }
.fm-val { min-width: 3.4ch; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fm-navy); }

/* Infobulle « ? » */
.fm-tip {
	position: absolute; top: 8px; right: 8px; z-index: 3; width: 1.6rem; height: 1.6rem;
	border-radius: 50%; border: 0; background: var(--fm-gold); color: var(--fm-on); font-weight: 700; cursor: help; padding: 0; line-height: 1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.fm-tip__text {
	position: absolute; top: 0; left: 0; right: 0; bottom: 2.9rem; z-index: 2; padding: .6rem 2.2rem .6rem .6rem;
	background: var(--fm-navy); color: var(--fm-on); font-size: .78rem; line-height: 1.3; text-align: left;
	overflow: auto; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s;
}
.fm-tip-wrap.is-open .fm-tip__text, .fm-tip:focus-visible + .fm-tip__text { opacity: 1; visibility: visible; }
@media (hover: hover) {
	.fm-tip-wrap:hover .fm-tip__text { opacity: 1; visibility: visible; }
}

/* Panneau (fiole) */
.fm-panel { background: var(--fm-bg); border: 1px solid var(--fm-line); border-radius: var(--fm-radius); padding: 1.25rem; text-align: center; color: var(--fm-navy); }
.fm-vial { width: 110px; margin: 0 auto .5rem; }
.fm-vial__cap { width: 46px; height: 22px; margin: 0 auto; background: var(--fm-gold); border-radius: 6px 6px 0 0; }
.fm-vial__neck { width: 58px; height: 22px; margin: 0 auto; border: 3px solid var(--fm-navy); border-bottom: 0; border-radius: 6px 6px 0 0; background: rgba(255, 255, 255, .7); }
.fm-vial__body { position: relative; height: 230px; border: 3px solid var(--fm-navy); border-radius: 14px 14px 40px 40px; overflow: hidden; background: rgba(255, 255, 255, .7); }
.fm-liquid { position: absolute; inset: 0; display: flex; flex-direction: column-reverse; }
.fm-liquid__seg { flex: 0 0 0%; min-height: 0; transition: flex-basis .35s ease; }
.fm-vial__pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: var(--fm-navy); text-shadow: 0 0 6px #fff, 0 0 3px #fff; }
.fm-vial__info { margin: 0 0 1rem; font-size: .9rem; }
.fm-label { display: block; margin-bottom: .35rem; font-weight: 600; }
.fm-nicotine { width: 100%; padding: .6rem; margin-bottom: 1rem; border-radius: 8px; border: 1px solid var(--fm-line); background: var(--fm-card); color: var(--fm-navy); font: inherit; }
.fm-add {
	width: 100%; padding: .85rem; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--fm-navy); color: var(--fm-on); font: inherit; font-weight: 700;
}
.fm-add:disabled { background: #b9b9b9; color: #fff; cursor: not-allowed; }
.fm-hint { margin: .75rem 0 0; font-size: .9rem; min-height: 1.3em; }
.fm-status { margin-top: .5rem; font-weight: 600; }
.fm-status.is-error { color: #b32d2e; }
.fm-cartlink { margin-left: .25rem; color: var(--fm-navy); text-decoration: underline; }
.fm-back { margin-top: 1rem; background: none; border: 0; color: var(--fm-navy); text-decoration: underline; cursor: pointer; font: inherit; }

/* Barre de progression collante (mobile) */
.fm-progress {
	position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .75rem;
	margin-top: 1rem; padding: .6rem 1rem; background: var(--fm-navy); color: var(--fm-on); border-radius: var(--fm-radius);
}
.fm-progress__track { flex: 1; height: 8px; background: rgba(255, 255, 255, .25); border-radius: 4px; overflow: hidden; }
.fm-progress__bar { width: 0; height: 100%; background: var(--fm-gold); transition: width .3s; }
.fm-progress__txt { font-weight: 700; min-width: 3.5ch; text-align: right; }

@media (max-width: 899px) {
	.fm-vial__body { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
	.fm-app * { transition: none !important; }
}
