/* Variáveis de cores */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --dark-color: #1f2937;
  --light-color: #f9fafb;
}

/* Reset e Estilos Globais */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
} 

html {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  margin: 0;
  padding: 0;
  background: #fefefe;
  padding-top: 60px;
  /* padding-bottom: 120px;  */
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Navbar Moderna Inspirada iFood */
.navbar-custom {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 1000;
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: 100%;
  margin: 0 auto;
}

.navbar-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.navbar-logo img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-icon-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  font-size: 18px;
  z-index: 2;
}

.nav-icon-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.nav-icon-btn:active {
  transform: scale(0.95);
}

.navbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 2;
  margin-left: auto;
}

.pwa-instalar-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color, #6366f1);
  white-space: nowrap;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ea1d2c;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.store-card{
  /* height: 100px; */
  margin-top: 30px;
}

.store-info {
  padding: 16px 20px 12px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.store-name {
  font-size: 0.8em;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #2e2e2e;
}

.store-details {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #717171;
  flex-wrap: wrap;
}

.store-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.store-rating i {
  color: #ffa500;
  font-size: 14px;
}

.badge-super {
  background: #ea1d2c;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.store-delivery {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.store-delivery i {
  color: #28a745;
}

/* Barra de Busca */
.search-bar {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: #fff;
  border-top: 1px solid #f0f0f0;
}

.search-bar.active {
  max-height: 80px;
  padding: 12px 16px;
}

.search-input-container {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 8px;
  padding: 10px 12px;
  gap: 8px;
}

.search-icon {
  color: #717171;
  font-size: 16px;
}

#search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  color: #2e2e2e;
}

#search-input::placeholder {
  color: #999;
}

.search-close {
  background: none;
  border: none;
  color: #717171;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.search-close:hover {
  color: #2e2e2e;
}

.search-close i {
  font-size: 16px;
}

header {
  background: pink;
  padding: 1rem;
  text-align: center;
}

#filtro-subcategoria {
  background-color: #f8f9fa;
  border-bottom: 1px solid #ddd;
  padding-top: 10px;
  padding-bottom: 10px;
}

#botoes-subcategorias button.active {
  background-color: #198754;
  color: white;
}

#produtos-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  justify-content: start;
  gap: 1rem;
  padding: 1rem;
}

#produtos-container .produtos-vazio {
  grid-column: 1 / -1;
}

#produtos-container .produto {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.2rem;
  text-align: left;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 335px;
  cursor: pointer;
  overflow: visible;
  position: relative;
}

#produtos-container .produto .produto-rodape {
  margin-top: auto;
  display: flex;
  flex-direction: column;
}

#produtos-container .produto .btn-favorito {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

#produtos-container .produto .btn-favorito i {
  color: #e11d48;
}

#produtos-container .produto img {
  object-fit: cover;
  aspect-ratio: 4/3;
  height: 180px;
  width: 100%;
  border-radius: 6px;
  background: #f6f6f6;
  flex-shrink: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  transform-origin: center center;
}

#produtos-container .produto.produto-imagem-ativa img {
  transform: scale(1.2);
}

/* Destaques (estilo stories) */
.destaques-container {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px;
  scroll-snap-type: x mandatory;
}

.destaque-item {
  width: 64px;
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}

.destaque-item img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}

.destaque-item.destaque-favoritos img {
  border-color: #e11d48;
}

.destaque-item span {
  display: block;
  font-size: 0.65rem;
  margin-top: 4px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.produto-destaque-target {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Overlay para ampliar imagem do produto */
.produto-imagem-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.produto-imagem-overlay.ativo {
  opacity: 1;
  pointer-events: auto;
}

.produto-imagem-overlay img {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.produto-imagem-overlay .fechar-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}

/* Stories por categoria */
.stories-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.stories-overlay.ativo {
  opacity: 1;
  pointer-events: auto;
}

.stories-content {
  max-width: 92vw;
  max-height: 80vh;
  text-align: center;
  position: relative;
}

.stories-image-wrap {
  position: relative;
  display: inline-block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.stories-image-wrap img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.stories-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
}

.stories-progress-fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

.stories-progress-fill.ativo {
  animation: stories-progress-fill linear forwards;
}

.stories-progress-fill.pausado {
  animation-play-state: paused;
}

@keyframes stories-progress-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.stories-content img {
  max-width: 92vw;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.stories-caption {
  color: #fff;
  margin-top: 10px;
  font-size: 0.95rem;
}

.stories-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 3;
}

.stories-nav.prev {
  left: 16px;
}

.stories-nav.next {
  right: 16px;
}

.stories-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 24px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
}
 
#produtos-container .produto h5 {
  margin-top: 0.5rem;
  /* min-height: 3rem; */
  display: flex;
  align-items: center;
  justify-content: center;
}

#produtos-container .produto p {
  min-height: 3rem;
  margin-bottom: 0.5rem;
  flex-grow: 1;
  font-size: 0.8rem;
}

#produtos-container .descricao-produto,
#produtos-container .descricao-produto-grupo {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

#produtos-container .descricao-lista {
  margin: 0;
  padding-left: 1.1rem;
}

#produtos-container .descricao-lista li {
  margin-bottom: 0.1rem;
}

#produtos-container .produto strong {
  display: block;
  margin-bottom: 0.5rem;
  text-align: center;
}

#produtos-container .produto button {
  margin-top: auto !important;
}

.estoque{
  font-size: 0.6rem;
  padding: 0 !important;
  margin: 0 !important;
}

.campos-custom-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
  margin: 6px 0 2px;
  padding: 0 4px;
}

.campo-custom-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0f0f0;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.72rem;
}

.campo-custom-nome {
  color: #999;
  text-transform: capitalize;
}

.campo-custom-valor {
  color: #333;
  font-weight: 600;
}

#modalQuantidade .modal-content{
  z-index: 1100;
}

/* admin */

.admin-container {
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-produto {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-produto input,
.form-produto textarea {
  padding: 0.8rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.form-produto button {
  background: #ff69b4;
  border: none;
  padding: 0.8rem;
  color: white;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
}

.form-produto button:hover {
  background: #e7579f;
}

header h1 {
  margin: 0.5rem 0;
}

header a {
  display: block;
  text-align: center;
  color: #333;
  margin-bottom: 1rem;
  text-decoration: none;
}

#badge-carrinho {
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
}

.flying-img {
  transition: all 0.7s ease-in-out;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

footer a:hover {
  color: #f8d7da;
  text-decoration: none;
}

#info-subcategoria-container {
  position: sticky;
  top: 56px; /* altura da navbar */
  z-index: 999;
}

.main-content {
  flex: 1 0 auto;
  padding-bottom: 2rem;
  /* z-index: 100; */
  background-color: whitesmoke;
}

footer.footer {
  flex-shrink: 0;
  margin-top: auto;
  /* background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); */
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

footer.footer h5,
footer.footer h6 {
  letter-spacing: 0.5px;
}

footer.footer .text-white-50 {
  opacity: 0.85;
}

footer.footer #redes-sociais div a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.7rem;
  text-align: center;
}

footer.footer #redes-sociais div a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Gradiente para Hero Section */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Navbar */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95) !important;
  /* height: 140px; */
}

/* Cards de Produtos */
.card {
  transition: all 0.3s ease;
  border-radius: 12px !important;
  overflow: hidden;
}

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

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

/* Botões */
.btn {
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-outline-primary {
  border-width: 2px;
}

/* Dropdown do Carrinho */
.dropdown-menu {
  border-radius: 12px !important;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Botões de Categoria */
#botoes-subcategorias {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.5rem 0.75rem;
  max-width: 100vw;
  width: 100%;
}

#botoes-subcategorias .btn {
  border-radius: 10px;
  padding: 0.2rem 1rem;
  font-size: 0.9rem;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  white-space: nowrap;
  flex-shrink: 0;
  text-transform: uppercase;
}

#botoes-subcategorias .btn.active,
#botoes-subcategorias .btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Modal */
.modal-content {
  border-radius: 16px !important;
}

/* Botão Voltar ao Topo */
#btn-topo {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .display-6 {
    font-size: 1.5rem;
  }
  
  #nomeLoja {
    font-size: 14px !important;
  }
}

/* Loading Animation */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Footer Minimalista */
.footer {
  margin-top: auto;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  position: sticky;
  bottom: 0;
  z-index: 999;
}

.footer .btn-light {
  border-radius: 12px;
  font-size: 1.1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.footer .btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.footer .badge {
  font-weight: 600;
  border-radius: 8px;
}

.credito-dc a {
  transition: color 0.25s ease, opacity 0.25s ease;
}

.credito-dc a:hover {
  color: #fff !important;
  opacity: 1;
}

.btn-finalizar {
  border-radius: 12px;
  font-size: 1.1rem;
  background: #F58E2D;
  color: #fff;
  border: var(--primary-color, #198754) 1px solid;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.btn-finalizar:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  color: #fff;
}

.hero {
  position: relative;
  height: 63vh;
}

.hero--sem-foto {
  height: auto;
  padding: 10px;
}

.hero--sem-foto .hero-img {
  display: none;
}

.hero--sem-foto .store-card {
  position: static;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-card {
  position: absolute;
  bottom: 1px;
  left: 3px;
  right: 3px;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.store-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-top: -40px;
  background: #fff;
  padding: 4px;
}

.store-name {
  margin-top: 8px;
  font-weight: 700;
}

.store-sub {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
}

.store-meta {
  font-size: 14px;
  margin-bottom: 4px;
}
.store-meta div {
  font-size: 10px;
}

.store-endereco {
  display: block;
  font-size: 13px;
  color: #6c757d;
  margin-top: 4px;
}

.store-meta .badge {
  background: #ff0000;
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.store-delivery {
  font-size: 14px;
}

.aberto-fechado{
  border-radius: 8px;
  margin-top: -35px;
  margin-left: auto;
  width: fit-content;
  max-width: 100%;
  text-align: right;
  font-size: 0.6em;
}

@media (max-width: 480px) {
  .aberto-fechado {
    margin-top: 4px;
    margin-left: 0;
  }
}

/* Toast fix: garante visibilidade acima de outros elementos */
.toast {
  z-index: 99999 !important;
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-width: 220px;
  position: fixed;
  top: 20px;
  margin-left: 30%;
}

.toast .toast-body {
  color: #fff;
}

/* Variações de produto */
.variacoes-tamanhos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.btn-variacao-tamanho {
  min-width: 42px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #198754;
  border-radius: 8px;
  background: #fff;
  color: #198754;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-variacao-tamanho.active {
  background: #198754;
  color: #fff !important;
}

.btn-variacao-tamanho.indisponivel {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.variacoes-cores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 4px;
}

.btn-variacao-cor {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #ccc;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-variacao-cor.active {
  box-shadow: 0 0 0 2px #333;
  transform: scale(1.25);
}

.btn-variacao-cor:hover {
  transform: scale(1.15);
}

.img-produto-grupo {
  transition: opacity 0.15s ease;
}

.seletores-grupo {
  margin-top: 4px;
}

.indisponivel {
  display: none !important;
} 