.showUp {
  z-index: 1000 !important;
}

.product-item {
  height: 100%;
  /*border-style: ridge; descomentar para colocar borda nos produtos*/
}

.image-holder {
  display: flex;
  flex-direction: column;
}

.image-holder > a:first-child {
  height: 260px; /* área só da imagem */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image {
  max-width: 100%;
  max-height: 240px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.product-content {
  min-height: 120px;
  padding-top: 15px;
}

.product-content h5 {
  min-height: 60px;
  line-height: 1.3;
}

.swiper-slide {
  height: auto;
  display: flex;
}

.swiper-slide .product-item {
  width: 100%;
}

/* Submenu para Dropdowns (niveis 2 e 3) */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu > .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: -1px;
  display: none;
}

/* Botao de expandir: so aparece no mobile */
.submenu-seta {
  display: none;
}

/* Desktop: fly-out por hover */
@media (min-width: 992px) {
  .dropdown-submenu:hover > .dropdown-menu {
    display: block;
  }

  /* abre para a esquerda quando estouraria a borda direita (classe via JS) */
  .dropdown-submenu > .dropdown-menu.submenu-esquerda {
    left: auto;
    right: 100%;
  }

  /* painel nivel 3 com rolagem se muito alto */
  .submenu-nivel-3 {
    max-height: min(70vh, 480px);
    overflow-y: auto;
  }
}

/* Ajuste para dispositivos móveis (offcanvas): accordion recolhido */
@media (max-width: 991.98px) {
  .dropdown-submenu > .dropdown-menu {
    position: static;
    display: none;
    border: none;
    box-shadow: none;
    padding-left: 20px;
    margin-left: 10px;
    border-left: 1px solid #dee2e6;
  }

  .dropdown-submenu.submenu-aberto > .dropdown-menu {
    display: block;
  }

  .dropdown-submenu .dropdown-toggle::after {
    display: none;
  }

  .submenu-seta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    background: none;
    border: 0;
    color: inherit;
    flex-shrink: 0;
  }

  .submenu-seta::after {
    content: "";
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    padding: 4px;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }

  .submenu-aberto > .submenu-linha > .submenu-seta::after {
    transform: rotate(-135deg);
  }
}

/* Menu de perfil do usuario logado */
.nav-perfil {
  border: 1px solid #dee2e6;
  border-radius: 50rem;
  padding: 0.35rem 0.9rem 0.35rem 0.45rem;
}

.perfil-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #e9ecef;
  color: #212529;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

/* Badge styles */
.badge {
  display: inline-block;
  padding: 0.5em 0.5em;
  font-size: 75%;
  font-weight: normal;
  line-height: 1;
  text-align: center;
  white-space: normal;
  vertical-align: baseline;
  border-radius: 0.25rem;
  word-wrap: break-word;
}

.badge-primary {
  color: #fff;
  background-color: #007bff;
}

.badge-secondary {
  color: #fff;
  background-color: #6c757d;
}

.badge-success {
  color: #fff;
  background-color: #28a745;
}

.badge-danger {
  color: #fff;
  background-color: #dc3545;
}

.badge-warning {
  color: #212529;
  background-color: #ffc107;
}

.badge-info {
  color: #fff;
  background-color: #17a2b8;
}

.badge-light {
  color: #212529;
  background-color: #f8f9fa;
}

.badge-dark {
  color: #fff;
  background-color: #343a40;
}

.badge-pill {
  border-radius: 10rem;
}

/* Loading overlay para carrinho */
.cart-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.cart-loading-overlay .spinner-border {
  width: 3rem;
  height: 3rem;
  border-width: 0.3em;
}

/* Grade de produtos — cards uniformes */
.produtos-grid .product-item,
.produtos-grid .image-holder,
.produtos-grid .product-content {
  display: flex;
  flex-direction: column;
}

/* Altura padrão da imagem (vale mesmo quando há badge antes do <a>) */
.produtos-grid .image-holder > a {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* desReferencia: exatamente 2 linhas (reserva e limita a altura) */
.produtos-grid .product-content h5 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
  height: 2.6em;
}

/* infoGrade (desGrade): no máximo 2 linhas */
.produtos-grid .product-content small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

/* Botão "Ver produto" sempre alinhado ao rodapé do card */
.produtos-grid .product-content .btn {
  margin-top: auto;
}

/* Setas do carrossel de fotos dos cards de produto */
.card-foto-nav {
  position: absolute;
  top: 130px; /* metade da área fixa de 260px da imagem */
  transform: translateY(-50%);
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  opacity: 0.65;
  transition: opacity 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
  cursor: pointer;
}

.card-foto-nav:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.95);
  color: #212529;
}

.card-foto-prev {
  left: 8px;
}

.card-foto-next {
  right: 8px;
}

.card-foto-nav svg {
  width: 16px;
  height: 16px;
}

/* Spinner de carregamento da foto do card */
.card-foto-spinner {
  position: absolute;
  top: 130px; /* centro da área fixa de 260px da imagem, igual às setas */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2; /* abaixo das setas (z-index 3), acima da imagem */
  display: none;
  align-items: center;
  justify-content: center;
  color: #6c757d;
}

/* Fade na troca de foto (mesmo padrão de detalhes.php) */
.product-image {
  transition: opacity 0.15s ease;
}

/* Nos cards com hover-zoom (index), a transition de style.css só declara transform
   e anularia o fade — redeclara as duas propriedades juntas */
.image-zoom-effect .product-image {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.15s ease;
}

@media (max-width: 575.98px) {
  .card-foto-nav {
    width: 26px;
    height: 26px;
  }

  .card-foto-nav svg {
    width: 14px;
    height: 14px;
  }
}
