/* Shared BrooPay palette for the public store, private panels and payment portal. */
:root {
  color-scheme: dark;
  --broopay-black: #050505;
  --broopay-surface: #050505;
  --broopay-field: #050505;
  --broopay-border: #393939;
  --broopay-orange: #ff6200;
  background: var(--broopay-black) !important;
  color: #fff !important;
}

html, body {
  background: var(--broopay-black) !important;
  color: #fff !important;
}

body, body * {
  color: #fff !important;
  border-color: var(--broopay-border) !important;
}

body * {
  background-color: transparent !important;
  background-image: none !important;
}

body :is(header, footer, nav, article, aside, section, form, dialog, table,
  [class*="-card"], [class*="-panel"], [class*="-summary"], [class*="-box"],
  [class*="-tile"], [class*="-row"], [class*="-item"], [class*="-modal"],
  .public-digital-product, .public-product, .store-card, details) {
  background-color: var(--broopay-surface) !important;
}

body :is(main, .halloween-spider-layer, .halloween-spider, .spider-legs,
  .public-product-visual, .pay-brand-viewport, .pay-footer-logo-viewport) {
  background-color: transparent !important;
}

body :is(input, select, textarea, option, [contenteditable="true"]) {
  background: var(--broopay-field) !important;
  color: #fff !important;
  border-color: #686868 !important;
  caret-color: #fff;
}

body :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--broopay-orange); }

body :is(input, textarea)::placeholder { color: #bcbcbc !important; opacity: 1; }
body :is(input, select, textarea):focus-visible,
body :is(button, a):focus-visible { outline: 2px solid var(--broopay-orange) !important; outline-offset: 2px; }

body :is(button, input[type="button"], input[type="submit"], input[type="reset"],
  [role="button"], a[class*="button"], a[class*="cta"]) {
  background: var(--broopay-orange) !important;
  color: #fff !important;
  border-color: var(--broopay-orange) !important;
}

body :is(button, input[type="button"], input[type="submit"], input[type="reset"],
  [role="button"], a[class*="button"], a[class*="cta"]):hover:not(:disabled) {
  background: #ff7a22 !important;
  border-color: #ff7a22 !important;
}

body .public-banner-dot:not([aria-pressed="true"]) {
  background: #929292 !important;
  border-color: transparent !important;
}
body .public-banner-dot[aria-pressed="true"] {
  background: var(--broopay-orange) !important;
  border-color: transparent !important;
}

/* The selected catalog category is the white pill beneath its banner. */
body #publicCategoryFilters button.active,
body #publicCategoryFilters button.active:hover {
  background: #fff !important;
  border-color: #fff !important;
  color: var(--broopay-black) !important;
}

body :is(button, input[type="button"], input[type="submit"], input[type="reset"]):disabled {
  background: #783412 !important;
  border-color: #783412 !important;
  color: #ddd !important;
}

/* Product cards are browsing surfaces, even when implemented as buttons. */
body button:is(.public-digital-product, .admin-catalog-group, .panel-product-card),
body button:is(.public-digital-product, .admin-catalog-group, .panel-product-card):disabled {
  background: var(--broopay-black) !important;
  border-color: var(--broopay-border) !important;
  color: #fff !important;
}

body button:is(.public-digital-product, .admin-catalog-group, .panel-product-card):hover:not(:disabled) {
  background: var(--broopay-black) !important;
  border-color: var(--broopay-orange) !important;
}

body :is(a, a *) { color: #fff !important; }
body a:hover { color: #ff9b58 !important; }
body :is(button, [role="button"], a[class*="button"], a[class*="cta"]) * { color: #fff !important; }

body :is(.pay-header, .header, .pay-public-footer, #publicFooter) {
  background: var(--broopay-black) !important;
}

body :is(.pay-brand-viewport img, .pay-footer-logo-viewport img,
  .pay-login-logo img, .header img, main > img) {
  filter: none !important;
}

body .halloween-spider { color: #342a38 !important; }
body .pay-login.admin-login form::before { background-color: var(--broopay-surface) !important; }
body .public-legal-page::before { mix-blend-mode: screen !important; }

/* Legal documents sit directly over the page artwork, without opaque blocks. */
body #publicApp > .public-legal-page,
body #publicApp .public-legal-page :is(header, article, aside, nav, footer, section, table, th, td) {
  background: transparent !important;
}

/* Let the artwork show through the checkout, payment choice and FAQ panels. */
body #publicApp .public-checkout-section :is(.public-checkout-details, .public-checkout-card, .public-checkout-summary),
body #publicApp .public-payment-section :is(.public-payment-methods, .public-cart-methods, .public-cart-methods label, .public-checkout-summary),
body #publicApp .public-faq-section,
body #publicApp .public-faq-section :is(.public-faq-list, details, summary) {
  background: transparent !important;
}

body :is(.public-product-visual, .public-cart-item-art, .pay-product img) {
  background: var(--broopay-black) !important;
}

body :is(hr, tr, td, th) { border-color: var(--broopay-border) !important; }
body ::selection { background: var(--broopay-orange); color: #fff; }

/* A receipt is a document: keep its original light treatment on screen and paper. */
body main.public-receipt-page {
  background: #f1f4f8 !important;
  color: #181818 !important;
}
body .public-receipt-page * {
  color: #181818 !important;
  border-color: #d8dde2 !important;
  background-color: transparent !important;
}
body .public-receipt-shell,
body .receipt-copyright,
body .receipt-loading,
body .receipt-invalid,
body .transaction-receipt,
body .receipt-product-initials { background: #fff !important; }
body .receipt-paper-area { background: #f4f6f9 !important; }
body .public-receipt-hero,
body .receipt-support { background: linear-gradient(135deg, #ff5a00, #e64800) !important; }
body .public-receipt-hero *,
body .receipt-support * { color: #fff !important; }
body .receipt-hero-title button { background: #fff !important; color: #e74b00 !important; border-color: rgba(255,255,255,.55) !important; }
body .receipt-product-initials { color: #e75300 !important; }
body .transaction-receipt-meta dt,
body .receipt-copyright { color: #666 !important; }
body .receipt-customer,
body .receipt-lines { border-color: #252525 !important; }
body .receipt-thanks span { border-color: #222 !important; }
body .receipt-hero-data,
body .receipt-hero-total,
body .receipt-hero-product { border-color: rgba(255,255,255,.32) !important; }
body .receipt-support a,
body .receipt-support a * { color: #fff !important; }
@media print {
  html, body, body main.public-receipt-page,
  body .public-receipt-shell, body .receipt-paper-area,
  body .transaction-receipt { background: #fff !important; color: #181818 !important; box-shadow: none !important; }
}

@media screen {
  html body main.public-receipt-page {
    padding: 0;
    background: #000 !important;
  }
  html body .public-receipt-shell {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: start;
    width: 100%;
    border-radius: 0;
    background: #000 !important;
    box-shadow: none;
  }
  .receipt-product-banner {
    display: block;
    width: 100%;
    height: auto;
  }
  .receipt-screen-details { min-width: 0; }
  html body .public-receipt-hero {
    background: #000 !important;
    padding: clamp(20px, 4vw, 64px);
  }
  html body .receipt-hero-title {
    justify-content: flex-start;
    text-align: left;
  }
  html body .receipt-paper-area {
    background: #000 !important;
    grid-template-columns: minmax(0, 80mm) auto;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px 24px;
    min-width: 0;
  }
  html body .receipt-paper-area > button {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 11px;
    background: #fff;
    color: #e74b00;
    font-weight: 900;
    cursor: pointer;
  }
  html body .receipt-paper-area .transaction-receipt {
    grid-column: 1;
    grid-row: 1;
    box-sizing: border-box;
    max-width: 100%;
  }
  html body .receipt-support,
  html body .receipt-copyright {
    grid-column: 1 / -1;
    background: #000 !important;
    color: #fff !important;
  }
}
@media screen and (max-width: 1000px) {
  html body .public-receipt-shell { grid-template-columns: minmax(0, 1fr); }
}
@media print {
  .receipt-screen-details,
  .receipt-paper-area > button { display: none !important; }
}

@media screen {
  html body .receipt-hero-title { justify-content: space-between; }
  .receipt-hero-title .receipt-hero-total {
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
  }
}
@media screen and (max-width: 700px) {
  .receipt-hero-title .receipt-hero-total { text-align: left; }
}

@media screen {
  html body .public-receipt-shell {
    grid-template-columns: minmax(0, 2fr) minmax(80mm, .65fr) minmax(96px, .35fr);
    grid-template-rows: 1fr;
    min-height: 100vh;
  }
  html body .receipt-paper-area {
    position: relative;
    align-self: stretch;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
    background: #fff !important;
  }
  html body .receipt-paper-area .transaction-receipt {
    width: 100%;
    margin: 0;
    box-shadow: none;
  }
  html body .receipt-paper-area > button {
    position: absolute;
    grid-column: auto;
    grid-row: auto;
    top: 8px;
    right: 8px;
  }
  html body .public-receipt-shell .receipt-showcase {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
    background: #ff5a00 !important;
  }
  .receipt-showcase h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 14px 8px;
    background: #ff5a00 !important;
    color: #111 !important;
    text-align: center;
    font-size: 1rem;
    line-height: 1.2;
  }
  .receipt-showcase-track {
    position: absolute;
    inset: 0 0 auto;
    animation: receipt-showcase-rise 28s linear infinite;
  }
  .receipt-showcase-track > div {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 0 12px 16px;
  }
  .receipt-showcase img {
    display: block;
    width: min(100%, 144px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 10px;
  }
  .receipt-showcase:hover .receipt-showcase-track { animation-play-state: paused; }
  @keyframes receipt-showcase-rise { to { transform: translateY(-50%); } }
}
@media screen and (max-width: 1000px) {
  html body .public-receipt-shell { grid-template-columns: minmax(0, 1fr) minmax(76px, 25%); grid-template-rows: auto 1fr; }
  .receipt-screen-details { grid-column: 1 / -1; }
}
@media screen and (prefers-reduced-motion: reduce) {
  .receipt-showcase-track { animation: none; }
}
@media print {
  .receipt-showcase { display: none !important; }
}

@media screen {
  html:has(body > .public-receipt-page) {
    scrollbar-color: #9b3300 #ff5a00;
  }
  .receipt-showcase-window {
    position: relative;
    min-height: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent 10px, rgba(0,0,0,.08) 28px, rgba(0,0,0,.35) 52px, rgba(0,0,0,.72) 80px, #000 116px, #000 calc(100% - 116px), rgba(0,0,0,.72) calc(100% - 80px), rgba(0,0,0,.35) calc(100% - 52px), rgba(0,0,0,.08) calc(100% - 28px), transparent calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, transparent 10px, rgba(0,0,0,.08) 28px, rgba(0,0,0,.35) 52px, rgba(0,0,0,.72) 80px, #000 116px, #000 calc(100% - 116px), rgba(0,0,0,.72) calc(100% - 80px), rgba(0,0,0,.35) calc(100% - 52px), rgba(0,0,0,.08) calc(100% - 28px), transparent calc(100% - 10px), transparent 100%);
  }
  html body .receipt-showcase h2 { z-index: 2; }
}

body .brusd-history-row .brusd-history-banner {
  flex: 1 1 130px;
  min-width: 0;
  max-width: 240px;
  margin: 0 auto;
}
body .brusd-history-banner img {
  display: block;
  width: 100%;
  height: 56px;
  object-fit: contain;
}
body .brusd-history-row > b { margin-left: auto; }

body .brusd-history-row > img,
body .brusd-swap-field:has(#brusdSwapAmount) img {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  border: 2px solid #fff !important;
}
body .brusd-swap-card #brusdSwapMax {
  background: transparent !important;
  color: #ff7628 !important;
  text-decoration: none;
}
body .brusd-swap-field :is(#brusdSwapAmount, #brusdSwapReceive):focus {
  outline: none !important;
  box-shadow: none !important;
}
body .brusd-swap-field:focus-within { border-color: #aaa !important; }
body .brusd-swap-arrow {
  width: 40px;
  height: 40px;
  color: #fff !important;
}

body .brusd-workspace-grid > .brusd-swap-card {
  position: sticky;
  top: calc(var(--brusd-header-height, 84px) + 8px);
  max-height: max(120px, calc(100dvh - var(--brusd-header-height, 84px) - 16px));
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 2;
}

body .brusd-swap-field > div {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  flex: 0 0 102px;
  align-items: center;
}

body #affiliateOperationsReport,
body #affiliateOperationsList {
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  padding: 0;
}
body #affiliateOperationsList .operation-product-logo:has(.affiliate-operation-banner) {
  width: 100%;
  height: auto;
}
body #affiliateOperationsList img.affiliate-operation-banner {
  display: block;
  width: 100%;
  max-width: 170px;
  height: 64px;
  object-fit: cover;
  object-position: left center;
  border-radius: 8px;
}
@media (min-width: 1001px) {
  body #affiliateOperationsList .affiliate-operation-row {
    grid-template-columns: minmax(72px,.7fr) minmax(90px,.8fr) minmax(58px,.5fr) minmax(130px,1.15fr) minmax(108px,1.2fr) minmax(85px,.9fr) minmax(80px,.7fr) minmax(100px,.8fr) auto;
  }
}
@media (max-width: 1000px) {
  body #affiliateOperationsList .affiliate-operation-row {
    grid-template-columns: minmax(76px,1fr) minmax(0,2fr) auto;
  }
}
