:root {
  --primary-color: #e47911;
  --secondary-color: #232f3e;
  --bg-color: #f3f3f3;
  --discount-red: #cc0c39;
  --button-amazon: #ffd814;
  --border-radius: 4px;
  --text-main: #111;
  --text-muted: #555;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-color);
  margin: 0;
  color: var(--text-main);
}

a,
a:visited,
a:hover,
a:active {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* HEADER */
header {
  background: var(--secondary-color);
  color: #fff;
  padding: 12px 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

header h1 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  margin: 0;
  color: #fff;
  text-decoration: none;
  line-height: 1.1;
}

header h1 img {
  height: 40px;
  width: 40px;
  margin-right: 12px;
  object-fit: contain;
}

.logo-link {
  display: block;
  color: #fff !important;
  text-decoration: none !important;
}

/* SEARCH / LANG / ACTIONS */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  flex-wrap: nowrap;
}

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

.search-container input {
  padding: 10px 12px;
  border-radius: var(--border-radius);
  border: none;
  width: 100%;
  font-size: 1rem;
  outline: none;
}

.lang-switcher {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lang-btn {
  background: #37475a;
  color: #fff;
  border: 1px solid #777;
  padding: 7px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.lang-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #000;
}

.top-actions {
  display: flex;
  width: 100%;
  gap: 5px;
}

.action-box {
  flex: 1;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  border-radius: var(--border-radius);
}

/* MENUS FLUTUANTES */
.filter-menu {
  display: none;
  background: #fff;
  border: 1px solid #ccc;
  width: 95%;
  max-width: 600px;
  margin: 0 auto;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 101;
  max-height: 75vh;
  overflow: hidden;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  border-radius: var(--border-radius);
  top: 130px;
}

.filter-menu.active {
  display: flex;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  padding: 15px;
  border-bottom: 2px solid var(--secondary-color);
}

.menu-body {
  overflow-y: auto;
  padding: 10px;
  flex: 1;
}

.menu-footer {
  padding: 10px;
  border-top: 1px solid #eee;
  background: #fff;
}

.btn-apply {
  width: 100%;
  background: var(--secondary-color);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--border-radius);
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
}

.filter-option {
  padding: 12px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.filter-option label {
  cursor: pointer;
  flex: 1;
}

/* LISTA DE PRODUTOS */
.product-list {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  overflow: hidden;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  padding: 10px 10px 2px;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.card-row {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.image-wrapper {
  width: 90px;
  flex: 0 0 90px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  align-self: flex-start;
}

.image-wrapper img {
  max-width: 90px;
  max-height: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0;
}

.content * {
  margin-bottom: 0;
}

/* LINHA BADGE + RATING */
.rating-badge-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
  min-width: 0;
}

.rating {
  margin-left: auto;
  font-weight: bold;
  color: #555;
  font-size: 0.8rem;
  white-space: nowrap;
}

.badge-special {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-weight: bold;
  font-size: 0.75rem;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-amazon-choice {
  background: #000;
  color: #fff;
}

.badge-best-seller {
  background: #ff8c00;
  color: #fff;
}

.product-title,
h1#product-title,
.similar-grid .product-title,
.card .product-title,
h2.product-title,
h3 {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.35 !important;
}

.product-title {
  font-size: 0.95rem;
  margin: 0 0 6px 0;
  -webkit-line-clamp: 2;
  font-weight: normal;
}

.product-title a {
  text-decoration: none;
  color: var(--text-main);
}

.price-action {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.price-info {
  font-size: 1rem;
  color: var(--discount-red);
  font-weight: bold;
  min-width: 0;
  text-align: left;
}

.current-price {
  font-size: 1rem;
  color: var(--discount-red);
  font-weight: bold;
  line-height: 1.2;
}

.old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.badge {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--discount-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 2px;
}

.amazon-badge {
  background: #ff9900;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
  font-weight: 600;
}

.btn {
  background: var(--button-amazon);
  text-decoration: none;
  color: #000 !important;
  padding: 10px 14px;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: bold;
  border: 1px solid #a88734;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  flex-shrink: 0;
  line-height: 1.2;
}

/* PAGINAÇÃO */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px 0;
  flex-wrap: wrap;
  padding: 0 10px;
}

.page-btn {
  display: inline-block;
  min-width: 38px;
  text-align: center;
  padding: 10px 14px;
  background: #1a1a1a;
  color: #fff !important;
  border-radius: 6px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  border: 1px solid #333;
  transition: all 0.2s ease;
}

.page-btn:hover,
.page-btn.active {
  background: #ff9900;
  color: #000 !important;
  border-color: #ff9900;
}

.dots {
  color: #999;
  padding: 0 5px;
}

/* FOOTER */
footer {
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 25px;
  text-align: center;
  margin-top: 30px;
}

.footer-note {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}

/* DESKTOP */
@media (min-width: 768px) {
  .card {
    height: 100%;
  }

  .card-row {
    align-items: stretch;
  }

  .image-wrapper {
    align-self: flex-start;
  }

  .content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    height: 100%;
  }

  .rating-badge-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    margin-left: auto;
    margin-bottom: 8px;
    flex-wrap: nowrap;
  }

  .product-title {
    max-width: 100%;
    margin-bottom: 10px;
  }

  .price-action {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }

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

  .btn {
    flex-shrink: 0;
    margin-left: auto;
  }
}
/* MOBILE */
@media (max-width: 767px) {
  .header-content {
    max-width: 100%;
    gap: 6px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .product-title {
    font-size: 0.95rem;
  }

  .btn {
    padding: 10px 12px;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .price-action {
    gap: 8px;
  }

  .product-title,
  h1#product-title,
  .similar-grid .product-title {
    font-size: 1.05rem;
    -webkit-line-clamp: 2 !important;
    max-height: 2.8em !important;
  }

  .similar-grid .product-title {
    -webkit-line-clamp: 3 !important;
    max-height: 4.1em !important;
  }

  .similar-grid .current-price {
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .similar-grid .price-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
  }

  .similar-grid .old-price {
    font-size: 0.9rem;
  }

  .similar-grid .card .content {
    width: 100%;
    min-width: 0;
  }

  .similar-grid .price-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
  }

  .similar-grid .price-info {
    flex: 1;
    min-width: 0;
  }

  .similar-grid .current-price {
    font-size: 1.15rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .similar-grid .btn {
    flex-shrink: 0;
    min-width: 130px;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .btn {
    padding: 9px 10px;
    font-size: 0.78rem;
  }
}

h1#product-title {
  font-size: 1.45rem;
  line-height: 1.35;
  -webkit-line-clamp: 4 !important;
  max-height: 5.6em !important;
}

#product-title.expanded {
  -webkit-line-clamp: unset !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
}

.sales-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 18px 0;
}

.sales-row .read-more-btn {
  margin-left: auto;
}

.monthly-sales {
  background: #f0f0f0;
  color: #333;
  font-size: 0.9rem;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

/* PRODUTOS SEMELHANTES */
.similar-grid .current-price {
  font-size: 1.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-grid .price-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.similar-grid .old-price {
  font-size: 0.9rem;
}

.similar-grid .card .content {
  width: 100%;
  min-width: 0;
}

.similar-grid .product-title {
  font-size: 1.05rem;
  -webkit-line-clamp: 3 !important;
  max-height: 4.1em !important;
}

.similar-grid .price-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.similar-grid .price-info {
  flex: 1;
  min-width: 0;
}

.similar-grid .current-price {
  font-size: 1.15rem;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-grid .btn {
  flex-shrink: 0;
  min-width: 130px;
  text-align: center;
}

/* BOTÃO LER MAIS */
.read-more-btn {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.read-more-btn:hover {
  background: #f5f5f5;
}