/* ===== Util ===== */
[hidden]{ display:none !important; }


/* ===== Header base ===== */
.tnz-header{
  position: sticky;
  top: 0;
  inset-inline: 0;
  z-index: 999;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  font-family: "Inter", Sans-serif;
  font-size: 14px;
  font-weight: 600;
}
.tnz-container{
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ===== Topbar ===== */
.tnz-topbar{
  background:#0f172a;
  color:#e5e7eb;
  font-size:14px;
  line-height:1;
}
.tnz-topbar .tnz-container{ min-height:40px; }
.tnz-topbar-menu{ display:flex; gap:16px; list-style:none; margin:0; padding:0; }
.tnz-topbar-menu a{ color:#e5e7eb; text-decoration:none; opacity:.9; }
.tnz-topbar-menu a:hover{ opacity:1; text-decoration:underline; }
.tnz-topbar-right{ display:flex; align-items:center; gap:12px; margin-left:auto; }
.tnz-cart-link{ display:inline-flex; align-items:center; gap:6px; color:#e5e7eb; text-decoration:none; font-weight:600; }
.tnz-cart-count{
  display:inline-block; min-width:20px; padding:2px 6px; border-radius:999px;
  background:#22c55e; color:#0b1220; text-align:center; font-size:12px;
}

/* ===== Linha Logo + Pesquisa ===== */
.tnz-brand-search{ background:#fed700; border-bottom:none; }
.tnz-brand-search .tnz-container{ min-height:90px; }
.tnz-brand{ flex:0 0 auto; }
.tnz-brand .site-title{ font-weight:800; font-size:24px; color:#0f172a; text-decoration:none; }
.tnz-brand img{ height:60px; width:auto; }

/* Pesquisa arredondada + lupa */
.tnz-search{ flex:1 1 auto; display:flex; justify-content:flex-end; }
form.woocommerce-product-search, form.search-form{
  width:100%; max-width:600px; display:flex; align-items:center; background:#fff;
  border-radius:999px; overflow:hidden;
}
.woocommerce-product-search input[type="search"], .search-form input[type="search"]{
  flex:1 1 auto; border:none; padding:14px 18px; font-size:16px; outline:none; background:transparent;
}
.woocommerce-product-search button, .search-form button, .woocommerce-product-search input[type="submit"]{
  border:none; background:#fff; color:#000; width:48px; height:48px; display:flex;
  align-items:center; justify-content:center; cursor:pointer; border-radius:50%; margin-right:4px;
}
.woocommerce-product-search button svg{ width:20px; height:20px; display:block; }

/* ===== Linha Categorias + Menu ===== */
.tnz-nav-row{ background:#fed700; border-bottom:none; }
.tnz-nav-row .tnz-container{
  min-height:56px; padding-top:8px; padding-bottom:0; align-items:flex-end; gap:20px;
}

/* Botão Produtos */
.tnz-cats-button{
  appearance:none; border:none; background:#fff; color:#000;
  padding:12px 18px; font-weight:600; font-size:15px;
  display:inline-flex; align-items:center; gap:8px; line-height:1; margin:0;
  border-radius:10px 10px 0 0;
}
.tnz-cats-button svg{ width:18px; height:18px; flex-shrink:0; }

/* Botão Menu principal (hamburger) */
.tnz-mainmenu-button{
  appearance:none;
  border:none;
  background:#fff;
  color:#000;
  padding:10px 14px;
  font-weight:600;
  font-size:15px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  line-height:1;
  margin:0;
  border-radius:10px 10px 0 0;
  cursor:pointer;
}
.tnz-mainmenu-icon svg{
  width:20px;
  height:20px;
  display:block;
}
.tnz-mainmenu-label{
  display:inline-block;
}

/* ===== Menu principal ===== */
.tnz-primary-nav{ flex:1 1 auto; }
.tnz-primary-menu{
  display:flex; gap:5px; list-style:none; margin:0; padding:0 0 0px 0;
}
.tnz-primary-menu > li{ position:relative; }
.tnz-primary-menu > li > a{
  display:flex;
  align-items:center;
  padding:10px 15px;
  font-family: "Inter", Sans-serif;
  font-size: 14px;
  font-weight: 600;
  color:#0f172a;
  text-decoration:none;
  line-height:1.2;
  position:relative;
}
.tnz-primary-menu > li > a::before{
  content:'';
  height: 3px;
  width: 0%;
  left: 0;
  background-color: #55595c;
  z-index: 2;
  position: absolute;
  bottom: 0;
  display: inline;
  transtion:all .25s linear;
}
.tnz-primary-menu > li > a::before:hover{
  width: 100%!important;
}

/* ===== Dropdown (submenus) ===== */
.tnz-primary-menu li ul.sub-menu{
  position:absolute; top:100%; left:0; min-width:260px; background:#fff; border-radius:4px;
  box-shadow:0 8px 24px rgba(0,0,0,.18); padding:8px 0; margin-top:0px; list-style:none;
  opacity:0; transform:translateY(8px); pointer-events:none; transition:opacity .15s ease, transform .15s ease;
  z-index:1000;
}
.tnz-primary-menu li:hover > ul.sub-menu{ opacity:1; transform:translateY(0); pointer-events:auto; }
.tnz-primary-menu li ul.sub-menu a{
  display:block; padding:10px 14px; color:#111; text-decoration:none; line-height:1.3; white-space:normal;
}
.tnz-primary-menu li ul.sub-menu a:hover{ background:#f5f5f5; }
.tnz-primary-menu li ul.sub-menu li.menu-item-has-children > ul.sub-menu{ top:0; left:100%; margin-left:8px; }

/* ===== Drawer / Offcanvas de Categorias ===== */
.tnz-overlay{
  position: fixed; inset: 0; background: rgba(0,0,0,.35); backdrop-filter: blur(2px);
  z-index: 10000;
}
.tnz-drawer{
  position: fixed; top: 0; bottom: 0; left: 0;
  width: min(95vw, 1024px);
  background: #ffffff; border-right: 1px solid #e5e7eb;
  transform: translateX(-100%); transition: transform .25s ease;
  display: grid; grid-template-rows: auto 1fr; z-index: 10001;
}
.tnz-drawer.is-open,
.tnz-drawer[aria-hidden="false"]{ transform: translateX(0); }

.tnz-drawer-header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px; border-bottom:1px solid #e5e7eb; background-color:#fed700;
}
.tnz-close{ appearance:none; border:0; background:transparent; font-size:20px; cursor:pointer; }

.tnz-drawer-content{ overflow:auto; padding:0; }
.tnz-drawer-content li{ list-style:none; }

/* Drawer do menu principal (mobile) */
.tnz-mainmenu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 10000;
}
.tnz-mainmenu-drawer{
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(90vw, 320px);
  max-width: 360px;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  z-index: 10001;
}
.tnz-mainmenu-drawer.is-open,
.tnz-mainmenu-drawer[aria-hidden="false"]{
  transform: translateX(0);
}
.tnz-mainmenu-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px;
  border-bottom:1px solid #e5e7eb;
  background-color:#fed700;
}
.tnz-mainmenu-close{
  appearance:none;
  border:0;
  background:transparent;
  font-size:20px;
  cursor:pointer;
}
.tnz-mainmenu-content{
  flex:1 1 auto;
  overflow:auto;
  padding:12px 16px 20px;
}
.tnz-mainmenu-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.tnz-mainmenu-list > li > a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-radius:10px;
  font-weight:600;
  color:#0f172a;
  text-decoration:none;
}
.tnz-mainmenu-list > li > a:hover{
  background:#f3f4f6;
}
.tnz-mainmenu-list li ul.sub-menu{
  list-style:none;
  margin:4px 0 0 10px;
  padding:0;
}
.tnz-mainmenu-list li ul.sub-menu a{
  display:block;
  padding:6px 10px;
  border-radius:8px;
  font-weight:500;
  font-size:13px;
  color:#111827;
  text-decoration:none;
}
.tnz-mainmenu-list li ul.sub-menu a:hover{
  background:#f3f4f6;
}


/* ===== Responsivo base ===== */
@media (max-width:900px){
  .tnz-primary-menu{ display:none; }
  .tnz-primary-nav{ display:none; }
  .tnz-brand-search .tnz-container{ flex-wrap:wrap; row-gap:12px; }
  .tnz-brand{ width:100%; }
  .tnz-search{ width:100%; justify-content:stretch; }
  .tnz-drawer{ width:100vw; left:0; }
  .tnz-mainmenu-button{
    margin-left:auto;
  }
}

/* Desktop: hide mobile main menu UI (hamburger, drawer, overlay) */
@media (min-width: 901px) {
  #tnz-open-mainmenu,
  .tnz-mainmenu-button,
  #tnz-mainmenu-drawer,
  .tnz-mainmenu-drawer,
  #tnz-mainmenu-overlay,
  .tnz-mainmenu-overlay {
    display: none !important;
  }
}

/* ===== Drawer Categorias (3 níveis) ===== */
.tnz-cats-grid{
  display:grid;
  grid-template-columns: 300px minmax(0,1fr);
  gap:0;
  min-height:60vh;
}
.cats-col{
  overflow:auto;
  max-height:calc(100vh - 140px);
  min-width:0;
}

/* -------- Coluna esquerda (Nível 1) — estilo Worten -------- */
.cats-level1{
  background:#fff;
  border-inline-end:1px solid #e5e7eb;
}
.tnz-level1{ list-style:none; margin:0; padding:0; }
.tnz-level1 .lvl1-item{ margin:0; }
.tnz-level1 .lvl1-link{
  display:flex; align-items:center; gap:8px;
  padding:14px 16px;
  text-decoration:none;
  color:#111;
  font-weight:600;
  background:#fff;
  border-bottom:1px solid #eee;
  cursor:pointer;
}
/* hover não muda cor */
.tnz-level1 .lvl1-item:hover .lvl1-link{ background:#fff; }
/* activo = cinzento */
.tnz-level1 .lvl1-item.is-active .lvl1-link{ background:#f5f5f5; color:#111; }
/* chevron */
.tnz-level1 .lvl1-link::after{
  content:""; margin-left:auto; width:16px; height:16px; background:#b3b3b3; opacity:1;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') no-repeat center/contain;
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') no-repeat center/contain;
}
.tnz-level1 .lvl1-item.is-active .lvl1-link::after{ background:#8f8f8f; }

/* -------- Painel da direita (N2 + N3) -------- */
.cats-panel{
  background:#fff;
  padding:18px 22px 24px;
}
.tnz-panel-empty{ color:#64748b; padding:8px 2px; }

/* Cabeçalho do painel */
.panel-head{ padding:6px 2px 14px; position:relative; }
.panel-title{
  margin:0 0 8px 0; font-weight:800; letter-spacing:.2px;
  font-size:clamp(18px,2.2vw,26px); color:#0f172a;
}
.panel-sep{ height:1px; background:#e5e7eb; }

/* Botão Voltar (mobile) */
@media (max-width:900px){
  .panel-head{ padding-left:44px; }
  .panel-head .panel-back{
    position:absolute; left:8px; top:50%; transform:translateY(-50%);
    width:28px; height:28px; border:0; background:transparent; cursor:pointer;
  }
  .panel-head .panel-back::before{
    content:""; display:block; width:20px; height:20px; background:#111827;
    -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M15.5 19l-7-7 7-7"/></svg>') no-repeat center/contain;
    mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M15.5 19l-7-7 7-7"/></svg>') no-repeat center/contain;
  }
}

/* Título do grupo (N2) */
.subgroup{ margin-block:18px 20px; }
.subgroup .subcat-title{
  margin:14px 0 12px 0; font-size:17px; font-weight:700; color:#111827;
}

/* Grelha de “cards” (N3) */
.icon-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(120px, 1fr));
  gap:18px 16px;
  list-style:none; margin:0; padding:0;
}
.cat-card a{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  text-decoration:none; color:#111827;
}
.cat-circle{
  width:108px;height:108px;border-radius:999px;
  background:#fff;box-shadow:inset 0 0 0 1px #e5e7eb;
  background-size:80%;background-repeat:no-repeat!important;background-position:center;
}
.cat-card a:hover .cat-circle{
  background-color:#fff; transform:translateY(-1px);
  box-shadow: inset 0 0 0 1px #d1d5db, 0 6px 20px rgba(2,6,23,.08);
}
.cat-label{
  margin-top:10px; font-size:13px; line-height:1.25; max-width:120px; color:#1f2937;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  text-wrap:pretty;
}

/* ===== Mobile: 2.º painel em slide ===== */
@media (max-width:900px){
  .tnz-cats-grid{ grid-template-columns:1fr; position:relative; }
  .cats-level1{ position:relative; z-index:1; }
  .cats-panel{
    position:absolute; inset:0; background:#fff;
    transform:translateX(100%); transition:transform .25s ease;
    z-index:2; padding:0;
  }
  .tnz-drawer.panel-open .cats-panel{ transform:translateX(0); }
}

/* ===== Opção A (desktop): começa estreito e EXPANDE ao abrir 2.º painel ===== */
@media (min-width:901px){
  .tnz-drawer{
    width:360px; transition:width .28s ease; background:#fff;
  }
  .tnz-cats-grid{ grid-template-columns:300px 0; }
  .tnz-drawer.panel-open{ width:min(95vw, 1024px); }
  .tnz-drawer.panel-open .tnz-cats-grid{ grid-template-columns:300px minmax(0,1fr); }

  .cats-panel{
    opacity:0; transform:translateX(12px);
    transition:opacity .2s ease, transform .28s ease;
  }
  .tnz-drawer.panel-open .cats-panel{
    opacity:1; transform:translateX(0);
  }

  /* L1 ocupa 100% da largura quando o 2.º painel está fechado */
  .tnz-drawer:not(.panel-open) .tnz-cats-grid{ grid-template-columns:1fr 0 !important; }
  .tnz-drawer:not(.panel-open) .cats-level1{ border-inline-end:none !important; }
  .tnz-drawer:not(.panel-open) .tnz-level1 .lvl1-link{ width:100%; padding-right:16px; }
}
/* N2: só título (sem link clicável) e separadores entre grupos */
.subgroup + .subgroup{
  border-top: 1px solid #e5e7eb;
  margin-top: 14px;
  padding-top: 14px;
}

/* Caso ainda venham <a> do template, neutraliza o clique e o visual de link */
.subgroup .subcat-title a{
  pointer-events: none;
  cursor: default;
  color: inherit;
  text-decoration: none;
}

/* Se usarmos <span> em vez de <a>, mantém o mesmo aspecto */
.subgroup .subcat-title .subcat-title-text{
  font: inherit;
  color: inherit;
}


.menu-brand-link{
  background-color: #666!important;
}
.menu-brand-link span{
  color: #fff;
}

/* === Tenazinha header layout adjustments (NON-DESTRUCTIVE PATCH) === */
/* Keep menus intact; only style the brand-search row + account/cart icons */

/* 1) Make cart/account dark on yellow band (original .tnz-cart-link was styled for dark topbar) */
.tnz-brand-search .tnz-cart-link{ color:#0f172a; }
.tnz-account-link{ text-decoration:none; color:#0f172a; display:inline-flex; align-items:center; gap:10px; }
.tnz-account-text{ font-weight:600; line-height:1.1; font-size:13px; white-space:nowrap; }
.tnz-user-cart{ display:flex; align-items:center; gap:18px; white-space:nowrap; }
.tnz-user-menu{ position:relative; display:inline-flex; align-items:center; }
.tnz-user-menu__toggle{
  border:0;
  background:transparent;
  padding:0;
  margin:0;
  cursor:pointer;
  font:inherit;
}
.tnz-user-menu__dropdown{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  min-width:180px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  box-shadow:0 14px 32px rgba(15,23,42,.14);
  z-index:80;
  overflow:hidden;
}
.tnz-user-menu__dropdown a{
  display:block;
  padding:10px 12px;
  font-size:13px;
  font-weight:600;
  color:#0f172a;
  text-decoration:none;
  line-height:1.2;
}
.tnz-user-menu__dropdown a:hover{
  background:#f8fafc;
}

/* User menu: remove any pink/hover background from theme/plugins */
.tnz-user-menu,
.tnz-user-menu__toggle {
  background: transparent !important;
  color: #111 !important;
}

.tnz-user-menu:hover,
.tnz-user-menu__toggle:hover,
.tnz-user-menu__toggle:focus,
.tnz-user-menu__toggle:focus-visible,
.tnz-user-menu__toggle:active {
  background: transparent !important;
  color: #111 !important;
  box-shadow: none !important;
  outline: none !important;
}

.tnz-user-menu svg,
.tnz-user-menu__toggle svg {
  fill: #111 !important;
  stroke: #111 !important;
}

.tnz-user-menu:hover svg,
.tnz-user-menu__toggle:hover svg,
.tnz-user-menu__toggle:focus svg,
.tnz-user-menu__toggle:active svg {
  fill: #111 !important;
  stroke: #111 !important;
}

.tnz-user-menu__toggle {
  cursor: pointer;
}

.tnz-user-menu.active,
.tnz-user-menu__toggle.active,
.tnz-user-menu.current {
  background: transparent !important;
  color: #111 !important;
}

/* 2) Worten-like stroke icons, inherit currentColor */
.tnz-account-icon, .tnz-cart-icon{ display:inline-block; vertical-align:middle; width:28px; height:28px; }

/* 3) Search form width (keeps rounded style from original) */
.tnz-brand-search .tnz-search{ width:100%; display:flex; justify-content:center; }
.tnz-brand-search form.woocommerce-product-search,
.tnz-brand-search form.search-form{ width:100%; max-width:740px; }

/* 4) Desktop/Grid layout: logo left, search centered, user-cart right */
@media (min-width: 840px){
  .tnz-brand-search .tnz-container{
    display:grid;                    /* override original flex for this row only */
    grid-template-columns:auto 1fr auto;
    align-items:center;
    column-gap:24px;
  }
  .tnz-brand{ justify-self:start; }
  .tnz-brand img{ height:60px; width:auto; }
  .tnz-brand-search .tnz-search{ justify-self:center; }
  .tnz-user-cart{ justify-self:end; }
  .tnz-account-link{ max-width:220px; overflow:hidden; text-overflow:ellipsis; }
}

/* 5) Mobile: logo never hides; search on second row full width (Worten-like) */
@media (max-width: 839.98px){
  .tnz-brand-search .tnz-container{
    display:grid;
    grid-template-columns:auto 1fr auto;
    grid-template-rows:auto auto;
    grid-template-areas:
    "brand . usercart"
    "search search search";
    row-gap:12px; column-gap:16px;
  }
  .tnz-brand{ grid-area:brand; display:block; }
  .tnz-user-cart{ grid-area:usercart; justify-self:end; }
  .tnz-brand-search .tnz-search{ grid-area:search; justify-content:stretch; }
  .tnz-brand-search form.woocommerce-product-search,
  .tnz-brand-search form.search-form{ max-width:unset; width:100%; }
}

/* 6) Small tweak: ensure header sits above nav row but under mega menus if any */
.tnz-brand-search{ position:relative; z-index:30; }
.tnz-categories, .tnz-primary-nav, .tnz-primary-menu{ position:relative; z-index:20; }
/* === Logo responsivo (proporções corretas em mobile e tablet) === */
/* Usa altura automática e limita a altura com clamp; mantém largura proporcional */
.tnz-brand img,
.tnz-brand .custom-logo,
.site-logo img{
  height:auto !important;
  width:auto !important;
  max-height:clamp(40px, 8vw, 60px) !important; /* 40px em telemóvel, até 60px no desktop */
  max-width: 100% !important;
  display:block;
}

/* Se o header ficar muito compacto em ecrãs muito pequenos, baixa um pouco a altura */
@media (max-width: 360px){
  .tnz-brand img,
  .tnz-brand .custom-logo,
  .site-logo img{
    max-height: 36px !important;
  }
}

/* === Bloco de Suporte (header) === */
.tnz-support{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:#000;                 /* sobre fundo #fed700 fica perfeito */
  line-height:1.1;
}
.tnz-support-icon svg{
  display:block;
}
.tnz-support-text{
  display:flex;
  flex-direction:column;
}
.tnz-support-title{
  font-size:14px;
  font-weight:700;            /* deixa o "Suporte" a bold como no exemplo */
}
.tnz-support-sub{
  font-size:11.5px;
  opacity:.8;
}

/* hover discreto */
.tnz-support:hover{ opacity:.9; }

/* N2 sem subcategorias: mini-cards de produtos */
.tnz-menu-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  padding: 0;
}

.tnz-menu-product {
  display: block;
  text-decoration: none;
  color: #111;
  font-size: 12px;
  padding: 0;
}

.tnz-menu-product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  display: block;
}

.tnz-menu-product span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}



/* responsivo: em ecrãs pequenos mostra só o título (ou até só o ícone) */
@media (max-width: 640px){
  .tnz-support-text{ display:none!important;}
  .tnz-support-sub{ display:none!important; }
  .tnz-support-title{ font-size:13px; }
  .tnz-brand-search .tnz-container {padding-top: 5px!important; }
  .tnz-support-text, .tnz-account-text{ display:none!important;}   /* fica apenas o ícone */
  .tnz-user-menu__dropdown{
    right:0;
    min-width:150px;
  }
}
@media (max-width: 420px){
  .tnz-support-text{ display:none!important;}   /* fica apenas o ícone */

  .tnz-brand-search .tnz-container {
    padding-top: 5px!important;
  }
}

.box-bottom-shadow{
  box-shadow: 0 8px 12px -8px rgba(0,0,0,.25);
}

/* média */
.box-bottom-shadow-md{
  box-shadow: 0 12px 24px -12px rgba(0,0,0,.28);
}

/* forte */
.box-bottom-shadow-lg{
  box-shadow: 0 18px 28px -16px rgba(0,0,0,.35);
}

@media (min-width: 2400px) {

  :root{
    /* Sidebar pinned */
    --tnz-cats-sidebar-w: clamp(350px, 18vw, 500px);

    /* Folga à direita (remove clipping residual) */
    --tnz-cats-gutter: 32px;

    /* Grid cap (máx 6 por linha, sem cards gigantes) */
    --tnz-grid-max-cols: 6;
    --tnz-grid-card-w: 260px; /* ajusta: 240 / 260 / 280 */
    --tnz-grid-gap: 18px;
  }

  /* Segurança contra overflow horizontal (o corte era por aqui; agora é só “seguro”) */
  html, body{
    overflow-x: hidden;
  }

  /* =========================================================
     1) Drawer pinned GLOBAL (todas as páginas) — CSS-first
     ========================================================= */

  /* Se existe regra global [hidden]{display:none!important} */
  #tnz-cats-drawer[hidden]{
    display: block !important;
  }

  /* Botão e overlay deixam de ser necessários */
  #tnz-open-cats{ display: none !important; }
  #tnz-cats-overlay{ display: none !important; }

  #tnz-cats-drawer.tnz-drawer{
    position: fixed;
    left: 0;
    top: var(--tnz-header-h, 0px);
    height: calc(100vh - var(--tnz-header-h, 0px));

    width: var(--tnz-cats-sidebar-w);
    max-width: var(--tnz-cats-sidebar-w);

    transform: none !important;
    transition: none !important;

    z-index: 998;
    box-sizing: border-box;
  }

  /* Opcional: esconder header do drawer (logo + X) */
  #tnz-cats-drawer .tnz-drawer-header{
    display: none !important;
  }
/* =========================================================
   PINNED: Subcategorias como flyout (não depende da largura do drawer)
   ========================================================= */

#tnz-cats-drawer.tnz-drawer{
  /* permite que o flyout “saia” para a direita */
  overflow: visible !important;
}

/* A grelha fica só com a coluna da esquerda (sidebar) */
#tnz-cats-drawer .tnz-cats-grid{
  grid-template-columns: var(--tnz-cats-sidebar-w) 0 !important;
  position: relative; /* âncora do flyout */
}

/* Coluna L1 com largura fixa */
#tnz-cats-drawer .cats-level1{
  width: var(--tnz-cats-sidebar-w);
  max-width: var(--tnz-cats-sidebar-w);
}

/* Painel direito vira flyout absoluto */
#tnz-cats-drawer .cats-panel{
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tnz-cats-sidebar-w);

  /* largura do flyout (ajusta se quiseres) */
  width: min(720px, calc(100vw - var(--tnz-cats-sidebar-w) - var(--tnz-cats-gutter)));
  max-width: calc(100vw - var(--tnz-cats-sidebar-w) - var(--tnz-cats-gutter));

  background: #fff;
  border-left: 1px solid #e5e7eb;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);

  overflow: auto;
  z-index: 999;

  /* estado fechado (mantém compat com o teu CSS existente) */
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .28s ease;
}

/* quando abre (JS mete .panel-open no drawer) */
#tnz-cats-drawer.panel-open .cats-panel{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
/* =========================================================
   PINNED: subcategorias à frente do conteúdo (stacking fix)
   ========================================================= */

/* Drawer sempre acima do conteúdo */
#tnz-cats-drawer.tnz-drawer{
  z-index: 999999 !important;
  overflow: visible !important;
}

/* A grelha interna pode manter-se */
#tnz-cats-drawer .tnz-cats-grid{
  position: relative;
}

/* Painel direito como FLYOUT FIXO (não fica preso a stacking contexts) */
#tnz-cats-drawer .cats-panel{
  position: fixed !important;

  /* encosta ao lado direito da sidebar */
  left: var(--tnz-cats-sidebar-w) !important;

  /* respeita o header */
  top: var(--tnz-header-h, 0px) !important;
  height: calc(100vh - var(--tnz-header-h, 0px)) !important;

  width: min(720px, calc(100vw - var(--tnz-cats-sidebar-w) - var(--tnz-cats-gutter))) !important;
  max-width: calc(100vw - var(--tnz-cats-sidebar-w) - var(--tnz-cats-gutter)) !important;

  background: #fff !important;
  border-left: 1px solid #e5e7eb !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.12) !important;

  overflow: auto !important;

  /* acima de TUDO */
  z-index: 1000000 !important;

  /* estado fechado */
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .28s ease;
}

/* quando abre */
#tnz-cats-drawer.panel-open .cats-panel{
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

  /* =========================================================
     2) FIX DEFINITIVO: o teu overflow vem do main#content
        (força a caber no viewport com a sidebar)
     ========================================================= */

  main#content.site-main,
  main#content#content{
    margin-left: var(--tnz-cats-sidebar-w) !important;

    /* Isto garante que o right nunca passa o viewport */
    width: calc(100vw - var(--tnz-cats-sidebar-w)) !important;
    max-width: calc(100vw - var(--tnz-cats-sidebar-w)) !important;

    /* folga para evitar corte residual */
    padding-right: var(--tnz-cats-gutter) !important;

    box-sizing: border-box !important;
  }

  /* Alguns temas usam wrappers extra; não deixes herdar offsets estranhos */
  #primary,
  .content-area,
  .site-content{
    max-width: 100% !important;
    box-sizing: border-box;
  }

  /* Elementor stretched pode usar 100vw e rebentar; clamp global no breakpoint */
  .elementor-section.elementor-section-stretched{
    width: 100% !important;
    left: 0 !important;
    max-width: 100% !important;
  }

  /* =========================================================
     3) Máx 6 por linha (sem cards gigantes)
     ========================================================= */

  /* --- Woo grid (se a listagem Woo estiver ativa) --- */
  .woocommerce ul.products,
  .woocommerce-page ul.products{
    display: grid !important;
    gap: var(--tnz-grid-gap);

    grid-template-columns: repeat(var(--tnz-grid-max-cols), minmax(0, 1fr)) !important;

    width: 100% !important;
    max-width: calc(
      var(--tnz-grid-max-cols) * var(--tnz-grid-card-w) +
      (var(--tnz-grid-max-cols) - 1) * var(--tnz-grid-gap)
    ) !important;

    margin-left: auto !important;
    margin-right: auto !important;

    padding-left: 0 !important;
    padding-right: 0 !important;

    box-sizing: border-box;
  }

  .woocommerce ul.products > li.product,
  .woocommerce-page ul.products > li.product{
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .woocommerce ul.products img{
    max-width: 100% !important;
    height: auto !important;
  }

  /* --- NPF (Product Filter) grid, quando existir --- */
  #npf-pjax-target,
  #npf-list{
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;

    /* folga à direita para evitar clipping */
    padding-right: var(--tnz-cats-gutter);
  }

  #npf-list .npf-results-bar,
  #npf-list .npf-sort{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
  }

  #npf-list .npf-results-bar > *,
  #npf-list .npf-sort > *{
    min-width: 0;
    max-width: 100%;
  }

  #npf-list .npf-grid{
    display: grid !important;
    gap: var(--tnz-grid-gap);

    grid-template-columns: repeat(var(--tnz-grid-max-cols), minmax(0, 1fr)) !important;

    width: 100% !important;
    max-width: calc(
      var(--tnz-grid-max-cols) * var(--tnz-grid-card-w) +
      (var(--tnz-grid-max-cols) - 1) * var(--tnz-grid-gap)
    ) !important;

    margin-left: auto !important;
    margin-right: auto !important;

    min-width: 0 !important;
    box-sizing: border-box;
  }

  #npf-list .npf-grid > *,
  #npf-list .product-item{
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  #npf-list img{
    max-width: 100% !important;
    height: auto !important;
  }

  #npf-list .product-title,
  #npf-list a{
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* =========================================================
   Header search suggestions dropdown (.tnz-search-suggest)
   ========================================================= */
.tnz-brand-search .tnz-search{
  position: relative;
}

.tnz-search-suggest{
  position:absolute;
  left:0;
  right:0;
  top:100%;
  margin-top:4px;
  background:#ffffff;
  border-radius:12px;
  box-shadow:0 14px 40px rgba(15,23,42,.18);
  max-height:320px;
  overflow-y:auto;
  z-index:120;
  padding:4px 0;
  font-size:14px;
}

.tnz-search-suggest__item,
.tnz-search-suggest__see-all{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  padding:8px 14px;
  text-decoration:none;
  color:#0f172a;
  cursor:pointer;
}

.tnz-search-suggest__item:hover,
.tnz-search-suggest__see-all:hover{
  background:#f3f4f6;
}

.tnz-search-suggest__title{
  font-weight:500;
  line-height:1.3;
  flex:1 1 auto;
}

.tnz-search-suggest__price{
  font-weight:600;
  color:#ef4444; /* default current price color (red) */
  margin-left:12px;
  white-space:nowrap;
}

/* WooCommerce price fragments inside the dropdown */
.tnz-search-suggest__price .amount{
  color:#ef4444;
}
.tnz-search-suggest__price del,
.tnz-search-suggest__price del .amount{
  color:#111827;
  text-decoration:line-through;
}
.tnz-search-suggest__price ins,
.tnz-search-suggest__price ins .amount{
  color:#ef4444;
  text-decoration:none;
}

.tnz-search-suggest__see-all{
  border-top:1px solid #e5e7eb;
  font-weight:600;
}

.tnz-search-suggest__title-all{
  flex:1 1 auto;
}

/* Focus panel: "Pesquisar por" + recentes */
.tnz-search-suggest__group--focus{
  padding:4px 0 6px;
}
.tnz-search-suggest__header{
  padding:6px 14px 8px;
  font-size:12px;
  font-weight:600;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:#6b7280;
}

.tnz-search-suggest__recent-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 14px;
  text-decoration:none;
  color:#0f172a;
  cursor:pointer;
}

.tnz-search-suggest__recent-item:hover{
  background:#f3f4f6;
}

.tnz-search-suggest__icon{
  width:18px;
  height:18px;
  flex-shrink:0;
  border-radius:999px;
  background:#e5e7eb;
  position:relative;
}
.tnz-search-suggest__icon::before{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:999px;
  border:2px solid #9ca3af;
}

.tnz-search-suggest__recent-text{
  flex:1 1 auto;
  font-size:14px;
  line-height:1.3;
}

.tnz-search-suggest__chevron{
  width:16px;
  height:16px;
  flex-shrink:0;
  background:#9ca3af;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') no-repeat center/contain;
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M9 6l6 6-6 6"/></svg>') no-repeat center/contain;
}

.tnz-search-suggest__clear{
  display:block;
  width:100%;
  border:0;
  background:transparent;
  text-align:right;
  padding:6px 14px 4px;
  font-size:12px;
  color:#9ca3af;
  cursor:pointer;
}
.tnz-search-suggest__clear:hover{
  color:#6b7280;
}

/* Keyboard highlight */
.tnz-search-suggest .is-active{
  background:#e5e7eb;
}

/* Empty state row */
.tnz-search-suggest__empty{
  padding:8px 14px 10px;
}

.tnz-search-suggest__empty-title{
  font-size:14px;
  color:#6b7280;
  margin-bottom:2px;
}

.tnz-search-suggest__empty-sub{
  font-size:12px;
  color:#9ca3af;
}

/* Offscreen decoy input to trap browser autofill */
.tnz-search-decoy{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
  pointer-events:none;
}
