/**
 * EasyCM — EasyGas · Commander / Dépôts (/easygaz/commander, /easy-gas/depots) · 2026
 * Liste de dépôts + vraie carte. Les fenêtres (commande, scanner, itinéraire) gardent leur style existant.
 * Préfixe : gc-
 */

.eg-app.gc-page {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: #f7f4f1 !important;
}
body:has(.gc) { background: #f7f4f1 !important; }

.gc {
  --ink: #17120e;
  --ink-2: #3d3833;
  --muted: #7b736c;
  --line: rgba(23, 18, 14, 0.08);
  --line-2: rgba(23, 18, 14, 0.14);
  --bg: #f7f4f1;
  --card: #fff;
  --soft: #fbf9f7;
  --flame: #ff5a00;
  --flame-2: #ff8a00;
  --ok: #16a34a;
  --wa: #25d366;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(23, 18, 14, 0.04), 0 14px 32px -18px rgba(23, 18, 14, 0.24);

  max-width: 1320px;
  margin: 0 auto;
  padding: 0 16px calc(110px + env(safe-area-inset-bottom, 0px));
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.gc *, .gc *::before, .gc *::after { box-sizing: border-box; }
.gc a { color: inherit; text-decoration: none; }
.gc h1, .gc h2, .gc h3, .gc p { margin: 0; }
.gc button { font-family: inherit; cursor: pointer; }
.gc :focus-visible { outline: 3px solid rgba(255, 90, 0, 0.35); outline-offset: 2px; }

/* ---------- Barre mobile ---------- */
.gc-bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px);
}
.gc-iconbtn {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink) !important;
  transition: transform 0.15s var(--ease);
}
.gc-iconbtn:active { transform: scale(0.92); }
.gc-bar__title { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.gc-bar__title strong { display: block; font-size: 1.05rem; font-weight: 800; }
.gc-bar__title small { display: block; font-size: 0.72rem; color: var(--muted); }

/* ---------- En-tête ---------- */
.gc-head { margin-top: 4px; }
.gc-head h1 { display: none; }
.gc-head p.gc-lead { display: none; }

.gc-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.gc-search__field {
  display: flex; align-items: center; gap: 10px;
  height: 52px; margin: 0; padding: 0 6px 0 14px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 18, 14, 0.04);
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gc-search__field:focus-within { border-color: #ffb37a; box-shadow: 0 0 0 4px rgba(255, 90, 0, 0.12); }
.gc-search__field > i { color: #a8a29e; }
.gc-search__field input { flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent; padding: 0; font-size: 16px; color: var(--ink); }
.gc-search__go { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--ink); color: #fff; }
.gc-locate {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 14px;
  border: 0; border-radius: 16px;
  background: linear-gradient(145deg, var(--flame-2), var(--flame)); color: #fff;
  font-size: 0.86rem; font-weight: 800; white-space: nowrap;
  box-shadow: 0 10px 22px -10px rgba(255, 90, 0, 0.75);
  transition: transform 0.15s var(--ease);
}
.gc-locate:active { transform: scale(0.96); }
.gc-locate span { display: none; }
.gc-status { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.76rem; color: var(--muted); }
.gc-status i { color: var(--flame); }

.gc-chips { display: flex; gap: 6px; margin: 12px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px; }
.gc-chips::-webkit-scrollbar { display: none; }
.gc-chip {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink-2) !important;
  font-size: 0.82rem; font-weight: 700; white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.gc-chip:active { transform: scale(0.95); }
.gc-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff !important; }
.gc-chip img { width: 14px; height: 22px; object-fit: contain; }
.gc-chip i { font-size: 0.78rem; }

.gc-filters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px; padding: 12px;
  border-radius: 18px; background: var(--card); border: 1px solid var(--line);
}
.gc-filters[hidden] { display: none; }
.gc-filters select {
  width: 100%; height: 46px; padding: 0 12px;
  border-radius: 13px; border: 1px solid var(--line-2); background: var(--soft);
  font-size: 16px; color: var(--ink);
}
.gc-filters button { grid-column: 1 / -1; height: 46px; border: 0; border-radius: 13px; background: var(--ink); color: #fff; font-weight: 800; }

/* ---------- Carte + liste ---------- */
.gc-body { margin-top: 14px; }
.gc-map {
  position: relative; overflow: hidden;
  height: 230px;
  border-radius: 24px; border: 1px solid var(--line);
  background: #e9e4de;
  box-shadow: var(--shadow);
}
.gc-map [data-eg-map] { position: absolute; inset: 0; width: 100%; height: 100%; }
.gc-map__status {
  position: absolute; right: 10px; top: 10px; z-index: 500;
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.95);
  font-size: 0.72rem; font-weight: 800; color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  pointer-events: none;
}
.gc-map__status i { color: var(--flame); }
.gc-map__locate {
  position: absolute; right: 10px; bottom: 10px; z-index: 500;
  display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 14px;
  background: #fff; color: var(--flame); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.gc-list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.gc-list-head h2 { font-size: 1.2rem !important; font-weight: 800 !important; letter-spacing: -0.025em; color: var(--ink) !important; }
.gc-list-head p { margin-top: 2px !important; font-size: 0.8rem; color: var(--muted); }
.gc-toggle { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 0.8rem; font-weight: 700; color: var(--ink-2); cursor: pointer; margin: 0; }
.gc-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.gc-toggle__ui { position: relative; width: 40px; height: 24px; border-radius: 99px; background: #d6d1cc; transition: background 0.2s; }
.gc-toggle__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.25s var(--ease); }
.gc-toggle input:checked + .gc-toggle__ui { background: var(--ok); }
.gc-toggle input:checked + .gc-toggle__ui::after { transform: translateX(16px); }
.gc-toggle input:focus-visible + .gc-toggle__ui { outline: 3px solid rgba(255, 90, 0, 0.35); outline-offset: 2px; }

/* ---------- Carte dépôt ---------- */
.gc .eg-depot-stack { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
.gc-card {
  position: relative;
  padding: 12px;
  border-radius: 24px;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 18, 14, 0.04);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease);
  animation: gc-rise 0.5s var(--ease) both;
}
.gc-card:hover { box-shadow: var(--shadow); border-color: rgba(255, 90, 0, 0.25); }
.gc-card.is-nearest { border-color: rgba(255, 90, 0, 0.45); box-shadow: 0 0 0 1px rgba(255, 90, 0, 0.45), var(--shadow); }
.gc-card.is-closed .gc-card__media { filter: grayscale(0.6); }
.gc-card[hidden] { display: none !important; }

.gc-card__top { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.gc-card__media {
  position: relative; overflow: hidden;
  width: 76px; height: 76px; border-radius: 18px;
  background: radial-gradient(circle at 50% 70%, #ffe3cc, #fff4ec 70%);
  display: grid; place-items: center;
}
.gc-card__media img { width: 100%; height: 100%; object-fit: cover; }
.gc-card__media i { font-size: 1.6rem; color: var(--flame); }
.gc-card__title { min-width: 0; }
.gc-card__badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.gc-card__name { display: block; font-size: 1.02rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.2; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-card__place { display: block; margin-top: 2px; font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-card__place i { color: var(--flame); font-size: 0.72rem; }

.gc-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 0.66rem; font-weight: 800; white-space: nowrap; }
.gc-badge.is-open { background: #dcfce7; color: #15803d; }
.gc-badge.is-open i { font-size: 0.4rem; }
.gc-badge.is-closed { background: #f5f5f4; color: #78716c; }
.gc-badge.is-best { background: var(--ink); color: #fff; }
.gc-badge.is-best i { color: #ffb37a; }

/* Téléphone du dépôt : bien visible et directement utilisable */
.gc-phone {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  margin-top: 12px;
}
.gc-phone__call {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  height: 48px; padding: 0 12px;
  border-radius: 15px; background: #fff4ec; border: 1px solid #ffd9bf;
  color: var(--ink) !important;
  transition: background 0.2s, transform 0.15s var(--ease);
}
.gc-phone__call:hover { background: #ffead9; }
.gc-phone__call:active { transform: scale(0.98); }
.gc-phone__icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--flame); color: #fff; font-size: 0.8rem; }
.gc-phone__text { min-width: 0; line-height: 1.15; }
.gc-phone__text small { display: block; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #c2410c; }
.gc-phone__text strong { display: block; font-size: 1rem; font-weight: 800; letter-spacing: 0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gc-phone__wa {
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 15px;
  background: var(--wa); color: #fff !important; font-size: 1.25rem;
  transition: transform 0.15s var(--ease), filter 0.2s;
}
.gc-phone__wa:hover { filter: brightness(0.95); }
.gc-phone__wa:active { transform: scale(0.94); }
.gc-phone--none { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: 0.78rem; color: var(--muted); }

.gc .eg-depot-metrics { display: flex !important; flex-wrap: wrap; gap: 6px !important; margin: 10px 0 0 !important; padding: 0 !important; background: none !important; border: 0 !important; grid-template-columns: none !important; }
.gc .eg-depot-metrics span { width: auto !important; min-height: 0 !important; justify-content: flex-start !important; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: 0.72rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.gc .eg-depot-metrics i { color: var(--flame); font-size: 0.7rem; }
.gc .eg-depot-metrics .fa-star { color: #f59e0b; }

.gc-stock { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-top: 10px; }
.gc-stock__item { padding: 8px 10px; border-radius: 13px; background: var(--soft); border: 1px solid var(--line); line-height: 1.2; }
.gc-stock__item b { display: block; font-size: 0.86rem; font-weight: 800; }
.gc-stock__item span { display: block; font-size: 0.72rem; font-weight: 700; color: var(--ink); }
.gc-stock__item small { display: block; font-size: 0.64rem; color: var(--ok); font-weight: 700; }
.gc-stock__item.is-low small { color: #b45309; }
.gc-brands { margin-top: 8px; font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-brands b { color: var(--ink-2); font-weight: 700; }

.gc-actions { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; margin-top: 12px; }
.gc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 46px; padding: 0 14px;
  border-radius: 14px; border: 1px solid var(--line-2);
  background: var(--card); color: var(--ink) !important;
  font-size: 0.84rem; font-weight: 800; white-space: nowrap;
  transition: background 0.2s, transform 0.15s var(--ease);
}
.gc-btn:hover { background: var(--soft); }
.gc-btn:active { transform: scale(0.97); }
.gc-btn--icon { width: 46px; padding: 0; }
.gc-btn--primary { border-color: transparent; background: linear-gradient(145deg, var(--flame-2), var(--flame)); color: #fff !important; box-shadow: 0 10px 22px -10px rgba(255, 90, 0, 0.75); }
.gc-btn--primary:hover { background: linear-gradient(145deg, #ff9a1f, #ff6a10); }
.gc-btn:disabled { opacity: 0.55; box-shadow: none; background: #efebe7; color: var(--muted) !important; cursor: not-allowed; }

.gc-empty { display: grid; justify-items: center; gap: 8px; padding: 36px 20px; border-radius: 24px; background: var(--card); border: 1.5px dashed var(--line-2); text-align: center; }
.gc-empty i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: #fff4ec; color: var(--flame); font-size: 1.3rem; }
.gc-empty strong { font-size: 1rem; }
.gc-empty p { max-width: 30ch; font-size: 0.85rem; color: var(--muted); }

/* Marqueurs et info-bulles de carte */
.eg-popup-phone { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; font-weight: 800; color: #17120e !important; text-decoration: none !important; font-variant-numeric: tabular-nums; }
.eg-popup-phone i { color: #ff5a00; }

/* Téléphone dans l'en-tête de la fenêtre de commande */
.eg-order-depot-phone { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 10px; border-radius: 999px; background: #fff4ec; color: #c2410c !important; font-size: 0.8rem; font-weight: 800; text-decoration: none !important; font-variant-numeric: tabular-nums; }
.eg-order-depot-phone[hidden] { display: none !important; }

/* ---------- PC ---------- */
@media (min-width: 640px) {
  .gc-locate span { display: inline; }
}

@media (min-width: 992px) {
  .gc { padding: 26px 28px 48px; }
  .gc-bar { display: none; }
  .gc-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 24px; margin: 0; }
  .gc-head h1 { display: block; font-size: 2rem !important; font-weight: 800 !important; letter-spacing: -0.035em; color: var(--ink) !important; }
  .gc-head p.gc-lead { display: block; margin-top: 4px !important; font-size: 0.95rem; color: var(--muted); }
  .gc-head__search { grid-column: 1 / -1; }
  .gc-search { max-width: 760px; }
  .gc-chips { margin-inline: 0; padding: 0; flex-wrap: wrap; overflow: visible; }

  .gc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); gap: 20px; align-items: start; margin-top: 18px; }
  .gc-list { order: 1; }
  .gc-map { order: 2; position: sticky; top: 96px; height: calc(100vh - 120px); min-height: 480px; border-radius: 28px; }
  .gc-list-head { margin-top: 0; }
  .gc-card { padding: 14px; }
  .gc-card__media { width: 88px; height: 88px; }
  .gc-card__name { font-size: 1.1rem; }
}
@media (min-width: 1500px) {
  .gc .eg-depot-stack { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .gc-body { grid-template-columns: minmax(0, 1fr) 40%; }
}

@keyframes gc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .gc *, .gc *::before, .gc *::after { animation: none !important; transition: none !important; }
}
