/* 2.27.3 手机底部导航（容器仍是 WoodMart 工具栏 .wd-toolbar，样式表只在 ≤1024px 加载）。
   效果稿：temp/veezoon/mock/bottom-nav-v3.html「A · тёмная парящая панель」。
   五项顺序：Главная、Каталог（打开目录抽屉）、Чат（打开聊天）、Корзина、Профиль——
   前四个链接由 WoodMart 输出（项目清单由 Plugin::filter_sticky_toolbar_fields 固定），Чат 由 chat-bottom-nav.js 插在中间。
   结构与数据接入（链接、选中态、购物车数量、聊天未读）在 chat-bottom-nav.js；本文件只管外观：
   第一段是全部图标（换图标只改这一段），第二段是样式（换风格整体替换这一段）。 */

/* ============================== 一、图标（实心，24×24，currentColor 着色） ============================== */
.wd-toolbar {
  --gb-ico-home: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.1 3.6 9.9a1 1 0 0 0-.4.8v8.6c0 1 .8 1.7 1.7 1.7h3.9v-5.3c0-.6.5-1 1-1h4.4c.5 0 1 .4 1 1V21h3.9c1 0 1.7-.8 1.7-1.7v-8.6a1 1 0 0 0-.4-.8z'/%3E%3C/svg%3E");
  --gb-ico-catalog: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3.5' y='3.5' width='7.5' height='7.5' rx='2.4'/%3E%3Crect x='13' y='3.5' width='7.5' height='7.5' rx='3.75'/%3E%3Crect x='3.5' y='13' width='7.5' height='7.5' rx='2.4'/%3E%3Crect x='13' y='13' width='7.5' height='7.5' rx='2.4'/%3E%3C/svg%3E");
  --gb-ico-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3.4c-5 0-8.8 3.4-8.8 7.8 0 2.3 1 4.3 2.8 5.8l-.7 3.3a.6.6 0 0 0 .9.6l3.6-1.8c.7.1 1.4.2 2.2.2 5 0 8.8-3.5 8.8-7.9S17 3.4 12 3.4zM8.3 12.4a1.2 1.2 0 1 1 0-2.4 1.2 1.2 0 0 1 0 2.4zm3.7 0a1.2 1.2 0 1 1 0-2.4 1.2 1.2 0 0 1 0 2.4zm3.7 0a1.2 1.2 0 1 1 0-2.4 1.2 1.2 0 0 1 0 2.4z'/%3E%3C/svg%3E");
  --gb-ico-cart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8.3 7.6V7a3.7 3.7 0 0 1 7.4 0v.6h1.5c.9 0 1.6.7 1.7 1.5l1 9.6a2 2 0 0 1-2 2.3H6.1a2 2 0 0 1-2-2.3l1-9.6c.1-.8.8-1.5 1.7-1.5zm1.8 0h3.8V7a1.9 1.9 0 0 0-3.8 0z'/%3E%3C/svg%3E");
  --gb-ico-profile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.3'/%3E%3Cpath d='M4.2 19.3c.7-3.5 3.8-5.5 7.8-5.5s7.1 2 7.8 5.5c.1.9-.5 1.7-1.4 1.7H5.6c-.9 0-1.5-.8-1.4-1.7z'/%3E%3C/svg%3E");
}
.wd-toolbar-home { --gb-nav-icon: var(--gb-ico-home); }
.wd-toolbar-shop, .wd-toolbar-shop-cat, .wd-toolbar-sidebar { --gb-nav-icon: var(--gb-ico-catalog); }
.wd-toolbar-chat { --gb-nav-icon: var(--gb-ico-chat); }
.wd-toolbar .wd-header-cart { --gb-nav-icon: var(--gb-ico-cart); }
.wd-toolbar .wd-header-my-account { --gb-nav-icon: var(--gb-ico-profile); }

/* ============================== 二、样式：深色悬浮条，选中项展开成绿色胶囊 ============================== */
:root {
  /* 占位高度 = 条高 62 + 上下各 12 + 安全区；/katalog/ 手机左列吸顶、页面底部留白都读它。 */
  --gb-bottom-nav-h: calc(86px + env(safe-area-inset-bottom, 0px));
}
body.sticky-toolbar-on:not(.gb-co2-page) { padding-bottom: var(--gb-bottom-nav-h) !important; }
.sticky-toolbar-on .wd-sticky-btn { bottom: var(--gb-bottom-nav-h); }
/* 结算页有自己的付款条（gb-checkout-v2.css 也隐藏 .wd-toolbar，这里保证新样式不会把它带回来）。 */
body.gb-co2-page .wd-toolbar { display: none !important; }

.wd-toolbar {
  left: 12px !important;
  right: 12px !important;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  height: 62px !important;
  padding: 0 8px !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 22px;
  background: #0e1b15 !important;
  box-shadow: 0 14px 30px rgba(14, 27, 21, .35) !important;
  font-family: 'Golos Text', var(--wd-text-font, Arial), sans-serif;
}
.wd-toolbar > a,
.wd-toolbar > div { flex: 0 1 auto !important; min-width: 0; }
/* 2.27.5：选中项不参与收缩（文字必须完整），挤的时候由未选中的图标项让位。 */
.wd-toolbar > a.gb-nav-active,
.wd-toolbar > div.gb-nav-active { flex: 0 0 auto !important; }
.wd-toolbar > a,
.wd-toolbar > div a {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 46px !important;
  min-width: 42px;
  padding: 0 9px !important;
  border-radius: 16px;
  color: rgba(255, 255, 255, .62) !important;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .22s ease, color .22s ease, padding .22s ease, gap .22s ease;
}
.wd-toolbar .wd-tools-icon {
  position: relative;
  display: block !important;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}
.wd-toolbar .wd-tools-icon::before {
  content: "" !important;
  display: block;
  width: 24px;
  height: 24px;
  font-family: inherit !important;
  background: currentColor;
  -webkit-mask: var(--gb-nav-icon) center / contain no-repeat;
  mask: var(--gb-nav-icon) center / contain no-repeat;
}
.wd-toolbar .wd-tools-icon svg { display: none; }
.wd-toolbar .wd-toolbar-label {
  position: static !important;
  display: block !important;
  max-width: 0;
  padding: 0 !important;
  overflow: hidden;
  opacity: 0;
  color: inherit;
  font-size: 13px !important;
  font-weight: 700;
  line-height: 1.2 !important;
  white-space: nowrap;
  text-overflow: clip !important; /* 主题默认 ellipsis；选中项留足宽度，不出现省略号 */
  transition: max-width .24s ease, opacity .18s ease;
}
/* 选中项：图标 + 文字同排的绿色胶囊。 */
.wd-toolbar .gb-nav-active > a,
.wd-toolbar > a.gb-nav-active {
  gap: 7px;
  padding: 0 12px 0 11px !important;
  background: #16955f;
  color: #fff !important;
}
.wd-toolbar .gb-nav-active .wd-toolbar-label { max-width: 120px; min-width: max-content; flex: 0 0 auto; opacity: 1; } /* 2.27.5：选中即按全宽排版，过渡中也不会截字 */
.wd-toolbar > a:focus-visible,
.wd-toolbar > div a:focus-visible { outline: 2px solid #7fd1aa; outline-offset: 2px; }

/* 购物车数量（2.27.5 缩小并移出图标）：红底白字，总高 16px（字号 10px），左下角只压住图标外接框右上角约 6×7px，
   主体在图标右上角外侧；描边用底条墨色。0 件不显示。选中态胶囊里，带角标时图标右侧多留 10px（两位数也不压字），角标不压文字。 */
.wd-toolbar .wd-tools-count { display: none !important; }
.wd-toolbar .wd-header-cart:not(.gb-nav-zero) .wd-cart-number {
  position: absolute;
  top: -9px;
  left: 18px;
  right: auto;
  display: grid !important;
  place-items: center;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border: 2px solid #0e1b15;
  border-radius: 8px;
  background: #e5484d;
  color: #fff;
  font: 700 10px/1 'Golos Text', Arial, sans-serif;
  letter-spacing: -.2px;
  box-sizing: content-box;
}
.wd-toolbar .wd-header-cart.gb-nav-active:not(.gb-nav-zero) .wd-tools-icon { margin-right: 10px !important; }
.wd-toolbar .wd-cart-number > span { display: none; }
/* 聊天未读：直径 8px 红点，圆心在图标外接框右上角。 */
.wd-toolbar .gb-chat-bottom-nav__badge { display: none !important; }
.wd-toolbar .gb-nav-unread .wd-tools-icon::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 5px;
  height: 5px;
  border: 1.5px solid #0e1b15;
  border-radius: 50%;
  background: #ff6b6f;
}

/* 很窄的屏（<360）：收紧间距，保证选中项胶囊 + 其余四个图标放得下。 */
@media (max-width: 359px) {
  .wd-toolbar { left: 8px !important; right: 8px !important; padding: 0 6px !important; }
  .wd-toolbar > a,
  .wd-toolbar > div a { min-width: 38px; padding: 0 7px !important; }
  .wd-toolbar .gb-nav-active > a,
  .wd-toolbar > a.gb-nav-active { padding: 0 11px 0 10px !important; gap: 6px; }
  .wd-toolbar .wd-toolbar-label { font-size: 12.5px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .wd-toolbar > a,
  .wd-toolbar > div a,
  .wd-toolbar .wd-toolbar-label { transition: none !important; }
}
