#compras-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2500;
}

#compras-modal.show {
  display: flex !important;
}

.compras-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  backdrop-filter: blur(5px);
  padding: 20px;
}

.compras-content {
  background: #f9f6f2;
  border-radius: 16px;
  width: 92%;
  max-width: 900px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.4s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.compras-header {
  background: #fff;
  border-bottom: 3px solid #8b3a3a;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.compras-header h1 {
  margin: 0;
  color: #8b3a3a;
  font-size: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: Georgia, serif;
}

.compras-close {
  background: none;
  border: none;
  font-size: 36px;
  color: #8b3a3a;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 6px;
}

.compras-close:hover {
  transform: scale(1.15);
  background: rgba(139, 58, 58, 0.1);
  color: #c27a5f;
}

.compras-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
  background: #ffffff;
}

.compra-item {
  background: linear-gradient(135deg, #faf8f5 0%, #f5f1ec 100%);
  border-left: 5px solid #8b3a3a;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.compra-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(211, 152, 88, 0.05) 100%);
  pointer-events: none;
}

.compra-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(139, 58, 58, 0.15);
  border-left-width: 7px;
}

.compra-livro-info {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(139, 58, 58, 0.15);
  position: relative;
  z-index: 1;
}

.compra-livro-capa {
  width: 80px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 2px solid #8b3a3a;
}

.compra-livro-detalhes h3 {
  margin: 0 0 8px 0;
  color: #8b3a3a;
  font-size: 20px;
  font-weight: 700;
  font-family: Georgia, serif;
}

.compra-livro-detalhes p {
  margin: 4px 0;
  color: #5a5a5a;
  font-size: 14px;
}

.compra-dados {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  position: relative;
  z-index: 1;
}

.compra-campo {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(139, 58, 58, 0.2);
  transition: all 0.2s ease;
}

.compra-campo:hover {
  border-color: #8b3a3a;
  box-shadow: 0 2px 8px rgba(139, 58, 58, 0.15);
}

.compra-campo-label {
  display: block;
  font-weight: 600;
  color: #8b3a3a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.compra-campo-valor {
  color: #333;
  font-size: 15px;
  line-height: 1.4;
}

.compra-preco-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(139, 58, 58, 0.15);
  position: relative;
  z-index: 1;
}

.compra-preco {
  font-size: 24px;
  font-weight: 700;
  color: #8b3a3a;
  font-family: Georgia, serif;
}

.compra-data {
  font-size: 14px;
  color: #666;
  font-style: italic;
}

.sem-compras {
  text-align: center;
  padding: 60px 20px;
  color: #8b3a3a;
  font-size: 18px;
  font-style: italic;
}

.sem-compras::before {
  content: '📦';
  display: block;
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.compra-status {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
}

.compra-status.finalizada {
  background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}

.compra-status.pendente {
  background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}

@media (max-width: 768px) {
  .compras-content {
    width: 95%;
    margin: 0 auto;
  }

  .compras-header h1 {
    font-size: 22px;
  }

  .compra-livro-info {
    flex-direction: column;
    text-align: center;
  }

  .compra-dados {
    grid-template-columns: 1fr;
  }

  .compra-preco-data {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .compras-overlay {
    padding: 10px;
  }
  
  .compras-content {
    width: 98%;
  }
  
  .compras-header {
    padding: 18px 20px;
  }
  
  .compras-header h1 {
    font-size: 20px;
  }
  
  .compra-item {
    padding: 18px;
  }
  
  .compra-livro-capa {
    width: 70px;
    height: 100px;
  }
  
  .compra-livro-detalhes h3 {
    font-size: 17px;
  }
  
  .compra-livro-detalhes p {
    font-size: 12px;
  }
  
  .compra-campo {
    padding: 12px;
  }
  
  .compra-campo-label {
    font-size: 11px;
  }
  
  .compra-campo-valor {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .compras-content {
    width: 99%;
  }
  
  .compras-header {
    padding: 15px;
  }
  
  .compras-header h1 {
    font-size: 18px;
  }
  
  .compras-body {
    padding: 15px;
  }
}
