/* Виджет доставки единого кабинета. Тема настраивается CSS-переменными на :root сайта. */
.hubw {
  --hubw-accent: var(--hub-accent, #c8102e);
  --hubw-accent-text: var(--hub-accent-text, #fff);
  --hubw-bg: var(--hub-bg, #ffffff);
  --hubw-surface: var(--hub-surface, #f6f5f2);
  --hubw-fg: var(--hub-fg, #16171a);
  --hubw-muted: var(--hub-muted, #7d8089);
  --hubw-line: var(--hub-line, rgba(0, 0, 0, .12));
  --hubw-radius: var(--hub-radius, 10px);
  color: var(--hubw-fg);
}

.hubw *, .hubw *::before, .hubw *::after { box-sizing: border-box; }

/* --- Категории --- */
.hubw__nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.hubw__nav button {
  border: 1px solid var(--hubw-line); background: transparent; color: inherit;
  border-radius: 999px; padding: 7px 15px; font: inherit; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.hubw__nav button:hover { border-color: var(--hubw-accent); }
.hubw__nav button.is-active { background: var(--hubw-accent); border-color: var(--hubw-accent); color: var(--hubw-accent-text); }

/* --- Меню --- */
.hubw__cat { margin-bottom: 34px; scroll-margin-top: 90px; }
.hubw__cat-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.hubw__cat-head h3 { margin: 0; font-size: 20px; }
.hubw__cat-head span { font-size: 13px; color: var(--hubw-muted); }

.hubw__items { display: grid; gap: 10px; }
.hubw__item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 13px 15px; background: var(--hubw-surface); border: 1px solid var(--hubw-line);
  border-radius: var(--hubw-radius);
}
.hubw__item-name { font-weight: 600; }
.hubw__item-desc { font-size: 13px; color: var(--hubw-muted); margin-top: 3px; }
.hubw__item-price { font-weight: 700; white-space: nowrap; }

.hubw__add {
  border: 1px solid var(--hubw-accent); background: var(--hubw-accent); color: var(--hubw-accent-text);
  border-radius: 999px; padding: 7px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.hubw__add:hover { filter: brightness(1.08); }
.hubw__qty { display: inline-flex; align-items: center; gap: 10px; }
.hubw__qty button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--hubw-line);
  background: var(--hubw-bg); color: inherit; font: inherit; font-size: 17px; line-height: 1; cursor: pointer;
}
.hubw__qty b { min-width: 18px; text-align: center; }

/* --- Кнопка корзины --- */
.hubw-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 2147482999;
  display: none; align-items: center; gap: 10px;
  background: var(--hub-accent, #c8102e); color: var(--hub-accent-text, #fff);
  border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.hubw-fab.is-visible { display: inline-flex; }
.hubw-fab span { opacity: .85; font-weight: 500; }

/* --- Панель корзины --- */
.hubw-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 2147483000;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.hubw-backdrop.is-open { opacity: 1; pointer-events: auto; }

.hubw-drawer {
  /* поверх шапок сайтов: у них бывает свой большой z-index */
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); z-index: 2147483001;
  background: var(--hub-bg, #fff); color: var(--hub-fg, #16171a);
  display: flex; flex-direction: column;
  transform: translateX(102%); transition: transform .28s ease;
  box-shadow: -18px 0 50px rgba(0, 0, 0, .25);
  font: inherit;
}
.hubw-drawer.is-open { transform: translateX(0); }
.hubw-drawer__head {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid var(--hub-line, rgba(0, 0, 0, .12));
}
.hubw-drawer__head h3 { margin: 0; font-size: 19px; flex: 1; }
.hubw-drawer__close { border: 0; background: none; font: inherit; font-size: 22px; cursor: pointer; color: inherit; line-height: 1; }
.hubw-drawer__body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.hubw-drawer__foot { padding: 18px 22px; border-top: 1px solid var(--hub-line, rgba(0, 0, 0, .12)); }

.hubw-line { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hub-line, rgba(0, 0, 0, .08)); }
.hubw-line__name { font-weight: 600; font-size: 15px; }
.hubw-line__sum { font-weight: 700; white-space: nowrap; }
.hubw-line__rm { border: 0; background: none; color: var(--hub-muted, #7d8089); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; margin-top: 6px; }

.hubw-total { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 6px; }
.hubw-total b { font-size: 20px; }
.hubw-note { font-size: 13px; color: var(--hub-muted, #7d8089); margin: 0 0 14px; }

.hubw-formhost { margin-top: 18px; }
.hubw-form { display: grid; gap: 10px; }
.hubw-form input, .hubw-form textarea, .hubw-form select {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 15px;
  border: 1px solid var(--hub-line, rgba(0, 0, 0, .18)); border-radius: var(--hub-radius, 10px);
  background: var(--hub-surface, #f6f5f2); color: inherit;
}
.hubw-form textarea { min-height: 74px; resize: vertical; }
.hubw-form label.hubw-check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--hub-muted, #7d8089); }
.hubw-form label.hubw-check input { width: auto; }
.hubw-radio { display: flex; gap: 8px; flex-wrap: wrap; }
.hubw-radio label {
  border: 1px solid var(--hub-line, rgba(0, 0, 0, .18)); border-radius: 999px; padding: 7px 14px;
  font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.hubw-radio input { accent-color: var(--hub-accent, #c8102e); }

.hubw-submit {
  width: 100%; padding: 14px; border: 0; border-radius: var(--hub-radius, 10px);
  background: var(--hub-accent, #c8102e); color: var(--hub-accent-text, #fff);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.hubw-submit:disabled { opacity: .5; cursor: not-allowed; }
.hubw-error { color: #d33; font-size: 14px; margin: 8px 0 0; }
.hubw-success { text-align: center; padding: 30px 0; }
.hubw-success b { display: block; font-size: 22px; margin-bottom: 8px; }
.hubw-empty { color: var(--hub-muted, #7d8089); padding: 26px 0; }

@media (max-width: 640px) {
  .hubw__item { grid-template-columns: 1fr auto; }
  .hubw__item-price { grid-column: 1; }
  .hubw-fab { right: 14px; bottom: 14px; }
}
