/* ================================================================
   mottoku — お得情報まとめ
   Modern minimalist design.
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #059669;
  --brand-mid: #10b981;
  --brand-deep: #047857;
  --brand-darker: #064e3b;
  --brand-light: #d1fae5;
  --brand-lighter: #ecfdf5;
  --brand-bg: #f0fdf4;

  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #64748b;
  --muted-light: #94a3b8;

  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --rakuten: #bf0000;
  --yahoo: #ff0033;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(5, 150, 105, 0.18), 0 4px 12px -4px rgba(15, 23, 42, 0.06);

  --container: 1240px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
               "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ================================================================
   Header — sticky, clean white background with brand accent
   ================================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 24px;
}

.site-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-name::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 2px;
}

.site-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.header-spacer { flex: 1; }

/* ================================================================
   Main container
   ================================================================ */
main {
  flex: 1;
  max-width: var(--container);
  margin: 0 auto;
  width: 100%;
  padding: 28px 24px 56px;
}

/* ================================================================
   Hero — compact left-aligned banner with brand gradient accent
   ================================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--brand-bg) 0%, #fff 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  margin-bottom: 36px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 95% 0%, rgba(16, 185, 129, 0.12) 0%, transparent 45%);
  pointer-events: none;
}

.hero-logo {
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand-darker);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  position: relative;
}

.hero-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand-deep);
  margin-bottom: 14px;
  position: relative;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 640px;
  position: relative;
}

/* ================================================================
   Section header
   ================================================================ */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}

.section-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head h2::before {
  content: "";
  width: 3px;
  height: 18px;
  background: var(--brand);
  border-radius: 2px;
}

.section-meta {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ================================================================
   Deal cards grid
   ================================================================ */
.deals-section { margin-bottom: 48px; }

.deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.deal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 180ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 180ms cubic-bezier(0.4, 0, 0.2, 1),
              border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-light);
}

.deal-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  overflow: hidden;
}

.deal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  transition: transform 220ms ease;
}

.deal-card:hover .deal-card-image img { transform: scale(1.04); }

.deal-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
  z-index: 2;
}

.badge-rakuten { background: var(--rakuten); }
.badge-yahoo   { background: var(--yahoo); }

.deal-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.deal-card-name {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
  margin: 0;
}

.deal-card-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand-darker);
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.deal-card-price-na {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin: 4px 0 0;
}

.deal-card-shop {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.deals-empty {
  text-align: center;
  color: var(--muted);
  padding: 56px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

/* ================================================================
   Stores section (chips)
   ================================================================ */
.stores-section { margin-bottom: 32px; }

.stores-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ================================================================
   Product detail page
   ================================================================ */
.product-page {
  max-width: 760px;
  margin: 0 auto;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-wrap img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

.product-image-wrap .deal-card-badge {
  top: 14px; left: 14px;
  font-size: 0.72rem;
  padding: 4px 10px;
}

.product-body {
  padding: 28px 32px 32px;
}

.product-platform {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-deep);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.product-price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--brand-darker);
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  line-height: 1;
}

.product-price-na {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.shop-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--brand-bg);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--brand-deep);
  font-weight: 600;
  margin-top: 4px;
}

.product-updated {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 10px;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  background: var(--brand-light);
  color: var(--brand-darker);
  border: 1.5px solid var(--brand-mid);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn-primary:hover {
  background: #a7f3d0;
  border-color: var(--brand);
  transform: translateY(-1px);
}

.notice-block {
  margin-top: 18px;
  background: var(--brand-bg);
  border: 1px solid var(--brand-light);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.notice-block p + p { margin-top: 4px; }

/* ================================================================
   Static pages (privacy / disclaimer)
   ================================================================ */
.static-page {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}

.static-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-darker);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--brand-light);
}

.static-page h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.static-page h2::before {
  content: "";
  width: 3px;
  height: 16px;
  background: var(--brand);
  border-radius: 2px;
}

.static-page p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 8px;
}

.static-page ul { margin: 8px 0 14px 1.4em; padding: 0; }

.static-page li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 4px;
}

.static-page a {
  color: var(--brand-deep);
  border-bottom: 1px solid var(--brand-light);
  transition: border-color 150ms ease;
}

.static-page a:hover { border-bottom-color: var(--brand); }

.static-page code {
  background: var(--brand-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--brand-darker);
}

.static-meta {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ================================================================
   Footer
   ================================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 32px 24px 28px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
}

.footer-copyright {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.footer-links { display: flex; gap: 22px; }

.footer-links a {
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 150ms ease;
}

.footer-links a:hover { color: var(--brand-deep); }

.footer-disclosure {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 0.72rem;
  color: var(--muted-light);
  line-height: 1.7;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 768px) {
  main { padding: 20px 16px 40px; }
  .hero { padding: 28px 22px 24px; border-radius: var(--radius); margin-bottom: 24px; }
  .hero-logo { font-size: 1.6rem; }
  .hero-desc { font-size: 0.84rem; }
  .deals-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .deal-card-image img { padding: 6px; }
  .deal-card-body { padding: 8px 10px 10px; }
  .deal-card-name { font-size: 0.74rem; }
  .deal-card-price { font-size: 0.95rem; }
  .deal-card-shop { font-size: 0.65rem; }
  .product-body { padding: 22px 20px 26px; }
  .product-name { font-size: 1.05rem; }
  .product-price { font-size: 1.7rem; }
  .static-page { padding: 28px 22px; border-radius: var(--radius); }
  .static-page h1 { font-size: 1.25rem; }
  .header-inner { padding: 12px 16px; gap: 12px; }
  .site-name { font-size: 1.15rem; }
}

@media (max-width: 420px) {
  .deals-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   Pagination
   ================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 150ms ease;
}

.page-link:hover {
  background: var(--brand-bg);
  border-color: var(--brand-light);
  color: var(--brand-deep);
}

.page-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: default;
}

.page-current:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--muted-light);
  font-size: 0.85rem;
}

.page-prev, .page-next {
  font-weight: 600;
}

@media (max-width: 480px) {
  .page-link { min-width: 32px; height: 32px; font-size: 0.8rem; padding: 0 8px; }
  .pagination { gap: 4px; }
}

/* ================================================================
   Filter bar — chip toggle style (modern SaaS, kaitorix inspired)
   ================================================================ */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.filter-label-inline {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 96px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 150ms ease;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}

.chip:hover {
  border-color: var(--brand-light);
  background: var(--brand-bg);
  color: var(--brand-deep);
}

.chip-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

.chip-active:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.search-row {
  border-top: 1px dashed var(--border-light);
  padding-top: 14px;
  margin-top: 4px;
  gap: 10px;
}

.search-row .filter-label-inline { display: none; }

.search-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--muted-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 40px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.search-input::placeholder { color: var(--muted-light); font-size: 0.85rem; }

.search-input:hover { border-color: var(--brand-light); }
.search-input:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.search-clear {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}

.search-clear:hover { background: var(--border); color: var(--text); }

.search-submit {
  height: 40px;
  padding: 0 22px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 10px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.search-submit:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
}

.search-submit:active { transform: translateY(1px); }

@media (max-width: 640px) {
  .filter-bar { padding: 12px 14px; gap: 10px; }
  .filter-label-inline { width: 100%; font-size: 0.62rem; }
  .chip { height: 28px; padding: 0 12px; font-size: 0.74rem; }
  .search-row { padding-top: 12px; }
  .search-input { height: 38px; font-size: 0.85rem; }
  .search-submit { height: 38px; padding: 0 16px; }
}

/* ================================================================
   Product page meta row + PR badge
   ================================================================ */
.product-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
}

/* override the prior block-level platform style so it sits inline in meta row */
.product-meta-row .product-platform {
  margin-bottom: 0;
  font-size: 0.72rem;
}

/* ================================================================
   Product page — image overlay (price + buy button at bottom)
   Inspired by kaitorix /deal/ page
   ================================================================ */
.image-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.78) 0%, rgba(15, 23, 42, 0.55) 60%, transparent 100%);
  pointer-events: none;
}

.image-overlay > * { pointer-events: auto; }

.image-overlay-btn-only { justify-content: flex-end; }

.overlay-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  line-height: 1;
}

.overlay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-darker);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.overlay-btn:hover {
  background: var(--brand-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.28);
}

@media (max-width: 640px) {
  .image-overlay { padding: 10px 12px; gap: 8px; }
  .overlay-price { font-size: 1.2rem; }
  .overlay-btn { padding: 8px 14px; font-size: 0.78rem; }
}
