:root {
  --asta-blue: #12496b;
  --asta-blue-dark: #0b3550;
  --asta-blue-light: #1c6b98;
  --asta-gold: #d9a627;
  --asta-gold-light: #f0c85a;
  --bg: #f4f7f9;
  --card-bg: #ffffff;
  --text: #1c2b33;
  --text-muted: #5a6b74;
  --stock-green: #2e8b57;
  --order-amber: #c17a1f;
  --border: #dde5ea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: linear-gradient(90deg, var(--asta-blue-dark), var(--asta-blue));
  padding: 10px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo-garpar {
  height: 40px;
  cursor: pointer;
  background: #fff;
  padding: 4px 8px;
  border-radius: 6px;
}

.logo-asta {
  height: 40px;
  cursor: pointer;
  border-radius: 6px;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.3);
}

.topbar-search {
  flex: 1;
  position: relative;
}

#globalSearch {
  width: 100%;
  padding: 10px 14px;
  border-radius: 20px;
  border: none;
  font-size: 14px;
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-height: 420px;
  overflow-y: auto;
  z-index: 60;
}
.search-dropdown.hidden { display: none; }

.search-result-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.search-result-item:hover { background: #f0f5f8; }
.search-result-item .sr-ref { font-weight: 600; font-size: 13px; }
.search-result-item .sr-brand { font-size: 12px; color: var(--text-muted); }

.badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  white-space: nowrap;
}
.badge-stock { background: #e3f5e9; color: var(--stock-green); }
.badge-order { background: #fbeed9; color: var(--order-amber); }

.btn-home {
  background: var(--asta-gold);
  color: var(--asta-blue-dark);
  border: none;
  padding: 9px 18px;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.btn-home:hover { background: var(--asta-gold-light); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  min-height: calc(100vh - 140px);
}

/* Home screen */
.home-banner {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background:
    radial-gradient(circle at 12% 15%, rgba(255,255,255,0.10) 0%, transparent 45%),
    linear-gradient(115deg, var(--asta-blue-dark) 0%, var(--asta-blue) 50%, #1c7ba8 100%);
  border-radius: 28px;
  padding: 0 48px 0 0;
  margin-bottom: 32px;
  box-shadow: 0 18px 44px rgba(11,53,80,0.35);
  position: relative;
  overflow: hidden;
  min-height: 460px;
}
.version-badge {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.home-banner::before {
  /* padrão de pontos subtil para textura profissional */
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.5;
  pointer-events: none;
}
.home-banner::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,166,39,0.35) 0%, rgba(217,166,39,0) 70%);
}
.home-banner-glow2 {
  content: "";
  position: absolute;
  left: 60px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120,200,240,0.18) 0%, rgba(120,200,240,0) 70%);
  pointer-events: none;
}

.home-panda {
  flex: 0 0 400px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  position: relative;
  z-index: 1;
  align-self: flex-end;
}
.home-panda-frame {
  width: 100%;
  height: 460px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.home-panda-frame::before {
  /* holofote dourado atrás do panda */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, rgba(217,166,39,0.10) 45%, transparent 72%);
  z-index: 0;
}
.home-panda-frame img {
  position: relative;
  z-index: 1;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(0,0,0,0.35));
}
.home-panda-placeholder {
  text-align: center;
  color: rgba(255,255,255,0.75);
  padding: 20px;
  font-size: 13px;
  line-height: 1.5;
}
.home-panda-placeholder .icon { font-size: 56px; margin-bottom: 10px; opacity: 0.85; }

.home-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 44px 0;
}
.home-right .eyebrow {
  display: inline-block;
  color: var(--asta-gold-light);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.home-right h1 {
  color: #fff;
  font-size: 29px;
  line-height: 1.25;
  margin: 0 0 8px;
  max-width: 460px;
}
.home-right > p {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  margin: 0 0 26px;
  max-width: 440px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  max-width: 640px;
}

.category-card {
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.18s ease;
  box-shadow: 0 6px 18px rgba(4,20,32,0.22);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.category-card:hover {
  border-color: var(--asta-gold);
  transform: translateX(6px);
  box-shadow: 0 10px 24px rgba(4,20,32,0.3);
}
.category-card .icon-badge {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: linear-gradient(135deg, #eef4f8, #dce9f1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.category-card .icon { display: flex; align-items: center; justify-content: center; }
.category-card .cc-text { flex: 1; min-width: 0; }
.category-card h2 { color: var(--asta-blue-dark); font-size: 15px; margin: 0 0 2px; line-height: 1.2; }
.category-card p { color: var(--text-muted); font-size: 11px; margin: 0; }
.category-card .cc-arrow { color: var(--asta-gold); font-size: 20px; font-weight: 700; }

@media (max-width: 900px) {
  .home-banner { flex-direction: column; align-items: center; padding: 32px 32px 0; min-height: 0; }
  .home-panda { flex-basis: auto; height: 320px; }
  .home-panda-frame { height: 320px; }
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--asta-blue); cursor: pointer; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* Brand grid */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.brand-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.brand-card:hover {
  border-color: var(--asta-gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(18,73,107,0.14);
}
.brand-logo-box {
  height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo {
  max-height: 44px;
  max-width: 100%;
  object-fit: contain;
}
.brand-name-text { margin: 0; font-size: 15px; color: var(--asta-blue-dark); }
.brand-card span { font-size: 11px; color: var(--text-muted); }

/* Reference list */
.ref-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.ref-toolbar input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.ref-count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ref-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: all 0.12s ease;
}
.ref-card:hover {
  border-color: var(--asta-blue-light);
  box-shadow: 0 4px 12px rgba(18,73,107,0.1);
}
.ref-card img, .ref-card .img-placeholder {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
  background: #f0f5f8;
  flex-shrink: 0;
}
.ref-card .img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--asta-blue-light);
}
.ref-card-info { flex: 1; min-width: 0; }
.ref-card-info .rc-ref { font-weight: 700; font-size: 13px; color: var(--asta-blue-dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-card-info .rc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Detail view */
.detail-panel {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  display: flex;
  gap: 28px;
}
.detail-photo {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  border-radius: 12px;
  background: #f0f5f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.detail-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.detail-photo .ph-icon { font-size: 64px; color: var(--asta-blue-light); }

.detail-body { flex: 1; }
.detail-body h2 { color: var(--asta-blue-dark); margin: 0 0 4px; font-size: 20px; }
.detail-body .d-oem { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

.price-box {
  background: #f4f9fc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
}
.price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.price-row .pv-label { color: var(--text-muted); }
.price-row .pv-value { font-weight: 700; color: var(--asta-blue-dark); }
.price-row.highlight .pv-value { color: var(--stock-green); font-size: 16px; }

.order-box {
  background: #fdf6e9;
  border: 1px solid #f0d9a8;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
  color: var(--order-amber);
  font-size: 13px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-top: 14px;
  font-size: 13px;
}
.info-grid .il { color: var(--text-muted); }
.info-grid .iv { font-weight: 600; }
.info-grid .iv.stock-sim { color: var(--stock-green); font-weight: 700; }
.info-grid .iv.stock-nao { color: var(--order-amber); font-weight: 700; }

/* Compatibilidade — bloco em destaque */
.compat-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #eef6fb, #e3f0f8);
  border: 1px solid #cfe3ee;
  border-left: 5px solid var(--asta-blue);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 14px 0;
}
.compat-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(18,73,107,0.12);
}
.compat-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--asta-blue-dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.compat-models {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.construction {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.construction .icon { font-size: 48px; margin-bottom: 12px; }
.construction h2 { color: var(--asta-blue-dark); }

@media (max-width: 700px) {
  .category-grid { grid-template-columns: 1fr; }
  .detail-panel { flex-direction: column; }
  .detail-photo { width: 100%; height: 200px; }
  .topbar-inner { flex-wrap: wrap; }
}
