/* Estilo comum para todas as páginas do site Fluxo Nutri */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

:root {
  --primary: #000000;
  --secondary: #6b7280;
  --text: #ffffff;
  --dark: #111111;
  --bg: #000000;
  --neon-blue: #6b7280;
  --neon-blue-glow: rgba(107, 114, 128, 0.3);
  --button-bg: #ffffff;
  --button-text: #000000;
  --button-hover: #6b7280;
  --button-hover-text: #ffffff;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  font-family: 'Poppins', sans-serif;
  line-height: 1.5;
}

/* Background com efeito de partículas otimizado */
.particles-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  background: linear-gradient(135deg, #0A1428 0%, #091428 100%);
  pointer-events: none;
  perspective: 1000px;
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
  will-change: transform;
}

.particle {
  position: fixed;
  background: var(--neon-blue);
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
  will-change: transform, opacity;
  transform: translate3d(0,0,0);
}

/* Barra de pesquisa otimizada */
.search-bar {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  padding: 0 20px;
}

.search-bar input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border-radius: 4px;
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #000000;
  font-size: 14px;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-bar input::placeholder {
  color: rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.search-bar input:focus {
  outline: none;
  border-color: #0066ff;
  box-shadow: 0 2px 15px rgba(0, 102, 255, 0.2);
}

/* Classe blur-background REMOVIDA - causava problemas com imagens externas */

.search-bar i {
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  color: #000000;
  font-size: 18px;
  pointer-events: none;
}

/* Botões e interações comuns */
button, .btn {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 0.5px;
}

button:hover, .btn:hover {
  background: var(--button-hover);
  color: var(--button-hover-text);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

button:active, .btn:active {
  transform: scale(0.98);
}

/* Links comuns */
a {
  color: var(--secondary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--button-hover);
}

/* Formulários */
input, textarea, select {
  padding: 12px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: var(--text);
  font-size: 14px;
  width: 100%;
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 10px rgba(0, 102, 255, 0.3);
}

/* Container comum */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* Efeito de scroll suave */
html {
  scroll-behavior: smooth;
}

/* Estilização do Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--button-hover);
}

/* Animações gerais */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Cards de Produtos */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  padding: 15px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.product-card {
  background: linear-gradient(180deg, #ffffff 55%, #1f2937 55%);
  border-radius: 8px;
  padding: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid rgba(0, 102, 255, 0.1);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 102, 255, 0.2);
  border-color: var(--secondary);
}

.product-image-container {
  position: relative;
  width: 100%;
  height: 180px;
  margin-bottom: 0;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  background: #ffffff;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
  transition: transform 0.3s ease;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-badges {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
  pointer-events: none;
}

.badge {
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  text-align: center;
  min-width: auto;
}

.badge.new {
  background: linear-gradient(135deg, #0066ff, #0052cc);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.sale {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.new {
  background: rgba(0, 102, 255, 0.9);
}

.badge.sale {
  background: rgba(255, 59, 48, 0.9);
}

.product-info {
  text-align: left;
  padding: 5px;
}

.product-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #ffffff;
  line-height: 1.2;
  height: 2.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
}

.original-price {
  text-decoration: line-through;
  color: #999;
  font-size: 14px;
  margin-right: 5px;
}

.current-price {
  display: inline-block;
}

/* Modal de Detalhes do Produto */
.product-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(9, 20, 40, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.product-modal-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.product-modal {
  background: linear-gradient(135deg, rgba(15, 25, 45, 0.98), rgba(10, 20, 40, 0.98));
  border: 1px solid rgba(0, 102, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  width: 95%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.product-modal-overlay.active .product-modal {
  transform: translateY(0);
}

.product-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(0, 102, 255, 0.1);
}

.product-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 28px;
  cursor: pointer;
  padding: 5px;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.product-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.modal-product-image {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  object-fit: contain;
}

.modal-product-info {
  color: #fff;
  padding: 15px 0;
}

.modal-product-description {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
  margin: 15px 0;
}

.modal-product-price {
  font-size: 24px;
  font-weight: 700;
  color: #0066ff;
  margin: 15px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-product-price .original-price {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

.modal-product-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  margin: 15px 0;
}

.stock-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4CAF50;
}

.stock-indicator.low {
  background: #FFC107;
}

.stock-indicator.out {
  background: #FF5252;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    padding: 10px;
  }

  .product-card, .product {
    padding: 5px;
  }

  .product-image-container {
    height: 140px;
    margin-bottom: 8px;
  }

  .product-image {
    padding: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .product-info {
    padding: 5px;
  }

  .product-title, .product h2 {
    font-size: 12px;
    line-height: 1.3;
    height: auto;
    margin-bottom: 4px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .product-price, .product .price {
    font-size: 13px;
    margin-top: 4px;
  }

  .product-badges {
    top: 3px;
    right: 3px;
    gap: 3px;
  }

  .badge {
    padding: 2px 5px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 2px;
    min-width: auto;
  }

  .product-modal {
    padding: 15px;
    margin: 10px;
  }

  .product-modal-content {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .modal-product-image {
    max-height: 300px;
    padding: 5px;
  }

  .modal-product-title {
    font-size: 18px;
  }

  .modal-product-description {
    font-size: 13px;
  }

  .modal-product-price {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }
  
  h2 {
    font-size: 20px;
  }
  
  p {
    font-size: 14px;
  }
}

/* Melhorias para acessibilidade */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
