:root {
  --primary: #2563eb;
  --secondary: #1e40af;
  --accent: #059669;
  --text: #1f2937;
  --bg: #f9fafb;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  margin: 0;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: #fff;
  padding: 15px 0;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
}

nav a {
  margin-left: 20px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

h1 {
  font-size: 2rem;
  color: #111827;
  margin-bottom: 20px;
}

h2 {
  color: #374151;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

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

.product-card h2 {
  font-size: 1rem;
  margin: 0 0 10px;
  flex-grow: 1;
  line-height: 1.4;
}

.price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
  display: block;
  margin-bottom: 15px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.btn:hover {
  background: var(--secondary);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-success {
  background: var(--accent);
}

.btn-success:hover {
  background: #047857;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.pagination a {
  padding: 10px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}

.pagination a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination a:hover:not(.active) {
  background: #f3f4f6;
}

footer {
  background: #1f2937;
  color: #d1d5db;
  padding: 60px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 10px;
}

.footer-grid a {
  color: #9ca3af;
  text-decoration: none;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}

.badges {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 6px;
  display: inline-block;
}

/* Product Page */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: #fff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  align-items: start;
}

.product-image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.trust-badges {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.trust-badges li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: #4b5563;
  background: #f3f4f6;
  padding: 10px;
  border-radius: 8px;
}

.features {
  margin: 30px 0;
}

.features li {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  gap: 10px;
}

.features li:before {
  content: "✓";
  color: var(--accent);
  font-weight: bold;
}

.category-tag {
  background: #e0e7ff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}

/* Categories Page */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.category-card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  transition: all 0.2s;
}

.category-card:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

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

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

  .header-content {
    flex-direction: column;
    gap: 15px;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  nav a {
    margin: 0;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-card img {
    height: 130px;
  }

  .product-card-content {
    padding: 8px;
  }

  .product-card h2 {
    font-size: 0.78rem;
  }

  .price {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  .btn {
    padding: 7px 8px;
    font-size: 0.78rem;
  }
}

html {
  scroll-behavior: smooth;
}

.section-anchor {
  scroll-margin-top: 80px;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 10px;
}

.category-nav a {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 6px 16px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-nav a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Search Bar ─────────────────────────────────────────── */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin: 0 16px;
}

.search-input-row {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 24px;
  padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-row:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.search-icon {
  color: #9ca3af;
  font-size: 1rem;
  flex-shrink: 0;
  margin-right: 6px;
}

#site-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 0.9rem;
  outline: none;
  color: var(--text);
  min-width: 0;
}

#site-search::placeholder {
  color: #9ca3af;
}

#search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

#search-clear:hover {
  color: #374151;
}

/* Dropdown */
.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.13);
  z-index: 300;
  overflow: hidden;
  max-height: 440px;
  overflow-y: auto;
}

.search-dropdown.open {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.search-item:last-of-type {
  border-bottom: none;
}

.search-item:hover {
  background: #f0f7ff;
}

.search-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid #f3f4f6;
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-title {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-item-title mark {
  background: #fef08a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

.search-item-price {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  margin-top: 2px;
}

.search-no-results {
  padding: 18px;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}

.search-more {
  padding: 10px 14px;
  font-size: 0.8rem;
  color: #6b7280;
  background: #f9fafb;
  text-align: center;
  border-top: 1px solid #f3f4f6;
}

/* Sem resultados na grade */
.search-no-results-grid {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
  font-size: 1rem;
}

/* Mobile: busca full-width abaixo do header */
@media (max-width: 768px) {
  .search-wrapper {
    max-width: 100%;
    margin: 8px 0 0;
    order: 3;
  }

  .header-content {
    flex-wrap: wrap;
  }
}

/* Resultados da busca como grid 2 col no mobile */
@media (max-width: 480px) {
  .search-dropdown {
    border-radius: 10px;
  }

  .search-item img {
    width: 40px;
    height: 40px;
  }

  .search-item-title {
    font-size: 0.78rem;
  }
}