/* ============================================================
   PARIS VIA — хаб компании.

   Бренд остаётся прежним (#7A3E93 и засечка в вордмарке), структура —
   в языке shadcn: нейтральная база, волосяные границы, сдержанные радиусы,
   заметный focus-ring. Нейтрали уведены в фиолетовый, чтобы серый не читался
   как «оставили по умолчанию».
   ============================================================ */

:root {
  color-scheme: light;

  --brand:      #7A3E93;
  --brand-ink:  #6B3382;
  --brand-soft: #F3ECF6;
  /* Кнопка поддержки живёт на своём фиолетовом: --brand в тёмной теме
     осветлён ради читаемости текста, а белая иконка на нём бы поплыла. */
  --fab:   #7A3E93;
  --fab-2: #6B3382;

  --ground:    #FAF9FB;
  --surface:   #FFFFFF;
  --surface-2: #F4F1F6;

  --ink:   #1C1720;
  --ink-2: #453D4E;
  --muted: #6E6478;
  --line:  #E8E2EC;
  --line-2:#F1EDF4;

  /* Семантика отдельно от акцента. Закрытый вечером магазин — не авария,
     поэтому «закрыто» приглушённое, а не красное. */
  --open:    #2E7D57;
  --open-bg: #E9F4EE;
  --closed:  #7C7387;

  --radius: 10px;
  --radius-sm: 7px;

  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-xs: 11.5px;
  --t-sm: 13px;
  --t-md: 15px;
  --t-lg: 18px;
  --t-xl: 23px;

  --shadow: 0 1px 2px rgba(28,23,32,.05);
  --shadow-lift: 0 6px 24px rgba(60,30,75,.10), 0 1px 3px rgba(28,23,32,.05);
}

/* Тёмная тема — не инверсия: фон уведён в фиолетовый, акцент осветлён,
   иначе #7A3E93 на тёмном проваливается по контрасту. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand:      #C79BDA;
    --brand-ink:  #DDBDEB;
    --brand-soft: #2A1F33;
    --fab:   #8B49A6;
    --fab-2: #9C58B8;
    --ground:    #14111A;
    --surface:   #1B1722;
    --surface-2: #221D2B;
    --ink:   #EFEAF2;
    --ink-2: #C9C0D2;
    --muted: #9A8FA6;
    --line:  #2C2637;
    --line-2:#241F2E;
    --open:    #6FCC9B;
    --open-bg: #173325;
    --closed:  #8A8095;
    --shadow: 0 1px 2px rgba(0,0,0,.35);
    --shadow-lift: 0 8px 28px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand:      #C79BDA;
  --brand-ink:  #DDBDEB;
  --brand-soft: #2A1F33;
  --fab:   #8B49A6;
  --fab-2: #9C58B8;
  --ground:    #14111A;
  --surface:   #1B1722;
  --surface-2: #221D2B;
  --ink:   #EFEAF2;
  --ink-2: #C9C0D2;
  --muted: #9A8FA6;
  --line:  #2C2637;
  --line-2:#241F2E;
  --open:    #6FCC9B;
  --open-bg: #173325;
  --closed:  #8A8095;
  --shadow: 0 1px 2px rgba(0,0,0,.35);
  --shadow-lift: 0 8px 28px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3);
}

:root[data-theme="light"] {
  color-scheme: light;
  --brand:      #7A3E93;
  --brand-ink:  #6B3382;
  --brand-soft: #F3ECF6;
  /* Кнопка поддержки живёт на своём фиолетовом: --brand в тёмной теме
     осветлён ради читаемости текста, а белая иконка на нём бы поплыла. */
  --fab:   #7A3E93;
  --fab-2: #6B3382;
  --ground:    #FAF9FB;
  --surface:   #FFFFFF;
  --surface-2: #F4F1F6;
  --ink:   #1C1720;
  --ink-2: #453D4E;
  --muted: #6E6478;
  --line:  #E8E2EC;
  --line-2:#F1EDF4;
  --open:    #2E7D57;
  --open-bg: #E9F4EE;
  --closed:  #7C7387;
  --shadow: 0 1px 2px rgba(28,23,32,.05);
  --shadow-lift: 0 6px 24px rgba(60,30,75,.10), 0 1px 3px rgba(28,23,32,.05);
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
h1, h2, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
.sprite { position: absolute; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 24px; }

/* ---------- шапка ---------- */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 22px; padding-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.mark { width: 30px; height: 30px; color: var(--brand); }
.mark svg { width: 100%; height: 100%; display: block; }
.wordmark { font-family: var(--serif); font-size: var(--t-lg); letter-spacing: .13em; line-height: 1; }
.wordmark .w1 { color: var(--ink); }
.wordmark .w2 { color: var(--brand); margin-left: .34em; }

.tools { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  color: var(--muted); transition: color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }
.icon-btn .ico { width: 17px; height: 17px; }

/* Шестерёнка админки намеренно неприметная: это служебный вход, а не
   пункт меню для всех. */
#admin .ico { width: 16px; height: 16px; }
#theme .ico-moon { display: none; }
:root[data-theme="dark"] #theme .ico-sun { display: none; }
:root[data-theme="dark"] #theme .ico-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme .ico-sun { display: none; }
  :root:not([data-theme="light"]) #theme .ico-moon { display: block; }
}

/* ---------- дата и часы ---------- */
.now {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-top: 18px;
}
.eyebrow {
  font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.date {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 5vw, 42px); line-height: 1.05; letter-spacing: -.01em;
  margin-top: 6px; text-wrap: balance;
}
.now-time { display: flex; align-items: baseline; gap: 8px; }
.clock {
  font-size: clamp(52px, 9vw, 86px); font-weight: 200; line-height: .9;
  letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.secs {
  font-size: clamp(15px, 2vw, 19px); font-weight: 400; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.summary {
  margin-top: 16px; padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--t-md);
}
.summary b { font-weight: 600; color: var(--ink); }

/* ---------- секции ---------- */
.block { padding-top: 34px; }
.section-title {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}

/* ---------- филиалы ---------- */
.branches { border-top: 1px solid var(--line-2); }
.branch {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center; gap: 18px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line-2);
}
.b-name { font-weight: 600; font-size: var(--t-md); }
.b-contacts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; }
.b-contact {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-sm); color: var(--muted); transition: color .15s;
}
a.b-contact:hover { color: var(--brand); }
.b-contact .ico { width: 13px; height: 13px; }

.b-when { text-align: right; }
.b-hours { font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.b-left { display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--closed);
}
.pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.pill[data-state="open"] { background: var(--open-bg); color: var(--open); }

.b-shift { text-align: right; min-width: 62px; }
.b-shift b {
  display: block; font-size: var(--t-xl); font-weight: 500; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.b-shift span { font-size: var(--t-xs); color: var(--muted); }
.b-shift[data-empty="true"] b { color: var(--muted); font-weight: 300; }

/* ---------- ресурсы ---------- */
.cards {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'ico body' 'host host';
  align-items: center; gap: 4px 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
}
.card-ico {
  grid-area: ico;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand);
}
.card-body { grid-area: body; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-name {
  display: flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: var(--t-md);
}
.ico-out { width: 13px; height: 13px; color: var(--muted); transition: color .16s, transform .16s; }
.card:hover .ico-out { color: var(--brand); transform: translate(1px, -1px); }
.card-meta { font-size: var(--t-sm); color: var(--muted); }
.card-host {
  grid-area: host;
  font-family: var(--mono); font-size: var(--t-xs); color: var(--muted);
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2);
  word-break: break-all;
}

/* ---------- подвал ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-top: auto; padding-top: 22px; padding-bottom: 28px;
  color: var(--muted); font-size: var(--t-xs);
}
.foot-brand { font-family: var(--serif); letter-spacing: .13em; }
.foot-sync { font-family: var(--mono); }

/* ---------- ассортимент ---------- */
.tiles {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.tile:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); transform: translateY(-1px); }

/* Подложка белая в обеих темах: у карточек товара фон вырезан под белый,
   на тёмном они бы висели с грязным ореолом. */
.tile-img {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; border-radius: var(--radius-sm);
  background: #fff; overflow: hidden;
}
.tile-img img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 6px;
}
.tile-name {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--t-sm); font-weight: 600; padding: 0 4px 2px;
}
.tile:hover .ico-out { color: var(--brand); transform: translate(1px, -1px); }

/* ---------- поддержка ---------- */
.support {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}

.support-fab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--fab); color: #fff;
  box-shadow: 0 6px 20px rgba(60,30,75,.30), 0 2px 6px rgba(28,23,32,.20);
  transition: background-color .16s, transform .16s, box-shadow .16s;
}
.support-fab:hover { background: var(--fab-2); transform: translateY(-2px); }
.support-fab:active { transform: translateY(0); }
.support-fab .ico { width: 25px; height: 25px; stroke-width: 1.8; }
.support-fab .ico-close { display: none; }
.support-fab[aria-expanded="true"] .ico-user  { display: none; }
.support-fab[aria-expanded="true"] .ico-close { display: block; }

/* Раскрывается из самой кнопки — точка роста в её углу. */
.support-pop {
  width: 224px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  text-align: center;
  transform-origin: 100% 100%;
  opacity: 0; visibility: hidden;
  transform: scale(.9) translateY(8px);
  transition: opacity .16s ease, transform .22s cubic-bezier(.2,.7,.3,1), visibility .22s;
}
.support.is-open .support-pop { opacity: 1; visibility: visible; transform: none; }

.support-title {
  font-size: var(--t-xs); font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 12px;
}
/* Подложка под кодом белая в любой теме: сканеры ждут тёмные модули на
   светлом, инвертированный код часть телефонов просто не читает. */
.support-qr {
  background: #fff; border-radius: 8px; padding: 8px;
  display: flex; justify-content: center;
}
.support-qr img { display: block; width: 152px; height: 152px; }
.support-link {
  display: inline-block; margin-top: 12px;
  font-size: var(--t-sm); font-weight: 500; color: var(--brand);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
}
.support-link:hover { text-decoration-color: currentColor; }

/* ---------- появление ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.card, .branch { animation: rise .32s cubic-bezier(.2,.7,.3,1) backwards; }
.cards .card:nth-child(1) { animation-delay: .02s; }
.cards .card:nth-child(2) { animation-delay: .05s; }
.cards .card:nth-child(3) { animation-delay: .08s; }
.cards .card:nth-child(4) { animation-delay: .11s; }
.cards .card:nth-child(5) { animation-delay: .14s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- узкие экраны ---------- */
@media (max-width: 720px) {
  .wrap { padding-inline: 18px; }

  /* Часы уходят под дату: рядом они не помещаются, а ужиматься флексу
     не даёт min-content самих цифр — строка вылезала за экран. */
  .now { flex-direction: column; align-items: flex-start; gap: 4px; }
  .now-date, .now-time { min-width: 0; max-width: 100%; }
  .clock { font-size: clamp(46px, 13vw, 64px); }

  /* Колонок здесь ровно две. Без явного переопределения остаётся три трека
     от широкой раскладки, и счётчик смены уезжает за правый край. */
  .branch {
    grid-template-columns: 1fr auto;
    grid-template-areas: 'main shift' 'when shift';
    gap: 6px 14px;
  }
  .b-main  { grid-area: main; }
  .b-when  { grid-area: when; text-align: left; }
  .b-shift { grid-area: shift; align-self: center; }
  .now { padding-top: 8px; }
  .cards { grid-template-columns: 1fr; }

  /* Кнопка поддержки не должна накрывать строку синхронизации. */
  .foot { padding-bottom: 92px; }
  .support { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); }
  .support-fab { width: 50px; height: 50px; }
}
