/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --castorama-blue: #0066cc;
  --castorama-blue-light: #3385d6;
  --castorama-blue-dark: #004499;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--neutral-700);
  background-color: var(--neutral-50);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--neutral-200);
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.saturn-logo h1 {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--neutral-800);
  letter-spacing: -0.02em;
}

.collaboration {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.for-text {
  font-size: 1.1rem;
  color: var(--neutral-500);
  font-style: italic;
}

.castorama-logo {
  background: var(--castorama-blue);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.hero-description {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--neutral-600);
  line-height: 1.7;
}

/* Filter Bar */
.filter-bar {
  background: white;
  padding: 2rem;
  border-bottom: 1px solid var(--neutral-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.filter-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.filters {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--neutral-600);
}

.filter-group select,
.sorting select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  color: var(--neutral-700);
  min-width: 140px;
  transition: border-color 0.2s ease;
}

.filter-group select:focus,
.sorting select:focus {
  outline: none;
  border-color: var(--castorama-blue);
  box-shadow: 0 0 0 3px rgb(0 102 204 / 0.1);
}

.sorting {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sorting label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--neutral-600);
}

.results-count {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--neutral-500);
}

/* Collections Gallery */
.collections-gallery {
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.collection-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-image-container {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.collection-card:hover .card-image {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.collection-card:hover .card-overlay {
  opacity: 1;
}

.card-overlay .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--castorama-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--castorama-blue-dark);
}

.btn-secondary {
  background: white;
  color: var(--neutral-700);
}

.btn-secondary:hover {
  background: var(--neutral-100);
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 0.5rem;
}

.card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: var(--neutral-100);
  color: var(--neutral-600);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--neutral-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-400);
  font-size: 0.9rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 16px;
  max-width: 1000px;
  max-height: 90vh;
  width: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: white;
}

.modal-hero {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-body {
  padding: 2rem;
}

.collection-info {
  margin-bottom: 2rem;
}

.collection-title {
  font-size: 2rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 1rem;
}

.collection-description {
  color: var(--neutral-600);
  line-height: 1.7;
}

.configurator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.configurator h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 1rem;
}

.shade-swatches {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.shade-swatch {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--neutral-300);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.shade-swatch:hover {
  transform: scale(1.05);
}

.shade-swatch.active {
  border-color: var(--castorama-blue);
  box-shadow: 0 0 0 3px rgb(0 102 204 / 0.2);
}

.shade-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shade-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem;
  text-align: center;
}

.format-chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.format-chip {
  padding: 0.75rem 1rem;
  border: 1px solid var(--neutral-300);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
}

.format-chip:hover {
  border-color: var(--castorama-blue);
}

.format-chip.active {
  background: var(--castorama-blue);
  color: white;
  border-color: var(--castorama-blue);
}

.tile-preview {
  grid-column: span 2;
  text-align: center;
}

.tile-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.variant-parameters {
  grid-column: span 2;
  background: var(--neutral-50);
  padding: 1.5rem;
  border-radius: 8px;
}

.parameters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.parameter {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parameter .label {
  font-weight: 500;
  color: var(--neutral-600);
}

.parameter .value {
  font-weight: 600;
  color: var(--neutral-800);
}

.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-buttons .btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variant-strip {
  border-top: 1px solid var(--neutral-200);
  padding-top: 2rem;
}

.variant-strip h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--neutral-800);
  margin-bottom: 1rem;
}

.variant-thumbnails {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.variant-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  border: 2px solid var(--neutral-300);
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.variant-thumbnail:hover {
  transform: scale(1.05);
}

.variant-thumbnail.active {
  border-color: var(--castorama-blue);
  box-shadow: 0 0 0 2px rgb(0 102 204 / 0.2);
}

.variant-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Footer */
.footer {
  background: var(--neutral-800);
  color: var(--neutral-300);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem;
  }

  .logos {
    flex-direction: column;
    gap: 1.5rem;
  }

  .saturn-logo h1 {
    font-size: 2rem;
  }

  .filter-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .filters {
    justify-content: center;
  }

  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .configurator {
    grid-template-columns: 1fr;
  }

  .tile-preview {
    grid-column: span 1;
  }

  .variant-parameters {
    grid-column: span 1;
  }

  .modal {
    padding: 1rem;
  }

  .modal-body {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .collections-gallery {
    padding: 2rem 1rem;
  }

  .collection-title {
    font-size: 1.5rem;
  }

  .parameters-grid {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    flex-direction: column;
  }
}

/* Loading and Animation States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus States for Accessibility */
.shade-swatch:focus,
.format-chip:focus,
.variant-thumbnail:focus {
  outline: 2px solid var(--castorama-blue);
  outline-offset: 2px;
}

button:focus,
select:focus {
  outline: 2px solid var(--castorama-blue);
  outline-offset: 2px;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
