*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: #f4f5f7;
  color: #222;
}

header {
  background: #1f2937;
  color: #fff;
  padding: 1.5rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

header p {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #d1d5db;
}

main {
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: auto;
}

.toggle-btn {
  width: 100%;
  text-align: left;
  font-size: 1.1rem;
  padding: 0.75rem 1rem;
  margin: 1rem 0 0.5rem 0;
  border: none;
  background: #2563eb;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle-btn:hover {
  background: #1d4ed8;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;

  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s ease;
}

.swatch-grid.show {
  max-height: none;
}

.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.2);
}

.swatch {
  height: 120px;
  background-size: cover;
  background-position: center;
}

.meta {
  padding: 0.6rem;
  font-size: 0.9rem;
}

.meta strong {
  display: block;
  margin-bottom: 0.25rem;
}

footer {
  text-align: center;
  padding: 1rem 0;
  font-size: 0.85rem;
  color: #555;
}

.meta .line {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #555;
}

.meta .name {
  text-transform: capitalize;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.badge {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  box-sizing: border-box;
}

.badge.out-stock {
  background: #ef4444;
  color: white;
}

.empty-message {
  width: 100%;
  padding: 1.2em;
  background-color: #f9f9f9;
  border: 2px dashed #ccc;
  border-radius: 8px;
  text-align: center;
  font-style: italic;
  color: #555;
  box-sizing: border-box;
  margin-bottom: 0.5em;
}

.update-info {
  background: #f3f4f6;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #555;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
