/* =========================================================
   GLOBAL.CSS — Design tokens + reset + componentes base
   Usado por: index.html, carrinho.html, checkout.html, jogo.html
   ========================================================= */

:root {
  /* Cores — tema claro com topbar/footer azul PlayStation */
  --bg-base: #ffffff;
  --bg-elevated: #f4f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f7f9fd;
  --blue-ps: #0070d1;
  --blue-ps-bright: #2196f3;
  --white: #ffffff;
  --text-main: #14213a;
  --grey-text: #5b6680;
  --grey-line: #e3e7f0;
  --success: #2ecc71;
  --danger: #ff5c5c;
  --shadow-card: 0 2px 10px rgba(20, 33, 58, 0.07);
  --shadow-card-hover: 0 6px 18px rgba(20, 33, 58, 0.12);

  /* Tipografia */
  --font-display: "Rajdhani", sans-serif;
  --font-body: "Inter", sans-serif;

  /* Layout */
  --max-width: 1280px;
  --radius: 10px;
  --radius-sm: 6px;
  --header-height: 72px;

  /* Transições */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

/* Foco visível para acessibilidade de teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--blue-ps-bright);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Respeita preferência de redução de movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   HEADER
   ========================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--blue-ps);
  border-bottom: 1px solid var(--blue-ps);
  color: var(--white);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.logo__bars {
  display: flex;
  gap: 3px;
}

.logo__bars span {
  width: 4px;
  height: 18px;
  background: var(--white);
  border-radius: 2px;
}

.logo__bars span:nth-child(2) { height: 24px; }
.logo__bars span:nth-child(3) { height: 14px; }

.search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 10px 16px 10px 40px;
  color: var(--white);
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.search input:focus {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s var(--ease);
}

.cart-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.cart-btn__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--white);
  color: var(--blue-ps);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 10px;
}

/* =========================================================
   BOTÕES
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}

.btn-primary {
  background: var(--blue-ps-bright);
  color: var(--white);
}

.btn-primary:hover {
  background: #3aa3ff;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--grey-line);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* =========================================================
   FOOTER
   ========================================================= */

.footer {
  background: var(--blue-ps);
  color: var(--white);
  margin-top: 80px;
  padding: 32px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
}

.footer__badges {
  display: flex;
  gap: 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
}

/* =========================================================
   UTILITÁRIOS
   ========================================================= */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Cartão base com leve sombra — usar em game-card, itens de carrinho etc. */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s var(--ease), transform 0.15s var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .search { display: none; }
}