/* Estilos para Skeleton Loaders e Paginação */

/* Skeleton Loaders para cartões de produto */
.skeleton-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.skeleton-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #eee 8%, #f5f5f5 18%, #eee 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.skeleton-title {
  width: 85%;
  height: 16px;
  margin: 16px 16px 8px;
  background: linear-gradient(90deg, #eee 8%, #f5f5f5 18%, #eee 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-price {
  width: 40%;
  height: 24px;
  margin: 8px 16px;
  background: linear-gradient(90deg, #eee 8%, #f5f5f5 18%, #eee 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-text {
  width: 90%;
  height: 10px;
  margin: 8px 16px;
  background: linear-gradient(90deg, #eee 8%, #f5f5f5 18%, #eee 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-button {
  width: 80%;
  height: 36px;
  margin: 16px auto;
  background: linear-gradient(90deg, #eee 8%, #f5f5f5 18%, #eee 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 18px;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Paginação */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pagination-button {
  background-color: #fff;
  border: 1px solid #dee2e6;
  color: #007bff;
  padding: 0.5rem 0.75rem;
  margin: 0 0.25rem;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.pagination-button:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
}

.pagination-button.active {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

.pagination-button:disabled,
.pagination-button.disabled {
  color: #6c757d;
  pointer-events: none;
  cursor: not-allowed;
  background-color: #fff;
  border-color: #dee2e6;
  opacity: 0.65;
}

/* Botão Voltar ao Topo */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #007bff;
  color: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
}

.back-to-top i {
  font-size: 1.5rem;
}

/* Responsividade para dispositivos móveis */
@media (max-width: 767.98px) {
  .pagination-button {
    padding: 0.4rem 0.6rem;
    margin: 0.2rem;
    font-size: 0.9rem;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
  
  /* Ajustes para grid de produtos em mobile */
  .product-grid {
    grid-template-columns: 1fr !important;
  }
  
  .product-card {
    width: 100% !important;
  }
  
  /* Ajustes para a barra de pesquisa em mobile */
  .search-container {
    flex-direction: column;
  }
  
  .search-input {
    width: 100% !important;
    margin-bottom: 0.5rem;
  }
  
  .search-button {
    width: 100% !important;
  }
}

/* Ajustes para tablets */
@media (min-width: 768px) and (max-width: 991.98px) {
  .product-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* Notificações e Feedback */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  background-color: #fff;
  border-left: 4px solid #007bff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  z-index: 1050;
  max-width: 350px;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification-success {
  border-left-color: #28a745;
}

.notification-error {
  border-left-color: #dc3545;
}

.notification-info {
  border-left-color: #17a2b8;
}

.notification-title {
  font-weight: 600;
  margin-bottom: 5px;
  color: #343a40;
}

.notification-message {
  color: #6c757d;
}

/* Estado vazio e erros */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.5rem;
  color: #343a40;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: #6c757d;
  max-width: 500px;
  margin: 0 auto;
}

.error-container {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
  padding: 1rem;
  border-radius: 0.25rem;
  margin: 1rem 0;
}

/* Indicador de carregamento global */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
