/*
 * Bellstore contact hub v3
 * Minimal store/contact UI for web, Telegram and VK Mini Apps.
 */

:root {
  --hub-blue: #0077ff;
  --hub-blue-pressed: #0066dc;
  --hub-bg: #f4f5f8;
  --hub-card: #ffffff;
  --hub-text: #111318;
  --hub-secondary: #81838b;
  --hub-border: rgba(15, 23, 42, 0.08);
  --hub-radius: 22px;
}

.contact-hub-source-hidden,
.contact-hub-quick-hidden {
  display: none !important;
}

.contact-hub-home {
  grid-column: 1 / -1;
  width: 100%;
  margin: 6px 0 0;
  scroll-margin-top: calc(var(--header-height, 64px) + 18px);
  color: var(--hub-text);
  font-family: Arial, -apple-system, BlinkMacSystemFont, sans-serif;
}

.contact-hub-home__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
  padding-inline: 2px;
}

.contact-hub-home__header > div {
  min-width: 0;
}

.contact-hub-home__eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--hub-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-hub-home__header h2 {
  margin: 0;
  max-width: 760px;
  color: var(--hub-text);
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.contact-hub-home__header h2 em {
  display: block;
  color: var(--hub-blue);
  font-style: normal;
}

.contact-hub-home__header p {
  margin: 13px 0 0;
  color: var(--hub-secondary);
  font-size: 14px;
  line-height: 1.35;
}

.contact-hub-home__all {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  border: 1px solid var(--hub-border);
  border-radius: 999px;
  background: var(--hub-card);
  color: var(--hub-blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.contact-hub-home__all svg,
.contact-hub-store__chevron svg,
.contact-hub-resource__link svg,
.contact-hub-phone svg,
.contact-hub-launcher svg,
.contact-hub-sheet__close svg,
.contact-hub-sheet__stores-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-hub-home__layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
  gap: 16px;
  align-items: start;
}

.contact-hub-resources,
.contact-hub-home__stores {
  min-width: 0;
}

.contact-hub-resources {
  display: grid;
  gap: 10px;
}

.contact-hub-phone,
.contact-hub-resource,
.contact-hub-home__stores {
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius);
  background: var(--hub-card);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.055);
}

.contact-hub-phone {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  background: var(--hub-blue);
  color: #fff;
  text-decoration: none;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
}

.contact-hub-phone:hover {
  background: var(--hub-blue-pressed);
  transform: translateY(-1px);
}

.contact-hub-phone__icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
}

.contact-hub-phone__copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-hub-phone__copy small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 400;
}

.contact-hub-phone__copy strong {
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.contact-hub-phone__copy span {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.contact-hub-phone__chevron {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.contact-hub-resource {
  padding: 14px;
}

.contact-hub-resource__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 2px 12px;
}

.contact-hub-resource__logo {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: block;
  border-radius: 13px;
  object-fit: contain;
}

.contact-hub-resource--telegram .contact-hub-resource__logo {
  border-radius: 50%;
}

.contact-hub-resource__title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-hub-resource__title strong {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.contact-hub-resource__title span {
  color: var(--hub-secondary);
  font-size: 12px;
}

.contact-hub-resource__links {
  border-top: 1px solid var(--hub-border);
}

.contact-hub-resource__link {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--hub-border);
  color: var(--hub-text);
  text-decoration: none;
}

.contact-hub-resource__link:last-child {
  border-bottom: 0;
}

.contact-hub-resource__link > span {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-hub-resource__link strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-hub-resource__link small {
  overflow: hidden;
  color: var(--hub-secondary);
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-hub-resource__link svg {
  flex: 0 0 auto;
  color: #c3c5cb;
}

.contact-hub-home__stores {
  overflow: hidden;
}

.contact-hub-home__stores-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid var(--hub-border);
}

.contact-hub-home__stores-head strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.contact-hub-home__stores-head span {
  color: var(--hub-secondary);
  font-size: 11px;
}

.contact-hub-store-list {
  display: flex;
  flex-direction: column;
}

.contact-hub-store {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hub-border);
  color: var(--hub-text);
  text-decoration: none;
  transition: background 0.15s ease;
}

.contact-hub-store:hover {
  background: #f8f9fb;
}

.contact-hub-store--last {
  border-bottom: 0;
}

.contact-hub-store__media {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: #f1f4f8;
  color: var(--hub-blue);
}

.contact-hub-store__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-hub-store__media svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.contact-hub-store__copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-hub-store__copy > strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}

.contact-hub-store__copy > span {
  overflow: hidden;
  color: var(--hub-secondary);
  font-size: 12px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-hub-store__copy > small {
  color: var(--hub-text);
  font-size: 11px;
  font-weight: 700;
}

.contact-hub-store__copy b {
  margin-right: 4px;
  color: #ff9500;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.contact-hub-store__chevron {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  color: #c5c7cd;
}

/* Compact launcher: mobile everywhere, desktop only outside home. */
.contact-hub-widget {
  position: fixed;
  z-index: 340;
  pointer-events: none;
}

.contact-hub-widget--hidden {
  display: none !important;
}

.contact-hub-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  min-width: 148px;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px 7px 7px;
  border: 1px solid var(--hub-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.14);
  color: var(--hub-text);
  font-family: Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  text-align: left;
  pointer-events: auto;
  cursor: pointer;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.contact-hub-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.17);
}

.contact-hub-widget--hub-visible .contact-hub-launcher {
  opacity: 0;
  transform: translateY(8px);
  visibility: hidden;
  pointer-events: none;
}

.contact-hub-launcher__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--hub-blue);
  color: #fff;
}

.contact-hub-launcher__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-hub-launcher__copy strong {
  font-size: 13px;
  font-weight: 700;
}

.contact-hub-launcher__copy small {
  color: var(--hub-secondary);
  font-size: 10px;
}

html.contact-hub-home-ready.is-desktop-layout .contact-hub-launcher {
  display: none;
}

@media (max-width: 767px) {
  .contact-hub-launcher {
    right: max(12px, env(safe-area-inset-right), var(--vk-inset-right, 0px));
    bottom: calc(
      var(--tab-bar-offset, 76px) + 12px + max(env(safe-area-inset-bottom), var(--vk-inset-bottom, 0px))
    );
  }

  /* Product buy bar sits at --tab-bar-offset (~68px tall). Keep contacts above it. */
  html:has(.page-product--with-buy-bar) .contact-hub-launcher,
  html.contact-hub-product-buy .contact-hub-launcher {
    bottom: calc(
      var(--tab-bar-offset, 76px) + 78px + max(env(safe-area-inset-bottom), var(--vk-inset-bottom, 0px))
    );
    min-width: 54px;
    padding: 7px;
    border-radius: 16px;
  }

  html:has(.page-product--with-buy-bar) .contact-hub-launcher__copy,
  html.contact-hub-product-buy .contact-hub-launcher__copy {
    display: none;
  }
}

/* Minimal contact sheet/popover */
.contact-hub-overlay {
  position: fixed;
  inset: 0;
  z-index: 1250;
  pointer-events: none;
}

.contact-hub-overlay[hidden] {
  display: none !important;
}

.contact-hub-overlay__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(15, 23, 42, 0.2);
  opacity: 0;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.18s ease;
}

.contact-hub-sheet {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(400px, calc(100vw - 40px));
  max-height: min(760px, calc(var(--contact-hub-vh, 100vh) - 40px));
  padding: 16px;
  overflow-y: auto;
  border: 1px solid var(--hub-border);
  border-radius: 26px;
  background: var(--hub-bg);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.23);
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  outline: none;
  overscroll-behavior: contain;
  pointer-events: none;
}

.contact-hub-overlay.open {
  pointer-events: auto;
}

.contact-hub-overlay.open .contact-hub-overlay__backdrop {
  opacity: 1;
}

.contact-hub-overlay.open .contact-hub-sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.contact-hub-sheet__handle {
  display: none;
}

.contact-hub-sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.contact-hub-sheet__header > div {
  min-width: 0;
}

.contact-hub-sheet__header span {
  display: block;
  margin-bottom: 5px;
  color: var(--hub-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.contact-hub-sheet__header h2 {
  margin: 0;
  color: var(--hub-text);
  font-family: Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.045em;
}

.contact-hub-sheet__header p {
  margin: 7px 0 0;
  color: var(--hub-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.contact-hub-sheet__close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e7e8ec;
  color: #74767d;
}

.contact-hub-sheet__content .contact-hub-phone,
.contact-hub-sheet__content .contact-hub-resource {
  box-shadow: none;
}

.contact-hub-sheet__content .contact-hub-phone {
  min-height: 82px;
}

.contact-hub-sheet__content .contact-hub-resource {
  padding: 12px;
}

.contact-hub-sheet__stores-link {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid var(--hub-border);
  border-radius: 15px;
  background: #fff;
  color: var(--hub-blue);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

html.contact-hub-open,
html.contact-hub-open body {
  overflow: hidden;
}

html.catalog-sheet-open .contact-hub-launcher,
body.service-sheet-open .contact-hub-launcher {
  display: none !important;
}

/* Purchase CTA must stay fully tappable above the contact chip. */
.product-buy-bar {
  z-index: 360 !important;
}

@media (max-width: 767px) {
  .contact-hub-sheet {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: calc(
      var(--contact-hub-vh, 100vh) - max(env(safe-area-inset-top), var(--vk-inset-top, 0px)) - 8px
    );
    padding:
      8px
      max(14px, env(safe-area-inset-right), var(--vk-inset-right, 0px))
      calc(16px + max(env(safe-area-inset-bottom), var(--vk-inset-bottom, 0px)))
      max(14px, env(safe-area-inset-left), var(--vk-inset-left, 0px));
    border-radius: 26px 26px 0 0;
    opacity: 1;
    transform: translateY(105%);
  }

  .contact-hub-overlay.open .contact-hub-sheet {
    transform: translateY(0);
  }

  .contact-hub-sheet__handle {
    width: 38px;
    height: 5px;
    display: block;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #c7c8ce;
  }
}

@media (max-width: 1023px) {
  .contact-hub-home__header {
    align-items: flex-start;
  }

  .contact-hub-home__header h2 {
    font-size: clamp(38px, 10vw, 54px);
  }

  .contact-hub-home__layout {
    grid-template-columns: 1fr;
  }

  .contact-hub-resources {
    grid-template-columns: 1fr 1fr;
  }

  .contact-hub-phone {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .contact-hub-home__header {
    display: block;
  }

  .contact-hub-home__header h2 {
    font-size: clamp(36px, 12vw, 48px);
  }

  .contact-hub-home__header p {
    max-width: 310px;
    font-size: 12px;
  }

  .contact-hub-home__all {
    margin-top: 13px;
  }

  .contact-hub-resources {
    grid-template-columns: 1fr;
  }

  .contact-hub-phone {
    grid-column: auto;
  }

  .contact-hub-store {
    min-height: 75px;
    padding-inline: 11px;
  }

  .contact-hub-store__media {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
  }

  .contact-hub-store__copy > strong {
    font-size: 15px;
  }
}

.contact-hub-launcher:focus-visible,
.contact-hub-home__all:focus-visible,
.contact-hub-phone:focus-visible,
.contact-hub-resource__link:focus-visible,
.contact-hub-store:focus-visible,
.contact-hub-sheet__close:focus-visible,
.contact-hub-sheet__stores-link:focus-visible {
  outline: 3px solid rgba(0, 119, 255, 0.25);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .contact-hub-launcher,
  .contact-hub-phone,
  .contact-hub-overlay__backdrop,
  .contact-hub-sheet {
    transition-duration: 0.01ms !important;
  }
}
