/* style.css */

/* ==============================
   VARIÁVEIS DE COR
   ============================== */
:root {
  --bg: #0b0b0c;
  --bg-alt: #131313;
  --text: #f5f5f5;
  --text-light: #bbb;
  --accent: #b71c1c;
  --radius: 12px;
  --panel-blur: blur(20px);
  /* Gradientes dos packs */
  --gradient-butterfly: linear-gradient(135deg, #4b0082, #8a2be2);
  --gradient-astronomical: linear-gradient(135deg, #006064, #7b1fa2);
  --gradient-og: linear-gradient(135deg, #004dff, #00cc66);
  --gradient-superhero: linear-gradient(135deg, #ff8c00, #dc143c);
  --gradient-incriveis: linear-gradient(135deg, #e53935, #ffb300);
  --gradient-marvel: linear-gradient(135deg, #c41414, #000000);
  --gradient-inicial: linear-gradient(135deg, #0288d1, #26c6da);
  --gradient-coringa: linear-gradient(135deg, #8e24aa, #43a047);
  --gradient-midnight: linear-gradient(135deg, #3f51b5, #311b92);
}

body.light {
  --bg: #f5f5f5;
  --bg-alt: #ffffff;
  --text: #111;
  --text-light: #555;
}

/* ==============================
   RESET & FONTES
   ============================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Botão genérico */
.btn {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  background: var(--accent);
  color: #fff;
  transition: filter 0.2s ease;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.logout-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
}

/* ==============================
   TOP BAR
   ============================== */
.top-bar {
  background: var(--bg-alt);
  backdrop-filter: var(--panel-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  z-index: 5;
}
.top-bar .logo {
  display: flex;
  align-items: center;
}
.top-bar .logo img {
  width: 40px;
  margin-right: 0.5rem;
}
.top-bar .logo span {
  font-size: 1.25rem;
  font-weight: bold;
}
.top-bar .metrics {
  display: flex;
  gap: 1.5rem;
}
.top-bar .metrics div {
  text-align: center;
}
.top-bar .metrics i {
  display: block;
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  color: var(--accent);
}
.top-bar .metrics div strong {
  display: block;
  font-size: 1.1rem;
}
.top-bar .metrics div span {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ==============================
   MAIN NAV
   ============================== */
.main-nav {
  background: var(--bg-alt);
  backdrop-filter: var(--panel-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  z-index: 4;
}
.main-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
}
.main-nav a.active {
  background: var(--accent);
  color: #fff;
}
.main-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}
.main-nav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.main-nav select {
  padding: 0.3rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--bg-alt);
  color: var(--text);
  cursor: pointer;
}
.main-nav select:hover {
  background: var(--accent);
  color: #fff;
}
.settings-link {
  color: var(--text);
  font-size: 1.2rem;
}
.settings-link:hover {
  color: var(--accent);
}
.main-nav .cart-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  position: absolute;
  top: -5px;
  right: -10px;
}

.cart-link.cart-bounce {
  animation: cart-bounce 0.3s ease;
}

@keyframes cart-bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.fly-image {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  animation: toast-in 0.3s forwards, toast-out 0.3s forwards 2.5s;
  z-index: 9999;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ==============================
   SEARCH
   ============================== */
.search-container {
  max-width: 600px;
  margin: 1rem auto;
  padding: 0 1.5rem;
}
.search-container input {
  width: 100%;
  padding: 0.6rem 2rem 0.6rem 1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
}
.search-container select {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
}

/* ==============================
   GRID DE PRODUTOS
   ============================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  justify-items: center;
}

/* ==============================
   CARD BASE
   ============================== */
.card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  width: 100%;
  max-width: 280px;
}
.card:hover {
  transform: translateY(-5px);
}

/* ==============================
   IMAGEM DO CARD
   ============================== */
.card-image {
  height: 160px;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-alt);
  overflow: hidden;
  border-radius: var(--radius);
}

.card-image img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
  display: block;
  position: relative;
  top: -8px;
  background: var(--bg-alt);
  padding: 0.5rem;
  border-radius: var(--radius);
}

/* ==============================
   CONTEÚDO DO CARD
   ============================== */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}
.card-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.card-content .availability {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.card-content .price {
  margin-top: auto;
  display: flex;
  align-items: center;
  font-size: 1rem;
  font-weight: bold;
}
.card-content .discount-price {
  color: var(--accent);
}
.card-content .original-price {
  margin-left: 0.5rem;
  color: var(--text-light);
  text-decoration: line-through;
  font-weight: normal;
}

/* ==============================
   FOOTER
   ============================== */
.site-footer {
  background: var(
    --bg-alt
  );
  padding: 1rem 1.5rem;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  color: var(--text-light);
  font-size: 0.85rem;
}
.site-footer a {
  color: var(--text-light);
  text-decoration: none;
  margin-left: 1rem;
}

/* ==============================
   PROFILE PAGE
   ============================== */
.profile-container {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.profile-header {
  text-align: center;
  margin-bottom: 2rem;
}
.profile-header img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin-bottom: 0.5rem;
}
.purchase-list table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.purchase-list th,
.purchase-list td {
  padding: 0.5rem;
  border-bottom: 1px solid var(--bg-alt);
  text-align: left;
}
#no-purchases {
  color: var(--text-light);
}

/* ==============================
   HOME PAGE ADJUSTMENTS
   ============================== */
.home-grid .card-image img {
  max-width: 115%;
  max-height: 135%;
}

.home-grid .card-image {
  background: var(--bg-alt);
}

/* ==============================
   PRODUCT PAGE LAYOUT IMPROVEMENTS
   ============================== */
main.product-detail {
  display: grid;
  gap: 2rem;
  padding: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  main.product-detail {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.detail-right .description-box {
  background: var(--bg-alt);
  padding: 1rem;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.detail-right .description {
  margin: 0;
  line-height: 1.4;
}

.detail-right .description ul {
  margin: 0 0 0 1.25rem;
  padding: 0;
  list-style: disc;
}

.detail-right .description li {
  margin-bottom: 0.3rem;
}

