:root {
  --bg-primary: #0a0c10;
  --bg-secondary: #121620;
  --bg-card: rgba(22, 28, 41, 0.7);
  --border-card: rgba(255, 255, 255, 0.06);
  --text-primary: #f0f4f9;
  --text-secondary: #90a0b7;
  --accent: #00d2ff;
  --accent-glow: rgba(0, 210, 255, 0.35);
  --green-price: #00e676;
  --card-hover-bg: rgba(30, 39, 58, 0.85);
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 210, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.03) 0%, transparent 40%);
  overflow-x: hidden;
}

header {
  padding: 2.5rem 1rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-card);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, transparent 100%);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent) 0%, #00e676 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #b2d2ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Search Bar Wrapper */
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
}

.search-container {
  display: flex;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: 50px;
  padding: 0.4rem;
  transition: all var(--transition-speed) ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.search-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  padding: 0.8rem 1.5rem;
}

.search-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.search-btn {
  background: linear-gradient(135deg, var(--accent) 0%, #00bcff 100%);
  border: none;
  color: #05070a;
  font-weight: 700;
  font-size: 1rem;
  padding: 0 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--accent-glow);
  filter: brightness(1.1);
}

.search-btn:active {
  transform: translateY(0);
}

/* Store Badges Filter Bar */
.stores-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0.5rem 0;
}

.store-chip {
  background-color: rgba(22, 28, 41, 0.4);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.store-chip.active {
  background-color: rgba(0, 210, 255, 0.1);
  border-color: rgba(0, 210, 255, 0.4);
  color: var(--accent);
}

.store-chip.failed {
  border-color: rgba(244, 67, 54, 0.3);
  color: #ff5252;
  background-color: rgba(244, 67, 54, 0.05);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #00e676;
}

.store-chip.failed .dot {
  background-color: #ff5252;
}

/* Results Section */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.8rem;
}

.results-count {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Product Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #00e676);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-8px) scale(1.01);
  background: var(--card-hover-bg);
  border-color: rgba(0, 210, 255, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.store-tag {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.store-tag.amazon { background-color: #ff9900; color: #000000; }
.store-tag.mercadolivre { background-color: #ffe600; color: #000000; }
.store-tag.magazineluiza { background-color: #0086ff; color: #ffffff; }
.store-tag.shopee { background-color: #ff5722; color: #ffffff; }
.store-tag.kabum { background-color: #fc1303; color: #ffffff; }
.store-tag.terabyteshop { background-color: #f7941e; color: #ffffff; }
.store-tag.pichau { background-color: #000000; color: #ff0000; border: 1px solid #ff0000; }
.store-tag.gigantec { background-color: #0b1a30; color: #ffffff; }
.store-tag.instantgaming { background-color: #e35e00; color: #ffffff; }

.coupon-tag {
  font-size: 0.75rem;
  background-color: rgba(0, 230, 118, 0.15);
  color: var(--green-price);
  border: 1px dashed var(--green-price);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: monospace;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 3.8rem;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price-container {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.price-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-price);
}

.buy-btn {
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.buy-btn:hover {
  background-color: var(--accent);
  color: #000000;
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.4);
}

/* Loading Spinner */
.spinner-container {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 210, 255, 0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  opacity: 0.5;
}

footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-card);
  margin-top: auto;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  h1 { font-size: 1.8rem; }
  .search-container { border-radius: 24px; flex-direction: column; gap: 0.5rem; padding: 0.8rem; }
  .search-btn { width: 100%; justify-content: center; padding: 0.8rem; }
  .results-grid { grid-template-columns: 1fr; }
}
