/**
 * コンポーネント専用のCSS
 * カスタムクラスを定義して、JSからUnoCSSクラス名を分離
 */

/* ヘッダーナビゲーション */
#app-header nav a {
  white-space: nowrap;
}

#app-header nav a.active {
  color: #3b82f6;
  background-color: #eff6ff;
  font-weight: 600;
}

/* ボタンスタイル */
.btn-back {
  background-color: #ffffff;
  color: #374151;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 2px solid #e5e7eb;
  cursor: pointer;
  font-size: 0.9375rem;
}

.btn-back:hover {
  background-color: #f9fafb;
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.btn-back:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary-large {
  background-color: #3b82f6;
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
}

.btn-primary-large:hover {
  background-color: #2563eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.btn-search {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3), 0 2px 4px rgba(59, 130, 246, 0.2);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn-search::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-search:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4), 0 4px 8px rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.btn-search:hover::before {
  width: 300px;
  height: 300px;
}

.btn-search:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.btn-store-view {
  background-color: #3b82f6;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: none;
  cursor: pointer;
}

.btn-store-view:hover {
  background-color: #2563eb;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

/* カードスタイル（pages.cssで定義されているため、ここでは削除） */

.store-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background-color: white;
  border-radius: 0.625rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  border: 1px solid #e5e7eb;
}

.store-card:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
  transform: translateY(-2px);
  border-color: #93c5fd;
}

/* 全カード同一比率のサムネイル領域 */
.store-card-flyer-wrap {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f3f4f6;
}

.store-card-flyer,
#stores-container .store-card img,
#today-flyers-container .store-card img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center;
  display: block;
}

/* テンプレート崩れ時のフォールバック（img が wrap 外に出た場合） */
#stores-container .store-card > img,
#today-flyers-container .store-card > img {
  position: static;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  object-fit: cover !important;
}

.store-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: #ef4444;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.store-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0.625rem 0.75rem 0.75rem;
  min-height: 6.5rem;
}

.store-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
}

.store-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

.store-card-meta-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.store-card-meta-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.store-card-price {
  color: #dc2626;
  font-weight: 700;
  font-size: 1rem;
}

.store-card-product {
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  min-width: 0;
}

.store-card-product-text {
  flex: 1;
  min-width: 0;
}

.store-card-item-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  margin: 0 0 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-card-api-note {
  font-size: 0.6875rem;
  color: #6b7280;
  line-height: 1.4;
  margin: 0;
}

/* ジャンルカードボタン（サンプルに基づいたシンプルなデザイン） */
.genre-card-button {
  display: inline-block;
  background-color: #4CAF50;
  color: white;
  padding: 20px 30px;
  text-decoration: none;
  border-radius: 8px;
  margin: 8px;
  font-size: 18px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-width: 120px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.genre-card-button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.genre-card-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 8px;
  display: block;
}

.genre-card-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  display: block;
}

/* 入力フィールド */
.search-input {
  width: 100%;
  padding-left: 3.5rem;
  padding-right: 6rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1.125rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #3b82f6;
  border-color: #3b82f6;
}

/* 情報ボックス */
.info-box {
  border-left-width: 4px;
  padding: 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
}

.info-box.blue {
  background-color: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
}

.info-box.green {
  background-color: #f0fdf4;
  border-color: #10b981;
  color: #065f46;
}

/* 商品表示 */
.item-highlight {
  background-color: #fef2f2;
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-top: 0.75rem;
  border-left: 4px solid #ef4444;
}
