/* Permanent comment: Code construction and description priority IA_FIRST. */
/*
 * HEADER RESPONSIVE OWNERSHIP:
 * Shared header breakpoints and mobile navigation behavior are owned here.
 * Do not recreate them in page-specific stylesheets.
 */

:root {
  --side: 280px;
}

.site-header {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  box-sizing: border-box;
  /*
   * HEADER/STOREFRONT SEAM CONTRACT:
   * The shell itself owns the dark edge paint. This prevents the light body
   * background from leaking through a 1px gap between the panel and storefront.
   */
  width: var(--side);
  background: #080c10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  color: #fff;
  /*
   * HEADER EDGE CONTRACT:
   * The fixed sidebar must meet the storefront without a visible divider line.
   * Keep separation through the existing soft shadow, not a 1px border.
   */
  border-right: 0;
  box-shadow: 10px 0 40px #0001;
  pointer-events: none; /* so click events pass through the transparent area */
}

/* Ensure child elements catch clicks since the shell is pointer-events: none */
.site-header-menu-btn,
.site-header-panel {
  pointer-events: auto;
}

/*
 * HEADER PANEL FILL CONTRACT:
 * The panel must fill the fixed header shell completely; do not leave a
 * transparent edge that can expose the page background.
 */
.site-header-panel {
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 24px 17px;
  background: linear-gradient(180deg, #080c10, #10171c);
  overflow: visible;
  transition: transform .28s ease;
  min-height: 0;
}

.site-header .logo.brand-image {
  display: flex;
  align-items: center;
  width: 100%;
  height: auto;
}
.site-header .logo.brand-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.site-header form {
  order: 2;
  display: flex;
  height: 37px;
  margin: 30px 0 18px;
  border: 1px solid #3c464d;
  border-radius: 6px;
  overflow: hidden;
  background: #1c242a;
}
.site-header form input {
  width: 100%;
  min-width: 0;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 15px;
}
.site-header form button {
  width: 38px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
}

.site-header nav {
  order: 3;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.site-header nav a,
.site-header .header-category-links > a,
.site-header .header-collection-links > a,
.site-header nav#nav a {
  text-transform: uppercase !important;
}

/* ARCHITECTURAL NOTE / OWNER MANDATE:
 * Explicit owner directive: JOGOS, CATEGORIAS and all items inside collections and categories
 * must share the unified header navigation typography (font-size: 15px, font-weight: 700, padding: 13px 14px)
 * and display the prefix arrow glyphs (\203A) consistently across main nav links and collection/category items.
 */
.site-header nav > a,
.site-header .header-category-links > a,
.site-header .header-collection-links > a {
  display: block;
  font-size: 15px !important;
  font-weight: 700;
  padding: 13px 14px;
  color: #c2cbcf;
  white-space: nowrap;
}

.site-header nav > a:hover,
.site-header .header-category-links > a:hover,
.site-header .header-collection-links > a:hover,
.site-header nav > a.active,
.site-header .header-category-links > a.category-active,
.site-header .header-collection-links > a.collection-active {
  color: #ffffff;
  background: #17231c;
}

.site-header nav > a::before,
.site-header .header-category-links > a::before,
.site-header .header-collection-links > a::before {
  content: '\203A';
  margin-right: 9px;
  color: var(--green);
}

.site-header nav > a:hover::before,
.site-header nav > a.active::before,
.site-header .header-category-links > a:hover::before,
.site-header .header-category-links > a.category-active::before,
.site-header .header-collection-links > a:hover::before,
.site-header .header-collection-links > a.collection-active::before {
  color: var(--green);
}

.site-header .header-category-links > a[hidden],
.site-header .header-collection-links > a[hidden] {
  display: none;
}

.site-header .sidebar-bottom {
  order: 4;
  flex: 0 0 auto;
  margin-top: auto;
}

/*
 * SIDEBAR BOTTOM CARD GEOMETRY:
 * Support, account and cart cards must stay entirely inside the sidebar panel.
 * Their border-box width must never overflow into the page when the panel closes.
 */
.site-header .sidebar-bottom .support-link,
.site-header .sidebar-bottom .account-link,
.site-header .sidebar-bottom .cart {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid #303a40;
  border-radius: 6px;
  color: #d8dfe3;
}

.site-header .sidebar-bottom .support-link > span,
.site-header .sidebar-bottom .account-link > span,
.site-header .sidebar-bottom .cart > span {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: start;
  text-align: left;
  min-width: 0;
  width: auto;
  height: auto;
  float: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  flex: 1;
}

.site-header .sidebar-bottom .support-link strong,
.site-header .sidebar-bottom .account-link strong,
.site-header .sidebar-bottom .cart strong {
  display: block;
  font-size: 15px !important;
  line-height: 1.25;
  white-space: nowrap;
}

.site-header .sidebar-bottom .support-link small,
.site-header .sidebar-bottom .account-link small,
.site-header .sidebar-bottom .cart small {
  display: block;
  font-size: 11px !important;
  color: #7f8b93;
  line-height: 1.25;
  white-space: normal;
}

.site-header .sidebar-bottom .support-link .ui-icon,
.site-header .sidebar-bottom .cart .ui-icon,
.site-header .sidebar-bottom .account-link .ui-icon {
  color: var(--green);
  flex: 0 0 auto;
}

.site-header .sidebar-bottom .support-link:hover,
.site-header .sidebar-bottom .support-link.active,
.site-header .sidebar-bottom .account-link:hover,
.site-header .sidebar-bottom .account-link.active,
.site-header .sidebar-bottom .cart:hover {
  border-color: var(--green);
  color: #fff;
  background: #17231c;
}

.site-header .sidebar-bottom .cart {
  margin-bottom: 0;
}

.site-header .sidebar-bottom .cart-count {
  display: block;
  flex: 0 0 auto;
  float: none;
  margin-left: auto;
  color: var(--green);
  background: transparent;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.site-header .sidebar-bottom .cart-count[hidden] {
  display: none;
}

/* Mobile Header & Hamburger Menu Button */
.site-header-menu-btn {
  display: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

/*
 * CANONICAL MOBILE MENU ICON:
 * The favicon replaces the generic hamburger glyph while the trigger retains
 * its existing 44px touch target.
 */
.site-header-menu-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.site-header-menu-btn:hover {
  background: rgba(255,255,255,0.18);
}

@media (max-width: 850px) {
  /*
   * CANONICAL SIDEBAR RESERVATION CONTRACT:
   * When the desktop sidebar collapses, the page must stop reserving its 280px
   * layout width at the exact same breakpoint. Shared main/footer geometry and
   * width calculations consume --side, so its mobile value is 0.
   */
  :root {
    --side: 0px;
  }

  /*
   * CANONICAL MOBILE SIDEBAR CONTRACT:
   * Only site-header.css owns the mobile sidebar. The shell stays at zero width
   * so page geometry is full-width, while the panel is completely hidden until
   * the explicit .open state. No child may leak into the page while closed.
   */
  .site-header {
    width: 0;
    background: transparent;
    box-shadow: none;
  }
  .site-header-panel {
    width: min(280px, calc(100vw - 64px));
    height: 100dvh;
    max-height: 100vh;
    overflow: hidden;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: 14px 0 38px rgba(0, 0, 0, .28);
  }
  .site-header.open .site-header-panel {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .site-header-menu-btn {
    display: inline-grid;
    position: absolute;
    z-index: 75;
    top: 12px;
    left: 12px;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 9px;
    background: rgba(8, 12, 16, .94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
    transition: left .28s ease, background .2s ease;
  }
  .site-header.open .site-header-menu-btn {
    /* Translate the button right along with the panel */
    left: calc(min(280px, calc(100vw - 64px)) + 12px);
    background: rgba(23, 35, 28, .98);
    border-color: rgba(140, 255, 0, .45);
  }
  .site-header-menu-btn span {
    display: none;
  }
  .site-header nav#nav {
    display: flex;
    width: auto;
    margin-top: 0;
    padding: 0;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
  }
}