/* BALELE v3 Phase 8 Step 4: Market Wall UI
   Theme UI only. Market truth is provided by balele-market REST APIs. */
body.balele-page-market {
  overflow: hidden;
}

.balele-market-page {
  height: 100vh;
  padding-top: var(--balele-header-h);
  overflow: hidden;
}

.balele-market-wall-section {
  position: relative;
  height: calc(100vh - var(--balele-header-h));
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(251, 146, 60, .18), transparent 30%),
    radial-gradient(circle at 86% 22%, rgba(250, 204, 21, .16), transparent 34%),
    linear-gradient(135deg, #fff8ef 0%, #fffdf8 48%, #f8fbff 100%);
}

.balele-market-wall-section::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(180, 130, 70, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 130, 70, .045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), rgba(0,0,0,.24));
}

.balele-market-intro {
  border-color: rgba(249, 115, 22, .18);
  background: rgba(255, 255, 255, .78);
  color: #1f2937;
  box-shadow: 0 14px 38px rgba(124, 92, 40, .10);
  backdrop-filter: blur(12px);
}

.balele-market-intro .eyebrow {
  color: #ea580c;
}

.balele-market-toolball {
  border-color: rgba(249, 115, 22, .18);
  background: rgba(255, 255, 255, .82);
  color: #1f2937;
  box-shadow: 0 14px 38px rgba(124, 92, 40, .11);
  backdrop-filter: blur(12px);
}

.balele-market-toolball button.is-active,
.balele-market-mobile-tabbar button.is-active {
  background: linear-gradient(135deg, #f97316, #facc15);
  color: #111;
}

.balele-market-pin {
  border-color: rgba(249, 115, 22, .24);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 30px rgba(124, 92, 40, .10);
}

.balele-market-pin::after {
  content: attr(data-market-label);
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  max-width: 112px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, .18);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .02em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

.balele-market-pin.is-best-offer::after {
  color: #fff;
  background: rgba(124, 58, 237, .9);
}

.balele-market-pin.is-sold-out {
  opacity: .72;
}

.balele-market-wall-status {
  color: rgba(31,41,55,.72);
}

@media (max-width: 760px) {
  .balele-market-page {
    padding-top: var(--ba-header-h-mobile, var(--balele-header-h));
  }

  .balele-market-wall-section {
    height: calc(100dvh - var(--ba-header-h-mobile, var(--balele-header-h)) - var(--ba-tabbar-h-mobile, 62px));
  }

  .balele-market-toolball {
    left: 12px;
    right: 12px;
    bottom: calc(var(--ba-tabbar-h-mobile, 62px) + env(safe-area-inset-bottom) + 12px);
    overflow: auto;
  }

  .balele-market-toolball input {
    width: 132px;
  }

  .balele-market-pin::after {
    bottom: -7px;
    max-width: 92px;
    font-size: 9px;
  }
}


/* BALELE v3 Phase 8 Step 10D3A: final regression market UI fixes. */
.balele-market-toolball button {
  background: rgba(255, 255, 255, .92);
  color: #5f3b16;
  border: 1px solid rgba(249, 115, 22, .18);
  box-shadow: 0 6px 16px rgba(124, 92, 40, .08);
}
.balele-market-toolball button:hover,
.balele-market-toolball button:focus {
  background: #fff7ed;
  color: #c2410c;
}
.balele-market-toolball input {
  color: #1f2937;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(249, 115, 22, .16);
}
.balele-market-toolball input::placeholder { color: rgba(31,41,55,.62); }
@media (max-width: 760px) {
  body.balele-page-market .balele-market-intro { display: none !important; }
  body.balele-page-market .balele-market-page {
    height: 100dvh;
    padding-top: var(--ba-header-h-mobile, var(--balele-header-h));
  }
  body.balele-page-market .balele-market-wall-section {
    height: calc(100dvh - var(--ba-header-h-mobile, var(--balele-header-h)) - var(--ba-tabbar-h-mobile, 62px));
    min-height: 0;
  }
  body.balele-page-market .balele-market-wall-viewport {
    top: 0;
    bottom: 0;
  }
  body.balele-page-market .balele-market-toolball {
    background: rgba(255,255,255,.94);
    color: #1f2937;
  }
}


/* BALELE v3 Phase 8 Step 10D3B: mobile Market wall top-gap correction.
   The mobile header is sticky/in normal flow, so the Market page must not add a
   second header-sized padding band below it. Keep the wall viewport directly
   under the header and reserve space only for the bottom tab bar. */
@media (max-width: 760px) {
  body.balele-page-market .balele-market-page {
    height: calc(100dvh - var(--ba-mobile-header-h, var(--ba-header-h-mobile, 58px))) !important;
    padding-top: 0 !important;
    overflow: hidden !important;
  }
  body.balele-page-market .balele-market-wall-section {
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
  }
  body.balele-page-market .balele-market-wall-viewport {
    inset: 0 0 calc(var(--ba-tabbar-h-mobile, 78px) + env(safe-area-inset-bottom)) 0 !important;
  }
}

/* BALELE v3 Launch Prep Step 1A1: PC Market top strip fix.
   The global header is now in normal/sticky flow, so Market must not add a
   second header-height padding band below it. This removes the black strip
   between the desktop header and the Market wall. */
@media (min-width: 761px) {
  body.balele-page-market .balele-market-page {
    height: calc(100vh - var(--ba-header-h-desktop, var(--balele-header-h, 72px))) !important;
    padding-top: 0 !important;
    overflow: hidden !important;
    background: transparent !important;
  }
  body.balele-page-market .balele-market-wall-section {
    height: 100% !important;
    min-height: 0 !important;
  }
}
