/* ==========================================================
   07. MODALES
   ========================================================== */

dialog {
  border: 0;
  padding: 0;
  width: min(650px,calc(100% - 30px));
  max-height: calc(100dvh - 35px);
  border-radius: 25px;
  color: var(--ink);
  background: white;
  box-shadow: 0 25px 100px #00000033;
  overflow: auto;
  overscroll-behavior: contain;
}

dialog::backdrop { background: #20271d77; backdrop-filter: blur(5px); }

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 23px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: white;
  z-index: 3;
}

.dialog-head h2 { font-size: 1.5rem; }
.dialog-body { padding: 24px; }

.field { display: grid; gap: 8px; margin-top: 17px; }
.field > span { font-size: .9375rem; font-weight: 600; }
.field input, .field select {
  width: 100%;
  min-height: 49px;
  padding: 12px 14px;
  border: 1px solid #d5ddcd;
  border-radius: 13px;
  background: white;
  color: var(--ink);
}

.city-form { display: flex; gap: 10px; margin-bottom: 14px; }
.city-form input { min-width: 0; width: 100%; min-height: 50px; border: 1px solid #d5ddcd; border-radius: 13px; padding: 12px 14px; }

.city-results { padding: 0; margin: 12px 0 0; list-style: none; }
.city-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
  min-height: 63px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.city-results button:hover { background: #f4f6ef; }
.city-results small { display: block; color: var(--muted); margin-top: 3px; }

.tour-list { list-style: none; padding: 0; margin: 20px 0 0; }
.tour-stop { padding: 20px; border: 1px solid var(--line); border-radius: 17px; margin-top: 12px; }
.tour-stop h3 { font-size: 1.2rem; margin: 9px 0; }
.tour-stop p { font-size: .875rem; color: var(--muted); }
.tour-stop .btn { margin-top: 14px; }

.pro-goals { border: 0; padding: 0; margin: 22px 0; }
.pro-goals legend { font-weight: 700; margin-bottom: 10px; }

.goal {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 9px;
  cursor: pointer;
}

.goal input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--orange); }
.goal small { display: block; color: var(--muted); margin-top: 4px; font-size: .8125rem; }
.goal:has(input:checked) { background: var(--orange-light); border-color: var(--orange); }

.pro-preview { padding: 24px; border-radius: 22px; background: var(--lilac); }
.pro-preview h3 { margin: 15px 0 9px; }
.pro-preview p { color: #62516d; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 10000;
  width: max-content;
  max-width: calc(100% - 30px);
  transform: translate(-50%,15px);
  padding: 14px 20px;
  border-radius: 16px;
  color: white;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
  font-size: .9375rem;
}

.toast.visible { opacity: 1; transform: translate(-50%,0); }


/* ==========================================================
   SERVICES, HORAIRES & TOURNÉE
   ========================================================== */
dialog[data-kind="tour"] { width: min(700px, calc(100% - 30px)); }

.service-dialog-body { padding-top: 22px; }
.service-dialog-intro {
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.service-dialog-intro h3 {
  margin: 0 0 5px;
  font-size: 1.42rem;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.service-dialog-intro p { margin: 0; line-height: 1.45; }

/* Food truck : pictogramme volontairement simple, comme sur l'aperçu. */
.service-dialog-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 54px;
  color: var(--ink);
  background: transparent;
}
.service-dialog-icon.is-truck .icon { width: 50px; height: 38px; stroke-width: 1.8; }

/* Adresse fixe : même langage graphique que la fiche établissement. */
.service-merchant-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--merchant-color, var(--orange));
  color: #fff;
  font: 800 2.15rem/1 var(--display-font);
  transform: rotate(-4deg);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.service-merchant-mark.has-avatar {
  border-radius: 50%;
  transform: none;
  background: var(--surface, #fff);
}
.service-merchant-mark img { width: 100%; height: 100%; object-fit: cover; }

/* La tournée se lit comme un petit planning, pas comme une pile de cartes. */
.tour-list {
  list-style: none;
  padding: 0 20px;
  margin: 10px 0 0;
  overflow: hidden;
  border: 1px solid #dbe5d5;
  border-radius: 22px;
  background: #fff;
}
.tour-list .notice { margin: 18px 0; }
.tour-stop {
  margin: 0;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.tour-stop:last-child { border-bottom: 0; }
.tour-stop.is-cancelled { opacity: .78; }

.tour-stop-main {
  display: grid;
  grid-template-columns: 54px minmax(0,1fr) auto;
  gap: 16px;
  align-items: center;
}
.service-date-tile {
  display: grid;
  place-items: center;
  width: 54px;
  min-height: 63px;
  padding: 7px 5px;
  border-radius: 13px;
  background: #eef3e9;
  color: var(--ink);
  text-align: center;
}
.service-date-tile small {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
}
.service-date-tile strong {
  display: block;
  margin-top: 5px;
  font-size: 1.36rem;
  line-height: 1;
  font-family: var(--display-font);
}
.tour-stop-copy { min-width: 0; }
.tour-stop-copy h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.2;
}
.tour-stop-copy p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.service-timing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e4efd9;
  color: #24723c;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.service-timing-badge.is-live { background: #dcefd7; color: #1d6b37; }
.service-timing-badge.is-pause { background: #f4eee1; color: #7b5b1f; }
.service-timing-badge.is-alert { background: #fde8e4; color: #aa3c31; }

.tour-stop-action { margin: 12px 0 0 70px; }
.tour-stop-action:empty { display: none; }
.tour-stop-action .btn { margin: 0; }
.tour-order-hint {
  margin: 0 !important;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}
.tour-order-hint.is-alert { color: #aa3c31; font-weight: 700; }
.service-demo-note { margin-top: 20px; }

.schedule-disclosure { margin-top: 16px; }
.schedule-disclosure > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
}
.schedule-disclosure > summary::-webkit-details-marker { display: none; }
.schedule-disclosure > summary .icon {
  width: 17px;
  height: 17px;
  transition: transform .18s ease;
}
.schedule-disclosure[open] > summary .icon { transform: rotate(90deg); }
.schedule-disclosure-body { margin-top: 12px; }
.schedule-empty { margin-top: 12px; }
.tour-list-full { margin-top: 0; }

.weekly-hours {
  overflow: hidden;
  border: 1px solid #dbe5d5;
  border-radius: 18px;
  background: #fff;
}
.weekly-hours-row {
  display: grid;
  grid-template-columns: minmax(105px,.75fr) minmax(0,1.25fr);
  gap: 20px;
  align-items: start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: .86rem;
  line-height: 1.45;
}
.weekly-hours-row:last-child { border-bottom: 0; }
.weekly-hours-row.is-today { background: #f4f8f0; }
.weekly-hours-row.is-today strong { color: var(--green, #2f7548); }
.weekly-hours-row > span { text-align: right; }
.weekly-hours-row .is-closed { color: var(--muted); }

@media(max-width:550px) {
  dialog[data-kind="tour"] { width: 100%; }
  .service-dialog-body { padding-inline: 16px; }
  .service-dialog-intro { grid-template-columns: 54px minmax(0,1fr); gap: 13px; }
  .service-dialog-icon { width: 54px; height: 48px; }
  .service-dialog-icon.is-truck .icon { width: 45px; height: 34px; }
  .service-merchant-mark { width: 54px; height: 54px; border-radius: 16px; font-size: 1.9rem; }
  .service-dialog-intro h3 { font-size: 1.22rem; }

  .tour-list { padding: 0 13px; border-radius: 18px; }
  .tour-stop-main { grid-template-columns: 48px minmax(0,1fr); gap: 12px; }
  .service-date-tile { width: 48px; min-height: 58px; border-radius: 12px; }
  .service-date-tile strong { font-size: 1.23rem; }
  .service-timing-badge { grid-column: 2; justify-self: start; margin-top: -3px; }
  .tour-stop-action { margin-left: 60px; }
  .tour-stop-copy p { font-size: .72rem; }

  .weekly-hours-row { grid-template-columns: 92px minmax(0,1fr); gap: 12px; padding: 12px 13px; }
}

