/* JapanSavers v3.0 - Mobile-First Accessible Stylesheet */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #cbd5e1;
  --primary: #b91c1c;
  --primary-dark: #991b1b;
  --secondary: #1e3a8a;
  --success: #15803d;
  --success-bg: #f0fdf4;
  --warning: #b45309;
  --warning-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", "Noto Sans KR", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

img, svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navigation */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.2rem;
}

.brand-badge {
  background: var(--primary);
  color: #fff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
}

.brand-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lang-switcher {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-alt);
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 8px 10px;
  min-height: 40px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
}

.lang-btn.active {
  background: var(--secondary);
  color: #fff;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
}

.main-nav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 6px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
}

.main-nav.open {
  display: flex;
}

.main-nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.main-nav a:hover, .main-nav a:focus {
  background: var(--surface-alt);
}

@media (min-width: 920px) {
  .menu-toggle {
    display: none;
  }
  .main-nav {
    display: flex;
    width: auto;
    flex-direction: row;
    border-top: none;
    padding: 0;
  }
}

/* Disclosure Banner */
.top-disclosure {
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  font-size: 0.85rem;
  padding: 10px 0;
  color: #1e3a8a;
}

/* Hero & Context Bar */
.hero {
  padding: 28px 0 20px;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  line-height: 1.25;
  overflow-wrap: break-word;
}

.hero p {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.city-weather-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-alt);
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.city-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.weather-status-box {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Sections */
.section {
  padding: 24px 0;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

/* Search & Filter Bar */
.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .filter-panel {
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: end;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.input-control, .select-control {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 12px;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

/* Coupon Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.coupon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  overflow-wrap: break-word;
}

.coupon-card.expired {
  opacity: 0.65;
  background: var(--surface-alt);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.badge-discount {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.badge-jcb {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.badge-verified {
  background: var(--success-bg);
  color: var(--success);
  border-color: #bbf7d0;
}

.badge-expired {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #fecaca;
}

.coupon-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.terms-box {
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.86rem;
  border: 1px solid var(--border);
}

.terms-box ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.terms-box li {
  margin-bottom: 4px;
}

.screenshot-warning {
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.tax-vs-coupon-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #075985;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary[aria-disabled="true"] {
  background: #94a3b8;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-alt);
}

.link-disclosure {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 18px;
  text-align: center;
}

/* Tax Calculator */
.calc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .calc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.calc-results {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 768px) {
  .calc-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.result-tile {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.result-tile.highlight {
  background: var(--success-bg);
  border-color: #86efac;
}

.result-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.result-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  margin-top: 4px;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f172a;
  color: #f8fafc;
  padding: 14px 16px;
  z-index: 60;
  border-top: 1px solid #334155;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  margin-top: 32px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0;
}
