/* ==========================================================================
   PROMOCAO.CLICK - Header Preto, Corpo Branco Clean, Rodapé Preto
   Cores: Preto (#0F1117), Branco (#FFFFFF), Amarelo Ouro (#F5C400)
   Tipografia: Inter (Corpo) e Montserrat (Marca e Botões)
   ========================================================================== */

:root {
  /* Fundo e Estrutura */
  --bg-header: #0f1117;
  --bg-header-surface: #1a1d26;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-footer: #0b0d13;
  --bg-footer-surface: #141822;

  /* Bordas */
  --border-light: #e2e8f0;
  --border-card: #e5e7eb;
  --border-dark: #222734;

  /* Amarelo Oficial (#F5C400) */
  --color-yellow: #f5c400;
  --color-yellow-hover: #dcaa00;
  --color-yellow-dark: #b88a00;
  --color-yellow-light: #fffbeb;
  --color-yellow-border: #fde68a;

  /* Tipografia para o Corpo Claro */
  --text-heading: #0f172a;
  --text-product: #b88a00;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  /* Tipografia para Header e Rodapé Escuros */
  --text-on-dark: #ffffff;
  --text-on-dark-muted: #94a3b8;
  --text-dark: #000000;

  /* Indicadores */
  --trend-down: #10b981;
  --trend-down-bg: #ecfdf5;
  --trend-up: #ef4444;

  /* Fontes */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-btn: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.06), 0 1px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

main.container {
  flex: 1;
}

/* ==========================================================================
   Header (Fundo Preto) e Logomarca PROMOCAO.CLICK
   ========================================================================== */
.navbar {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-dark);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-bottom: 14px;
}

.brand-container {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  cursor: pointer;
}

.brand-text-wrapper {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-main-title {
  font-family: var(--font-btn);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.2px;
  display: inline-flex;
  align-items: center;
}

.brand-white {
  color: #ffffff;
}

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

.brand-subline {
  font-family: var(--font-btn);
  font-size: 8.5px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 3.3px;
  margin-top: 4px;
  display: block;
  width: 100%;
  transition: color 0.2s;
}

.brand-container:hover .brand-subline {
  color: var(--color-yellow);
}

.search-box {
  flex: 1;
  max-width: 440px;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-header-surface);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  color: var(--text-on-dark);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.search-input:focus {
  border-color: var(--color-yellow);
  background: #11141d;
}

.search-input::placeholder {
  color: var(--text-on-dark-muted);
}

/* Menu de Categorias no Header */
.categories-nav {
  border-top: 1px solid var(--border-dark);
  background-color: rgba(11, 13, 19, 0.95);
  padding: 6px 0;
}

.categories-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories-inner::-webkit-scrollbar {
  display: none;
}

.category-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-btn);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.category-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.category-btn.active {
  background-color: var(--color-yellow);
  color: var(--text-dark);
  border-color: var(--color-yellow);
  box-shadow: 0 1px 4px rgba(245, 196, 0, 0.3);
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-body);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--color-yellow-dark);
}

/* ==========================================================================
   Catálogo de Produtos (Corpo Branco)
   ========================================================================== */
.catalog-section {
  padding: 32px 0 60px;
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text-heading);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 4px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
}

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

.product-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
}

.product-card-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.product-card-brand {
  font-size: 11px;
  font-family: var(--font-btn);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-yellow-dark);
  letter-spacing: 0.8px;
  transition: color 0.2s;
}

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

.product-card-offers {
  font-size: 11px;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.product-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 16px;
  color: var(--text-heading);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.product-card:hover .product-card-title {
  color: var(--color-yellow-dark);
}

.product-card-pricing {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.price-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.price-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

.btn-history-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  color: var(--text-body);
  font-family: var(--font-btn);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-history-trigger:hover {
  background: var(--color-yellow-light);
  border-color: var(--color-yellow-border);
  color: #855d00;
  transform: translateY(-1px);
}

.btn-history-trigger svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.product-card-img-wrap {
  width: 100%;
  overflow: hidden;
  cursor: pointer;
}

.product-card-title {
  cursor: pointer;
}

.btn-card-details {
  display: block;
  width: 100%;
  text-align: center;
  background-color: var(--color-yellow);
  color: var(--text-dark);
  border: none;
  outline: none;
  font-family: var(--font-btn);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  margin-top: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(245, 196, 0, 0.3);
}

.btn-card-details:hover {
  background-color: var(--color-yellow-hover);
  color: var(--text-dark);
  text-decoration: none;
}

/* ==========================================================================
   Detalhe do Produto (Novo Layout com Destaque Acima da Dobra)
   ========================================================================== */
.product-detail-view {
  display: none;
  padding-bottom: 60px;
}

.product-detail-view.active {
  display: block;
}

/* Header do Produto com CTA em Destaque */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

.detail-header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  min-width: 320px;
}

.detail-img {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.detail-info {
  flex: 1;
}

.detail-badge-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: #f1f5f9;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.primary {
  background: var(--color-yellow-light);
  color: #855d00;
  border-color: var(--color-yellow-border);
}

.detail-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

/* Bloco de Alta Conversão no Topo (Preço Agora + Ver Oferta) */
.detail-cta-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  background: #fffdf5;
  border: 1.5px solid var(--color-yellow-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  min-width: 260px;
  box-shadow: 0 2px 8px rgba(245, 196, 0, 0.12);
  text-align: right;
}

.detail-price-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.detail-price-val {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-heading);
  letter-spacing: -1px;
  line-height: 1.15;
  margin: 3px 0;
}

.detail-price-store {
  font-size: 12px;
  font-weight: 700;
  color: #855d00;
  margin-bottom: 12px;
}

.btn-ver-oferta {
  display: inline-block;
  background-color: var(--color-yellow);
  color: var(--text-dark);
  font-family: var(--font-btn);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(245, 196, 0, 0.4);
  transition: background-color 0.2s, transform 0.1s;
  text-align: center;
  width: 100%;
}

.btn-ver-oferta:hover {
  background-color: var(--color-yellow-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Grade Intermediária: Ofertas Atuais ao lado das Métricas Históricas
   ========================================================================== */
.product-middle-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: stretch;
}

@media (max-width: 960px) {
  .product-middle-grid {
    grid-template-columns: 1fr;
  }
}

.offers-panel {
  display: flex;
  flex-direction: column;
}

.metrics-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-between;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.metric-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.metric-val {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-heading);
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-heading);
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
}

.offers-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: #f8fafc;
}

.offers-table td {
  padding: 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.store-name-cell {
  font-weight: 700;
  color: var(--text-heading);
}

.store-price-cell {
  font-weight: 800;
  color: var(--text-heading);
}

.store-btn-link {
  display: inline-block;
  background-color: var(--color-yellow);
  color: var(--text-dark);
  border: 1px solid transparent;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-family: var(--font-btn);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background-color 0.2s, transform 0.1s;
  box-shadow: 0 1px 3px rgba(245, 196, 0, 0.3);
}

.store-btn-link:hover {
  background-color: var(--color-yellow-hover);
}

/* ==========================================================================
   Card do Gráfico de Histórico de Preços (Apresentado por Último)
   ========================================================================== */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.chart-title-area h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.4px;
}

.chart-title-area p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chart-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Abas de Período */
.period-tabs {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.period-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 12px;
  font-family: var(--font-btn);
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.period-btn:hover {
  color: var(--text-heading);
}

.period-btn.active {
  background: var(--color-yellow);
  color: var(--text-dark);
  box-shadow: 0 1px 3px rgba(245, 196, 0, 0.3);
}

.store-select {
  background: #ffffff;
  border: 1px solid var(--border-card);
  color: var(--text-heading);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

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

/* ==========================================================================
   Viewport do Gráfico SVG
   ========================================================================== */
.chart-viewport-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: rgba(0, 0, 0, 0.06);
  stroke-dasharray: 4 4;
}

.chart-axis-text {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-family);
  font-weight: 600;
}

.chart-min-ref-line {
  stroke: var(--trend-down);
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
  opacity: 0.85;
}

.chart-min-ref-text {
  fill: #059669;
  font-size: 11px;
  font-weight: 800;
}

.chart-path-line {
  fill: none;
  stroke: #dcaa00;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-path-area {
  fill: url(#chart-gradient);
}

.chart-dot {
  fill: #ffffff;
  stroke: #dcaa00;
  stroke-width: 2.5;
  r: 4;
  transition: r 0.2s, stroke-width 0.2s;
  cursor: pointer;
}

.chart-dot:hover, .chart-dot.active {
  r: 7;
  stroke: var(--text-heading);
  fill: var(--color-yellow);
}

/* Crosshair e Tooltip */
.chart-crosshair {
  stroke: rgba(15, 23, 42, 0.25);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
  display: none;
}

.chart-tooltip {
  position: absolute;
  background: #0f172a;
  border: 1px solid var(--color-yellow);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  z-index: 20;
  display: none;
  transform: translate(-50%, -120%);
  min-width: 150px;
}

.tooltip-date {
  font-size: 11px;
  color: var(--text-on-dark-muted);
  margin-bottom: 3px;
}

.tooltip-price {
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
}

.tooltip-store {
  font-size: 11px;
  color: var(--color-yellow);
  margin-top: 3px;
  font-family: var(--font-btn);
  font-weight: 800;
  text-transform: uppercase;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ==========================================================================
   Rodapé (Fundo Preto)
   ========================================================================== */
.footer {
  background-color: var(--bg-footer);
  border-top: 1px solid var(--border-dark);
  color: var(--text-on-dark-muted);
  padding: 40px 0 30px;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-desc {
  font-size: 13px;
  color: var(--text-on-dark-muted);
  max-width: 400px;
}

.footer-copy {
  font-size: 12px;
  color: #64748b;
}
