/* Premium Digital Store - Clean Light Theme */

:root {
  /* Color Palette - Snack Theme (Potato Chips) */
  --bg-light: #ffffff;
  --bg-secondary: #FFF9C4;
  /* Soft Cream Yellow */
  --bg-tertiary: #FFF59D;
  --bg-gradient: linear-gradient(135deg, #ffffff 0%, #FFF9C4 100%);

  --card-bg: #ffffff;
  --card-border: #FFE082;
  --card-hover-shadow: rgba(0, 0, 0, 0.1);

  --text-main: #3E2723;
  /* Dark Brown */
  --text-muted: #6D4C41;
  --text-accent: #F44336;

  --primary: #F44336;
  /* Vibrant Red */
  --primary-dark: #D32F2F;
  --primary-gradient: linear-gradient(90deg, #F44336, #D32F2F);
  --secondary: #6c757d;
  --success: #4CAF50;
  --danger: #F44336;

  /* Header/Footer Colors */
  --header-bg: #FFC107;
  /* Golden Yellow */
  --header-text: #3E2723;
  /* Dark Brown */

  --shadow-soft: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);

  /* Spacing & Sizes */
  --container-width: 1000px;
  --header-height: 70px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Noto Sans JP', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

header .container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

header .header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-family: 'Fredoka', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--header-text);
}

header a {
  text-decoration: none;
  color: var(--header-text);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 100px 20px 60px;
  animation: fadeIn 0.8s ease-out;
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  line-height: 1.3;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 40px;
}

/* Search and Filter Section */
.search-filter-section {
  padding: 30px 0;
  background: var(--bg-secondary);
}

.search-bar {
  max-width: 600px;
  margin: 0 auto 20px;
}

.search-bar input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-light);
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.search-bar input:focus {
  border-color: var(--primary);
  background: var(--bg-light);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.category-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-btn {
  padding: 10px 24px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  background: var(--bg-light);
  color: var(--text-main);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
}

.category-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.category-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  padding-bottom: 60px;
  animation: fadeIn 1s ease-out;
}

/* Product Card */
.product-card {
  display: block;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-soft);
  position: relative;
  border: 1px solid var(--card-border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.card-image-placeholder {
  width: 100%;
  height: 180px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 500;
}

.product-card img {
  transition: transform 0.5s ease;
}

.product-card:hover img {
  transform: scale(1.05);
}

.card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 600;
}

.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-accent);
  margin-top: auto;
}

/* Product Detail */
.product-detail-container {
  padding: 40px 0;
  animation: fadeIn 0.6s ease-out;
}

.product-detail {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-soft);
}

.detail-header {
  margin-bottom: 30px;
}

.detail-title {
  font-size: 2.2rem;
  margin: 0 0 15px;
  color: var(--text-main);
  font-weight: 700;
}

.detail-price {
  font-size: 1.8rem;
  color: var(--primary);
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
}

.detail-description {
  margin-bottom: 50px;
  white-space: pre-wrap;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.9;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  padding: 30px 0;
}

.btn-buy {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  background: var(--primary);
  color: #ffffff;
  padding: 18px 0;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
  border: none;
  cursor: pointer;
}

.btn-buy:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}



/* Footer home icon etc */
.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 30px;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
  font-weight: 600;
}

.back-link:hover {
  color: var(--primary);
}

footer {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 60px 0 40px;
  text-align: center;
  color: var(--header-text);
  font-size: 0.85rem;
  margin-top: auto;
  background: var(--header-bg);
}

footer a {
  color: var(--header-text);
  text-decoration: none;
  transition: color 0.2s;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.9);
}

footer p:last-of-type {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

footer p:last-of-type::before,
footer p:last-of-type::after {
  content: none;
}

/* Mobile Responsive */
/* Image Gallery (Mercari-like) */
.gallery-container {
  width: 100%;
  margin-bottom: 24px;
}

.main-image-area {
  width: 100%;
  aspect-ratio: 4 / 3;
  /* Mercari style often 1:1 or 4:3 */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
  border: 1px solid var(--glass-border);
  touch-action: pan-y;
  /* 横スクロール（スワイプ）時のブラウザ既定動作を抑制 */
}

.main-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Show full image */
  background-color: #0f0f13;
  transition: opacity 0.3s ease;
}

.thumbnail-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.thumbnail-item {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
  background: #000;
}

.thumbnail-item.active {
  border-color: var(--text-accent);
  opacity: 1;
}

.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 600px) {
  .hero {
    padding: 60px 20px 40px;
  }

  .hero h2 {
    font-size: 1.8rem;
  }

  .search-filter-section {
    padding: 20px 16px;
  }

  .search-bar {
    max-width: 100%;
    margin: 0 0 16px;
  }

  .search-bar input {
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .category-btn {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-detail {
    padding: 25px;
  }

  .detail-title {
    font-size: 1.6rem;
  }
}