:root {
  --bg: #f7f4ee;
  --ink: #2e2a24;
  --muted: #736b5f;
  --line: #ded6c7;
  --accent: #7a4d25;
  --accent-ink: #fff;
  --ok: #2f6f3e;
  --warn: #8a6d1b;
  --err: #a12b2b;
  --card: #fffefa;
  --panel: #ece4d6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Iowan Old Style", Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; font-weight: 600; }

.container { max-width: 1040px; margin: 0 auto; padding: 2rem 1.25rem 3.5rem; }

/* header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.65rem 1.25rem; background: rgba(255, 254, 250, 0.96);
  border-bottom: 1px solid var(--line);
}
.site-header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-header nav a:not(.btn) { text-decoration: none; color: var(--ink); }
.brand { display: flex; align-items: center; }
.brand img { display: block; width: 128px; height: auto; }
.inline { display: inline; margin: 0; }
button.link {
  background: none; border: none; color: var(--accent);
  font: inherit; cursor: pointer; padding: 0; text-decoration: underline;
}

/* buttons */
.btn {
  display: inline-block; padding: 0.6rem 1.1rem; border-radius: 6px;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
  border: 1px solid var(--accent); cursor: pointer; font: inherit;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled {
  cursor: not-allowed;
  filter: grayscale(0.4);
  opacity: 0.55;
}
.btn-ghost { background: transparent; color: var(--accent); }
.btn-small { padding: 0.35rem 0.7rem; font-size: 0.9rem; }

/* messages */
.messages { list-style: none; max-width: 900px; margin: 1rem auto 0; padding: 0 1.2rem; }
.msg { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 0.5rem; border: 1px solid var(--line); }
.msg.success, .state.ok { background: #eaf4ec; border-color: #cfe6d5; color: var(--ok); }
.msg.error, .state.ko { background: #f7e9e9; border-color: #e8cccc; color: var(--err); }
.msg.warning, .state.wait { background: #f7f1df; border-color: #e8ddb8; color: var(--warn); }
.state { padding: 0.6rem 1rem; border-radius: 6px; border: 1px solid var(--line); }

/* home */
.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

/* home — bandeau panettones */
.home-banner {
  position: relative;
  margin: -2rem -1.25rem 0;
  min-height: 210px;
  max-height: 46vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}
.home-banner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(20, 16, 12, 0.8) 0%,
    rgba(20, 16, 12, 0.28) 45%,
    rgba(20, 16, 12, 0.05) 100%
  );
}
.home-banner-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
  padding: 1.4rem 1.5rem 1.2rem;
  color: #fff;
}
.home-banner-copy .eyebrow { color: #f0d9c4; margin-bottom: 0.5rem; }
.home-banner-copy h1 {
  margin: 0;
  color: #fff;
  font-size: 2.15rem;
  line-height: 1.1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}
/* home — bande info */
.home-info {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.6rem;
  margin: 0 0 2.5rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.home-info span { position: relative; }
.home-info span + span::before {
  content: "·";
  position: absolute;
  left: -0.95rem;
}

/* home — présentation */
.atelier-presentation {
  max-width: 680px;
  margin: 0 0 2.5rem;
}
.atelier-presentation h2 {
  color: var(--accent);
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 0 0 1.25rem;
}
.atelier-presentation p {
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 1rem;
  text-align: justify;
}

/* home — réalisations (carousel) */
.realisations { margin: 2.5rem 0 1rem; }
.carousel { position: relative; margin-top: 1.25rem; }
.carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.6rem;
}
.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}
.carousel-slide {
  flex: 0 0 min(72%, 340px);
  margin: 0;
  scroll-snap-align: start;
}
.carousel-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 10px;
}
.carousel-slide figcaption {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.carousel-nav {
  position: absolute;
  top: calc(50% - 1.25rem);
  transform: translateY(-50%);
  z-index: 2;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(46, 42, 36, 0.28);
}
.carousel-nav.prev { left: 0.25rem; }
.carousel-nav.next { right: 0.25rem; }
.carousel-nav:hover { filter: brightness(1.08); }
.carousel-nav:active { transform: translateY(-50%) scale(0.94); }

/* fournée + cards */
.fournee { margin: 0 0 2.5rem; }
.fournee h2, .space h2 { margin: 0; }
.section-heading {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.6rem;
}
.section-heading > span,
.fournee-date { color: var(--muted); }
.insta-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}
.insta-link svg { flex: 0 0 auto; }
.insta-link:hover { color: var(--accent); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 1rem; box-shadow: 0 1px 2px rgba(46, 42, 36, 0.04);
}
.card h3 { margin: 0 0 0.3rem; }
.card-photo {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: 6px; margin-bottom: 0.6rem; display: block;
  background: var(--line);
}
.card-meta { margin: 0.2rem 0; }
.card.is-out { opacity: 0.6; }
.allergens, .avail, .help, .note { color: var(--muted); font-size: 0.9rem; }
.tag { background: var(--err); color: #fff; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.8rem; }
.cta { margin-top: 1rem; }
.empty { color: var(--muted); font-style: italic; }

/* about */
.about { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.about-photo {
  width: 220px;
  max-width: 50vw;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(46, 42, 36, 0.14);
}
.about-body { max-width: 640px; }
.about-body p { margin: 0 0 0.9rem; }
.about-body h2 { margin: 1.75rem 0 0.5rem; }
.about-todo { color: var(--muted); font-size: 0.9rem; }
.about-sign {
  color: var(--accent);
  font-style: italic;
  font-weight: 700;
  margin-top: 1.25rem;
}

/* forms */
.form-page, .space { max-width: 640px; }
.client-space { max-width: 900px; }
.space-header {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.space-header h1 { margin: 0; }
form label { display: block; margin: 0.8rem 0; }
form input[type=text], form input[type=email], form input[type=password],
form input[type=number], form select {
  display: block; width: 100%; padding: 0.5rem; margin-top: 0.25rem;
  border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}
form input[type=number] { width: 5rem; }
.help.error { color: var(--err); }

.order-panel,
.orders-panel {
  margin-top: 2rem;
}
.order-panel + .order-panel {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.order-products {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}
.order-product {
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem 1.1rem;
  /* [vignette (0 si pas de photo)] [infos] [quantité] */
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 190px);
  padding: 1rem;
}
.order-product.no-photo {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
}
.order-product.no-photo .order-product-main {
  grid-column: 1;
}
.order-product.no-photo .order-product-side {
  grid-column: 2;
}
.order-product-photo {
  grid-column: 1;
  width: 132px; height: 132px; object-fit: cover;
  border-radius: 6px; display: block;
  background: var(--line);
}
.order-product h3,
.order-product p {
  margin: 0;
}
.order-product-main {
  grid-column: 2;
  min-width: 0;
}
.order-product-main p {
  color: var(--muted);
}
.order-product-side {
  grid-column: 3;
  align-items: flex-end;
  display: grid;
  gap: 0.5rem;
}
.order-product-side label {
  margin: 0;
  width: 100%;
}
.order-product-side label span,
.availability {
  color: var(--muted);
  display: block;
  font-size: 0.9rem;
}
.order-product-side select {
  min-height: 42px;
  width: 100%;
}
.order-product.is-out {
  opacity: 0.62;
}
.delivery-choice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 1rem 0;
  padding: 1rem;
}
.delivery-choice h3 {
  margin: 0 0 0.5rem;
}
.delivery-choice label {
  display: block;
}
.delivery-choice label span {
  display: block;
  margin-bottom: 0.3rem;
}
.mule-ico {
  width: auto;
  height: 2rem;
  vertical-align: -0.7em;
  margin-right: 0.3rem;
}
.delivery-choice select,
.delivery-choice input[type=text] {
  min-height: 44px;
  width: 100%;
}
.delivery-choice .help {
  margin: 0.4rem 0 0;
}

/* --- Sélecteur de point Mondial Relay --- */
.mr-picker {
  margin-top: 0.75rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.75rem;
}
.mr-search {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.mr-search input {
  flex: 1;
  min-height: 44px;
}
.mr-map {
  height: 260px;
  border-radius: 8px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.mr-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}
.mr-results button {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mr-results button:hover {
  border-color: var(--accent);
}
.mr-results button span {
  font-size: 0.88rem;
  color: var(--muted);
}
.mr-recap {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mr-recap span {
  font-size: 0.9rem;
  color: var(--muted);
}
.pickup-recap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  text-align: left;
}
.promo-badge {
  background: #fff7e6;
  border: 1px solid #f0c674;
  border-radius: 8px;
  color: #7a4d25;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
}
.order-estimate [data-order-discount-row] {
  align-items: baseline;
  color: var(--ok);
  display: flex;
  grid-column: 1 / -1;
  justify-content: space-between;
}
.order-estimate [data-order-discount-row][hidden] {
  display: none;
}
.order-estimate [data-order-discount-row] span {
  color: inherit;
}
.order-estimate [data-order-discount-row] strong {
  font-size: 1rem;
}
.order-summary {
  align-items: center;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1rem;
}
.order-summary p {
  margin: 0;
}
.order-summary strong {
  display: block;
}
.order-estimate {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, auto);
  min-width: 330px;
  padding: 0.55rem 0.75rem;
}
.order-estimate span {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
}
.order-estimate strong {
  font-size: 1.25rem;
  line-height: 1.1;
  margin-top: 0.1rem;
  white-space: nowrap;
}
.order-estimate .help {
  grid-column: 1 / -1;
  margin: 0;
}
.order-history {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.order-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
.order-card header,
.order-actions {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}
.order-card h3 {
  margin: 0.15rem 0 0;
}
.order-ref {
  color: var(--muted);
  font-size: 0.9rem;
}
.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  flex: 0 0 auto;
  font-size: 0.86rem;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.status-pre_commande { background: #f7f1df; color: var(--warn); }
.status-commande { background: #eef2f6; color: #31506c; }
.status-payee { background: #eaf4ec; color: var(--ok); }
.status-annulee { background: #f7e9e9; color: var(--err); }
.order-lines {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  list-style: none;
  margin: 1rem 0;
  padding: 0.55rem 0;
}
.order-lines li {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.25rem 0;
}
.order-facts {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1rem;
}
.order-facts div {
  min-width: 0;
}
.order-facts dt {
  color: var(--muted);
  font-size: 0.86rem;
}
.order-facts dd {
  font-weight: 600;
  margin: 0.1rem 0 0;
  overflow-wrap: anywhere;
}
.order-actions {
  align-items: center;
  min-height: 42px;
}

/* tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: var(--card); }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.9rem; color: var(--muted); }
.order-table input { margin: 0; }

/* footer */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 1.5rem 1.2rem; text-align: center; color: var(--muted); font-size: 0.9rem;
}
.site-footer img { opacity: 0.7; }

@media (max-width: 560px) {
  .container { padding: 1.25rem 1rem 2.5rem; }
  .site-header { align-items: flex-start; padding: 0.55rem 1rem; }
  .site-header nav { gap: 0.75rem; width: 100%; }
  .brand img { width: 104px; }
  .home-banner {
    margin: -1.25rem -1rem 0;
    min-height: 160px;
    max-height: 38vh;
  }
  .home-banner-copy { padding: 1.15rem 1rem 1rem; }
  .home-banner-copy h1 { font-size: 1.6rem; }
  .atelier-presentation { margin: 0 0 2rem; }
  .atelier-presentation h2 { font-size: 1.35rem; }
  .atelier-presentation p { font-size: 1rem; }
  .carousel-slide { flex-basis: 82%; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .space-header { align-items: flex-start; flex-direction: column; }
  .space-header .btn { width: 100%; text-align: center; }
  .order-product {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
  .order-product-photo,
  .order-product-main,
  .order-product-side {
    grid-column: 1;
  }
  .order-product-photo {
    width: 100%;
    height: 150px;
  }
  .order-product-side {
    align-items: stretch;
  }
  .order-summary {
    align-items: stretch;
    flex-direction: column;
  }
  .order-estimate {
    grid-template-columns: 1fr;
    min-width: 0;
  }
  .order-summary .btn,
  .order-actions .btn {
    text-align: center;
    width: 100%;
  }
  .order-card header,
  .order-actions {
    flex-direction: column;
  }
  .order-facts {
    grid-template-columns: 1fr;
  }
  .about { flex-direction: column; }
  .about-photo { max-width: 70vw; }
}
