* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  color: white;
  font-family: "Poppins", sans-serif;
}

.page-container {
  background: linear-gradient(180deg, hsl(150, 50%, 30.5%), hsl(150, 50%, 35%));
  display: grid;
  grid-template-rows: 100px 1fr;
  grid-template-areas: "header" "main";
  height: 100vh;
}

.header {
  grid-area: header;
  background: linear-gradient(180deg, hsl(150, 50%, 20%), hsl(150, 50%, 30.4%));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.title {
  font-size: 26px;
  font-weight: 600;
}

.main-content {
  grid-area: main;
  padding: 20px 12px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.card-group {
  width: calc(33.333% - 20px);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card {
  width: 100%;
  border-radius: 12px;
  border: 3px solid hsl(50, 50%, 50%);
  overflow: hidden;
  background: white;
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-6px);
}

.card img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========== FIX: NO STACKING ========== */
.card-bottom-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  /* Critical to prevent wrapping */
  flex-wrap: nowrap;
  gap: 10px;
}

.card-title {
  font-size: 19px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  /* Prevent title from pushing buttons */
  flex-shrink: 1;
  min-width: 0;
}

.btn-group {
  display: flex;
  gap: 6px;
  /* Keep buttons together, never wrap */
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  padding: 4px 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.action-btn:hover {
  background: rgba(255,255,255,0.25);
}

.like-btn.liked {
  background: #3ea6ff;
  border-color: #3ea6ff;
}

.fav-btn.favorited {
  background: #ffcd00;
  border-color: #ffcd00;
  color: #111;
}

/* Responsive */
@media (max-width: 900px) {
  .card-group { width: calc(50% - 16px); }
}
@media (max-width: 576px) {
  .card-group { width: 100%; max-width: 320px; }
}