/* Étiquette de savon — styles communs aux pages Canada (etiquette.html) et Europe (etiquette-europe.html)
   Copyright (C) 2026 Alignement.com — GNU GPL v3 ou ultérieure. */
:root {
  --navy: #0a1628;
  --accent: #2e7de9;
  --link: #8cc4ff;
  --gold: #f0b23a;
  --text: #f4f7fc;
  --soft: #d5deec;
  --card-bg: rgba(255,255,255,0.05);
  --border: rgba(46,125,233,0.35);
  --ok: #82e0aa;
  --warn: #ffcc66;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; }
body {
  background: var(--navy);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(46,125,233,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,125,233,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none; z-index: 0;
}
.container { max-width: 1000px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
a { color: var(--link); }

header { padding: 32px 0 12px; text-align: center; }
.breadcrumb { font-size: 0.85rem; color: var(--soft); margin-bottom: 16px; }
.breadcrumb a { text-decoration: none; }
header h1 {
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: 2px; line-height: 1.15;
}
header p { color: var(--soft); margin-top: 6px; }
.header-line { width: 120px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 16px auto 0; }

main { padding: 24px 0 12px; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.card-num { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 0.8rem; letter-spacing: 3px; text-transform: uppercase; color: var(--link); }
.card-title { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 1.45rem; letter-spacing: 1px; margin-bottom: 14px; }

label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; color: var(--text); }
.hint { font-size: 0.85rem; color: var(--soft); margin-top: 3px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(140,196,255,0.45);
  border-radius: 8px;
  color: var(--text);
  font: inherit; font-size: 1rem;
  padding: 9px 12px;
}
textarea { resize: vertical; min-height: 5.2em; }
select option { background: var(--navy); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 > * { min-width: 0; }
.row > input { flex: 1; min-width: 0; width: auto; }
.field { margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row > select { flex: 1; min-width: 200px; width: auto; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { margin-top: 6px; width: 18px; height: 18px; flex: none; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; cursor: pointer;
  font-family: 'Montserrat', sans-serif; font-size: 1rem; font-weight: 600;
  border: 1px solid rgba(140,196,255,0.55);
  background: rgba(46,125,233,0.18); color: var(--text);
  text-decoration: none;
}
.btn:hover { background: rgba(46,125,233,0.35); }
.btn-gold { border-color: var(--gold); background: rgba(240,178,58,0.16); }
.btn-gold:hover { background: rgba(240,178,58,0.3); }

.msg { margin-top: 10px; padding: 10px 14px; border-radius: 8px; background: rgba(240,178,58,0.12); border: 1px solid rgba(240,178,58,0.5); }
.msg.ok { background: rgba(39,174,96,0.12); border-color: rgba(130,224,170,0.5); }
.msg[hidden] { display: none; }
.note {
  background: rgba(240,178,58,0.07);
  border: 1px solid rgba(240,178,58,0.35);
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--soft);
  margin-top: 12px;
}
.note strong { color: var(--gold); }
.note.warn { background: rgba(255,204,102,0.1); border-color: var(--warn); color: var(--text); }

/* Tableau des ingrédients */
.ing-wrap { overflow-x: auto; }
table.ing { width: 100%; border-collapse: collapse; }
table.ing th { text-align: left; font-size: 0.85rem; color: var(--soft); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.ing td { padding: 6px 8px; border-bottom: 1px solid rgba(46,125,233,0.15); vertical-align: middle; }
table.ing td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.ing td.src { color: var(--soft); font-size: 0.9rem; }
table.ing input { padding: 6px 9px; min-width: 210px; }
table.ing input.edited { border-color: var(--ok); }
table.aller input { min-width: 0; width: 5.5em; text-align: right; }
table.aller td.oui { color: var(--ok); font-weight: 700; }
table.aller tr.he td { color: var(--gold); font-weight: 600; padding-top: 12px; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; background: rgba(255,204,102,0.2); color: var(--warn); border: 1px solid var(--warn); white-space: nowrap; }
.seuil td { border-top: 2px dashed rgba(240,178,58,0.5); }
.liste { margin-top: 14px; padding: 14px 16px; border-radius: 10px; background: rgba(255,255,255,0.92); color: #111; font-size: 0.95rem; }
.liste b { color: #000; }

/* Aperçu de l'étiquette : mêmes dimensions qu'à l'impression */
.apercu-wrap { overflow-x: auto; padding: 10px 0; }
.apercu { display: block; }
.apercu > * { margin: 0 auto; }   /* vraie taille ; sur petit écran, le zoom réduit l'aperçu */
.etq {
  background: #fff; color: #000;
  font-family: 'Montserrat', Arial, sans-serif;
  overflow: hidden;
  display: flex; flex-direction: column;
  padding: 0.1in 0.13in;
  line-height: 1.22;
}
.apercu .etq { box-shadow: 0 0 0 1px #999, 0 6px 24px rgba(0,0,0,0.45); border-radius: 4px; }
.etq .e-nom { font-weight: 800; font-size: 1.45em; line-height: 1.1; }
.etq .e-sous { font-style: italic; font-size: 1.05em; }
.etq .e-id { font-weight: 600; margin-top: 0.15em; }
.etq .e-ing { margin-top: 0.35em; }
.etq .e-ing b { font-weight: 700; }
.etq .e-bas { margin-top: auto; padding-top: 0.35em; display: flex; justify-content: space-between; gap: 0.6em; align-items: flex-end; }
.etq .e-poids { font-weight: 700; font-size: 1.15em; white-space: nowrap; }
.etq .e-garde { margin-top: 0.3em; }
.etq .e-fab { font-size: 0.92em; }
.fit-msg { text-align: center; margin-top: 8px; color: var(--soft); font-size: 0.9rem; }
.fit-msg.warn { color: var(--warn); }

.guide h2 { font-family: 'Rajdhani', sans-serif; font-size: 1.45rem; margin-bottom: 10px; }
.guide h3 { font-size: 1.1rem; color: var(--gold); margin: 18px 0 6px; }
.guide p, .guide li { color: var(--text); }
.guide p + p { margin-top: 8px; }
.guide ul { margin: 6px 0 0 1.3em; }
.guide code { background: rgba(255,255,255,0.1); padding: 0 4px; border-radius: 4px; }
table.ref { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.92rem; }
table.ref th, table.ref td { text-align: left; padding: 5px 8px; border-bottom: 1px solid rgba(46,125,233,0.2); }
table.ref th { color: var(--soft); }

footer { text-align: center; padding: 20px 0 40px; font-size: 0.9rem; color: var(--soft); }
footer p + p { margin-top: 6px; }

#printSheet { display: none; }

/* Bande en papier kraft : panneaux devant, côté, dos, côté, rabat */
.bande { display: flex; position: relative; color: #1b1410; font-family: 'Montserrat', Arial, sans-serif; line-height: 1.2; }
.apercu .bande { background: #c8a273; box-shadow: 0 6px 24px rgba(0,0,0,0.45); }
.bande .pan { position: relative; height: 100%; flex: none; overflow: hidden;
              display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
/* Repères de pliage : petits traits en haut et en bas, pas de ligne en travers du devant */
.bande .pan + .pan::before, .bande .pan + .pan::after { content: ''; position: absolute; left: 0; height: 0.35cm; border-left: 0.2mm solid #1b1410; }
.bande .pan + .pan::before { top: 0; }
.bande .pan + .pan::after { bottom: 0; }
.bande .pan > * { max-width: 100%; overflow-wrap: anywhere; }
.bande .b-devant { padding: 0 0.2cm; }
.bande .b-devant { justify-content: space-evenly; }
.bande .b-logo { height: 36%; display: flex; justify-content: center; flex: none; }
.bande .b-logo svg, .bande .b-logo img { height: 100%; width: auto; max-width: 90%; object-fit: contain; }
.bande .b-nom { font-weight: 800; font-size: 1.25em; margin-top: 0.25em; }
.bande .b-sous { font-style: italic; }
.bande .b-id { font-size: 0.8em; margin-top: 0.15em; }
.bande .b-sig { font-family: 'Dancing Script', cursive; font-weight: 600; font-size: 2em; line-height: 1; margin-top: 0.15em; }
.bande .b-poids { font-size: 0.8em; font-weight: 600; margin-top: 0.2em; }
.bande .b-cadre { border: 0.25mm dashed #1b1410; border-radius: 1mm; display: flex; align-items: center; justify-content: center; font-size: 0.7em; opacity: .8; }
/* Moitiés de l'autocollant, de part et d'autre de la jointure */
.bande .b-demi.g { align-items: flex-start; }
.bande .b-demi.d { align-items: flex-end; }
.bande .b-cadre.demi-g { border-left: none; border-radius: 0 1mm 1mm 0; }
.bande .b-cadre.demi-d { border-right: none; border-radius: 1mm 0 0 1mm; justify-content: flex-end; padding-right: 0.3em; }
.bande .b-dos { padding: 0.25cm 0.3cm; align-items: stretch; justify-content: flex-start; text-align: left; line-height: 1.22; }
.bande .b-dos .e-nom { font-weight: 800; font-size: 1.2em; }
.bande .b-dos .e-bas { margin-top: auto; display: flex; justify-content: space-between; gap: 0.5em; align-items: flex-end; }
.bande .b-dos .e-poids { font-weight: 700; white-space: nowrap; }
.bande .b-colle { font-size: 0.6em; opacity: .55; writing-mode: vertical-rl; }
/* Bande-cadeau, plus étroite : le logo à gauche, le nom et la description à droite */
.bande.cadeau .b-cadeau { flex-direction: row; justify-content: center; gap: 0.25cm; padding: 0.15cm 0.3cm; }
.bande.cadeau .b-logo { height: 78%; flex: none; }
.bande.cadeau .b-logo svg, .bande.cadeau .b-logo img { max-width: none; }
.bande.cadeau .b-texte { min-width: 0; text-align: left; }
.bande.cadeau .b-nom { margin-top: 0; font-size: 1.3em; line-height: 1.1; }
.bande.cadeau .b-sous { margin-top: 0.15em; }

@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  /* Une ligne par ingrédient : le nom en entier, puis sa part et sa source */
  table.ing thead { display: none; }
  table.ing, table.ing tbody, table.ing tr, table.ing td { display: block; width: 100%; }
  table.ing tr { padding: 8px 0; border-bottom: 1px solid rgba(46,125,233,0.2); }
  table.ing td { border: none; padding: 2px 0; }
  table.ing td.num, table.ing td.src { display: inline; text-align: left; }
  table.ing td.num::after { content: ' · '; color: var(--soft); }
  table.ing input { min-width: 0; }
  .seuil td { border-top: none; }
  table.ing tr.seuil { border-top: 2px dashed rgba(240,178,58,0.5); }
}

@media print {
  html, body { background: #fff; }
  body::before, .container { display: none !important; }
  #printSheet { display: block; position: relative; overflow: hidden; }
  #printSheet .etq { position: absolute; }
  #printSheet .etq.libre { outline: 1px dashed #999; }
  #printSheet .bande { position: absolute; transform: rotate(90deg); transform-origin: top left; outline: 0.2mm solid #1b1410; }
}

/* Europe : symbole du pot ouvert à côté de sa durée */
.etq .pao { height: 2.1em; width: auto; vertical-align: middle; }

/* Sélecteur du pays de vente, sous le titre */
.pays { display: inline-flex; margin-top: 16px; border: 1px solid rgba(140,196,255,0.55); border-radius: 10px; overflow: hidden; }
.pays a { padding: 9px 18px; font-weight: 600; text-decoration: none; color: var(--text); background: rgba(46,125,233,0.10); }
.pays a + a { border-left: 1px solid rgba(140,196,255,0.55); }
.pays a:hover { background: rgba(46,125,233,0.30); }
.pays a.actif { background: rgba(240,178,58,0.22); color: #fff; box-shadow: inset 0 -3px 0 var(--gold); }
