/* pcarbon.ru — мобильная навигация: анимированное off-canvas меню + bottom-bar.
   Подключается в _Layout после tailwind.local.css. */

/* ─────────────────────────────────────────────
   OFF-CANVAS МЕНЮ (анимированное)
   Управление: класс .is-open на #site-mobile-menu (см. бургер-скрипт в _Layout).
   Элемент всегда в DOM (не hidden) — иначе CSS-transition не работает.
   ───────────────────────────────────────────── */
#site-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0);
  visibility: hidden;
  transition: background-color .25s ease, visibility 0s linear .25s;
}
#site-mobile-menu.is-open {
  background: rgba(0, 0, 0, 0.45);
  visibility: visible;
  transition: background-color .25s ease, visibility 0s linear 0s;
}

/* Панель выезжает справа */
#site-mobile-menu .pc-mobile-panel {
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  will-change: transform;
}
#site-mobile-menu.is-open .pc-mobile-panel {
  transform: translateX(0);
}

/* Пункты меню — лёгкое поочерёдное появление */
#site-mobile-menu.is-open .pc-mobile-panel nav > a {
  animation: pcMobileItemIn .35s ease both;
}
@keyframes pcMobileItemIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─────────────────────────────────────────────
   BOTTOM BAR (app-style), только мобайл/планшет
   ───────────────────────────────────────────── */
.pc-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-top: 1px solid var(--color-line, #e7e5e4);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 1024px) {
  .pc-bottombar { display: none; }
}

.pc-bottombar-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  min-height: 56px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  text-decoration: none;
  transition: color .15s ease;
  position: relative;
}
.pc-bottombar-item:hover,
.pc-bottombar-item:active { color: var(--color-brand, #0d9488); }
.pc-bottombar-item.is-active { color: var(--color-brand, #0d9488); }

.pc-bottombar-item svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
}
.pc-bottombar-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 30px;
  border-radius: 9999px;
  transition: background-color .2s ease;
}
/* Активный пункт — иконка в закруглённой подложке (Material-style pill) */
.pc-bottombar-item.is-active .pc-bottombar-icon-wrap {
  background-color: rgba(13, 148, 136, 0.14); /* brand с прозрачностью */
}
.pc-bottombar-label {
  font-weight: 500;
  white-space: nowrap;
}

/* Бейдж счётчика корзины */
.pc-bottombar-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: var(--color-brand, #0d9488);
  border-radius: 9999px;
}

/* Кнопка-меню в bottom-bar — это <button>, сбрасываем дефолты */
button.pc-bottombar-item {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* Чтобы контент не прятался под bottom-bar на мобиле */
@media (max-width: 1023px) {
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

/* ─────────────────────────────────────────────
   FAB «Заказать звонок» — плавающая кнопка (мобайл)
   Появляется через таймаут, закрывается крестиком (sessionStorage).
   ───────────────────────────────────────────── */
.pc-call-fab {
  position: fixed;
  right: 12px;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 14px); /* над bottom-bar */
  z-index: 44;
  display: none;
  align-items: flex-start;
  gap: 2px;
}
.pc-call-fab.is-visible { display: flex; animation: pcFabIn .35s cubic-bezier(.34,1.56,.64,1) both; }
@media (min-width: 1024px) {
  .pc-call-fab { display: none !important; } /* только мобайл */
}

.pc-call-fab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--color-brand, #0d9488);
  color: #fff;
  border: none;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
  white-space: nowrap;
}
.pc-call-fab-btn svg { width: 18px; height: 18px; }
.pc-call-fab-btn:active { transform: scale(0.97); }

.pc-call-fab-close {
  width: 22px;
  height: 22px;
  margin-left: -6px;
  margin-top: -6px;
  border-radius: 9999px;
  border: 2px solid #fff;
  background: #475569;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  font-family: Arial, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.pc-call-fab.is-hiding { animation: pcFabOut .28s ease forwards; }

@keyframes pcFabIn {
  from { opacity: 0; transform: translateY(24px) scale(.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pcFabOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(24px) scale(.9); }
}
