/* ============================================================================
   O-Box shop theme — "Republic Terminal"
   A Knights of the Old Republic / Star Wars-inspired futuristic HUD skin.
   Layered on top of O-Box's own (auto-injected) component CSS.
   ========================================================================= */

:root {
  --hud-black: #03080d;
  --hud-deep: #061019;
  --hud-panel: rgba(8, 26, 38, 0.82);
  --hud-panel-2: rgba(6, 20, 30, 0.92);
  --hud-line: #1d5e73;
  --hud-line-soft: rgba(52, 197, 224, 0.22);
  --hud-cyan: #3fd6f0;
  --hud-cyan-dim: #2a9cb5;
  --hud-amber: #ffb648;
  --hud-amber-dim: #b7791f;
  --hud-red: #ff5a4d;
  --hud-green: #6dffa8;
  --hud-ink: #cfeaf3;
  --hud-ink-dim: #7ea9ba;
  --hud-glow: 0 0 6px currentColor, 0 0 16px rgba(63, 214, 240, 0.35);
  --hud-font: "Rajdhani", "Titillium Web", "Exo 2", "Segoe UI", system-ui, sans-serif;
  --hud-mono: "Share Tech Mono", "Consolas", "SFMono-Regular", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { background: var(--hud-black); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--hud-ink);
  font-family: var(--hud-font);
  letter-spacing: 0.02em;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(63, 214, 240, 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(255, 182, 72, 0.06), transparent 55%),
    linear-gradient(180deg, #04121b 0%, #03080d 45%, #01050a 100%);
  background-attachment: fixed;
}

/* Moving scanline + faint grid overlay across the viewport. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(63, 214, 240, 0.035) 0,
    rgba(63, 214, 240, 0.035) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: screen;
}

body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  height: 22vh;
  top: -22vh;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(63, 214, 240, 0.05),
    transparent
  );
  animation: hud-scan 9s linear infinite;
}

@keyframes hud-scan {
  to { transform: translateY(144vh); }
}

img { max-width: 100%; }
a { color: var(--hud-cyan); }
a:hover { color: #9af0ff; }

/* The framework hides scaffolding fragments in production. */
.oo-unused { display: none; }
.ui-disabled { opacity: 0.45; filter: grayscale(0.4); cursor: not-allowed; }

/* ---------------------------------------------------------------------------
   Structural chrome
   ------------------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  backdrop-filter: blur(6px);
  background:
    linear-gradient(180deg, rgba(7, 26, 38, 0.96), rgba(4, 14, 22, 0.92));
  border-bottom: 1px solid var(--hud-line);
  box-shadow: 0 1px 0 rgba(63, 214, 240, 0.25), 0 12px 30px rgba(0, 0, 0, 0.55);
}

.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--hud-cyan) 18%, var(--hud-amber) 50%, var(--hud-cyan) 82%, transparent);
  opacity: 0.55;
  animation: hud-hum 4s ease-in-out infinite;
}

@keyframes hud-hum {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.header-top,
.header-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.header-main { flex-wrap: wrap; border-top: 1px solid var(--hud-line-soft); }

/* Brand / logo — Republic crest lettering */
.logo {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--hud-ink);
  text-shadow: var(--hud-glow);
  padding-left: 2.1rem;
}

.logo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5rem;
  height: 1.5rem;
  transform: translateY(-50%);
  border: 2px solid var(--hud-amber);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 182, 72, 0.7), inset 0 0 6px rgba(255, 182, 72, 0.5);
}

.logo::after {
  content: "shop";
  font-size: 0.55rem;
  letter-spacing: 0.4em;
  color: var(--hud-amber);
  opacity: 0.85;
}

/* ---------------------------------------------------------------------------
   Navigation (Ebon Hawk style)
   ------------------------------------------------------------------------ */

#navi-wrapper { flex: 1 1 auto; min-width: 0; position: relative; }

#oo-navi { font-size: 0.95rem; }

#oo-navi .oo-navi-pane,
#oo-navi ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#oo-navi .oo-navi-pane {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.6rem;
}

#oo-navi .oo-navi-1st-pane > a,
#oo-navi .oo-navi-1st-pane > span,
#oo-navi .oo-navi-1st-pane > .oo-navi-name {
  display: inline-block;
  padding: 0.5rem 0.25rem;
  color: var(--hud-ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s, text-shadow 0.18s;
}

#oo-navi .oo-navi-1st-pane:hover > a,
#oo-navi .oo-navi-1st-pane > a:hover,
#oo-navi .oo-navi-active > a {
  color: var(--hud-cyan);
  border-bottom-color: var(--hud-cyan);
  text-shadow: 0 0 8px rgba(63, 214, 240, 0.8);
}

#oo-navi .oo-navi-mega,
#oo-navi .oo-navi-2nd-pane {
  background: var(--hud-panel-2);
  border: 1px solid var(--hud-line);
  box-shadow: 0 0 0 1px rgba(63, 214, 240, 0.15), 0 16px 40px rgba(0, 0, 0, 0.7);
  padding: 0.75rem 1rem;
}

#oo-navi .oo-navi-2nd-pane a {
  color: var(--hud-ink-dim);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}
#oo-navi .oo-navi-2nd-pane a:hover { color: var(--hud-cyan); text-shadow: var(--hud-glow); }

/* Hamburger */
#mham {
  display: none;
  background: transparent;
  color: var(--hud-cyan);
  border: 1px solid var(--hud-line);
  border-radius: 2px;
  font-size: 1.1rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  box-shadow: inset 0 0 8px rgba(63, 214, 240, 0.15);
}
#mham:hover { box-shadow: 0 0 12px rgba(63, 214, 240, 0.5); }

/* ---------------------------------------------------------------------------
   Search terminal
   ------------------------------------------------------------------------ */

#oo-search { position: relative; flex: 1 1 16rem; min-width: 12rem; }

#oo-search input.oo-search-val,
#oo-search input[type="text"],
#oo-search input[type="search"] {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.1rem;
  color: var(--hud-ink);
  font-family: var(--hud-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  background: rgba(2, 12, 18, 0.85);
  border: 1px solid var(--hud-line);
  border-radius: 2px;
  box-shadow: inset 0 0 12px rgba(63, 214, 240, 0.12);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#oo-search input:focus {
  border-color: var(--hud-cyan);
  box-shadow: inset 0 0 14px rgba(63, 214, 240, 0.25), 0 0 14px rgba(63, 214, 240, 0.35);
}

#oo-search::before {
  content: "▸";
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hud-cyan);
  z-index: 2;
  pointer-events: none;
  text-shadow: var(--hud-glow);
}

.oo-search-preview {
  background: var(--hud-panel-2);
  border: 1px solid var(--hud-line);
  box-shadow: 0 0 0 1px rgba(63, 214, 240, 0.15), 0 20px 50px rgba(0, 0, 0, 0.75);
}
.oo-search-preview-hint {
  color: var(--hud-amber);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
}
.oo-search-preview-items-item { border-top: 1px solid var(--hud-line-soft); }
.oo-search-preview-items-item:hover { background: rgba(63, 214, 240, 0.07); }

/* ---------------------------------------------------------------------------
   Status / minicart readout
   ------------------------------------------------------------------------ */

#oo-status {
  font-family: var(--hud-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--hud-ink-dim);
  text-align: right;
  white-space: nowrap;
}

#oo-status a { text-decoration: none; }
#oo-status .oo-status-auth-name { color: var(--hud-cyan); text-shadow: var(--hud-glow); }
#oo-status .oo-status-auth-datelink { color: var(--hud-amber); }

/* ---------------------------------------------------------------------------
   Buttons — console keys
   ------------------------------------------------------------------------ */

button,
.oo-cart-submit,
.shop-btn-add,
.oo-search-btn {
  font-family: var(--hud-font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--hud-black);
  background: linear-gradient(180deg, var(--hud-cyan), var(--hud-cyan-dim));
  border: 1px solid rgba(154, 240, 255, 0.7);
  border-radius: 2px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(63, 214, 240, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.1s, box-shadow 0.18s, filter 0.18s;
}

button:hover,
.oo-cart-submit:hover,
.shop-btn-add:hover,
.oo-search-btn:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 18px rgba(63, 214, 240, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

button:active { transform: translateY(1px); }

/* Amber variant for primary checkout actions. */
.oo-cart-submit,
.oo-cart-submit-auth,
.oo-cart-submit-located,
.oo-cart-submit-anon,
.oo-cart-submit-change {
  background: linear-gradient(180deg, var(--hud-amber), var(--hud-amber-dim));
  border-color: rgba(255, 220, 150, 0.8);
  box-shadow: 0 0 12px rgba(255, 182, 72, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#cart-toggle {
  position: relative;
  padding-right: 1.9rem;
}
#cart-toggle::after {
  content: attr(data-count);
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--hud-black);
  background: var(--hud-amber);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(255, 182, 72, 0.9);
}
#cart-toggle.has-items::after { display: inline-flex; }

#cart-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  background: transparent;
  color: var(--hud-cyan);
  border: 1px solid var(--hud-line);
  padding: 0.2rem 0.55rem;
  font-size: 1rem;
  box-shadow: none;
}
#cart-close:hover { box-shadow: 0 0 12px rgba(63, 214, 240, 0.6); }

/* ---------------------------------------------------------------------------
   Main console (shop pane)
   ------------------------------------------------------------------------ */

main {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
}

/* HUD panel framing around the shop viewport. */
main::before,
main::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--hud-cyan);
  opacity: 0.6;
  pointer-events: none;
}
main::before { top: 0.5rem; left: 0.5rem; border-right: 0; border-bottom: 0; }
main::after { bottom: 0.5rem; right: 0.5rem; border-left: 0; border-top: 0; }

#oo-shop {
  position: relative;
  padding: 1.5rem clamp(1rem, 3vw, 2.25rem) 2.5rem;
  border: 1px solid var(--hud-line);
  background:
    linear-gradient(180deg, rgba(8, 26, 38, 0.55), rgba(3, 10, 16, 0.75));
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(63, 214, 240, 0.08),
    0 0 30px rgba(0, 0, 0, 0.5);
}

/* Corner brackets on the console. */
#oo-shop::before,
#oo-shop::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px solid var(--hud-amber);
  opacity: 0.75;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 182, 72, 0.6));
}
#oo-shop::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
#oo-shop::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

/* Section titles */
#oo-shop .oo-shop-title,
h1, h2, h3 {
  color: var(--hud-ink);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#oo-shop .oo-shop-title {
  position: relative;
  margin: 0 0 1.25rem;
  padding-bottom: 0.6rem;
  font-size: 1.35rem;
  text-shadow: 0 0 12px rgba(63, 214, 240, 0.45);
  border-bottom: 1px solid var(--hud-line);
}
#oo-shop .oo-shop-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 120px;
  height: 2px;
  background: var(--hud-amber);
  box-shadow: 0 0 10px var(--hud-amber);
}

/* ---------------------------------------------------------------------------
   Item lists / cards
   ------------------------------------------------------------------------ */

.oo-shop-sl-pane { display: block; }

.oo-shop-item,
.oo-shop-sl-pane-tpl {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.9rem;
  background: linear-gradient(180deg, rgba(10, 32, 46, 0.7), rgba(4, 15, 23, 0.85));
  border: 1px solid var(--hud-line-soft);
  border-left: 3px solid var(--hud-cyan-dim);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.oo-shop-item:hover {
  border-color: var(--hud-cyan);
  border-left-color: var(--hud-amber);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(63, 214, 240, 0.25), 0 14px 28px rgba(0, 0, 0, 0.55);
}

.oo-shop-item-name {
  color: var(--hud-ink);
  font-size: 1rem;
  letter-spacing: 0.08em;
}
.oo-shop-item-price,
.oo-shop-item .oo-shop-item-price {
  color: var(--hud-amber);
  font-family: var(--hud-mono);
  text-shadow: 0 0 8px rgba(255, 182, 72, 0.5);
}

.oo-shop-item.oo-shop-item-incart { border-left-color: var(--hud-green); }
.oo-shop-item.oo-shop-item-incart .oo-shop-item-loaded::after {
  content: "◈ IN CARGO";
  color: var(--hud-green);
  font-family: var(--hud-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
}
.oo-shop-node-inactive { opacity: 0.5; }

.imagewrapper {
  display: block;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--hud-line-soft);
}

.oo-shop-singleitem-img img,
.imagewrapper img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(1.05) contrast(1.05);
}

/* ---------------------------------------------------------------------------
   Cart drawer — landing bay readout
   ------------------------------------------------------------------------ */

#cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100%;
  z-index: 900;
  padding: 1.25rem 1.25rem 2rem;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(6, 22, 33, 0.98), rgba(2, 9, 14, 0.99));
  border-left: 1px solid var(--hud-line);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.8), inset 1px 0 0 rgba(63, 214, 240, 0.3);
}

#cart-drawer[hidden] { display: none; }

#cart-drawer h1,
#cart-drawer h2,
#cart-drawer h3 { font-size: 1rem; }

#oo-cart table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }

#oo-cart th,
#oo-cart td {
  border-bottom: 1px solid var(--hud-line-soft);
  padding: 0.4rem 0.3rem;
  text-align: left;
}

#oo-cart tr#oo-cart-tpl,
#oo-cart .oo-cart-pos { background: rgba(63, 214, 240, 0.04); }
#oo-cart .oo-cart-sum-val { color: var(--hud-amber); font-weight: 700; }
#oo-cart .oo-cart-empty { color: var(--hud-ink-dim); }

/* ---------------------------------------------------------------------------
   Flash messages & loading
   ------------------------------------------------------------------------ */

#oo-flash {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 950;
  max-width: min(680px, 92vw);
  pointer-events: none;
}

.oo-flash-msg,
.oo-flash-error {
  display: block;
  margin-top: 0.4rem;
  padding: 0.6rem 1.1rem;
  font-family: var(--hud-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  border: 1px solid var(--hud-cyan);
  background: rgba(6, 22, 33, 0.96);
  color: var(--hud-ink);
  box-shadow: 0 0 14px rgba(63, 214, 240, 0.35);
}
.oo-flash-error {
  border-color: var(--hud-red);
  color: #ffd5d1;
  box-shadow: 0 0 16px rgba(255, 90, 77, 0.5);
}

#oo-loadingbar .oo-loadingbar-box {
  height: 3px;
  background: rgba(63, 214, 240, 0.08);
}
#oo-loadingbar .oo-loadingbar-bar {
  background: linear-gradient(90deg, var(--hud-cyan), var(--hud-amber));
  box-shadow: 0 0 12px rgba(63, 214, 240, 0.8);
}

/* O-Box loading overlay */
.oo-loading {
  background: rgba(2, 8, 12, 0.8);
  backdrop-filter: blur(2px);
}
.oo-loading::after {
  content: "SYNCHRONIZING…";
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--hud-cyan);
  font-family: var(--hud-mono);
  letter-spacing: 0.35em;
  animation: hud-flicker 1.6s steps(2) infinite;
}
@keyframes hud-flicker { 50% { opacity: 0.35; } }

/* ---------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------ */

.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  color: var(--hud-ink-dim);
  font-family: var(--hud-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-align: center;
  border-top: 1px solid var(--hud-line-soft);
  text-transform: uppercase;
}
.site-footer .ticker-line {
  color: var(--hud-amber);
  overflow: hidden;
  white-space: nowrap;
  animation: hud-marquee 26s linear infinite;
}
@keyframes hud-marquee {
  from { transform: translateX(60%); }
  to { transform: translateX(-60%); }
}

/* ---------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------ */

@media (max-width: 860px) {
  #mham { display: inline-block; order: 3; }
  #navi-wrapper { order: 4; flex-basis: 100%; }
  .oo-ham-off #oo-navi { display: none; }
  .oo-ham-on #oo-navi { display: block; }

  #oo-search { order: 2; flex-basis: 100%; }
  #oo-status { order: 1; }

  .oo-shop-item { padding: 0.75rem; }
}

@media (min-width: 900px) {
  .oo-shop-sl-pane {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::after,
  .site-header::after,
  .site-footer .ticker-line,
  .oo-loading::after { animation: none; }
}
