
/* ANIMAÇÃO HAMBURGUER/X GARANTIDA */
.toggle-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}
.toggle-button .hamburger {
  display: inline-block;
  width: 28px;
  height: 28px;
  position: relative;
  transition: 0.25s;
}
.toggle-button .hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: #fff;
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.32s cubic-bezier(.86,0,.07,1);
}
.toggle-button .hamburger span:nth-child(1) { top: 5px; }
.toggle-button .hamburger span:nth-child(2) { top: 12px; }
.toggle-button .hamburger span:nth-child(3) { top: 19px; }
.toggle-button.active .hamburger span:nth-child(1) {
  top: 12px; transform: rotate(45deg);
}
.toggle-button.active .hamburger span:nth-child(2) {
  opacity: 0; left: 25%;
}
.toggle-button.active .hamburger span:nth-child(3) {
  top: 12px; transform: rotate(-45deg);
}


/* ANIMAÇÃO HAMBURGUER/X */
.toggle-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}
.toggle-button .hamburger {
  display: inline-block;
  width: 28px;
  height: 28px;
  position: relative;
  transition: 0.25s;
}
.toggle-button .hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: #fff;
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.32s cubic-bezier(.86,0,.07,1);
}
.toggle-button .hamburger span:nth-child(1) { top: 5px; }
.toggle-button .hamburger span:nth-child(2) { top: 12px; }
.toggle-button .hamburger span:nth-child(3) { top: 19px; }
.toggle-button.active .hamburger span:nth-child(1) {
  top: 12px; transform: rotate(45deg);
}
.toggle-button.active .hamburger span:nth-child(2) {
  opacity: 0; left: 25%;
}
.toggle-button.active .hamburger span:nth-child(3) {
  top: 12px; transform: rotate(-45deg);
}


/* PATCH CRÍTICO: DropDown SEMPRE visível quando ativo */
.toggle-dropdown {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  position: absolute !important;
  left: 0 !important;
  top: 48px !important;
  z-index: 9999 !important;
  background: #1253a4;
  min-width: 180px;
  transition: opacity 0.18s, transform 0.18s !important;
}
.toggle-dropdown.active {
  display: flex !important;
  flex-direction: column;
  opacity: 1 !important;
  pointer-events: all !important;
}

/*
 Theme Name: General Market Complete
 Theme URI: https://viriato.vision
 Author: General Market
 Version: 2.4
 Text Domain: generalmarket
*/

/* ================
   RESET GLOBAL
   ================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
footer { flex-shrink: 0; }

/* ================
   HEADER
   ================ */
.site-header {
  background: #002e6d;
  width: 100%;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
}

/* 1) LOGO */
.site-logo img {
  max-height: 36px;
  width: auto;
  display: block;
}

/* 2) TOGGLE CATEGORIAS */
.toggle-container {
  position: relative;
  flex: 0 0 auto;
}
.toggle-button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0;
}
.toggle-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #00357f;
  padding: 0.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
}
.toggle-dropdown.active {
  display: block;
}
.toggle-dropdown .categorias-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toggle-dropdown .categorias-menu a {
  color: white;
  text-decoration: none;
}

/* 3) MENU PRINCIPAL */
.main-menu {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}
.main-menu-items {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.main-menu-items a {
  color: white;
  text-decoration: none;
  white-space: nowrap;
}

/* 4) PESQUISA */
.header-search {
  flex: 0 0 auto;
}
.search-form {
  display: flex;
  align-items: center;
  height: 36px;
}
.search-field {
  -webkit-appearance: none;
  appearance: none;
  height: 100%;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-radius: 4px 0 0 4px;
  font-size: 14px;
}
.search-submit {
  position: relative;
  height: 100%;
  width: 36px;
  background: #0d6efd;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}
.search-submit::after {
  content: "🔍";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-size: 16px;
  color: white;
}

/* 5) ÍCONES */
.header-icons {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 0 0 auto;
}
.header-icons a {
  position: relative;
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
}
.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e03e2d;
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  padding: 2px 5px;
  line-height: 1;
}

/* ================
   RESPONSIVO
   ================ */
/* Tablet até 1024px: esconde menu principal */
@media screen and (max-width: 1024px) {
  .main-menu { display: none !important; }
  .header-inner {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
    justify-content: flex-start;
  }
  .site-logo img { max-height: 32px; }
  .toggle-button,
  .search-field,
  .search-submit {
    height: 30px;
    font-size: 14px;
  }
  .search-field {
    padding: 0 6px;
  }
}
/* Mobile até 600px */
@media screen and (max-width: 600px) {
  .header-inner {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  .site-logo img { max-height: 28px; }
  .search-field { width: 80px; }
  .search-submit { width: 30px; }
  .header-icons a { font-size: 1.3rem; }
}

/* ================
   CAROUSEL & FOOTER
   ================ */
/* (mantém o teu código original aqui em baixo) */


/* ─── MOBILE: HEADER DISTRIBUÍDO ─── */
@media screen and (max-width: 600px) {
  .header-inner {
    justify-content: space-between !important;
    padding: 0.5rem !important;
  }

  /* logo e toggle mantêm tamanho mínimo */
  .site-logo,
  .toggle-container,
  .header-icons {
    flex: 0 0 auto !important;
  }

  /* faz a search ocupar o resto do espaço */
  .header-search {
    flex: 1 1 auto !important;
    margin: 0 0.5rem !important;
  }

  /* input ocupa todo esse espaço menos o botão */
  .header-search .search-field {
    width: calc(100% - 36px) !important;
  }

  /* botão da lupa colado à direita do input */
  .header-search .search-submit {
    margin-left: -36px !important;
    z-index: 1 !important;
  }
}
@media screen and (max-width: 600px) {
  /* Aumenta o botão de toggle no mobile */
  .toggle-button {
    font-size: 2rem !important;   /* de 1.5rem para 2rem */
    height: 40px !important;      /* de 30px para 40px */
    width: 40px !important;       /* opcional: largura igual à altura */
  }
}
/* ─── REMOVE HORIZONTAL OVERFLOW ─── */
html, body {
  overflow-x: hidden;
}

/* ─── (Opcional) Permite o header quebrar linha em ecrãs muito estreitos ─── */
@media screen and (max-width: 480px) {
  .header-inner {
    flex-wrap: wrap !important;
  }
}

/* ====== MELHORIA VISUAL DO TOGGLE DROPDOWN ====== */
.toggle-dropdown .categorias-menu .dropdown-btn {
  display: block;
  width: 100%;
  background: #1752a4;
  color: #fff;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  transition: 
    background 0.18s, 
    box-shadow 0.18s, 
    transform 0.18s;
  box-shadow: 0 1px 6px rgba(23,82,164,0.08);
  cursor: pointer;
  outline: none;
}

.toggle-dropdown .categorias-menu .dropdown-btn:hover,
.toggle-dropdown .categorias-menu .dropdown-btn:focus {
  background: #2477d6;
  color: #fff;
  box-shadow: 0 3px 12px rgba(23,82,164,0.12);
  transform: scale(1.02);
}

.toggle-dropdown .categorias-menu li {
  width: 100%;
  margin: 0;
}

@media (max-width: 600px) {
  .toggle-dropdown {
    width: 100vw;
    left: 0;
    border-radius: 0 0 16px 16px;
    padding: 12px 0;
  }
  .toggle-dropdown .categorias-menu .dropdown-btn {
    padding: 18px 24px;
    font-size: 1.08rem;
    min-height: 48px;
  }
}

.toggle-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.18s, transform 0.18s;
}
.toggle-dropdown.active {
  display: block;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.toggle-dropdown .categorias-menu .dropdown-btn:active {
  background: #1253a4;
  box-shadow: 0 4px 20px rgba(23,82,164,0.15);
}


/* ========== DROPDOWN CATEGORIAS VISUAL MELHORADO ========== */
.toggle-dropdown .categorias-menu li > a {
  display: block;
  width: 100%;
  background: #1752a4;
  color: #fff;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.18s;
  box-shadow: 0 1px 6px rgba(23,82,164,0.08);
  cursor: pointer;
  outline: none;
}

.toggle-dropdown .categorias-menu li > a:hover,
.toggle-dropdown .categorias-menu li > a:focus {
  background: #2477d6;
  color: #fff;
  box-shadow: 0 3px 12px rgba(23,82,164,0.12);
  transform: scale(1.02);
}

.toggle-dropdown .categorias-menu li {
  width: 100%;
  margin: 0;
}

@media (max-width: 600px) {
  .toggle-dropdown {
    width: 100vw;
    left: 0;
    border-radius: 0 0 16px 16px;
    padding: 12px 0;
  }
  .toggle-dropdown .categorias-menu li > a {
    padding: 18px 24px;
    font-size: 1.08rem;
    min-height: 48px;
  }
}

.toggle-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.18s, transform 0.18s;
}
.toggle-dropdown.active {
  display: block;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.toggle-dropdown .categorias-menu li > a:active {
  background: #1253a4;
  box-shadow: 0 4px 20px rgba(23,82,164,0.15);
}
/* ========== FIM DO PATCH ========== */



/* ========== DROPDOWN CATEGORIAS VISUAL PREMIUM ========== */
.toggle-dropdown {
  padding: 12px 0;
  background: #1253a4;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.16);
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  /* animação */
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.18s, transform 0.18s;
  z-index: 1002;
}
.toggle-dropdown.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
  display: flex;
  animation: dropdownFadeIn 0.22s cubic-bezier(.44,1.56,.57,.93);
}

.categorias-menu {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.categorias-menu li {
  width: 100%;
}

.toggle-dropdown .categorias-menu li > a {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0 22px;
  background: #2477d6;
  color: #fff;
  border-radius: 12px;
  font-size: 1.06rem;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 2px 8px rgba(23,82,164,0.06);
  transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
  cursor: pointer;
  outline: none;
  border: none;
  text-decoration: none;
  gap: 10px;
}

.toggle-dropdown .categorias-menu li > a:hover,
.toggle-dropdown .categorias-menu li > a:focus {
  background: #1752a4;
  color: #fff;
  box-shadow: 0 6px 16px rgba(23,82,164,0.12);
  transform: scale(1.025);
}

/* MOBILE: menu ocupa largura total, padding extra, botões maiores */
@media (max-width: 700px) {
  .toggle-dropdown {
    width: 100vw;
    left: 0 !important;
    border-radius: 0 0 18px 18px;
    min-width: unset;
    max-width: unset;
    padding: 18px 0 22px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    align-items: stretch;
  }
  .categorias-menu {
    padding: 0 10px;
    gap: 16px;
  }
  .toggle-dropdown .categorias-menu li > a {
    min-height: 56px;
    font-size: 1.13rem;
    padding: 0 34px;
    border-radius: 14px;
  }
}

/* Opcional: animação ao abrir */
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-14px);}
  to   { opacity: 1; transform: translateY(0);}
}
/* ========== FIM PREMIUM PATCH ========== */



/* BOTÃO HAMBURGUER ANIMADO PARA X */
.toggle-button .hamburger {
  display: inline-block;
  width: 28px;
  height: 28px;
  position: relative;
  transition: 0.25s;
}
.toggle-button .hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: #fff;
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.32s cubic-bezier(.86,0,.07,1);
}
.toggle-button .hamburger span:nth-child(1) {
  top: 5px;
}
.toggle-button .hamburger span:nth-child(2) {
  top: 12px;
}
.toggle-button .hamburger span:nth-child(3) {
  top: 19px;
}

/* ESTADO ATIVO: vira X */
.toggle-button.active .hamburger span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}
.toggle-button.active .hamburger span:nth-child(2) {
  opacity: 0;
  left: 25%;
}
.toggle-button.active .hamburger span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}



/* BOTÃO HAMBURGUER ANIMADO PARA X */
.toggle-button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
}
.toggle-button .hamburger {
  display: inline-block;
  width: 28px;
  height: 28px;
  position: relative;
  transition: 0.25s;
}
.toggle-button .hamburger span {
  display: block;
  height: 4px;
  width: 100%;
  background: #fff;
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.32s cubic-bezier(.86,0,.07,1);
}
.toggle-button .hamburger span:nth-child(1) {
  top: 5px;
}
.toggle-button .hamburger span:nth-child(2) {
  top: 12px;
}
.toggle-button .hamburger span:nth-child(3) {
  top: 19px;
}
.toggle-button.active .hamburger span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}
.toggle-button.active .hamburger span:nth-child(2) {
  opacity: 0;
  left: 25%;
}
.toggle-button.active .hamburger span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}
