/* ==========================================================================
   CubiWiz Loja Brasil v2 — Header Flutuante, Mega-Menu, Busca Viva e Gavetas
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 28px;
  }
}

.cube-stripe {
  height: 4px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--cube-red) 0% 16.66%,
    var(--cube-orange) 16.66% 33.33%,
    var(--cube-yellow) 33.33% 50%,
    var(--cube-green) 50% 66.66%,
    var(--cube-blue) 66.66% 83.33%,
    var(--wiz-cyan-bright) 83.33% 100%
  );
}

/* Faixa Sandbox obrigatória */
.sandbox-banner {
  background: #fde047;
  color: #09090b;
  border-bottom: 1px solid #ca8a04;
  font-weight: 800;
  font-size: 0.76rem;
  text-align: center;
  padding: 5px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sandbox-pill {
  background: #09090b;
  color: #fde047;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  text-transform: uppercase;
}

/* Barra de Campanha / Anúncio Dinâmica */
.promo-bar {
  background: var(--promo-bar-bg);
  color: var(--promo-bar-ink);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 7px 14px;
  letter-spacing: 0.01em;
  transition: background-color 0.25s, color 0.25s;
}

/* Header Principal (Pílula Flutuante no Desktop → Sticky Sólido no Scroll) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 95;
  padding: 8px 0;
  background: rgba(7, 9, 18, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--dark-border);
  color: var(--dark-text);
  transition: padding 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 1024px) {
  .site-header {
    background: transparent;
    border-bottom-color: transparent;
    padding: 12px 0 4px;
  }
  .site-header .header-pill-shell {
    background: rgba(9, 12, 24, 0.97);
    backdrop-filter: blur(18px);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-pill);
    padding: 8px 18px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    transition: border-radius 0.22s ease, padding 0.22s ease;
  }
  .site-header.is-scrolled {
    background: rgba(7, 9, 18, 0.98);
    border-bottom-color: var(--dark-border);
    padding: 6px 0;
  }
  .site-header.is-scrolled .header-pill-shell {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    padding: 4px 0;
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #ffffff;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-link:hover {
  text-decoration: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.22);
}

.brand-txt {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-name span {
  background: linear-gradient(90deg, var(--wiz-cyan-bright), #818cf8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--cube-yellow);
}

/* Navegação Desktop + Gatilho Mega-Menu */
.main-nav {
  display: none;
  align-items: center;
  gap: 2px;
}

@media (min-width: 1024px) {
  .main-nav {
    display: flex;
  }
}

.nav-link,
.nav-dropdown-btn {
  background: transparent;
  border: 0;
  color: #d5def7;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-link:hover,
.nav-link.is-active,
.nav-dropdown-btn:hover,
.nav-dropdown-btn[aria-expanded="true"] {
  color: #0b1120;
  background: #ffffff;
  text-decoration: none;
}

/* Busca Preditiva no Header */
.header-search-wrap {
  display: none;
  position: relative;
  flex: 1;
  max-width: 280px;
}

@media (min-width: 820px) {
  .header-search-wrap {
    display: block;
  }
}

.header-search-input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}

.header-search-input::placeholder {
  color: #9ba8ce;
}

.header-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--wiz-cyan-bright);
}

.header-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Painel Dropdown de Busca Instantânea */
.search-results-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: var(--window-bg);
  color: var(--ink);
  border: 1.5px solid var(--window-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 120;
}

.search-hit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.14s;
}

.search-hit-row:hover {
  background: var(--window-subtle);
  text-decoration: none;
}

.search-hit-row img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--card-media-bg);
  flex-shrink: 0;
}

/* Mega-Menu Flutuante de Departamentos */
.mega-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0d1224;
  color: #f1f5ff;
  border: 1.5px solid #26325b;
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
  padding: 22px;
  z-index: 110;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr;
  gap: 24px;
}

.mega-links-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mega-links-col a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.mega-links-col a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.mega-cards-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mega-promo-card {
  background: #161f3d;
  border: 1px solid #2c3b6e;
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}

.mega-promo-card:hover {
  transform: translateY(-2px);
  border-color: var(--wiz-cyan-bright);
  text-decoration: none;
}

.mega-promo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f7fb;
}

/* Ações Direita do Header (Tema, Busca Mobile, Sacola, Menu) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-switcher-wrap {
  position: relative;
}

.icon-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  transition: background 0.15s, border-color 0.15s;
}

.icon-pill-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
}

.theme-label-desktop {
  display: none;
}

@media (min-width: 1180px) {
  .theme-label-desktop {
    display: inline;
  }
}

.theme-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 245px;
  background: var(--window-bg);
  color: var(--ink);
  border: 1.5px solid var(--window-border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
  padding: 10px;
  z-index: 125;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-popover-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  padding: 4px 8px;
}

.theme-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
}

.theme-option-btn:hover {
  background: var(--window-subtle);
}

.theme-option-btn.is-active {
  background: var(--wiz-indigo);
  color: #ffffff;
}

html[data-theme="black-friday"] .theme-option-btn.is-active {
  color: #09090b;
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--cube-yellow);
  color: #0b1120;
  font-weight: 800;
  font-size: 0.85rem;
  border: 0;
  transition: transform 0.14s;
}

.cart-btn:hover {
  transform: translateY(-1px);
}

.cart-btn-label {
  display: none;
}

@media (min-width: 500px) {
  .cart-btn-label {
    display: inline;
  }
}

.cart-badge {
  background: var(--cube-red);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 900;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.1rem;
}

@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }
}

/* Gaveta Lateral Universal (Slide-Over: Menu Mobile, Sacola e Quick-View) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 8, 18, 0.62);
  backdrop-filter: blur(4px);
}

.slide-drawer {
  position: fixed;
  top: 10px;
  bottom: 10px;
  right: 10px;
  width: calc(100vw - 20px);
  max-width: 430px;
  z-index: 160;
  background: var(--window-bg);
  color: var(--ink);
  border: 1.5px solid var(--window-border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-drawer-left {
  right: auto;
  left: 10px;
  max-width: 360px;
  animation: drawerSlideInLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawerSlideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes drawerSlideInLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--window-border);
}

.drawer-head strong {
  font-size: 1.05rem;
  font-weight: 900;
}

.drawer-close-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--window-border-strong);
  background: var(--window-subtle);
  color: var(--ink);
  font-weight: 900;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.drawer-foot-dark {
  background: var(--dark-bg);
  color: var(--dark-text);
  padding: 18px 20px;
  border-top: 1px solid var(--dark-border);
}

/* Área Principal & Rodapé */
.site-main {
  flex: 1;
  padding-bottom: 56px;
}

.site-footer {
  background: var(--dark-bg);
  color: var(--dark-muted);
  border-top: 1px solid var(--dark-border);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 44px 0 32px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  }
}

.footer-col h3 {
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col p {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--dark-muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.store-badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  background: var(--dark-surface-2);
  border: 1px solid var(--dark-border);
  color: var(--dark-text);
  font-size: 0.76rem;
  font-weight: 600;
}

.store-badge-soon small {
  color: var(--wiz-cyan-bright);
  font-weight: 800;
}

.footer-legal-bar {
  border-top: 1px solid var(--dark-surface-2);
  padding: 20px 0 28px;
  font-size: 0.79rem;
  color: #8290b8;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
