/* ==========================================================================
   TRIONEX — dock-nav.css
   Floating glassmorphism navigation.
   Desktop (≥ 1024px): vertical dock on the left edge, labels as tooltips.
   Tablet / mobile:    horizontal pill at the bottom, the active item expands
                       into a pill with its label.
   Requires: base.css, js/dock-nav.js
   ========================================================================== */

.dock {
  --dock-bg: rgba(6, 13, 30, 0.8);
  --dock-border: rgba(255, 255, 255, 0.14);
  --dock-ink: rgba(255, 255, 255, 0.72);
  --dock-ink-active: #ffffff;
  --dock-active-bg: rgba(255, 255, 255, 0.14);

  position: fixed;
  z-index: calc(var(--z-header) - 2);   /* under the header + mobile drawer */
  display: flex;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--dock-border);
  border-radius: 26px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 45%),
    var(--dock-bg);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow:
    0 18px 40px rgba(2, 8, 23, 0.35),
    0 2px 6px rgba(2, 8, 23, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.dock.is-ready { opacity: 1; }

/* No backdrop-filter support → make the panel solid enough to read */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dock { --dock-bg: rgba(8, 16, 38, 0.92); }
}

.dock__item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 46px;
  height: 46px;
  padding: 0 12px;
  border-radius: 18px;
  color: var(--dock-ink);
  font-family: var(--font-head);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--dur-mid) var(--ease-out),
              color var(--dur-mid) var(--ease-out),
              padding var(--dur-mid) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.dock__item svg { width: 21px; height: 21px; flex-shrink: 0; }
.dock__item:hover { color: var(--dock-ink-active); background: rgba(255, 255, 255, 0.07); }
.dock__item:active { transform: scale(0.94); }
.dock__item:focus-visible { outline: 2px solid var(--color-accent-light); outline-offset: 2px; }

.dock__item.is-active {
  color: var(--dock-ink-active);
  background: var(--dock-active-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Call button — navy gradient so it reads as the main action */
.dock__item--call {
  color: #ffffff;
  background: var(--gradient-navy);
  box-shadow: 0 6px 16px rgba(26, 86, 196, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.dock__item--call:hover { background: var(--gradient-navy-hover); }

/* cart badge inside the dock */
.dock .cart-count {
  top: 5px;
  right: 5px;
  box-shadow: 0 0 0 2px rgba(8, 16, 38, 0.9);
  background: var(--color-accent-light);
  color: #06224f;
}

/* --------------------------------------------------------------------------
   Mobile / tablet — bottom pill
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .dock {
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    translate: -50% 0;
    width: min(440px, calc(100% - 24px));
    justify-content: space-between;
    transform: translateY(0);
  }
  .dock:not(.is-ready) { transform: translateY(20px); }
  .dock.is-hidden { transform: translateY(calc(100% + 24px)); }

  .dock__label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-width var(--dur-mid) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
  }
  .dock__item.is-active { padding: 0 16px 0 14px; }
  .dock__item.is-active .dock__label { max-width: 90px; opacity: 1; }
  .dock__item:not(.is-active) { gap: 0; }

  /* keep the last bit of the page clear of the dock */
  body { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 380px) {
  .dock__item { min-width: 42px; height: 44px; padding: 0 10px; }
  .dock__item.is-active { padding: 0 12px; }
  .dock__item.is-active .dock__label { max-width: 64px; }
}

/* --------------------------------------------------------------------------
   Desktop — vertical dock on the left
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .dock {
    left: 18px;
    top: 50%;
    translate: 0 -50%;
    flex-direction: column;
    border-radius: 24px;
    transform: translateX(0);
  }
  .dock:not(.is-ready) { transform: translateX(-16px); }

  .dock__item { width: 48px; height: 48px; min-width: 0; padding: 0; }

  /* label becomes a tooltip to the right */
  .dock__label {
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    padding: 0.45em 0.8em;
    border-radius: 10px;
    background: rgba(8, 16, 38, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.78rem;
    pointer-events: none;
    opacity: 0;
    transform: translate(-6px, -50%);
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  }
  .dock__item:hover .dock__label,
  .dock__item:focus-visible .dock__label { opacity: 1; transform: translate(0, -50%); }

  /* thin light bar marking the active item */
  .dock__item.is-active::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 50%;
    width: 3px;
    height: 20px;
    border-radius: 3px;
    background: var(--color-accent-light);
    transform: translateY(-50%);
  }

  .dock__sep {
    width: 26px;
    height: 1px;
    margin: 4px auto;
    background: rgba(255, 255, 255, 0.14);
  }

  /* Hero copy sits at the left gutter — nudge it clear of the dock. */
  .hero-slider .slide-content,
  .hero-slider .slide-number { left: max(var(--gutter), 104px); }
  .hero-slider .slide-total { left: calc(max(var(--gutter), 104px) + clamp(18px, 2vw, 30px) + 3.4rem); }
}

/* On laptop widths the page gutter is narrower than the dock — keep page
   content clear of it. (From ~1500px up there is room already.) */
@media (min-width: 1024px) and (max-width: 1500px) {
  main .container,
  .site-footer .container { padding-left: max(var(--gutter), 104px); }
}
@media (max-width: 1023px) { .dock__sep { display: none; } }
