/* Resetar estilos padrão do navegador */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
  /* Melhor rolagem no iOS */
}

/* Container principal */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Header */
header {
  background-color: #15AC21;
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  margin-bottom: 10px;
  text-align: center;
}

.logo img {
  height: 50px;
  max-width: 100%;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: column;

}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

/* Navegação de categorias */
.category-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 5px;
}

.category-tab {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: 1;
  min-width: 120px;
  max-width: calc(50% - 4px);
}

.category-tab:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.category-tab.active {
  background-color: white;
  color: #15AC21;
  font-weight: 600;
}

/* Conteúdo principal */
main {
  padding: 20px 0;
  overflow-x: hidden;
  /* Evitar rolagem horizontal */
}

main h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
  font-weight: 600;
}

/* Seção de pesquisa e filtros */
.filters-section {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.search-container {
  display: flex;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 8px;
}

#search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  height: 44px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-button,
.clear-search {
  border: none;
  padding: 0 15px;
  background-color: #15AC21;
  color: white;
  cursor: pointer;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  border-radius: 8px;
}

.search-button {
  background-color: #15AC21;
  font-weight: 500;
}

.clear-search {
  background-color: #6c757d;
  padding: 0;
  width: 44px;
}

.search-button i,
.clear-search i {
  font-size: 16px;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.filter-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  height: 44px;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 30px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Botão de limpar filtros */
.clear-filters-btn {
  background-color: #15AC21;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 140px;
}

.clear-filters-btn:hover {
  background-color: rgba(21, 172, 33, 0.8);
}

.clear-filters-btn i {
  margin-right: 8px;
}

/* Remover a lupa flutuante */
.floating-search-icon {
  display: none;
}

/* Seções expansíveis */
#brands-section,
#categories-section {
  max-height: 80px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#brands-section.expanded,
#categories-section.expanded {
  max-height: 300px;
  overflow-y: auto;
}

/* Grade de produtos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  /* Espaço extra para rolagem */
}

.product-card {
  background-color: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card:active {
  transform: translateY(0);
}

.product-image {
  height: 180px;
  overflow: hidden;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

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

.product-details {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-category {
  font-size: 12px;
  color: #15AC21;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-weight: 600;
}

.product-title {
  font-size: 14px;
  margin-bottom: 10px;
  line-height: 1.3;
  flex: 1;
  font-weight: 500;
}

.product-code {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}

.product-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #555;
  margin-bottom: 15px;
}

.product-info span {
  display: flex;
  align-items: center;
}

.product-info i {
  margin-right: 5px;
  color: #15AC21;
}

.view-details {
  background-color: #15AC21;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-details i {
  margin-left: 5px;
}

.view-details:hover {
  background-color: rgba(21, 172, 33, 0.8);
}

/* Melhorar a visualização dos produtos encontrados */
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 0 5px;
}

.product-count-container {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* Melhorar a paginação */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

.page-nav {
  background-color: #15AC21;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.page-nav:hover:not(:disabled) {
  background-color: rgba(21, 172, 33, 0.8);
}

.page-nav:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.page-nav i {
  margin: 0 5px;
}

.pagination-numbers {
  display: flex;
  gap: 5px;
}

.page-number {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
}

.page-number.active {
  background-color: #15AC21;
  color: white;
}

.page-number:hover:not(.active) {
  background-color: #e0e0e0;
}

/* Tornar os filtros mais responsivos */
@media (max-width: 1100px) {
  .filter-controls {
    flex-wrap: wrap;
  }

  .filter-group {
    min-width: calc(50% - 10px);
    flex: 0 0 calc(50% - 10px);
  }

  .clear-filters-btn {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.2rem;
  }

  .logo img {
    height: 40px;
  }

  .search-container {
    gap: 8px;
    margin-bottom: 15px;
  }

  #search-input {
    flex-basis: 100%;
    min-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
  }

  .search-button,
  .clear-search {
    height: 44px;
  }

  .search-button {
    flex: 1;
    border-radius: 8px;
    margin-right: 8px;
  }

  .clear-search {
    flex: 0 0 44px;
    border-radius: 8px;
    padding: 0;
    justify-content: center;
  }

  .filter-controls {
    flex-direction: column;
    gap: 15px;
  }

  .filter-group {
    min-width: 100%;
    flex: initial;
  }

  .filter-group label {
    margin-bottom: 5px;
  }

  .clear-filters-btn-wrapper {
    width: 100%;
    margin-top: 5px;
  }

  .clear-filters-btn {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .modal-content {
    width: 95%;
  }

  .modal-body {
    flex-direction: column;
    gap: 20px;
  }

  /* Aumentar tamanho dos elementos tocáveis em dispositivos móveis */
  .category-tab,
  .search-button,
  .clear-search,
  .filter-group select,
  .clear-filters-btn,
  .view-details {
    min-height: 44px;
    /* Tamanho mínimo recomendado para elementos tocáveis */
  }

  main h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  /* Melhorar visualização do título da seção */
  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .product-header h2 {
    margin-bottom: 5px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .product-image {
    height: 140px;
  }

  .category-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 10px;
    margin: 0 -15px;
    padding: 0 15px 10px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: none;
  }

  .category-tab {
    white-space: nowrap;
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
    min-width: 0;
    margin-bottom: 8px;
  }

  .search-container {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .search-button {
    border-radius: 8px;
    flex: 1;
    max-width: calc(100% - 52px);
  }

  .clear-search {
    border-radius: 8px;
    flex: 0 0 44px;
    padding: 0;
  }

  .clear-search i {
    font-size: 18px;
  }

  /* Ajustar detalhes para economizar espaço em telas pequenas */
  .product-details {
    padding: 12px;
  }

  .product-title {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .product-info {
    margin-bottom: 10px;
  }

  .view-details {
    padding: 8px 10px;
    font-size: 12px;
  }

  /* Melhor alinhamento e espaçamento da contagem de produtos */
  .product-header {
    margin-bottom: 10px;
  }

  .product-count-container {
    font-size: 13px;
  }

  /* Melhorar paginação em mobile */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .page-nav {
    font-size: 13px;
    padding: 8px 10px;
  }

  .pagination-numbers {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Modal de produto */
.product-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
}

.product-modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  max-width: 800px;
  width: 100%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #666;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.05);
}

.close-modal:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.1);
}

.modal-product-details {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .modal-product-details {
    flex-direction: row;
  }
}

.modal-product-image {
  flex: 0 0 40%;
  padding: 20px;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-product-image img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.modal-product-info {
  flex: 1;
  padding: 20px;
}

.modal-product-category {
  font-size: 14px;
  color: #15AC21;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}

.modal-product-title {
  font-size: 20px;
  margin-bottom: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.modal-product-code {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}

.modal-product-specs {
  margin-bottom: 20px;
}

.spec-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.spec-icon {
  width: 30px;
  text-align: center;
  color: #15AC21;
}

.spec-label {
  width: 100px;
  font-weight: 500;
}

.spec-value {
  flex: 1;
}

.modal-actions {
  margin-top: 20px;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  background-color: #25D366;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
  min-height: 44px;
}

.whatsapp-btn i {
  margin-right: 8px;
  font-size: 18px;
}

.whatsapp-btn:hover {
  background-color: #128C7E;
}

/* Mensagens de erro */
.error-message {
  background-color: rgba(231, 76, 60, 0.1);
  border-left: 4px solid #e74c3c;
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 5px 5px 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.error-message i {
  font-size: 1.5rem;
  color: #e74c3c;
}

/* Animações e efeitos */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px 0;
}

.spinner {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(45, 89, 134, 0.3);
  border-radius: 50%;
  border-top-color: #15AC21;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading p {
  color: #666;
}

/* No results */
.no-results {
  text-align: center;
  padding: 30px 0;
  color: #666;
}

.no-results i {
  font-size: 40px;
  color: #15AC21;
  opacity: 0.7;
  margin-bottom: 10px;
}

.no-results p {
  font-size: 16px;
}

.hidden {
  display: none !important;
}

/* Estilo para o contador de produtos encontrados */
#product-count {
  font-weight: 600;
  color: #15AC21;
}

/* Rodapé */
footer {
  background-color: #15AC21;
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-top: 40px;
}

footer p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* Remover marca para certos produtos */
.medicamento .product-info .product-brand,
.equipamentos .product-info .product-brand,
.equipamentos .product-code {
  display: none;
}

/* Esconder N/A em medicamentos */
.medicamento .tag-na {
  display: none;
}

/* Esconder filtro de marca para medicamentos */
.medicamento-filter #brand-filter-container {
  display: none;
}

/* Esconder marca no card de medicamentos */
.medicamento .product-card .product-info .product-brand {
  display: none;
}

/* Melhorar os botões de pesquisa */
.search-button {
  background-color: #15AC21;
  transition: background-color 0.3s;
}

.search-button:hover {
  background-color: rgba(21, 172, 33, 0.8);
}

.clear-search {
  background-color: #6c757d;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search:hover {
  background-color: #5a6268;
}

.clear-search i {
  margin: 0;
}

/* Garantir que o filtro de categoria ocupe toda a largura quando o de marca estiver oculto */
.medicamento-filter .filter-group {
  width: 100%;
}

.credits-section {
  background: linear-gradient(135deg, #121212 0%, #2a2a2a 100%);
  padding: 10px 0;
  position: relative;
  overflow: hidden;
}

.credits-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4a90e2, #50e3c2, #b8e986);
  animation: gradient-shift 8s linear infinite;
}

.credits-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.credits-text {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.credits-link {
  color: #50e3c2;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: all 0.3s ease;
  padding: 0 3px;
}

.credits-link:hover {
  color: #ffffff;
}

.credits-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #50e3c2;
  transition: width 0.3s ease;
}

.credits-link:hover::after {
  width: 100%;
}

.credits-icon {
  font-size: 16px;
  margin-right: 5px;
  display: inline-block;
  animation: sparkle 1.5s infinite;
}

.credits-icon-link {
  font-size: 14px;
  margin-left: 3px;
  opacity: 0;
  transform: translateY(3px);
  transition: all 0.3s ease;
}

.credits-link:hover .credits-icon-link {
  opacity: 1;
  transform: translateY(0);
}

.credits-highlight {
  position: relative;
  z-index: 1;
}

.credits-highlight::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(80, 227, 194, 0.2);
  z-index: -1;
  transform: scaleX(0.8);
  transition: all 0.3s ease;
}

.credits-link:hover .credits-highlight::before {
  transform: scaleX(1);
  height: 90%;
  background-color: rgba(80, 227, 194, 0.1);
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes sparkle {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.1) rotate(10deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }
}

/* Responsivo */
@media (max-width: 768px) {
  .credits-text {
    font-size: 9px;
  }
}