:root {
  --bg-dark: #000000; 
  --bg-panel: #111111;
  --brand-yellow: #ffcb05; 
  --brand-red: #ff1d25;    
  --text-light: #fafafa;
  --text-muted: #a1a1aa;
  --border-color: #333333;
  --wa-color: #25D366;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .display-font {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
}

a { text-decoration: none; color: inherit; }

/* --- Ticker --- */
.ticker-wrap {
  background: var(--brand-yellow);
  color: #000;
  width: 100%;
  overflow: hidden;
  padding: 8px 0;
  border-bottom: 3px solid #000;
}

.ticker {
  display: flex;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  letter-spacing: 1.5px;
}

.ticker-item { margin-right: 40px; }

@keyframes ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* Container Global */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* --- Hero --- */
.hero {
  padding: 60px 0 60px;
  text-align: center;
  background: radial-gradient(circle at top, #1a1a1a 0%, var(--bg-dark) 60%);
}

.logo-container {
  margin-bottom: 24px;
}

.logo-container img {
  max-width: 150px; 
  height: auto;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1;
  margin-bottom: 24px;
  color: var(--text-light);
}

.highlight {
  color: var(--brand-yellow);
  display: block;
}

.hero p {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  font-weight: 600;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s;
  border: none;
  min-width: 220px;
  text-align: center;
}

.btn i {
  font-size: 32px;
}

.btn:hover {
  transform: scale(1.02) translateY(-2px);
}

.btn-primary {
  background: var(--brand-yellow);
  color: #000;
  box-shadow: 4px 4px 0px #000;
  border: 2px solid #000;
}

.btn-primary:hover { filter: brightness(1.1); }

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--text-light);
  background: rgba(255,255,255,0.05);
}

/* --- Dashboard & Busca --- */
.dashboard {
  padding: 46px 0;
  border-top: 2px dashed var(--border-color);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center; 
  margin-bottom: 15px; 
  flex-wrap: wrap;
  gap: 15px;
}

.header-titles {
  flex: 1;
  min-width: 300px; 
}

.header-titles h2 {
  font-size: 32px;
}

.section-disclaimer {
  font-size: 14px;
  color: var(--text-muted);
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  width: 100%; 
  line-height: 1.5;
  margin-bottom: 32px;
}

/* --- Barra de Busca com Botão de Filtro --- */
.search-bar {
  display: flex;
  width: 100%;
  max-width: 500px;
}

.search-bar.full-width {
  max-width: 100%;
}

.search-bar input {
  flex-grow: 1;
  padding: 14px;
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  background: var(--bg-panel);
  border: 2px solid var(--border-color);
  color: var(--text-light);
  border-right: none;
  outline: none;
  min-width: 0;
}

.search-bar input:focus { border-color: var(--brand-yellow); }

.btn-filter {
  background: var(--bg-panel);
  border: 2px solid var(--border-color);
  border-right: none;
  padding: 0 16px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter i {
  color: var(--text-muted);
  transition: color 0.2s;
}

.btn-filter:hover i {
  color: var(--text-light);
}

.btn-search {
  padding: 0 24px;
  background: var(--brand-yellow);
  border: 2px solid var(--brand-yellow);
  color: #000;
  font-family: 'Anton', sans-serif;
  font-size: 18px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-search:hover{
    opacity: 0.9;
}

/* Estado ativo do filtro (ícone laranja) */
.btn-filter.has-filter i {
  color: var(--brand-yellow);
}

/* --- Categorias (Grupos) --- */
#grupos{
  border-top: 0;
  padding-top: 0;
}

.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.group-card {
  background: var(--bg-panel);
  border: 2px dashed var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 0.2s ease;
}

.group-card:hover {
  border-color: var(--brand-yellow);
}

.group-icon {
  font-size: 32px;
  color: var(--brand-yellow);
  margin-bottom: 16px;
}

.group-name {
  font-size: 18px;
  font-family: 'Anton', sans-serif;
  letter-spacing: 1px;
  margin-bottom: 24px;
  line-height: 1.2;
  flex-grow: 1;
}

.group-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.group-actions .btn {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  font-size: 14px;
  flex-direction: row; 
}

.group-actions .btn i {
  font-size: 20px;
}

/* --- Grid de Produtos --- */
.deals-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.product-card {
  background: var(--bg-panel);
  border: 2px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  transition: all 0.2s ease;
  position: relative;
  min-height: 380px; 
}

.product-card:hover {
  border-color: var(--brand-yellow);
  transform: translateY(-4px);
}

.product-image-wrapper {
  width: 100%;
  height: 180px;
  background-color: #ffffff;
  border-bottom: 2px dashed var(--border-color);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain; 
  opacity: 0; 
  transition: opacity 0.3s ease;
  z-index: 1;
}

.loading-spinner {
  position: absolute;
  font-size: 24px;
  color: var(--border-color);
  z-index: 0;
}

.discount-tag {
  position: absolute;
  top: 16px;
  right: -8px;
  background: var(--brand-red);
  color: #fff;
  font-family: 'Anton', sans-serif;
  padding: 4px 10px;
  font-size: 14px;
  border-radius: 2px;
  box-shadow: 2px 2px 0px #000;
  z-index: 2;
}

.product-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.mp-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1f1f22;
  padding: 4px 10px 4px 4px;
  border-radius: 30px;
  font-family: 'Manrope', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-light);
  width: fit-content;
  margin-bottom: 12px;
}

/* --- Ícones personalizados dos Marketplaces (18x18px) --- */
.mp-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.mp-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mp-shopee .mp-icon { background: transparent; }
.mp-ml .mp-icon { background: transparent; }
.mp-amazon .mp-icon { background: #000; color: #FF9900; border: 1px solid #333; font-size: 10px; }

.product-title {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 600; 
  line-height: 1.3;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  margin-top: auto; 
}

.product-pricing {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px; 
}

.price-old {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: line-through;
  font-weight: 600;
}

.price-new {
  font-family: 'Anton', sans-serif;
  font-size: 26px;
  color: var(--brand-yellow);
  line-height: 1;
}

.product-btn {
  width: 100%;
  padding: 12px;
  text-align: center;
  background: #2a2a2a;
  color: var(--text-light);
  font-family: 'Anton', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  transition: background 0.2s, color 0.2s;
  display: block;
}

.product-card:hover .product-btn {
  background: var(--brand-yellow);
  color: #000;
}

/* --- Paginação --- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  background: #1f1f22;
  color: var(--text-light);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  cursor: pointer;
  transition: 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--brand-yellow);
}

.page-btn.active {
  background: var(--brand-yellow);
  color: #000;
  border-color: var(--brand-yellow);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Radar de Cupons --- */

/* --- Filtros Rápidos de Cupons por Tag --- */
.product-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.product-tag-filter {
  background: var(--bg-panel);
  color: var(--text-muted);
  border: 2px solid var(--border-color);
  padding: 8px 16px;
  font-family: 'Anton', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.product-tag-filter:hover {
  border-color: var(--text-light);
  color: var(--text-light);
}

/* Estado Ativo (Tag Selecionada) */
.product-tag-filter.active {
  background: var(--brand-yellow);
  color: #000;
  border-color: var(--brand-yellow);
  box-shadow: 2px 2px 0px #000;
}

/* Listagem de Cupons */
.coupons-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.promo-code-card {
  background: var(--bg-panel);
  border: 2px dashed #3f3f46;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; 
  height: 100%;
  position: relative;
  overflow: visible !important;
}

.promo-code-card:hover {
  border-color: var(--text-light);
  transform: none;
}

.promo-top {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  min-height: 40px;
}

/* Container da fita flutuante visível */
.promo-ribbon-wrapper {
  position: absolute;
  top: 5px;
  left: -10px;
  z-index: 99;
  pointer-events: none;
  filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.6));
}

.promo-ribbon-wrapper::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  border-top: 8px solid #997a00;
  border-left: 8px solid transparent;
}

.promo-ribbon-flag {
  background: var(--brand-yellow);
  color: #000;
  font-family: 'Anton', sans-serif;
  font-size: 20px;
  padding: 6px 28px 6px 14px;
  clip-path: polygon(0 0, 100% 0, 85% 50%, 100% 100%, 0 100%);
  letter-spacing: 1px;
}

.promo-category {
  display: block;
  color: var(--brand-yellow);
  font-size: 16px;
  font-weight: 800;
  margin-top: 8px;
}

.promo-desc.compact {
  margin-bottom: 8px;
}

.promo-footer {
  display: flex;
  flex-direction: column;
}

.promo-action {
  display: flex;
  align-items: center;
  background: #000;
  border: 1px solid #3f3f46;
  border-radius: 4px;
  overflow: hidden;
}

.promo-hash {
  flex-grow: 1;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 800;
  color: var(--brand-yellow);
  padding: 8px;
  letter-spacing: 2px;
}
.promo-hash a{
  color: var(--brand-yellow);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}
.promo-hash a:hover{
  opacity: 0.9;
}

.btn-disblock{
  background: #3f3f46;
  color: #fff;
  border: none;
  padding: 14px 16px;
  font-family: 'Anton', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px; /* Ajusta o tamanho do ícone do FontAwesome */
  padding: 0 16px; /* Reduz o padding lateral já que agora é um ícone */
  height: 48px;    /* Mantém a mesma altura do botão ABRIR */
}

.btn-disblock:hover, .btn-copy:hover {
  background: var(--text-light);
  color: #000;
}

.promo-rules {
  font-size: 12px;
  color: #a5a5b1; 
  line-height: 1.4;
  margin-top: 16px;
  border-top: 1px solid #27272a;
  padding-top: 12px;
  min-height: 36px;
}

.promo-rules.text-only {
  margin-bottom: 16px;
  margin-top: 0;
  padding-top: 0;
  border: none;
  font-size: 13px;
  color: #d4d4d8;
}

.promo-stock {
  font-size: 12px;
  line-height: 1.4;
  margin-top: 16px;
  border-top: 1px solid #27272a;
  padding-top: 12px;
  color: var(--brand-yellow);
  font-weight: 600;
}

/* --- Modais --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-panel);
  border: 2px dashed var(--brand-yellow);
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modal-content h3 {
  color: var(--brand-yellow);
  margin-bottom: 16px;
  font-size: 24px;
}

.modal-content p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 15px;
}

.modal-label {
  display: block;
  text-align: left;
  color: var(--text-muted);
  font-family: 'Anton', sans-serif;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-size: 14px;
}

.category-select {
  width: 100%;
  padding: 12px;
  margin-bottom: 24px;
  background: #1f1f22;
  border: 2px solid var(--border-color);
  color: var(--text-light);
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.category-select:focus {
  border-color: var(--brand-yellow);
}

.modal-ctas {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-ctas .btn {
  flex-direction: row; 
  width: 100%;
  padding: 16px;
  font-size: 18px;
}

.modal-ctas .btn i {
  font-size: 24px;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: var(--text-light);
}

/* --- Tooltip --- */
.tooltip {
  display: none;
  position: absolute;
  bottom: -35px;
  right: 50%;
  transform: translateX(50%);
  background: var(--wa-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  white-space: nowrap;
  z-index: 10;
}

/* --- Footer --- */
footer {
  padding: 40px 0;
  text-align: center;
  border-top: 2px dashed var(--border-color);
  margin-top: 60px;
  background: #050505;
}

.footer-logo {
  max-width: 40px;
  margin-bottom: 16px;
}

footer p {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12.5px; 
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Alerta de Erro do Gerador de Links --- */
.alert-error {
  width: 100%;
  background-color: rgba(255, 29, 37, 0.1);
  border: 2px dashed var(--brand-red);
  color: var(--text-light);
  padding: 12px 16px;
  font-size: 14px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  margin-top: 12px; /* Dá o espaçamento em relação ao campo de cima */
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  text-align: left;
}

.alert-error i {
  color: var(--brand-red);
  font-size: 18px;
  flex-shrink: 0;
}

/* --- Botão Abrir Estilizado (Padrão idêntico ao Copiar com cores do Buscar) --- */
.btn-open-action {
  background-color: var(--brand-yellow); /* Fundo amarelo/laranja do tema */
  color: #000000;                        /* Texto preto em negrito */
  border: none;
  font-family: 'Anton', sans-serif;      /* Mesma fonte estilizada dos botões */
  font-size: 16px;
  letter-spacing: 0.5px;
  padding: 11px 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-open-action:hover {
  opacity: 0.9;
}

.result-actions-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 1024px) {
  .deals-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .dashboard-header { align-items: flex-start; }
  
  /* Container da busca flexível em coluna */
  .search-bar { 
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
    max-width: 100%; 
  }

  /* O input ocupa 100% da largura na primeira linha */
  .search-bar input { 
    flex: 0 0 100%;
    width: 100%;
    border: 2px solid var(--border-color); 
    padding: 14px; 
    border-radius: 0;
    border-right: 2px solid var(--border-color);
  }

  /* Botão de filtro com tamanho fixo na linha de baixo */
  .btn-filter {
    flex: 0 0 50px;
    width: 50px;
    min-width: 50px;
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
  }

  /* O botão de busca usa o calc exato para preencher o resto da linha ao lado do filtro */
  .btn-search { 
    flex: 0 0 calc(100% - 58px); /* 100% menos os 50px do filtro + 8px do gap */
    width: calc(100% - 58px);
    height: 48px;
    padding: 0 16px; 
    border-radius: 0;
    white-space: nowrap; 
    border: 2px solid var(--brand-yellow);
  }

  .deals-grid { grid-template-columns: repeat(2, 1fr); }
  .coupons-list { grid-template-columns: 1fr; }
}

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