/* =============================================================================
   Bottom Navigation Block
   Floating navigation bar centered at the bottom of the screen
   ============================================================================= */

/*
   Strategy to avoid transform-on-fixed mobile glitches:
   The outer .bottom-nav-block is a fixed-position container that spans the
   full viewport width (left:0/right:0) but uses pointer-events:none so clicks
   pass through.  The visible pill is the inner .bottom-nav-inner which is
   centered via margin:0 auto and has pointer-events:auto so items are
   clickable.  No transform is used on the fixed element, which prevents the
   "hides on scroll" bug on iOS Safari & Chrome Android.
*/

.bottom-nav-block {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 1050;
  pointer-events: none;
  text-align: center;
}

.bottom-nav-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: #ffffff;
  border-radius: 50px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 6px 8px;
  max-width: calc(100vw - 32px);
  pointer-events: auto;
}

/* Builder preview override: keep the block in normal flow so block controls
   (move up/down, delete) remain clickable above the content.
   The pill inside retains pointer-events:auto for interactive preview. */
.block-live.block-bottom-nav > .bottom-nav-block {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  z-index: auto !important;
  pointer-events: none !important;
  text-align: center !important;
}

.block-live.block-bottom-nav > .bottom-nav-block > .bottom-nav-inner {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 18px;
  text-decoration: none;
  color: var(--bn-text, #333333);
  border-radius: 40px;
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
  min-width: 60px;
}

.bottom-nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--bn-accent, #c81f34);
}

.bottom-nav-item:active,
.bottom-nav-item.active {
  background: rgba(200, 31, 52, 0.1);
  color: var(--bn-accent, #c81f34);
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.bottom-nav-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  color: var(--bn-accent, #c81f34);
  transition: transform 0.2s ease;
}

.bottom-nav-item:hover .bottom-nav-icon svg {
  transform: scale(1.1);
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.1;
  color: inherit;
}

/* =============================================================================
   Responsive adjustments
   ============================================================================= */
@media (max-width: 575.98px) {
  .bottom-nav-block {
    bottom: 16px;
  }

  .bottom-nav-inner {
    padding: 4px 6px;
    border-radius: 40px;
    max-width: calc(100vw - 16px);
  }

  .bottom-nav-item {
    padding: 6px 12px;
    min-width: 48px;
    gap: 2px;
  }

  .bottom-nav-icon {
    width: 22px;
    height: 22px;
  }

  .bottom-nav-icon svg {
    width: 20px;
    height: 20px;
  }

  .bottom-nav-label {
    font-size: 0.55rem;
  }

  .block-live.block-bottom-nav > .bottom-nav-block {
    bottom: 0 !important;
  }
}

/* =============================================================================
   Palette Preview
   ============================================================================= */
.bp-bottom-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 8px;
  width: 100%;
  height: 100%;
}

.bp-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.bp-bottom-nav-icon {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c81f34;
}
