body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #0f172a;
  color: #fff;
}

header {
  padding: 18px 20px;
  background: #020617;
}

.header-content {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1;
}

.brand-logo {
  width: min(100%, 320px);
  max-height: 150px;
  height: auto;
  object-fit: contain;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

#userStatus {
  color: #cbd5e1;
  font-weight: 600;
}

.search-controls,
.filter-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 15px 20px 0;
}

.auth-panel,
.cart-panel {
  max-width: 980px;
  margin: 14px auto 0;
  padding: 18px 20px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 14px;
}

.auth-panel-header,
.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.auth-panel-header h2,
.cart-panel-header h2 {
  margin: 0;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.auth-tab {
  background: #1e293b;
  color: #cbd5e1;
}

.auth-tab.active {
  background: #38bdf8;
  color: #020617;
}

.auth-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.auth-message {
  margin: 12px 0 0;
  color: #cbd5e1;
}

.auth-message.error {
  color: #fca5a5;
}

input {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #38bdf8;
  background: #020617;
  color: white;
  min-width: 220px;
}

button,
.btn-link {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: #38bdf8;
  color: black;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn-link:hover {
  opacity: 0.88;
  transform: scale(1.03);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#loginBtn {
  background: #f59e0b;
  color: #111827;
}

#loginBtn:hover {
  background: #fbbf24;
}

.btn-comprar,
.btn-link {
  background: #22c55e;
  color: white;
}

.btn-remover {
  background: #ef4444;
  color: white;
}

.btn-secundario {
  background: #475569;
  color: white;
}

.btn-qty {
  min-width: 34px;
  padding: 8px 10px;
  background: #334155;
  color: white;
}

.cart {
  display: block;
  width: calc(100% - 40px);
  max-width: 980px;
  margin: 14px auto 0;
  text-align: center;
  padding: 12px;
  background: #1e293b;
  color: white;
}

.cart:hover {
  background: #334155;
}

.hidden {
  display: none;
}

ul {
  list-style: none;
  padding: 20px;
  max-width: 980px;
  margin: auto;
}

li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #1e293b;
  margin-bottom: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  transition: 0.2s;
  border: 1px solid #334155;
}

li:hover {
  background: #334155;
  transform: translateY(-2px);
}

li img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  background: #0b1120;
}

li h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 22px;
}

.info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.detalhes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.descricao {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
  line-height: 1.5;
}

.lado-direito {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 160px;
}

.preco {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: #38bdf8;
}

#status {
  text-align: center;
  color: #cbd5e1;
}

mark {
  background: yellow;
  color: black;
}

#cartItems,
.checkout-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  max-width: none;
}

.cart-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
}

.cart-item:hover,
.checkout-list li:hover {
  transform: none;
}

.cart-item-info,
.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item p {
  margin: 4px 0 0;
  color: #cbd5e1;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-value {
  min-width: 24px;
  text-align: center;
  font-weight: bold;
}

.cart-item-subtotal {
  margin: 0;
  font-weight: bold;
  color: #f8fafc;
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

#cartTotal {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
  color: #f8fafc;
}

#cartEmpty {
  color: #cbd5e1;
  margin-top: 16px;
}

.disabled-link {
  pointer-events: none;
  opacity: 0.5;
}

.checkout-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.checkout-back {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.checkout-card {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 20px;
}

.checkout-card h2 {
  margin-top: 0;
}

.checkout-form {
  display: grid;
  gap: 12px;
}

.checkout-form button {
  justify-self: start;
}

.checkout-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
  padding: 14px 16px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 10px;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  color: #cbd5e1;
}

.checkout-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-weight: bold;
  color: #f8fafc;
  padding-top: 16px;
  border-top: 1px solid #334155;
}

.checkout-note {
  color: #cbd5e1;
}

.checkout-item-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.checkout-qty {
  color: #cbd5e1;
  font-size: 14px;
}

.invoice-card {
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0b1220;
}

.invoice-card h3 {
  margin-top: 0;
}

.invoice-card p {
  margin: 8px 0;
  color: #cbd5e1;
}

.history-card {
  margin-top: 20px;
}

.success-message {
  color: #86efac;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .header-content {
    flex-direction: column;
    align-items: center;
  }

  .brand-logo {
    width: min(100%, 220px);
  }

  .top-bar {
    justify-content: center;
    flex-wrap: wrap;
  }

  .search-controls,
  .filter-controls,
  .auth-form,
  .auth-panel-header,
  .cart-panel-header,
  .cart-panel-actions,
  .cart-item,
  .cart-footer,
  .checkout-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-controls,
  .checkout-item-meta {
    align-items: flex-start;
    justify-content: flex-start;
  }

  li {
    flex-direction: column;
    align-items: stretch;
  }

  li img {
    width: 100%;
    height: auto;
  }

  .lado-direito {
    align-items: flex-start;
  }

  input {
    width: min(100%, 320px);
  }

  .cart {
    width: calc(100% - 24px);
  }
}
