/* =======================================================
   VARIÁVEIS GLOBAIS
   ======================================================= */
:root {
  --pbloja-orange: #ee4d2d;
  --pbloja-orange-dark: #d73211;
  --pbloja-topbar: #b52e13;
  --pbloja-bg: #f5f5f5;
}

body {
  background: var(--pbloja-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =======================================================
   TOPBAR (Acima do Header Principal)
   ======================================================= */
.pbloja-topbar {
  background: var(--pbloja-topbar);
  color: rgba(255, 255, 255, .85);
  font-size: .78rem;
  padding: .35rem 0;
  /* Correção do Dropdown ficar atrás do header */
  position: relative;
  z-index: 1030; 
}

.pbloja-topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem .75rem;
}

.pbloja-topbar-left,
.pbloja-topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
}

.pbloja-topbar a {
  color: rgba(255, 255, 255, .85);
  text-decoration: none;
  transition: color .15s;
}

.pbloja-topbar a:hover {
  color: #fff;
}

.pbloja-topbar .sep {
  opacity: .35;
}

.topbar-label {
  opacity: .75;
}

.topbar-social {
  font-size: .95rem;
  line-height: 1;
  padding: 0 .15rem;
}

.topbar-user {
  color: rgba(255, 255, 255, .9) !important;
  font-size: .78rem;
}

.topbar-user:hover {
  color: #fff !important;
}

/* Correção do Dropdown: texto escuro no fundo branco */
.pbloja-topbar .dropdown-menu {
  z-index: 1031;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border-radius: 6px;
  margin-top: 6px;
}

.pbloja-topbar .dropdown-menu .dropdown-item {
  color: #212529 !important;
  font-weight: 500;
}

.pbloja-topbar .dropdown-menu .dropdown-item:hover,
.pbloja-topbar .dropdown-menu .dropdown-item:focus {
  color: #1e2125 !important;
  background-color: #f8f9fa;
}

/* =======================================================
   HEADER PRINCIPAL (Laranja)
   ======================================================= */
.pbloja-header {
  background: var(--pbloja-orange);
  color: #fff;
}

.pbloja-header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .75rem 0;
}

.pbloja-logo {
  color: #fff;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -.5px;
  text-decoration: none;
  flex-shrink: 0;
}

.pbloja-logo:hover {
  color: #fff;
}

/* Barra de Busca */
.pbloja-search {
  flex: 1 1 auto;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.pbloja-search .form-control {
  border: 0;
  box-shadow: none;
  padding: .55rem .9rem;
}

.pbloja-search .btn {
  background: var(--pbloja-orange-dark);
  color: #fff;
  border-radius: 0;
  padding-inline: 1.1rem;
}

.pbloja-search .btn:hover {
  background: #a22509;
  color: #fff;
}

/* Carrinho */
.pbloja-cart {
  color: #fff;
  font-size: 1.6rem;
  position: relative;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}

.pbloja-cart:hover {
  color: #fff;
}

.pbloja-cart .badge {
  position: absolute;
  top: -6px;
  right: -12px;
  background: #fff;
  color: var(--pbloja-orange);
  border-radius: 10px;
  font-size: .7rem;
  padding: 2px 6px;
  border: 1px solid var(--pbloja-orange);
}

/* =======================================================
   BARRA DE CATEGORIAS (Centralizada)
   ======================================================= */
.pbloja-catbar {
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, .04);
}

.pbloja-catbar-list {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: .55rem 0;
}

.pbloja-catbar-list a {
  color: #444;
  text-decoration: none;
  font-size: .875rem;
  padding: .3rem .6rem;
  border-radius: 4px;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.pbloja-catbar-list a:hover {
  color: var(--pbloja-orange);
  background: rgba(238, 77, 45, .07);
}

.pbloja-catbar-list a.active {
  color: var(--pbloja-orange);
  font-weight: 700;
  border-bottom: 2px solid var(--pbloja-orange);
  border-radius: 0;
  padding-bottom: .15rem;
}

/* =======================================================
   BOTÕES E BANNER
   ======================================================= */
.btn-pbloja {
  background: var(--pbloja-orange);
  color: #fff !important;
  border: none;
}

.btn-pbloja:hover, 
.btn-pbloja:focus {
  background: var(--pbloja-orange-dark);
  color: #fff !important;
}

.pbloja-banner {
  background: linear-gradient(135deg, #ff7a3d, #ee4d2d);
  color: #fff;
  border-radius: 8px;
  padding: 2rem;
}

/* =======================================================
   CARD DE PRODUTO
   ======================================================= */
.pbloja-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* CRÍTICO: Necessário para o selo de desconto não vazar */
  position: relative; 
  border: 1px solid rgba(0,0,0,.04);
}

.pbloja-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

/* Selo de Desconto */
.pbloja-badge-desc {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(255, 212, 36, .95);
  color: var(--pbloja-orange);
  padding: 4px 8px;
  font-size: .75rem;
  font-weight: 700;
  border-bottom-left-radius: 8px;
  z-index: 2;
}

.pbloja-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.pbloja-card-body {
  padding: .8rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
}

.pbloja-card-title {
  color: #333;
  text-decoration: none;
  font-size: .85rem;
  line-height: 1.3;
  min-height: 2.2em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pbloja-card-title:hover {
  color: var(--pbloja-orange);
}

.pbloja-card-vendedor {
  font-size: .72rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.pbloja-card-price {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  flex-wrap: wrap;
}

.pbloja-card-price .price {
  color: var(--pbloja-orange);
  font-weight: 700;
  font-size: 1rem;
}

.pbloja-card-price del {
  color: #999;
  font-size: .75rem;
}

.pbloja-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .72rem;
  color: #888;
  margin-bottom: .5rem;
}

/* Botão dentro do Card */
.pbloja-card .btn-pbloja {
  background: var(--pbloja-orange);
  color: #fff !important;
  border: none;
}

.pbloja-card .btn-pbloja:hover {
  background: var(--pbloja-orange-dark);
}

/* =======================================================
   CONTROLE DE QUANTIDADE (Carrinho e Detalhes)
   ======================================================= */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.qty-stepper .btn-qty {
  background: #f7f7f7;
  border: none;
  width: 32px;
  height: 34px;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
}

.qty-stepper .btn-qty:hover {
  background: #ececec;
}

.qty-stepper .qty-input {
  border: none;
  border-inline: 1px solid #eee;
  text-align: center;
  width: 56px;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.qty-stepper .qty-input:focus {
  box-shadow: none;
}

/* =======================================================
   AVALIAÇÕES (Estrelas Interativas)
   ======================================================= */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 1.8rem;
  color: #ddd;
  cursor: pointer;
  transition: color .15s;
  line-height: 1;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #ffc107;
}

/* =======================================================
   FOOTER
   ======================================================= */
.pbloja-footer {
  background: #fff;
  border-top: 1px solid #eee;
}

/* Ajuste do Carrossel */
.carousel-img {
  height: 200px;
  object-fit: cover;
}

@media (max-width: 770px) {
  .carousel-img {
    height: 200px;
  }
}

.pbloja-logo .logo-img {
    max-height: 50px; /* Ajuste conforme o tamanho da sua imagem */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Seletor de estrelas (interativo) */
.star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
  justify-content: flex-end; /* Alinha as estrelas à esquerda */
}

.star-rating input {
  display: none;
}

.star-rating label {
  font-size: 1.8rem; /* Deixa as estrelas maiores */
  color: #ddd;       /* Cor cinza quando não selecionada */
  cursor: pointer;
  transition: color .15s;
  line-height: 1;
}

/* Efeito de acender as estrelas ao passar o mouse ou clicar */
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #ffc107; /* Cor amarela */
}