/* Reset e Container Principal */
.hm-cat-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}
.hm-cat-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 1200px;
  padding: 20px 0;
  font-family: inherit;
  color: #333;
}

/* =========================================
   DESKTOP (COMPACTO E 100% VISÍVEL)
========================================= */
@media (min-width: 768px) {
  .hm-cat-container {
    flex-direction: row;
    align-items: flex-start;
  }

  .hm-cat-sidebar {
    width: 230px; /* Mais estreito para otimizar espaço */
    flex-shrink: 0;
    position: sticky;
    top: 20px; /* Acompanha a descida da tela */
    background: #fdfdfd;
    padding: 15px; /* Padding reduzido */
    border-radius: 8px;
    border: 1px solid #eee;
    /* Sem max-height e sem overflow para não ter barra de rolagem! */
  }

  /* Esconde elementos exclusivos do mobile */
  .hm-cat-sidebar-header,
  .hm-cat-btn-flutuante {
    display: none;
  }

  /* Filtros Compactos no PC */
  .hm-cat-btn-copiar {
    padding: 8px;
    font-size: 11px;
    margin-bottom: 15px;
  }
  .hm-cat-grupo {
    margin-bottom: 12px;
  } /* Menos espaço entre grupos */

  /* Títulos como texto normal, sem setinha */
  .hm-cat-titulo {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding-bottom: 4px;
    margin: 0 0 8px 0;
    border-bottom: 1px solid #eaeaea;
    cursor: default;
  }
  .hm-cat-titulo span {
    display: none;
  }

  /* Listas sempre abertas e compactas */
  .hm-cat-lista {
    display: flex !important;
    padding: 0;
    background: transparent;
    flex-direction: column;
  }
  .hm-cat-label {
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #555;
    transition: color 0.2s;
  }
  .hm-cat-label:hover {
    color: #000;
  }
  .hm-cat-label input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
    cursor: pointer;
    accent-color: #333;
  }
}

/* =========================================
   MOBILE (BOTÃO SUTIL E DROPDOWN)
========================================= */
@media (max-width: 767px) {
  /* Botão Flutuante Sutil (Pílula Escura) */
  .hm-cat-btn-flutuante {
    position: fixed;
    bottom: 90px; /* Fica acima da barra inferior da Nuvemshop e WhatsApp */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 99998;
    cursor: pointer;
  }

  /* Sidebar invisível que desliza da esquerda */
  .hm-cat-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    z-index: 99999;
    background: #fff;
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
    padding: 20px;
    overflow-y: auto;
    transition: left 0.3s ease;
  }
  .hm-cat-sidebar.hm-ativo {
    left: 0;
  } /* Classe que faz o menu aparecer */

  .hm-cat-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
  }
  .hm-cat-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
  }
  .hm-cat-fechar {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #555;
  }

  .hm-cat-btn-copiar {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 14px;
    margin-bottom: 20px;
  }

  /* Grupos sanfona (Dropdown) */
  .hm-cat-grupo {
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
  }
  .hm-cat-titulo {
    font-size: 14px;
    padding: 15px;
    background: #fafafa;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
  }
  .hm-cat-titulo span {
    font-size: 12px;
    transition: transform 0.3s;
  }
  .hm-cat-lista {
    display: none;
    padding: 15px;
    flex-direction: column;
  }

  /* Abertura da sanfona */
  .hm-cat-grupo.hm-ativo .hm-cat-lista {
    display: flex;
  }
  .hm-cat-grupo.hm-ativo .hm-cat-titulo span {
    transform: rotate(180deg);
  }

  /* Checkboxes Mobile */
  .hm-cat-label {
    font-size: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #555;
  }
  .hm-cat-label:last-child {
    margin-bottom: 0;
  }
  .hm-cat-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #333;
  }
}

/* =========================================
   ELEMENTOS GERAIS (BOTÃO, CARDS, GRID)
========================================= */
.hm-cat-btn-copiar {
  background: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.hm-cat-btn-copiar:hover {
  background: #e4e4e4;
}
.hm-cat-btn-copiar.copiado {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}

.hm-cat-grade {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
}
@media (min-width: 768px) {
  .hm-cat-grade {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
}

.hm-cat-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.hm-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.hm-cat-img-box {
  width: 100%;
  padding-top: 100%;
  position: relative;
  background: #fafafa;
}
.hm-cat-img-box img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hm-cat-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hm-cat-nome {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin: 0;
  line-height: 1.2;
}
.hm-cat-cod {
  font-size: 11px;
  color: #888;
  font-family: monospace;
}
.hm-cat-tag {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.hm-cat-tag-classic {
  color: #8c8c8c;
}
.hm-cat-tag-premium {
  color: #2c3e50;
}
.hm-cat-tag-gold {
  color: #d4af37;
}

.hm-cat-vazio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #777;
  background: #f9f9f9;
  border-radius: 8px;
  border: 1px dashed #ccc;
  font-size: 15px;
}
