/* =============================================================================
   Bottom Single Block
   Floating single-item navigation positioned at bottom-left or bottom-right
   ============================================================================= */

/*
   Strategy mirroring bottom-nav: the outer .bottom-single-block is a
   fixed-position container that spans the full viewport but uses
   pointer-events:none so clicks pass through.  The visible pill is the
   inner .bottom-single-inner which has pointer-events:auto.
   No transform is used on the fixed element, preventing iOS scroll glitches.
*/

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

.bottom-single-block.is-left {
  text-align: left;
}

.bottom-single-block.is-right {
  text-align: right;
}

.bottom-single-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  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: 8px 20px 8px 16px;
  pointer-events: auto;
  text-decoration: none;
  color: var(--bs-text, #333333);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  max-width: calc(100vw - 32px);
}

.bottom-single-block.is-left .bottom-single-inner {
  margin-left: 24px;
}

.bottom-single-block.is-right .bottom-single-inner {
  margin-right: 24px;
}

.bottom-single-inner:hover {
  background: #f5f5f5;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.16), 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.block-live.block-bottom-single > .bottom-single-block > .bottom-single-inner {
  pointer-events: auto !important;
}

.bottom-single-inner:active {
  background: #e8e8e8;
}

.bottom-single-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

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

.bottom-single-icon-img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.2s ease;
}

.bottom-single-inner:hover .bottom-single-icon svg,
.bottom-single-inner:hover .bottom-single-icon-img {
  transform: scale(1.1);
}

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

/* Builder preview override: use sticky so the block floats at the bottom
   of the preview canvas while staying interactive. */
.block-live.block-bottom-single > .bottom-single-block {
  position: sticky !important;
  bottom: 0 !important;
  left: auto !important;
  right: auto !important;
  pointer-events: auto !important;
}

.block-live.block-bottom-single > .bottom-single-block.is-left {
  text-align: left !important;
}

.block-live.block-bottom-single > .bottom-single-block.is-right {
  text-align: right !important;
}

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

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

  .bottom-single-block.is-left .bottom-single-inner {
    margin-left: 16px;
  }

  .bottom-single-block.is-right .bottom-single-inner {
    margin-right: 16px;
  }

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

  .bottom-single-icon {
    width: 26px;
    height: 26px;
  }

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

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

  .bottom-single-label {
    font-size: 0.75rem;
  }
}

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

.bp-bottom-single-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

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