/* Base styles and CSS variables */
:root {
  /* Light theme variables */
  --background-color: #f5f5f7;
  --text-color: #1d1d1f;
  --secondary-text-color: #86868b;
  --card-background: #fff;
  --gradient-start: #fff;
  --gradient-end: #f5f5f7;
  --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Dark theme variables */
@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #000000;
    --text-color: #f5f5f7;
    --secondary-text-color: #a1a1a6;
    --card-background: rgb(33, 33, 33);
    --gradient-start: #171717;
    --gradient-end: #000000;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }
}

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

/* Base styles */
body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

/* Layout */
.store-container {
  max-width: 100%;
  margin: 0 auto;
  padding-bottom: 5rem;
}

/* Header */
.store-header {
  text-align: center;
  padding-top: 3.75rem;
  background: linear-gradient(
    180deg,
    var(--gradient-start) 0%,
    var(--gradient-end) 100%
  );
  margin-bottom: 2.5rem;
}

.store-header h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 1.25rem;
  padding: 0 1.25rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: fadeInUp 0.8s ease forwards;
}

/* Grid layout */
.items-grid {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 3.75rem;
}

/* Item cards */
.item-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(2.5rem);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 3.75rem;
}

.item-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.item-image {
  width: 100%;
  order: -1;
}

.item-image img {
  width: 100%;
  height: auto;
  max-height: 18.75rem;
  object-fit: cover;
  border-radius: 1.25rem;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card details */
.item-details {
  padding: 1.5rem;
  background: var(--card-background);
  border-radius: 1.25rem;
  transition: background-color 0.3s ease;
}

.item-details h2 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.item-details p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--secondary-text-color);
  margin-bottom: 1.25rem;
}

.price {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.25rem;
}

.store {
  font-size: 1.0625rem;
  color: var(--secondary-text-color);
  margin-bottom: 1.25rem;
}

/* Buttons */
.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #0071e3;
  color: white;
  padding: 0.75rem 1.875rem;
  border-radius: 1.875rem;
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-buttons {
  margin: 1.5rem auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 75rem;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 1.875rem;
  background: var(--card-background);
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 0.125rem 0.5rem var(--shadow-color);
}

.filter-btn.active {
  background: #0071e3;
}

/* Hover states */
@media (hover: hover) {
  .item-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 1.25rem 2.5rem var(--shadow-color);
  }

  .store-link:hover {
    background: #0077ed;
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.5rem var(--shadow-color);
  }

  .filter-btn:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem var(--shadow-color);
  }
}

/* Desktop styles */
@media (min-width: 48rem) {
  .store-header {
    padding-top: 7.5rem;
    margin-bottom: 3.75rem;
  }

  .store-header h1 {
    font-size: 3.5rem;
  }

  .items-grid {
    gap: 7.5rem;
    padding: 0 1.25rem;
  }

  /* Desktop: side by side layout */
  .item-card {
    flex-direction: row;
    align-items: center;
    gap: 3.75rem;
    margin-bottom: 7.5rem;
  }

  .item-image {
    flex: 1;
    max-width: 37.5rem;
    order: 0;
  }

  .item-card:nth-child(even) {
    flex-direction: row-reverse;
  }

  .item-image img {
    max-height: none;
  }

  .item-details {
    flex: 1;
    padding: 2.5rem;
  }

  .item-details h2 {
    font-size: 2.5rem;
  }

  .item-details p {
    font-size: 1.125rem;
  }

  .store-link {
    width: auto;
  }
}

/* Animations */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
