﻿:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: #121212;
  --border: #292929;
  --text: #f2f2f2;
  --muted: #a5a5a5;
  --purple: #8550cd;
  --header-height: 81px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-height) + 20px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Arial, Helvetica, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, summary { font: inherit; }
button, summary { cursor: pointer; }
button { color: inherit; }
h1, h2, h3, p { margin: 0; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid #ba8afa; outline-offset: 4px; }
[hidden] { display: none !important; }
.container { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 1100; background: var(--purple); padding: 12px; }
.skip-link:focus { top: 12px; }
.site-header { position: sticky; top: 0; width: 100%; z-index: 1000; border-bottom: 1px solid #252525; background: #0b0b0b; }
.navbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-size: 19px; font-weight: 750; letter-spacing: -.4px; white-space: nowrap; }
.brand > span:last-child { color: #ae7bea; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a:hover, summary:hover, .nav-button:hover, .text-button:hover { color: #bd94ef; }
.nav-links a[aria-current] { color: #bd94ef; }
.nav-button { border: 0; background: transparent; padding: 8px 0; }
.cart-count { color: var(--muted); margin-left: 5px; }
.category-menu { position: relative; }
.category-menu summary { list-style: none; padding: 8px 0; }
.category-menu summary::-webkit-details-marker { display: none; }
.category-options { position: absolute; z-index: 5; top: calc(100% + 12px); left: 0; min-width: 195px; padding: 6px; border: 1px solid var(--border); background: #171717; }
.category-options button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; }
.category-options button:hover { background: #242424; }
.category-options button[aria-pressed="true"] { color: #bd94ef; }
.store-banner { margin-top: 28px; position: relative; background: #191919; }
.store-banner > img { display: block; width: 100%; height: 480px; object-fit: cover; object-position: center 45%; }
.banner-caption { position: absolute; bottom: 24px; left: 24px; display: flex; align-items: center; gap: 24px; padding: 15px 18px; background: #0b0b0bef; }
.banner-caption h1 { font-size: 20px; font-weight: 600; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 20px; background: var(--purple); border: 1px solid var(--purple); border-radius: 3px; color: white; font-size: 14px; font-weight: 600; }
.button:hover { background: #7542bd; border-color: #7542bd; }
.catalog-section { padding: 38px 0 58px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
h1, h2 { font-size: 24px; font-weight: 600; }
.catalog-heading p { font-size: 13px; color: var(--muted); }
.demo-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.catalog-section > .demo-note { margin-bottom: 22px; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.product-card { min-width: 0; background: var(--surface); border: 1px solid var(--border); }
.product-card > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.product-content { padding: 16px; }
h3 { font-size: 16px; font-weight: 500; }
.price { font-size: 19px; font-weight: 700; margin: 12px 0 16px; }
.product-content .button { width: 100%; }
.site-footer { border-top: 1px solid var(--border); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-block: 25px; color: var(--muted); font-size: 12px; }
dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; background: var(--surface); color: var(--text); border: 1px solid #454545; border-radius: 4px; }
dialog::backdrop { background: #000b; }
.dialog-top { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.text-button { background: none; border: 0; padding: 8px; text-decoration: underline; }
dialog > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 16px; }
dialog > p { margin-block: 14px; }
/* Compatibilidade com as páginas básicas de conta existentes. */
.brand-icon { display: none; }
.brand small { display: inline; margin-left: 5px; font-size: inherit; color: #ae7bea; }
.account-link, .secondary-link { color: #bd94ef; }
.placeholder-main { min-height: 70vh; display: grid; place-items: center; padding-block: 48px; }
.placeholder-panel { width: min(480px, 100%); padding: 28px; background: var(--surface); border: 1px solid var(--border); }
.placeholder-panel h1 { font-size: 28px; }
.placeholder-panel p { margin-block: 16px; color: var(--muted); }
.placeholder-panel .eyebrow { color: #bd94ef; }
.secondary-link { display: block; margin-top: 20px; }
@media (max-width: 1000px) {
  .store-banner > img { height: 340px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-links { gap: 20px; }
}
@media (max-width: 680px) {
  .container { width: calc(100% - 32px); }
  .navbar { flex-direction: column; align-items: flex-start; gap: 10px; padding-block: 18px 12px; }
  .brand { font-size: 18px; }
  .nav-links { width: 100%; justify-content: space-between; gap: 10px; font-size: 13px; }
  .category-options { left: -48px; }
  .store-banner { margin-top: 18px; }
  .store-banner > img { height: 250px; }
  .banner-caption { position: static; justify-content: space-between; padding: 14px; gap: 12px; background: var(--surface); }
  .banner-caption h1 { font-size: 16px; }
  .banner-caption .button { font-size: 13px; padding-inline: 15px; }
  .catalog-section { padding-block: 28px 38px; }
  .product-grid { gap: 14px; }
  .product-content { padding: 12px; }
  h3 { font-size: 14px; min-height: 42px; }
  .price { font-size: 17px; }
  .product-content .button { padding-inline: 8px; font-size: 13px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 380px) {
  .product-grid { grid-template-columns: 1fr; }
  h3 { min-height: 0; }
  .nav-links { gap: 8px; font-size: 12px; }
}


/* Header da loja: permanece no fluxo, sem sobrepor o início do conteúdo. */
.store-navbar { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 80px; gap: 24px; padding-block: 0; }
.store-navbar .brand { justify-self: start; }
.store-navbar .nav-links { justify-self: center; gap: 26px; width: auto; }
.store-navbar .nav-links > a, .nav-link { display: inline-flex; align-items: center; min-height: 44px; position: relative; padding: 10px 0; border: 0; background: transparent; color: #d5d5d5; font-size: 14px; white-space: nowrap; transition: color 150ms ease; }
.store-navbar .nav-links > a::after, .nav-link::after { content: ''; position: absolute; bottom: 5px; left: 0; right: 0; height: 1px; background: #ad7cde; transform: scaleX(0); transition: transform 150ms ease; }
.store-navbar .nav-links > a:hover, .nav-link:hover, .store-navbar .nav-links > a[aria-current] { color: #bd94ef; }
.store-navbar .nav-links > a:hover::after, .nav-link:hover::after { transform: scaleX(1); }
.header-actions { display: flex; align-items: center; justify-self: end; gap: 10px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 8px; border: 0; background: transparent; color: #d5d5d5; transition: color 150ms ease; }
.icon-button:hover { color: #bd94ef; }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .cart-count { margin: 0; font-size: 11px; }
.catalog-tools { display: flex; align-items: center; gap: 22px; }
.catalog-tools .category-menu summary { color: #c3c3c3; min-height: 44px; padding: 11px 0; }
.catalog-tools .category-menu summary::after { content: '⌄'; margin-left: 8px; }
.catalog-tools .category-options { left: auto; right: 0; top: 100%; }
@media (max-width: 1050px) {
  :root { --header-height: 119px; }
  .store-navbar { grid-template-columns: 1fr auto; gap: 0 16px; padding-block: 10px 6px; }
  .store-navbar .nav-links { grid-column: 1 / -1; grid-row: 2; gap: 30px; }
  .header-actions { grid-column: 2; grid-row: 1; }
}
@media (max-width: 680px) {
  .store-navbar { align-items: center; }
  .store-navbar .brand { font-size: 16px; letter-spacing: -.5px; }
  .header-actions { gap: 0; }
  .store-navbar .nav-links { justify-content: space-between; width: 100%; gap: 10px; }
  .store-navbar .nav-links > a, .store-navbar .nav-link { font-size: 12px; }
  .catalog-heading { align-items: flex-start; }
  .catalog-tools { gap: 5px; flex-direction: column; align-items: flex-end; }
  .catalog-tools .category-menu summary { padding-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .store-navbar *, .store-navbar *::after { transition: none; }
}


/* Ajustes exclusivos abaixo de 768px. Sticky reserva a própria altura no fluxo. */
@media (width < 768px) {
  .store-navbar.mobile-nav-ready { position: relative; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; min-height: 72px; padding-block: 10px; align-items: center; }
  .store-navbar.mobile-nav-ready .brand { min-width: 0; white-space: normal; }
  .store-navbar.mobile-nav-ready .header-actions { gap: 0; }
  .store-navbar.mobile-nav-ready .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%; max-height: calc(100dvh - var(--header-height) - 16px); overflow-y: auto; padding: 8px 16px; margin: 0; border: 1px solid var(--border); background: #0b0b0b; }
  .store-navbar.mobile-nav-ready.menu-open .nav-links { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .store-navbar.mobile-nav-ready .nav-links > a, .store-navbar.mobile-nav-ready .nav-link { width: 100%; text-align: left; flex-shrink: 0; }
  /* Sem padding equivalente ao header: sticky já ocupa esse espaço. */
  #conteudo { padding-top: 18px; }
  #conteudo .store-banner { margin-top: 0; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Formulário de cadastro: estilos restritos à página de registro. */
.register-form { display: grid; gap: 10px; margin-top: 24px; }
.register-form label { margin-top: 6px; }
.register-form input { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--border); border-radius: 3px; background: var(--bg); color: var(--text); }
.register-form input:focus-visible { outline: 2px solid #ba8afa; outline-offset: 2px; }
.register-form small { color: var(--muted); }
.register-form .button { margin-top: 12px; }
.register-form .button:disabled { opacity: .65; cursor: wait; }
.register-form #register-message { margin: 6px 0 0; padding: 12px; border: 1px solid currentColor; border-radius: 3px; overflow-wrap: anywhere; }
.register-form #register-message[data-type="error"] { color: #ffaaaa; }
.register-form #register-message[data-type="success"] { color: #c9a5fa; }

.placeholder-panel .auth-message { padding: 12px; border: 1px solid currentColor; border-radius: 3px; color: #ffaaaa; overflow-wrap: anywhere; }
#user-details { overflow-wrap: anywhere; }
#logout-button:disabled { opacity: .65; cursor: wait; }
