:root {
  --primary: #FF9A76;
  --secondary: #FF6B9D;
  --accent-blue: #4FC3F7;
  --accent-purple: #CE93D8;
  --accent-gold: #FFB74D;
  --bg-light: #FFF5F5;
  --bg-peach: #FFE5DC;
  --text-dark: #5D4037;
  --white: #FFFFFF;
  --shadow: rgba(255, 107, 157, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Comic Sans MS', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-peach) 100%);
  color: var(--text-dark);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  background: linear-gradient(135deg, #FFE5DC 0%, #FFC9B9 30%, #FFB5A0 60%, #FFA08A 100%);
  color: #8B4513;
  padding: 20px 20px 40px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(255, 160, 138, 0.3);
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '✨';
  position: absolute;
  font-size: 3rem;
  opacity: 0.4;
  top: 20px;
  left: 10%;
  animation: float 3s ease-in-out infinite;
}

.header::after {
  content: '🎀';
  position: absolute;
  font-size: 3rem;
  opacity: 0.4;
  top: 20px;
  right: 10%;
  animation: float 3s ease-in-out infinite 1.5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.logo-container {
  margin-bottom: 20px;
  animation: fadeInDown 1s ease-out;
}

.logo {
  max-width: 300px;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(139, 69, 19, 0.2));
}

.header h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
  font-weight: 700;
  letter-spacing: 2px;
  color: #8B4513;
}

.subtitle {
  font-size: 1.3rem;
  opacity: 0.9;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
  color: #A0522D;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filtros */
.filters-section {
  display: flex;
  gap: 15px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  display: flex;
  gap: 10px;
  min-width: 250px;
}

.search-box input {
  flex: 1;
  padding: 14px 20px;
  border: 3px solid var(--secondary);
  border-radius: 25px;
  font-size: 1rem;
  background: white;
  transition: all 0.3s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 15px var(--shadow);
}

.search-box button {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.search-box button:hover {
  transform: scale(1.1);
}

.filter-options select {
  padding: 14px 20px;
  border: 3px solid var(--accent-blue);
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  background: white;
  color: var(--text-dark);
  font-weight: 500;
}

/* Grid de Produtos */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.produto-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
  border: 3px solid transparent;
}

.produto-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 8px 30px var(--shadow);
  border-color: var(--secondary);
}

.produto-imagem {
  width: 100%;
  height: 250px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-light), var(--bg-peach));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.produto-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.produto-imagem:hover img {
  transform: scale(1.1);
}

.produto-imagem::after {
  content: '👶';
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 2rem;
  opacity: 0.2;
}

/* Galeria de imagens no modal */
.modal-imagem-container {
  position: relative;
}

.modal-imagem {
  width: 100%;
  height: 400px;
  background-color: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.modal-imagem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.imagem-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--secondary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 10;
}

.imagem-nav:hover {
  background: var(--secondary);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.imagem-nav.prev {
  left: 10px;
}

.imagem-nav.next {
  right: 10px;
}

.imagem-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.imagem-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  overflow-x: auto;
  padding: 5px;
}

.imagem-thumbnail {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s;
  flex-shrink: 0;
}

.imagem-thumbnail:hover {
  border-color: var(--accent-blue);
}

.imagem-thumbnail.active {
  border-color: var(--secondary);
  box-shadow: 0 0 10px var(--shadow);
}

.imagem-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imagem-contador {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.produto-imagem img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.produto-imagem .no-image {
  color: #999;
  font-size: 3rem;
}

.produto-info {
  padding: 20px;
}

.produto-nome {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.produto-id {
  font-size: 0.85rem;
  color: var(--accent-gold);
  margin-bottom: 15px;
  font-weight: 600;
}

.produto-preco {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

.produto-estoque {
  font-size: 0.9rem;
  color: #666;
}

.estoque-disponivel {
  color: #4CAF50;
  font-weight: 600;
}

.estoque-baixo {
  color: var(--primary);
  font-weight: 700;
  animation: pulse 2s infinite;
}

.estoque-indisponivel {
  color: #999;
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-produto {
  background: white;
  border-radius: 25px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 4px solid var(--secondary);
  box-shadow: 0 10px 50px rgba(255, 107, 157, 0.3);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  box-shadow: 0 4px 12px var(--shadow);
  z-index: 10;
  color: white;
  font-weight: bold;
  transition: transform 0.3s;
}

.modal-close:hover {
  transform: rotate(90deg) scale(1.1);
}

.modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 30px;
}

.modal-imagem {
  width: 100%;
  height: 400px;
  background-color: var(--light);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-imagem img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-info h2 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
}

.modal-id {
  color: #666;
  font-size: 0.9rem;
}

.modal-preco {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.preco-label {
  font-size: 0.9rem;
  color: #666;
}

.preco-valor {
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-estoque {
  padding: 10px;
  background-color: var(--light);
  border-radius: 6px;
  font-weight: 500;
}

.modal-quantidade {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quantidade-control {
  display: flex;
  gap: 10px;
  align-items: center;
}

.quantidade-control button {
  width: 45px;
  height: 45px;
  border: 3px solid var(--secondary);
  background: white;
  color: var(--secondary);
  font-size: 1.8rem;
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.quantidade-control button:hover {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  transform: scale(1.1);
}

.quantidade-control input {
  width: 80px;
  padding: 10px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 1.1rem;
}

.btn-comprar {
  padding: 18px 35px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-comprar:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
}

.btn-comprar:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Carrinho Flutuante */
.carrinho-float {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--shadow);
  z-index: 900;
  transition: all 0.3s;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.carrinho-float:hover {
  transform: scale(1.15);
  box-shadow: 0 8px 30px var(--shadow);
}

#carrinho-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--accent-gold), var(--primary));
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 900;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Painel do Carrinho */
.carrinho-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100%;
  background: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s;
}

.carrinho-panel:not(.hidden) {
  transform: translateX(0);
}

.carrinho-header {
  padding: 25px;
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px var(--shadow);
}

.carrinho-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
}

.carrinho-header button {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.carrinho-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.carrinho-vazio {
  text-align: center;
  color: #999;
  padding: 40px 20px;
}

.carrinho-item {
  display: flex;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid var(--border);
}

.carrinho-item-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.carrinho-item-info {
  flex: 1;
}

.carrinho-item-nome {
  font-weight: 600;
  margin-bottom: 5px;
}

.carrinho-item-preco {
  color: var(--secondary);
  font-weight: 700;
  font-size: 1.1rem;
}

.carrinho-item-qtd {
  font-size: 0.9rem;
  color: #666;
}

.carrinho-item-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1.2rem;
}

.carrinho-footer {
  padding: 20px;
  border-top: 2px solid var(--border);
}

.carrinho-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.btn-finalizar {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  text-transform: uppercase;
}

.btn-finalizar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(76, 175, 80, 0.4);
}

/* Estados */
.hidden {
  display: none !important;
}

.loading {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 1.2rem;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 1.2rem;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: white;
  text-align: center;
  padding: 25px;
  margin-top: 50px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 -4px 20px var(--shadow);
}

/* Responsivo */
@media (max-width: 768px) {
  .modal-content {
    grid-template-columns: 1fr;
  }
  
  .carrinho-panel {
    width: 100%;
  }
  
  .header h1 {
    font-size: 1.8rem;
  }
}
