/* =========================================================
   Mazari Display Dock — v1.4.0
   Floating jewelry-case navbar · No theme conflicts
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600&display=swap');

#mdock-stage,
#mdock-stage * {
  box-sizing: border-box;
}

#mdock-stage {
  all: initial;
  font-family: 'Vazirmatn', Tahoma, Arial, sans-serif !important;
  direction: rtl;
  position: fixed !important;
  bottom: 0; left: 0; right: 0;
  max-width: 520px;
  margin: 0 auto;
  height: 128px;
  pointer-events: none;
  z-index: 99990;  /* below chat widgets (usually 99999) but above page content */
  display: block;
}

/* Ambient floor glow */
.mdock-floor-glow {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 340px; height: 60px;
  background: radial-gradient(ellipse at center, rgba(200,169,110,.10) 0%, transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}

/* ── Tray ── */
.mdock-tray {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  left: 16px; right: 16px;
  height: 72px;
  pointer-events: auto;
  border-radius: 36px;
  background: linear-gradient(180deg, rgba(28,34,46,.94) 0%, rgba(12,16,24,.97) 100%) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(200,169,110,.18) !important;
  box-shadow:
    0 24px 50px rgba(0,0,0,.55),
    0 2px 0 rgba(255,255,255,.04) inset,
    0 -1px 0 rgba(0,0,0,.3) inset;
  display: flex !important;
  align-items: center !important;
  justify-content: space-around !important;
  padding: 0 8px;
}

/* ── Wells ── */
.mdock-well {
  all: unset;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: radial-gradient(circle at 50% 35%, rgba(0,0,0,.35), transparent 70%) !important;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.4), inset 0 -1px 0 rgba(255,255,255,.03);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  outline: none !important;
  outline-offset: 0 !important;
  border: none !important;
  -webkit-user-select: none;
  user-select: none;
}

.mdock-well::-moz-focus-inner {
  border: 0 !important;
}

.mdock-well:focus,
.mdock-well:focus-visible,
.mdock-well:active {
  outline: none !important;
  border: none !important;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.4), inset 0 -1px 0 rgba(255,255,255,.03), 0 0 0 2px rgba(200,169,110,.3);
}

button.mdock-well {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.mdock-well-icon {
  width: 21px; height: 21px;
  color: #5e6c80 !important;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  transition: color .25s ease, transform .2s ease;
  pointer-events: none;
}

.mdock-well:hover .mdock-well-icon,
.mdock-well.mdock-active .mdock-well-icon {
  color: #c8a96e !important;
  transform: translateY(-1px);
  filter: drop-shadow(0 2px 6px rgba(200,169,110,.4));
}

.mdock-well::after {
  content: '';
  position: absolute;
  bottom: -9px; left: 50%;
  transform: translateX(-50%) scale(0);
  width: 3px; height: 3px;
  border-radius: 50%;
  background: #c8a96e;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.mdock-well.mdock-active::after {
  transform: translateX(-50%) scale(1);
}

/* Cart chip */
.mdock-chip {
  position: absolute;
  top: 0; left: 2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #c8a96e !important;
  color: #0a0e16 !important;
  font-size: 8.5px !important;
  font-weight: 700 !important;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  display: flex !important;
  align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
  pointer-events: none;
  line-height: 1;
}

/* Spacer to leave room for the centerpiece */
.mdock-spacer {
  width: 64px;
  flex-shrink: 0;
  pointer-events: none;
}

/* ── Pedestal centerpiece (AI button) ── */
.mdock-pedestal {
  all: unset;
  position: absolute;
  bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 84px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none !important;
  outline: none !important;
  border: none !important;
}

.mdock-pedestal:focus,
.mdock-pedestal:focus-visible {
  outline: none !important;
}

.mdock-riser {
  width: 6px; height: 22px;
  background: linear-gradient(180deg, rgba(200,169,110,.25), rgba(200,169,110,.05));
  border-radius: 3px;
  margin-bottom: -3px;
  order: 2;
}

.mdock-gem {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 22px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #2a3344 0%, #161c28 50%, #0d111a 100%) !important;
  border: 1px solid rgba(200,169,110,.35) !important;
  box-shadow:
    0 18px 36px rgba(0,0,0,.6),
    0 4px 12px rgba(0,0,0,.4),
    inset 2px 2px 4px rgba(255,255,255,.08),
    inset -3px -3px 8px rgba(0,0,0,.5);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease;
  order: 1;
}

.mdock-pedestal:active .mdock-gem {
  transform: rotate(45deg) scale(.93);
}

.mdock-gem::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 30px; height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,.25), transparent);
  border-radius: 1px;
}

.mdock-gem-icon {
  position: absolute;
  inset: 0;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: rotate(-45deg);
  pointer-events: none;
}

.mdock-gem-icon svg { width: 26px; height: 26px; }

.mdock-particle {
  position: absolute;
  border-radius: 50%;
  background: #c8a96e;
  opacity: 0;
  animation: mdock-particle-float 3.5s ease-in-out infinite;
  pointer-events: none;
}
.mdock-particle.p1 { width:3px; height:3px; top:6px; right:8px; animation-delay:0s; }
.mdock-particle.p2 { width:2px; height:2px; top:30px; left:2px; animation-delay:1.2s; }
.mdock-particle.p3 { width:2.5px; height:2.5px; bottom:14px; right:4px; animation-delay:2.3s; }

@keyframes mdock-particle-float {
  0%   { opacity: 0; transform: translateY(4px) scale(.6); }
  30%  { opacity: .7; }
  70%  { opacity: .4; }
  100% { opacity: 0; transform: translateY(-14px) scale(1); }
}

.mdock-label {
  order: 3;
  margin-top: 8px;
  font-size: 9px !important;
  font-weight: 500 !important;
  color: rgba(200,169,110,.65) !important;
  letter-spacing: 1.5px;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  white-space: nowrap;
}

.mdock-pedestal {
  display: flex !important;
  flex-direction: column !important;
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .mdock-particle { animation: none !important; opacity: 0 !important; }
  .mdock-gem, .mdock-well-icon, .mdock-well::after { transition: none !important; }
}

/* ── Responsive ── */
@media (max-width: 380px) {
  .mdock-tray { left: 12px; right: 12px; padding: 0 4px; }
  .mdock-well { width: 42px; height: 42px; }
  .mdock-gem  { width: 58px; height: 58px; }
  .mdock-spacer { width: 58px; }
}

/* ── Mobile-only: hide completely on tablet/desktop ── */
@media (min-width: 769px) {
  div#mdock-stage,
  #mdock-stage.mdock-stage {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

/* Hide on the AI advisor page itself to avoid pointing to self */
body.page-mazari-ai #mdock-stage,
body[data-mdock-hide="1"] #mdock-stage {
  display: none !important;
}

/* ── Retire the legacy bottom navbar (superseded by this dock) ── */
#mzhNavbar,
nav.mzh-navbar {
  display: none !important;
}

/* ════════════════════════════════════════
   SEARCH OVERLAY
   ════════════════════════════════════════ */
.mdock-search-overlay {
  position: fixed !important;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  left: 16px; right: 16px;
  max-width: 488px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(28,34,46,.97), rgba(12,16,24,.99)) !important;
  border: 1px solid rgba(200,169,110,.25) !important;
  border-radius: 20px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
  backdrop-filter: blur(20px);
  z-index: 99991;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.96);
  transition: all .28s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}

.mdock-search-overlay.mdock-search-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mdock-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  border-radius: 50px;
  padding: 6px 6px 6px 16px;
}

.mdock-search-input {
  all: unset !important;
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  color: #e2e8f0 !important;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  font-size: 14px !important;
  direction: rtl;
  padding: 6px 4px !important;
  outline: none !important;
  border: none !important;
  background: transparent !important;
}
.mdock-search-input::placeholder { color: #4a5568 !important; }
.mdock-search-input:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

.mdock-search-submit {
  all: unset !important;
  -webkit-appearance: none;
  appearance: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c8a96e, #b0884c) !important;
  display: flex !important;
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  outline: none !important;
  border: none !important;
}
.mdock-search-submit::-moz-focus-inner { border: 0 !important; }
.mdock-search-submit:focus,
.mdock-search-submit:active {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(200,169,110,.4) !important;
}
.mdock-search-submit svg { width: 16px; height: 16px; stroke: #0a0e16; }

.mdock-search-close {
  all: unset !important;
  -webkit-appearance: none;
  appearance: none;
  width: 32px; height: 32px;
  display: flex !important;
  align-items: center; justify-content: center;
  color: #5e6c80 !important;
  font-size: 16px !important;
  cursor: pointer;
  flex-shrink: 0;
  outline: none !important;
  border: none !important;
}
.mdock-search-close::-moz-focus-inner { border: 0 !important; }
.mdock-search-close:hover { color: #c8a96e !important; }
.mdock-search-close:focus {
  outline: none !important;
}

/* Backdrop behind the search panel */
.mdock-search-backdrop {
  position: fixed !important;
  inset: 0;
  background: rgba(5,8,13,.5);
  backdrop-filter: blur(2px);
  z-index: 99989;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
  pointer-events: none;
}
.mdock-search-backdrop.mdock-search-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* ════════════════════════════════════════
   SMART AUTO-HIDE
   The dock yields when important mobile UI enters its footprint.
   ════════════════════════════════════════ */
#mdock-stage {
  transition: transform .34s cubic-bezier(.22,.9,.3,1), opacity .22s ease, visibility .22s ease !important;
  will-change: transform, opacity;
}

#mdock-stage.mdock-smart-hidden {
  transform: translateY(calc(100% + 28px)) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#mdock-stage.mdock-smart-hidden .mdock-tray,
#mdock-stage.mdock-smart-hidden .mdock-pedestal {
  pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
  #mdock-stage { transition: none !important; }
}
