/* --- Explore Hero Section --- */
.explore-hero {
  position: relative;
  background-color: var(--fg);
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.explore-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.explore-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.2) 100%
  );
  z-index: 1;
}

.explore-hero-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    rgba(255, 210, 0, 0.15) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  opacity: 0.3;
  z-index: 2;
}

.explore-hero .relative {
  z-index: 3;
}

/* --- Filter Buttons --- */
.filter-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: var(--bg);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn:hover {
  background-color: var(--accent-soft);
  color: var(--fg);
  transform: translateY(-1px);
}

.filter-btn.active {
  background-color: var(--accent);
  color: var(--black);
  border-color: var(--accent);
  font-weight: 600;
  transform: translateY(0);
}

/* --- Sort Select --- */
.sort-select {
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  transition: all 0.2s ease;
}

.sort-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 210, 0, 0.15);
}

/* --- Colour Cards --- */
.colour-card {
  position: relative;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.colour-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.colour-swatch {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
}

.colour-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.colour-card:hover .colour-swatch::after {
  opacity: 1;
}

.colour-info {
  padding: 0.75rem;
  text-align: center;
  background: var(--bg);
}

.colour-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--fg);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.colour-code {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-family: monospace;
}

/* --- Modal Styles --- */
.colour-modal {
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.colour-modal.show {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  transition: background-color 0.2s ease;
}

.modal-content {
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close {
  z-index: 10;
}

.modal-swatch {
  position: relative;
}

.modal-swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(#e5e5e5 0% 25%, white 0% 50%) 50% / 20px
    20px;
  z-index: -1;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .filter-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .colour-card {
    border-radius: 8px;
  }

  .colour-info {
    padding: 0.5rem;
  }

  .colour-name {
    font-size: 0.75rem;
  }

  .colour-code {
    font-size: 0.65rem;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  .colour-card,
  .filter-btn,
  .modal-content {
    transition: none;
    animation: none;
  }
}

/* --- Light colours need dark border for visibility --- */
.colour-card[data-category="whites"] .colour-swatch,
.colour-card[data-category="yellows"] .colour-swatch {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
