.certificates-gallery {
  text-align: center;
}

.certificate-item {
  display: inline-block;
  margin: 10px;
  width: 148px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #7c3aed 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
  position: relative;
  overflow: hidden;
}

.certificate-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.certificate-item img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 10px;
  border: 2px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.22);
  object-fit: cover;
  aspect-ratio: 16 / 10;
  background: #fff;
  cursor: pointer;
}

.image-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
}

.modal-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.modal-wrapper {
  position: relative;
  display: inline-block;
}

.modal-image {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.close-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  padding: 4px 10px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  line-height: 1;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #eee;
}

@media (max-width: 600px) {
  .certificate-item {
    width: 46vw !important;
    margin: 8px 4px;
    padding: 5px;
  }

  .certificate-item img {
    height: auto !important;
    min-height: 92px;
  }

  .certificates-section h4 {
    text-align: center;
  }

  .modal-image {
    max-width: 95%;
    max-height: 80vh;
  }
}
