/* ============================================
   R SHOP - Game Shop Page Styles
   Mode toggle, game hub, product grid, cards
   ============================================ */

/* --- Page Header --- */
.page-header {
  text-align: center;
  padding: 32px 20px 20px;
  animation: fadeInUp 0.6s ease both;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  letter-spacing: 8px;
  color: var(--white);
  transition: opacity 0.3s ease;
}

.page-title-line {
  width: 40px;
  height: 2px;
  background: linear-gradient(to right, var(--purple), var(--gold));
  margin: 12px auto 0;
}

/* --- Mode Toggle --- */
.mode-toggle-section {
  padding: 0 20px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin: 0 auto 20px;
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.15);
  color: var(--gray);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px;
}

.mode-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mode-btn:hover {
  border-color: rgba(201, 168, 76, 0.3);
  color: var(--white);
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(139, 92, 246, 0.1));
  border-color: var(--gold);
  color: var(--gold);
}

/* --- Game Hub --- */
.game-hub {
  padding: 0 20px 32px;
  animation: fadeInUp 0.6s ease 0.15s both;
}

.game-hub-desc {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  margin-bottom: 20px;
}

.game-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

/* --- Game Card --- */
.game-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(201, 168, 76, 0.1);
  transition: all 0.4s ease;
  animation: fadeInUp 0.5s ease both;
  min-height: 150px;
}

.game-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.game-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.7;
  transition: opacity 0.4s ease;
}

.game-card-bg.has-image {
  opacity: 1;
}

.game-card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.7s ease;
}

.game-card:hover .game-card-bg-img {
  opacity: 1;
  transform: scale(1.04);
}

.game-card:hover .game-card-bg {
  opacity: 0.9;
}

.game-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  padding: 20px 24px;
  gap: 12px;
  min-height: inherit;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.2) 45%,
    transparent 70%
  );
}

.game-card-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 4px 12px rgba(0,0,0,0.5);
}

.game-card-name-en {
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
  margin-left: auto;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.game-card-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.3s ease, transform 0.3s ease;
}

.game-card-arrow svg {
  width: 18px;
  height: 18px;
}

.game-card:hover .game-card-arrow {
  color: var(--gold);
  transform: translateX(4px);
}

/* --- Product Detail View --- */
.product-detail-view {
  padding: 0 20px 48px;
  animation: fadeInUp 0.5s ease both;
}

/* Back to Hub */
.back-to-hub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--gray);
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 16px;
  transition: color 0.3s ease;
  min-height: 36px;
}

.back-to-hub svg {
  width: 16px;
  height: 16px;
}

.back-to-hub:hover {
  color: var(--gold);
}

/* Selected Game Banner */
.selected-game-banner {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  aspect-ratio: 16 / 7;
  border: 1px solid rgba(201, 168, 76, 0.1);
}

.banner-bg {
  position: absolute;
  inset: 0;
  opacity: 0.6;
}

.banner-bg.has-image {
  opacity: 1;
}

.banner-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.selected-game-banner:hover .banner-bg-img {
  opacity: 0.85;
}

.banner-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 20px 24px;
  height: 100%;
  box-sizing: border-box;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    transparent 65%
  );
}

.banner-name {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 4px 16px rgba(0,0,0,0.5);
}

.banner-name-en {
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: auto;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* --- Filter Bar (inside detail view) --- */
.filter-bar {
  animation: fadeInUp 0.6s ease 0.1s both;
}

/* Sub filters (category + sort) */
.sub-filters {
  display: flex;
  gap: 10px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
}

.filter-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--black-card);
  border: 1px solid rgba(201, 168, 76, 0.12);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 12px;
  padding: 10px 36px 10px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.3s ease;
  min-height: 40px;
}

.filter-select:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.3);
}

.filter-select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--gray);
  pointer-events: none;
}

/* --- Product Grid --- */
.product-section {
  padding: 0;
}

.product-count {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* --- Product Card --- */
.product-card {
  background: var(--black-card);
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.4s ease;
  animation: fadeInUp 0.5s ease both;
}

.product-card:hover {
  border-color: rgba(201, 168, 76, 0.2);
  transform: translateY(-2px);
}

/* Card image area */
.product-image {
  position: relative;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image-icon {
  color: rgba(255, 255, 255, 0.12);
}

.product-image-icon svg {
  width: 48px;
  height: 48px;
}

/* Product card thumbnail image */
.product-image--photo {
  position: relative;
}

.product-image-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  background: #0a0a0a;
}

.product-image--photo .product-game-badge,
.product-image--photo .product-category-badge {
  z-index: 2;
}

.product-game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 2px;
}

.product-category-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 2px;
}

/* Card body */
.product-body {
  position: relative;
  padding: 16px;
}

.product-category {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.product-number {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--gray-dark);
  font-family: var(--font-body);
  margin-bottom: 6px;
}

.product-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
  line-height: 1.4;
}

.product-desc {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 14px;
}

.product-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--white);
  letter-spacing: 1px;
}

.product-price-yen {
  font-size: 11px;
  color: var(--gray);
  margin-right: 2px;
}

.product-stock {
  font-size: 10px;
  color: var(--gray);
}

.product-stock.low {
  color: var(--crimson);
}

.product-stock.sold-out {
  color: var(--crimson);
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.product-card.is-sold-out {
  opacity: 0.55;
  pointer-events: none;
}

.product-sold-out-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  background: var(--crimson);
  color: #fff;
  font-family: var(--font-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  padding: 6px 20px;
  border-radius: 3px;
  z-index: 5;
  white-space: nowrap;
  pointer-events: none;
}

.product-views {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--gray-dark);
}

.product-views svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  animation: fadeInUp 0.5s ease both;
}

.empty-icon {
  color: var(--gray-dark);
  margin-bottom: 16px;
}

.empty-icon svg {
  width: 48px;
  height: 48px;
}

.empty-title {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--gray);
  margin-bottom: 8px;
}

.empty-desc {
  font-size: 12px;
  color: var(--gray-dark);
}

/* ================================================
   PC Enhancement (min-width: 769px)
   ================================================ */
@media (min-width: 769px) {
  .page-header {
    padding: 48px 40px 24px;
  }

  .page-title {
    font-size: 26px;
    letter-spacing: 10px;
  }

  .page-title-line { width: 52px; }

  /* Mode toggle */
  .mode-toggle-section {
    padding: 0 40px;
  }

  .mode-toggle {
    max-width: 440px;
  }

  .mode-btn {
    font-size: 14px;
    padding: 14px 20px;
    min-height: 48px;
  }

  .mode-btn-icon {
    width: 18px;
    height: 18px;
  }

  /* Game hub */
  .game-hub {
    padding: 0 40px 40px;
  }

  .game-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 420px));
    justify-content: center;
    gap: 20px;
    max-width: 900px;
  }

  .game-card {
    min-height: 180px;
  }

  .game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  }

  .game-card-name {
    font-size: 18px;
    letter-spacing: 3px;
  }

  .game-card-name-en {
    font-size: 11px;
  }

  /* Product detail view */
  .product-detail-view {
    padding: 0 40px 80px;
    max-width: 1280px;
    margin: 0 auto;
  }

  .back-to-hub {
    font-size: 13px;
    margin-bottom: 20px;
  }

  .selected-game-banner {
    aspect-ratio: 21 / 9;
    max-height: 240px;
    margin-bottom: 24px;
  }

  .banner-name {
    font-size: 24px;
    letter-spacing: 6px;
  }

  .banner-name-en {
    font-size: 12px;
    letter-spacing: 4px;
  }

  .filter-bar {
    max-width: 1280px;
    margin: 0 auto;
  }

  .sub-filters { flex-wrap: nowrap; }

  .filter-select-wrap { min-width: 180px; flex: 0 1 220px; }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  }

  .product-image { height: 160px; }
  .product-name { font-size: 15px; }
  .product-price { font-size: 20px; }

  .empty-state { padding: 80px 40px; }
}

/* Large desktop: 3 columns */
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
