/* ===================== GERAL ===================== */
body {
  font-family: 'Arial', sans-serif;
  background: #fff;
  margin: 0;
  padding: 0;
  color: #222;
}

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

/* ===================== NAVBAR ===================== */

.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 20px; 
    background: rgb(49, 98, 0); 
    color: #fff; 
    position: relative; 
    z-index: 1000;
    flex-wrap: nowrap; /* Garante linha única no desktop */
}

/* Se houver uma container interna em outras páginas, ela não deve interferir */
.navbar-container {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.navbar-logo {
    display: flex;
    align-items: center;
}

.navbar-logo img.logo { 
    width: 50px; 
    height: auto; 
    margin-right: 10px; 
}

.navbar a.site-title { 
    font-size: 20px;
    font-weight: bold;
    color: #fff; 
    text-decoration: none; 
    margin-left: 0; /* Ajuste para não empurrar o texto */
}

/* FORMULÁRIO DE BUSCA - DESKTOP */
.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 480px;   /* 👈 cria espaço visual */
    margin: 0 20px;     /* 👈 afasta do nome */
}


.search-form input[type="text"] {
    flex: 1;
    width: 100%;
    min-width: 200px; 
    padding: 8px;
    box-sizing: border-box;
}

.search-form button {
    padding: 8px 12px;
    margin-left: 5px;
    flex-shrink: 0; 
}

/* BOTÕES DE AÇÃO */
.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.user-actions a {
    background: rgb(47, 94, 0);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
    white-space: nowrap; /* Impede que o texto do botão quebre */
}

.user-actions a:hover {
    background: #0056b3;
}

/* Responsividade Básica para não quebrar em telas menores */
@media (max-width: 900px) {
    .navbar {
        flex-wrap: wrap;
    }
    .search-form {
        order: 3;
        width: 100%;
        margin: 10px 0 0 0;
        max-width: none;
    }
}

/* Carrinho */
.btn-carrinho {
  background: rgb(47, 94, 0);
  color: white;
  padding: 6px 12px;
  border-radius: 5px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.3s;
}

.btn-carrinho:hover {
  background: #0056b3;
}


/* ===================== MOBILE NAVBAR ===================== */
@media (max-width: 768px) {

    .navbar {
        padding: 10px;
    }

    .navbar-container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    /* LINHA SUPERIOR: MENU + LOGO + TÍTULO */
    .navbar-left {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start; /* 👈 tudo à esquerda */
        gap: 10px;
    }

    /* BOTÃO MENU */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: rgba(255,255,255,0.15);
        font-size: 20px;
        cursor: pointer;
        flex-shrink: 0;
    }

    /* LOGO */
    .navbar-logo img.logo {
        width: 40px;
        height: auto;
    }

    /* TÍTULO */
    .navbar a.site-title {
        font-size: 18px;
        font-weight: bold;
        white-space: nowrap;
    }

    /* BUSCA EMBAIXO */
    .search-form {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }

    .search-form input[type="text"] {
        min-width: unset;
        font-size: 16px;
    }

    /* AÇÕES EMBAIXO */
    .user-actions {
        width: 100%;
        order: 3;
        margin-top: 10px;
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .user-actions a {
        flex: 1;
        text-align: center;
        padding: 10px;
        font-size: 14px;
    }
}


/* ======= GRID DE PRODUTOS CONSOLIDADO ======= */
.products-grid,
.produtos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* desktop/tablet: quantas couberem com mínimo de 180px */
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  align-items: start;
}

/* Card padrão */
.product-card,
.produto-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
  min-width: 0; /* ESSENCIAL para permitir encolhimento dentro do grid */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Imagem responsiva */
.product-card img,
.produto-card img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* Título e descrição: evitar que forcem largura */
.product-card .title,
.produto-card .title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* trocar para normal se preferir quebra */
  min-width: 0;
}

.product-card .price,
.produto-card .price {
  font-size: 15px;
  font-weight: 800;
  color: #000;
}

/* ======= REGRAS PARA FORÇAR 3 COLUNAS NO CELULAR ======= */
@media (max-width: 768px) {
  .products-grid,
  .produtos {
    /* Força exatamente 3 colunas no celular conforme pediu */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .product-card img,
  .produto-card img {
    max-height: 110px;
  }

  .product-card .title,
  .produto-card .title {
    font-size: 12px;
    white-space: normal;         /* permitir quebra para melhorar legibilidade */
    display: -webkit-box;
    -webkit-line-clamp: 2;      /* corta em 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Telas muito pequenas (<= 420px) manter 3 colunas, ajustar tamanhos */
@media (max-width: 420px) {
  .products-grid,
  .produtos {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 colunas no iPhone */
    gap: 6px;
    padding: 6px;
  }

  .product-card img,
  .produto-card img {
    max-height: 90px;
  }

  .product-card .title,
  .produto-card .title {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .product-card,
  .produto-card {
    padding: 6px;
  }
}

/* ===================== RESPONSIVIDADE ===================== */
@media (max-width: 1024px) {
  .products-grid,
  .produtos {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* Celulares e tablets */
@media (max-width: 768px) {
  .products-grid,
  .produtos {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 por linha */
    gap: 8px;
    justify-content: center;
    align-items: start;
  }

  .product-card,
  .produto-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 8px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
  }

  .product-card img,
  .produto-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 5px;
  }

  .product-card h3,
  .produto-card h3 {
    font-size: 13px;
  }

  .product-card p,
  .produto-card p {
    font-size: 12px;
  }
}

/* iPhones e telas menores */
@media (max-width: 420px) {
  .products-grid,
  .produtos {
    grid-template-columns: repeat(3, 1fr); /* sempre 3 por linha */
    gap: 5px;
  }

  .product-card img,
  .produto-card img {
    height: 90px;
  }
}

@media (max-width: 768px) {
  .products-grid,
  .produtos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 produtos por linha */
    gap: 10px;
    justify-items: center;
    align-items: start;
  }

  .product-card,
  .produto-card {
    width: 100%;
    max-width: none; /* remove limite que empilhava */
    text-align: center;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    padding: 8px;
  }

  .product-card img,
  .produto-card img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 8px;
  }

  .product-card h3,
  .produto-card h3 {
    font-size: 14px;
  }

  .product-card p,
  .produto-card p {
    font-size: 13px;
  }
}

@media (max-width: 420px) {
  .products-grid,
  .produtos {
    grid-template-columns: repeat(3, 1fr); /* 3 colunas no iPhone e similares */
    gap: 6px;
    padding: 6px;
  }

  .product-card img,
  .produto-card img {
    max-height: 100px; /* ajusta altura da imagem */
  }
}

/* ===================== LOJAS ===================== */
/* ===== LOJAS ATIVAS (CARROSSEL REAL) ===== */
.shops-grid {
  display: flex;
  flex-wrap: nowrap;     /* IMPEDIR QUEBRAR LINHA */
  overflow-x: auto;       /* CARROSSEL */
  gap: 15px;
  padding: 20px 10px;
  scroll-snap-type: x mandatory;
}

.shops-grid::-webkit-scrollbar {
  height: 6px;
}

.shops-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.shop-card {
  flex: 0 0 auto;         /* NUNCA ENCOLHE, NUNCA QUEBRA */
  width: 180px;           /* TAMANHO FIXO */
  scroll-snap-align: start;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding-bottom: 10px;
  transition: transform 0.2s;
}

.shop-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: 8px;
}


.shop-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s;
  width: 180px;
}

.shop-card img {
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  border-bottom: 1px solid #eee;
  border-radius: 6px;
}

.shop-card:hover {
  transform: scale(1.05);
}

/* Mobile - scroll horizontal */
@media (max-width: 768px) {
  .shops-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 0 8px 10px 8px;
  }

  .shop-card {
    flex: 0 0 auto;
    width: 110px;
  }

  .shop-card img {
    max-height: 120px;
  }
}

/* ===== OVERRIDE FINAL: força 3 colunas no mobile + fallback flex ===== */
/* selector bem específico para sobrescrever regras anteriores */
div.products-grid.override,
div.produtos.override {
  box-sizing: border-box;
}

/* GRID default (desktop/tablet) */
div.products-grid.override,
div.produtos.override {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 12px !important;
  padding: 12px !important;
  align-items: start !important;
}

/* CARD */
div.products-grid.override > .product-card,
div.produtos.override > .product-card,
div.products-grid.override > .produto-card,
div.produtos.override > .produto-card {
  min-width: 0 !important;          /* evita forçar largura da coluna */
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
}

/* Conteúdo que pode estourar */
div.products-grid.override .title,
div.produtos.override .title,
div.products-grid.override .price,
div.produtos.override .price {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* ===== FORÇA EXATAMENTE 3 COLUNAS EM TELAS <= 768px ===== */
@media (max-width: 768px) {
  div.products-grid.override,
  div.produtos.override {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; /* exatamente 3 colunas */
    gap: 8px !important;
    padding: 8px !important;
    width: 100% !important;
  }

  /* fallback com flex caso grid esteja desativado: */
  div.products-grid.override.flexfallback,
  div.produtos.override.flexfallback {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    flex-wrap: wrap !important;
  }
  div.products-grid.override.flexfallback > .product-card,
  div.produtos.override.flexfallback > .product-card,
  div.products-grid.override.flexfallback > .produto-card,
  div.produtos.override.flexfallback > .produto-card {
    flex: 0 0 calc(33.333333% - 8px) !important; /* 3 por linha com gap */
    max-width: calc(33.333333% - 8px) !important;
    box-sizing: border-box !important;
  }

  /* ajuste de imagem/título para caber */
  div.products-grid.override .product-card img,
  div.produtos.override .product-card img,
  div.products-grid.override .produto-card img,
  div.produtos.override .produto-card img {
    width: 100% !important;
    height: auto !important;
    max-height: 110px !important;
    object-fit: contain !important;
  }

  div.products-grid.override .title,
  div.produtos.override .title {
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    font-size: 12px !important;
  }
}

/* telas muito pequenas */
@media (max-width: 420px) {
  div.products-grid.override,
  div.produtos.override {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 6px !important;
  }
  div.products-grid.override > .product-card,
  div.produtos.override > .product-card {
    padding: 6px !important;
  }
}



/* Garante grid no container da home e evita conflitos */
.product-gallery .products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 16px !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  align-items: start !important;
}

/* Card: permite encolher sem forçar a largura da coluna */
.product-gallery .product-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Imagem e textos */
.product-gallery .product-card img {
  width: 100% !important;
  height: auto !important;
  max-height: 160px !important;
  object-fit: cover !important;
  display: block !important;
}

.product-gallery .product-name {
  margin: 6px 8px 0 8px !important;
  font-weight: 700 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

/* PRECISE: força EXATAMENTE 3 colunas em telas <= 768px (só na home) */
@media (max-width: 768px) {
  .product-gallery .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important; /* 3 colunas */
    gap: 8px !important;
    padding: 8px !important;
  }

  .product-gallery .product-card {
    /* se houver regras width:100% conflitantes, garante que ocupe apenas uma coluna */
    width: 100% !important;
    padding: 8px !important;
  }

  .product-gallery .product-card img {
    max-height: 110px !important;
  }

  .product-gallery .product-name {
    font-size: 13px !important;
    -webkit-line-clamp: 2 !important;
  }

  .product-gallery .product-price {
    margin: 4px 8px 8px 8px !important;
    font-size: 13px !important;
    color: #c00 !important;
    font-weight: 700 !important;
  }
}

/* Ajuste para telas muito pequenas (<=420px) */
@media (max-width: 420px) {
  .product-gallery .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 6px !important;
  }

  .product-gallery .product-card img {
    max-height: 90px !important;
  }

  .product-gallery .product-name { font-size: 12px !important; }
  .product-gallery .product-price { font-size: 12px !important; }
}

/* ===================== ESTRELAS DE AVALIAÇÃO ===================== */
.product-rating {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 5px;
}

.product-rating .star {
  font-size: 16px;
  color: #ccc; /* cor das estrelas vazias */
}

.product-rating .star.full {
  color: #FFD700; /* cor dourada para estrelas cheias */
}

/* opcional: ligeiro brilho ao passar o mouse */
.product-rating .star:hover {
  transform: scale(1.1);
  transition: 0.2s;
}

/* ===================== ALTURA UNIFORME NOS PRODUTOS (CELULAR) ===================== */
@media (max-width: 768px) {
  .product-gallery .products-grid {
    align-items: stretch !important; /* faz todas as colunas ficarem iguais */
  }

  .product-gallery .product-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    height: 100% !important;
    min-height: 220px !important; /* altura mínima idêntica */
    box-sizing: border-box !important;
  }

  .product-gallery .product-card img {
    flex-shrink: 0 !important;
    max-height: 110px !important;
    object-fit: contain !important;
  }

  .product-gallery .product-name {
    min-height: 35px !important; /* altura fixa do título */
  }

  .product-gallery .product-price {
    margin-top: auto !important; /* empurra preço para baixo */
  }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 420px) {
  .product-gallery .product-card {
    min-height: 200px !important;
  }

  .product-gallery .product-name {
    min-height: 30px !important;
  }

  .product-gallery .product-card img {
    max-height: 95px !important;
  }
}

/* ========== CURSOR NAS CATEGORIAS ========== */
/* ================= CATEGORIAS - FIX DEFINITIVO ================= */

.categorias {
  list-style: none;
  padding: 8px;
  margin: 0;
}

.categorias li {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 6px;

  background: #fff;
  border-radius: 10px;

  font-size: 16px;
  font-weight: 500;

  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* hover desktop */
.categorias li:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: translateX(4px);
}

/* seta da direita */
.categorias .arrow {
  font-size: 18px;
  opacity: 0.6;
  flex-shrink: 0;
}

/* mobile: toque confortável */
@media (max-width: 768px) {
  .categorias li {
    font-size: 17px;
    padding: 16px;
  }
}


/* ================== FOOTER ================== */
.site-footer {
  background: rgb(49, 98, 0);
  color: #eee;
  padding: 36px 20px;
  margin-top: 30px;
  font-size: 0.95rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 220px 220px;
  gap: 24px;
  align-items: start;
}
.footer-about h3, .footer-links h4, .footer-contact h4 {
  color: #f7c600;
  margin-bottom: 8px;
}
.footer-about p.small { color: #ccc; font-size: 0.9rem; margin-top: 12px; }
.footer-links ul { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 8px 0; }
.footer-links a, .footer-contact a, .socials a { color: #eee; text-decoration: none; }
.footer-links a:hover, .footer-contact a:hover, .socials a:hover { color: #f7c600; text-decoration: underline; }

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
}

/* Estilo geral */
.termos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* permite quebrar linha se necessário */
}

/* Ajuste para telas pequenas */
@media (max-width: 480px) {
    .termos {
        flex-direction: row; /* continua em linha */
        align-items: flex-start;
        gap: 5px;
    }
    .termos span, .termos a {
        white-space: normal; /* permite quebrar linha */
        word-break: break-word;
    }
}

.slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.slider-container img {
    display: none;
    width: 100%;
    border-radius: 6px;
    object-fit: contain;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    padding: 10px;
}
.slider-container img.active-slide {
    display: block;
}
.slider-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
.slider-buttons button {
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background-color: #007bff;
    color: white;
    cursor: pointer;
}
.slider-buttons button:hover {
    background-color: #0056b3;
}

/* Divisão entre pedidos */
.pedido-row {
  border-bottom: 2px solid #d9534f; /* vermelho */
  box-shadow: 0 2px 6px rgba(217, 83, 79, 0.3);
}

/* Controles de pedidos */
.pedidos-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pedidos-controls label {
  font-size: 14px;
}
.pedidos-controls select,
.pedidos-controls button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  font-weight: 600;
}
.pedidos-controls span {
  margin-left: auto;
  font-size: 13px;
  color: #555;
}

/* Faz a tabela caber bem no celular com rolagem lateral */
.tabela-pedidos {
  width: 100%;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* Garante que o cabeçalho e as células se ajustem */
.tabela-pedidos table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px; /* evita quebrar o cabeçalho */
}

/* ================== MENU LATERAL ================== */
.side-menu {
  position: fixed;
  top: 0; 
  left: -300px; /* Escondido à esquerda */
  width: 250px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 5px rgba(0,0,0,0.3);
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 1001; /* Fica acima do overlay */
}

/* Classe aplicada via JS para abrir o menu */
.side-menu.open {
  left: 0;
}

/* ================== OVERLAY (Fundo Escuro) ================== */
/* Ajustado para .menu-overlay para bater com o seu HTML */
.menu-overlay {
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000; /* Abaixo do menu, acima do conteúdo */
  
  /* Estado inicial: Invisível */
  opacity: 0;
  visibility: hidden;
  display: none;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Impede cliques quando escondido */
}

/* Classe aplicada via JS para mostrar o fundo escuro */
.menu-overlay.show {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Ativa o clique para fechar o menu */
}

/* ================== SUBMENUS ================== */
.submenu {
  position: fixed; 
  top: 0; 
  left: 100%; /* Começa fora da tela */
  width: 100%; 
  height: 100%; 
  background: #fff; 
  z-index: 1002; /* MAIS ALTO que o side-menu (1001) */
  transition: left 0.3s;
}

/* Classe aplicada via JS ao clicar em uma categoria */
.submenu.open {
  display: block;
}

/* Estilo extra para o botão de fechar dentro do menu */
.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 10px;
}


/* Estrelas bonitas e douradas */
.product-stars i {
    color: #FFD700;
    margin: 0 1px;
    font-size: 16px;
}

/* Nome do produto */
.product-name {
    font-weight: bold;
    margin-top: 8px;
    font-size: 16px;
}

/* Preço vermelho sangue estilo Worten */
.red-price {
    color: #d60000;
    font-weight: bold;
    margin-top: 5px;
    font-size: 17px;
}

/* ======================= */
/*       LOJAS ATIVAS      */
/* ======================= */

.shops-grid {
    display: grid;
    justify-content: center;          /* Mantém tudo juntinho no PC e mobile */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-width: 700px;                 /* ← impede que o grid fique largo demais no PC */
    margin: 0 auto;                   /* centra o grid */
}

.shop-card {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    width: 150px;                     /* largura fixa, igual em todas as telas */
    height: auto;
    margin: 0 auto;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.shop-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
}

/* Texto */
.shop-card p {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: center;
}


/* ===================== FOOTER MOBILE FIX ===================== */
@media (max-width: 768px) {
  .site-footer {
    text-align: left !important;
  }

  .footer-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important; /* tudo encostado à esquerda */
    gap: 25px;
    padding: 0 20px;
  }

  .footer-about,
  .footer-links,
  .footer-contact {
    width: 100% !important;
    text-align: left !important;
  }

  .footer-links ul {
    padding-left: 0;
    list-style: none;
  }

  .footer-links li {
    margin-bottom: 8px;
  }

  .footer-contact a,
  .footer-links a {
    text-align: left !important;
    display: inline-block;
  }
}

/* Wrapper que permite scroll horizontal */
.table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

/* A tabela nunca será comprimida além disso */
table {
    min-width: 650px;
}

/* Ajuste REAL para mobile */
@media (max-width: 768px) {

    .detail-image img {
        width: 100% !important;
        max-width: 90vw !important;
        height: auto !important;
        padding: 5px;
    }

    .detail-card {
        padding: 0;
    }
}

.shops-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;       /* habilita scroll horizontal */
    white-space: nowrap;    /* força os itens na mesma linha */
    padding-bottom: 10px;
    flex-wrap: nowrap;      /* impede quebra de linha */
    scroll-behavior: smooth;
}

.shop-card {
    flex: 0 0 auto;         /* cada card mantém tamanho fixo e não cresce */
}

.logo {
    width: 50px;        /* ajuste o tamanho conforme desejar */
    height: 50px;       /* deixe igual ao width para manter proporção quadrada */
    border-radius: 50%; /* deixa circular */
    object-fit: cover;  /* garante que a imagem preencha o círculo sem deformar */
}

/* ============================================
   CORREÇÃO FINAL — CARROSSEL DE LOJAS
   ============================================ */

/* Força as lojas a ficarem sempre lado a lado */
.active-shops .shops-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    gap: 20px !important;
    padding: 10px 0 !important;
    scroll-snap-type: x mandatory !important;
}

/* Cada card tem tamanho FIXO: não encolhe nunca */
.active-shops .shop-card {
    flex: 0 0 180px !important;
    width: 180px !important;
    flex-shrink: 0 !important; /* <- AQUI está a magia */
    scroll-snap-align: start;
}

/* Imagem da loja */
.active-shops .shop-card img {
    width: 100% !important;
    height: 140px !important;
    object-fit: cover !important;
    border-radius: 12px;
}

/* Remove qualquer regra antiga que tente encolher */
.active-shops .shops-grid,
.active-shops .shop-card {
    min-width: unset !important;
}

/* ===================== LOJAS - CARROSSEL 100% FIXO ===================== */

.shops-grid {
  display: flex;
  flex-wrap: nowrap;          /* NÃO QUEBRA LINHA */
  overflow-x: auto;           /* SCROLL HORIZONTAL */
  gap: 15px;
  padding: 20px 10px;
  scroll-snap-type: x mandatory;
}

.shops-grid::-webkit-scrollbar {
  height: 6px;
}

.shops-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.shop-card {
  flex: 0 0 180px !important;   /* TAMANHO FIXO — NÃO ENCOLHE */
  width: 180px !important;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  text-align: center;
  padding-bottom: 10px;
  transition: transform 0.2s;
}

.shop-card:hover {
  transform: scale(1.05);
}

/* Imagens padronizadas */
.shop-card img {
  width: 100% !important;
  height: 140px !important;
  object-fit: contain !important;
  border-radius: 8px;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  .shops-grid {
    gap: 10px;
    padding: 10px 8px;
  }

  .shop-card {
    flex: 0 0 120px !important;   /* tamanho menor no mobile */
    width: 120px !important;
  }

  .shop-card img {
    height: 110px !important;
  }
}

/* ================== LOJAS ATIVAS ================== */
.active-shops {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    clear: both;
    position: relative;
    z-index: 1;
}

/* Grid das lojas dentro do carrossel */
.active-shops .shops-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding-bottom: 10px;
    justify-content: flex-start; /* alinha os cards à esquerda */
}

/* Cards individuais das lojas */
.active-shops .shop-card {
    flex: 0 0 auto;
    width: 150px;
    text-align: center;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    padding: 10px;
    box-sizing: border-box;
}

/* Imagem da loja */
.active-shops .shop-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    margin-bottom: 5px;
}

/* Nome da loja */
.active-shops .shop-card p {
    font-size: 14px;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
}

/* ================== RESOLUÇÃO MOBILE ================== */
@media (max-width: 768px) {
    .active-shops .shops-grid {
        gap: 15px;
        padding-bottom: 10px;
    }

    .active-shops .shop-card {
        width: 120px;
    }

    .active-shops .shop-card img {
        height: 80px;
    }
}


/* ================= AUTH PAGES ================= */

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Arial, sans-serif;
}

.auth-container {
    width: 100%;
    padding: 20px;
}

.auth-card {
    max-width: 420px;
    margin: auto;
    background: #ffffff;
    border-radius: 12px;
    padding: 30px 28px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: fadeIn 0.5s ease;
}

.auth-title {
    text-align: center;
    margin-bottom: 10px;
    color: #203a43;
}

.info-text {
    text-align: center;
    font-size: 14px;
    color: #555;
    margin-bottom: 25px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.auth-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 15px;
    transition: border 0.3s, box-shadow 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #2c5364;
    box-shadow: 0 0 0 2px rgba(44,83,100,0.2);
}

.hint {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    display: block;
}

.btn-primary {
    width: 100%;
    background: #2c5364;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
}

.btn-primary:hover {
    background: #203a43;
    transform: translateY(-1px);
}

.success-msg {
    margin-top: 18px;
    padding: 12px;
    background: #e6f7ec;
    color: #1e7f4f;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.error-msg {
    margin-top: 18px;
    padding: 12px;
    background: #fdecea;
    color: #b71c1c;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
}

.auth-footer a {
    color: #2c5364;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.password-strength {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

#strength-bar {
    height: 100%;
    width: 0%;
    background: red;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
}

#strength-text {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: bold;
}

#toast-sucesso, #toast-erro {
    visibility: hidden;
    min-width: 280px;
    color: #fff;
    text-align: center;
    border-radius: 8px; /* Bordas mais suaves */
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    top: -50px; /* Começa mais alto para o bounce ter espaço */
    transform: translateX(-50%);
    opacity: 0;

    /* Shadow leve para efeito de flutuação */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);

    /* Transition: cubic-bezier cria o efeito de 'bounce' no TOP */
    transition: opacity 0.5s ease, top 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

#toast-sucesso { background-color: rgb(255, 137, 19); }
#toast-erro { background-color: #e74c3c; }

.toast-show {
    visibility: visible !important;
    opacity: 1 !important;
    top: 40px !important;
}

/* ================== HOT BANNERS - FIX DEFINITIVO ================== */

/* container do link */
.hot-carousel a.hot-banner {
    all: unset;                /* 🔥 REMOVE TODAS AS HERANÇAS */
    display: block;
    flex: 0 0 auto;
    width: 92vw;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: #ccc;
    scroll-snap-align: center;
}

/* imagem */
.hot-carousel a.hot-banner img {
    all: unset;
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;

    overflow: hidden;   /* ✅ elimina o aviso do Chrome */
}


/* carrossel */
.hot-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.hot-carousel::-webkit-scrollbar {
    display: none;
}

/* desktop */
@media (min-width: 768px) {
    .hot-carousel a.hot-banner {
        width: 260px;
        height: 150px;
    }
}

/* esconder setas no celular */
@media (max-width: 767px) {
    .carousel-btn {
        display: none !important;
    }
}

/* wrapper do carrossel */
.hot-carousel-wrapper {
    position: relative;
}

/* botões */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
}

/* esquerda e direita */
.carousel-btn.left {
    left: -20px;
}

.carousel-btn.right {
    right: -20px;
}

/* ================== SEÇÕES GERAIS ================== */
.section {
    margin: 30px 0;
    padding: 0 15px;
}

.section h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

/* ================== CARROSSEL DE PRODUTOS ================== */
.product-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
}

.product-carousel::-webkit-scrollbar {
    height: 6px;
}

.product-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

/* ================== CARD ================== */
.product-card {
    flex: 0 0 220px; /* controla largura */
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    scroll-snap-align: start;
    position: relative;
    text-align: center;
    transition: transform 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
}

/* ================== IMAGEM ================== */
.product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ================== TEXTO ================== */
.product-card h3 {
    font-size: 0.95rem;
    margin: 5px 0;
}

.price {
    font-weight: bold;
    font-size: 1rem;
    color: rgb(255, 255, 0);
}

.old-price {
    font-size: 0.85rem;
    text-decoration: line-through;
    color: #777;
}

/* ================== BADGES ================== */
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e53935;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 7px;
    border-radius: 6px;
}

/* ================== RANKING ================== */
.rank {
    position: absolute;
    top: 10px;
    right: 10px;
    font-weight: bold;
    padding: 4px 7px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
}

.rank.gold { background: #fbc02d; color: rgb(255, 0, 0); }
.rank.silver { background: #bdbdbd; color: rgb(255, 0, 0); }
.rank.bronze { background: #cd7f32; } 


/* ================== BANNER CAROUSEL ================== */
.banner-carousel {
    width: 100%;
    margin: 20px auto;
}

.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* SLIDE */
.carousel-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
}

/* ================== MOBILE (PERFEITO, NÃO MEXE) ================== */
.banner-imagem {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 14px;
}

/* ================== DESKTOP (NÃO CORTA TEXTO) ================== */
@media (min-width: 1024px) {

    .banner-carousel {
        max-width: 1200px;
    }

    .banner-imagem {
        height: 320px;
        object-fit: contain;      /* 🔥 NÃO CORTA */
        background-color: #000;   /* ou #f5f5f5 se preferir */
    }
}

.slides-wrapper {
    display: flex;
    width: 100%;
    transition: transform 0.5s ease;
     touch-action: pan-x pan-y; /* 🔥 ESSENCIAL pro swipe funcionar */
}


.carousel-container .prev,
.carousel-container .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    font-size: 26px;
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.carousel-container .prev {
    left: 12px;
}

.carousel-container .next {
    right: 12px;
}

@media (max-width: 768px) {
    .carousel-container .prev,
    .carousel-container .next {
        display: none;
    }
}

.banner-imagem {
    pointer-events: none; /* 🔥 deixa o swipe passar */
}

/* ================== INDICADORES (DOTS) ================== */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s;
}

.carousel-dot.active {
    background: #111;
}

/* ================== DRAG EFFECT ================== */
.slides-wrapper.dragging {
    transition: none;
    cursor: grabbing;
}


/* ======================= PRODUTOS COM DESCONTO ======================= */
.product-card.desconto {
    position: relative;
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

.product-card.desconto:hover {
    transform: translateY(-5px);
}

/* Badge de percentual de desconto */
.product-card.desconto .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #e53935; /* vermelho chamativo */
    color: #fff;
    font-size: 0.75em;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 4px;
    z-index: 2;
}

/* Imagem do produto */
.product-card.desconto img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 8px;
}

/* Nome do produto */
.product-card.desconto h3 {
    font-size: 1em;
    margin: 5px 0;
    color: #333;
}

/* Preço antigo riscado */
.product-card.desconto .old-price {
    text-decoration: line-through;
    color: #888888;  /* cinza suave */
    font-size: 0.9em;
    margin: 3px 0;
}

/* Preço com desconto destacado */
.product-card.desconto .price {
    color: #e53935;  /* vermelho chamativo */
    font-weight: bold;
    font-size: 1.1em;
    margin: 0;
}


/* CSS */
.produtos-loja .destaque {
    border: 2px solid #ff9900;
    box-shadow: 0 0 15px #ff9900;
    background-color: #fffbe6;
    animation: destaque 1s ease;
}

@keyframes destaque {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.1); }
}

/* 🔥 Produto destacado ao entrar na loja */
.product-card.destaque {
    border: 3px solid #d00000;
    box-shadow: 0 0 0 rgb(208, 0, 0,0.35);
    animation: destaquePulse 1.2s ease-in-out infinite;
}

/* animação tipo pulse */
@keyframes destaquePulse {
    0% {
        box-shadow: 0 0 0 0 rgb(208, 000, 0);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 18px 8px rgb(0, 255, 0);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(208, 0, 0, 0);
        transform: scale(1);
    }
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(160deg, #f7f7f7, #eaeaea);
  color: #222;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 900px;
  margin: 50px auto;
  background: #fff;
  padding: 32px 40px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

h1 { color: #d32f2f; margin-top: 0; }
h2 { margin-top: 40px; color: #333; border-bottom: 2px solid #eee; padding-bottom: 6px; }
p { line-height: 1.6; }
ul { list-style: none; padding: 0; }
ul li { margin-bottom: 12px; display: flex; gap: 10px; }
ul li i { color: #d32f2f; margin-top: 3px; }

.collapsible-content { display: none; margin-top: 20px; }
.toggle-btn {
  margin-top: 15px;
  background: none;
  border: none;
  color: #d32f2f;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
}
.toggle-btn:hover { text-decoration: underline; }

section { margin-top: 50px; }
.vender-conosco { background: #fafafa; padding: 30px; border-radius: 12px; margin-top: 50px; }
.contact { margin-top: 30px; font-size: 0.95rem; }
footer { margin-top: 50px; font-size: 0.85rem; color: #666; border-top: 1px solid #eee; padding-top: 15px; }

/* Container relativo para posicionamento absoluto da lista */
.search-form {
    position: relative;
}

/* Lista de sugestões */
.autocomplete-list {
    position: absolute;
    top: 100%;               /* logo abaixo do input */
    left: 0;
    width: 100%;
    max-height: 220px;       /* altura máxima da lista */
    overflow-y: auto;
    background: #fff;        /* fundo branco para contraste */
    border: 1px solid rgb(49, 98, 0);
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    z-index: 2000;           /* acima de outros elementos */
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;       /* pequeno espaçamento abaixo do input */
}

/* Item da lista */
.autocomplete-list li {
    padding: 8px 12px;
    cursor: pointer;
    color: #222;             /* cor do texto */
    transition: background 0.2s;
    font-size: 14px;
}

/* Hover do item */
.autocomplete-list li:hover {
    background-color: rgb(49, 98, 0);
    color: #fff;
}

/* Mensagem de “não encontrado” */
.autocomplete-list li.no-result {
    color: #999;
    font-style: italic;
    cursor: default;
    background-color: transparent;
}

/* Centraliza a secção inteira */
.hot-categories {
    max-width: 1200px; /* Largura máxima ideal para PC */
    margin: 40px auto; /* Centraliza horizontalmente e dá espaço em cima/baixo */
    padding: 0 20px;
    text-align: center; /* Centraliza o título H2 */
}

.hot-categories h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

/* Centraliza o Wrapper que contém os botões e o carrosel */
.hot-carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center; /* Centraliza os itens no eixo horizontal */
    gap: 10px;
    position: relative;
}

/* Configuração do Carrosel */
.hot-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto; /* Permite scroll se for maior que a tela */
    scroll-behavior: smooth;
    padding: 10px 0;
    /* Remove a barra de scroll visualmente se quiseres */
    scrollbar-width: none; 
}

.hot-carousel::-webkit-scrollbar {
    display: none; /* Esconde scroll no Chrome/Safari */
}

/* Ajuste dos Banners */
.hot-banner {
    flex: 0 0 auto; /* Impede que os banners encolham */
    width: 280px;   /* Define um tamanho fixo para os banners no PC */
    transition: transform 0.3s;
}

.hot-banner img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hot-banner:hover {
    transform: scale(1.05);
}

/* Botões laterais */
.carousel-btn {
    background: rgba(0,0,0,0.1);
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    transition: 0.3s;
}

.carousel-btn:hover {
    background: #c00;
    color: white;
}

/* No elemento que mostra o e-mail lá no topo */
.nav-user-email {
    display: inline-block;
    max-width: 120px; /* Limita o tamanho visual na barra */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Faz a mágica do "usuario..." */
    vertical-align: middle;
}