:root {
  --orange: #ee4d2d;
  --orange-dark: #d73211;
  --orange-light: #fff0ed;
  --yellow: #ffd424;
  --text: #222;
  --text-muted: #757575;
  --border: #e8e8e8;
  --bg: #f5f5f5;
  --green: #26aa99;
  --radius: 3px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- topo mini ---------- */
.topbar {
  background: var(--orange-dark);
  color: #fff;
  font-size: 12px;
}
.topbar .container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  height: 30px;
  align-items: center;
}
.topbar span { opacity: .9; }

/* ---------- header principal ---------- */
.header {
  background: linear-gradient(180deg, var(--orange), var(--orange-dark));
  padding: 14px 0 40px;
}
.header .container {
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  font-style: italic;
  letter-spacing: -1px;
  white-space: nowrap;
}
.logo small {
  display: block;
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  opacity: .85;
}
.search-wrap { flex: 1; }
.search-box {
  display: flex;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  border: 2px solid var(--yellow);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 9px 14px;
  font-size: 14px;
}
.search-box button {
  background: var(--orange);
  color: #fff;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 500;
}
.search-box button:hover { background: var(--orange-dark); }
.search-tags {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 11px;
  color: #fff;
  opacity: .85;
  flex-wrap: wrap;
}
.header-icons {
  display: flex;
  gap: 22px;
  color: #fff;
  align-items: center;
}
.header-icons .icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  gap: 2px;
  position: relative;
}
.header-icons svg { width: 24px; height: 24px; }
.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--yellow);
  color: #7a4a00;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- categorias ---------- */
.category-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  margin-top: -28px;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  z-index: 2;
}
.category-bar .container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-top: 6px;
  padding-bottom: 6px;
}
.category-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 20px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text);
  transition: background .15s;
}
.category-chip svg { width: 18px; height: 18px; color: var(--orange); }
.category-chip:hover, .category-chip.active {
  background: var(--orange-light);
  color: var(--orange-dark);
  font-weight: 600;
}

/* ---------- banner ---------- */
.banner {
  margin: 16px 0;
  background: linear-gradient(120deg, #ff7337, var(--orange) 60%, var(--orange-dark));
  border-radius: var(--radius);
  padding: 28px 32px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.banner h1 { margin: 0 0 6px; font-size: 26px; }
.banner p { margin: 0; opacity: .9; font-size: 14px; max-width: 480px; }
.banner .badge {
  background: var(--yellow);
  color: #7a4a00;
  font-weight: 800;
  font-size: 22px;
  padding: 14px 20px;
  border-radius: var(--radius);
  text-align: center;
  line-height: 1.1;
}
.banner .badge small { display: block; font-size: 11px; font-weight: 600; }

/* ---------- secao ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 12px;
}
.section-title h2 {
  font-size: 16px;
  letter-spacing: .5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0;
  border-bottom: 2px solid var(--orange);
  padding-bottom: 8px;
}
.section-title .clear-filter {
  font-size: 13px;
  color: var(--orange-dark);
  font-weight: 600;
}

/* ---------- grid de produtos ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  transition: box-shadow .15s, transform .1s, border-color .15s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  transform: translateY(-2px);
  border-color: var(--border);
}
.product-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  background: #f2f2f2;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.discount-flag {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 0 0 0 4px;
}
.product-info { padding: 8px 10px 10px; flex: 1; display: flex; flex-direction: column; }
.product-name {
  font-size: 13px;
  line-height: 1.3;
  height: 34px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.price-row {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.price-now { color: var(--orange); font-weight: 700; font-size: 16px; }
.price-old { color: var(--text-muted); font-size: 11px; text-decoration: line-through; }
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}
.stars { color: var(--yellow); font-size: 11px; letter-spacing: 1px; }
.free-ship {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- pagina de produto ---------- */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  padding: 12px 0;
}
.breadcrumb a:hover { color: var(--orange-dark); }
.product-detail {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
}
.gallery-main {
  aspect-ratio: 1/1;
  background: #f2f2f2;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  cursor: pointer;
}
.gallery-thumbs img.active { border-color: var(--orange); }

.detail-title { font-size: 20px; font-weight: 500; margin: 0 0 10px; }
.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.detail-rating-row .rating-num { color: var(--orange-dark); border-bottom: 1px solid var(--orange-dark); padding-bottom: 2px; }
.detail-price-box {
  background: #fafafa;
  padding: 16px 20px;
  margin: 16px 0;
  border-radius: var(--radius);
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.detail-price-box .price-now { font-size: 28px; }
.detail-price-box .discount-pill {
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
}
.detail-row {
  display: flex;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid #f4f4f4;
}
.detail-row .label { width: 110px; color: var(--text-muted); flex-shrink: 0; }
.buy-actions { margin-top: 22px; display: flex; gap: 12px; }
.btn-buy {
  background: var(--orange);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 40px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-buy:hover { background: var(--orange-dark); }
.btn-buy[disabled], .btn-buy.disabled {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-buy svg { width: 18px; height: 18px; }
.affiliate-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
}

.detail-tabs {
  background: #fff;
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
}
.tab-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.tab-btn {
  background: none;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--orange-dark); border-color: var(--orange-dark); }
.tab-content { padding: 24px; line-height: 1.7; font-size: 14px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr { border-bottom: 1px solid #f4f4f4; }
.spec-table td { padding: 10px 0; font-size: 13px; }
.spec-table td:first-child { color: var(--text-muted); width: 200px; }

.rating-summary { display: flex; gap: 40px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.rating-score { text-align: center; }
.rating-score .num { font-size: 34px; color: var(--orange); font-weight: 700; }
.rating-bars { flex: 1; max-width: 320px; }
.rating-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.rating-bar-track { flex: 1; height: 6px; background: #eee; border-radius: 4px; overflow: hidden; }
.rating-bar-fill { height: 100%; background: var(--orange); }

/* ---------- footer ---------- */
.footer {
  margin-top: 40px;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 30px 0 16px;
  color: var(--text-muted);
  font-size: 12px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.footer h4 { color: var(--text); font-size: 13px; margin: 0 0 10px; }
.footer li { margin-bottom: 6px; }
.footer li a:hover { color: var(--orange-dark); }
.footer-disclaimer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.6;
}

/* ---------- utilidades ---------- */
.empty-state { text-align: center; padding: 60px 0; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--orange-dark); margin-bottom: 12px; font-weight: 600; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 12px 22px;
  border-radius: 4px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
  z-index: 100;
}
.toast.show { opacity: 1; }

@media (max-width: 860px) {
  .product-detail { grid-template-columns: 1fr; }
  .header .container { flex-wrap: wrap; }
  .header-icons { display: none; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
