:root {
  --bg: #fff;
  --accent: #50d127;
  --gray: #cecece;
  --ink: #1f1f1f;
  --muted: #7d7d7d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
}

.stage {
  width: min(1220px, 95vw);
  margin: 6vh auto 3rem;
}

.camera-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.camera-btn {
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 26px #50d12755;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.camera-btn:hover {
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 14px 30px #50d12766;
}

.camera-btn svg {
  width: 44px;
  height: 44px;
  fill: #fff;
}

.camera-title {
  margin: 0.9rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.camera-subtitle {
  margin: 0.35rem 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 0.95rem;
}

.source-menu {
  margin-top: 0.95rem;
  border: 1px solid var(--gray);
  border-radius: 14px;
  background: #fff;
  padding: 0.45rem;
  display: flex;
  gap: 0.45rem;
  box-shadow: 0 10px 24px #00000014;
}

.source-action {
  min-width: 128px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--gray);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.source-action:hover {
  border-color: var(--accent);
  color: #0f5f00;
}

.status {
  min-height: 22px;
  margin: 0;
  color: #4b4b4b;
  font-size: 0.92rem;
}

.status-row {
  margin-top: 0.85rem;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.loader {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--gray);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-popup {
  margin: 1rem auto 0;
  padding: 0.6rem;
  border: 1px solid var(--gray);
  border-radius: 16px;
  background: #fff;
}

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.popup-header h2 {
  margin: 0;
  font-size: 0.98rem;
}

.close-popup {
  min-height: 34px;
  padding: 0 0.75rem;
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
}

.result-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-card {
  border: 1px solid var(--gray);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 20px #0000000c;
  min-width: 0;
}

.result-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f9f9f9;
  border-bottom: 1px solid #ececec;
}

.result-body {
  padding: 0.45rem;
}

.article {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}

.category {
  margin: 0.25rem 0 0;
  color: #9a9a9a;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.description {
  margin: 0.25rem 0 0;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price {
  margin: 0.35rem 0 0;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
}

.card-link {
  margin-top: 0.35rem;
  display: inline-block;
  color: #107700;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.74rem;
}

.hidden {
  display: none !important;
}

@media (min-width: 840px) {
  .results-popup {
    padding: 1.1rem;
  }

  .result-grid {
    gap: 1rem;
  }

  .popup-header {
    margin-bottom: 0.9rem;
  }

  .popup-header h2 {
    font-size: 1.05rem;
  }

  .result-card {
    border-radius: 10px;
  }

  .result-body {
    padding: 0.9rem 0.85rem 1rem;
  }

  .category {
    margin: 0.45rem 0 0;
    font-size: 0.9rem;
  }

  .description {
    margin: 0.45rem 0 0;
    font-size: 1.02rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .price {
    margin: 0.65rem 0 0;
    font-size: 1.65rem;
  }

  .card-link {
    margin-top: 0.6rem;
    font-size: 0.93rem;
  }
}
