/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

:root {
  --bg:       #F9F7F4;
  --bg-alt:   #F2EDE8;
  --accent:   #9B8FA0;
  --text:     #3A3530;
  --text-sub: #7A706A;
  --border:   #E0D8D0;
  --white:    #FFFFFF;
  --shadow:   rgba(58,53,48,0.08);
  --price:    #7A6068;
  --danger:   #c0504d;
}

body {
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ===== Header ===== */
header {
  position: sticky;
  top: 0; z-index: 100;
  background: rgba(249,247,244,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.logo span {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.62rem;
  color: var(--text-sub);
  display: block;
  letter-spacing: 0.1em;
  margin-top: -2px;
}
nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  color: var(--text-sub);
  text-decoration: none;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--accent); }
.cart-btn {
  position: relative;
  background: none; border: none;
  cursor: pointer; padding: 6px;
  color: var(--text);
}
.cart-btn svg { display: block; }
.cart-badge {
  position: absolute;
  top: 0; right: 0;
  background: var(--accent);
  color: #fff;
  font-family: sans-serif;
  font-size: 0.62rem;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
}
.cart-badge.visible { display: flex; }

/* ===== Page Switch ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== Hero ===== */
.hero {
  background: var(--bg-alt);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 1rem;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}
.hero > p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.85rem;
  color: var(--text-sub);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  line-height: 1.9;
}

/* Price Guide */
.price-guide {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
}
.pg-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 110px;
}
.pg-item.pg-highlight { border-color: var(--accent); }
.pg-count {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.06em;
}
.pg-price {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--price);
}
.pg-item.pg-highlight .pg-price { color: var(--accent); }
.pg-save {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.65rem;
  color: var(--accent);
}

/* ===== Filter Bar ===== */
.filter-bar {
  padding: 1rem 1.5rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.78rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--white);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.filter-chip.active,
.filter-chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ===== Lesson Grid ===== */
.lesson-grid {
  padding: 2rem 1.5rem 5rem;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* ===== Card ===== */
.card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px var(--shadow);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(58,53,48,0.12);
}
.card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-alt);
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.card:hover .card-thumb img { transform: scale(1.04); }
.card-body { padding: 1rem 1.1rem 1.1rem; }
.card-date {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.68rem;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 0.3rem;
  line-height: 1.5;
}
.card-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-price {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--price);
}
.card-duration {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== Detail Page ===== */
.detail-back {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.8rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  width: fit-content;
  transition: color 0.2s;
  text-decoration: none;
}
.detail-back:hover { color: var(--accent); }
.detail-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 700px) {
  .detail-wrap { grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }
}
.detail-thumb {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-alt);
}
.detail-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.detail-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.detail-title {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin-bottom: 1.2rem;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.meta-tag {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-sub);
  background: var(--white);
}
.detail-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 2;
  margin-bottom: 1.4rem;
}
.detail-notes {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.6rem;
}
.detail-notes p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--text-sub);
  line-height: 1.9;
}
.detail-notes p::before { content: '※ '; }
.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.detail-price {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--price);
}
.detail-price-unit {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  color: var(--text-sub);
}
.btn-cart {
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-cart:hover { background: #8a7d90; transform: translateY(-1px); }
.btn-cart.added { background: #5a7a5e; }

/* ===== Cart Drawer ===== */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58,53,48,0.35);
  z-index: 200;
  cursor: pointer;
}
.cart-overlay.open { display: block; }
.cart-drawer {
  position: fixed;
  top: 0; right: -420px;
  width: min(420px, 95vw);
  height: 100%;
  background: var(--white);
  z-index: 201;
  box-shadow: -4px 0 32px rgba(58,53,48,0.12);
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { right: 0; }
.cart-header {
  padding: 1.4rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-header h2 {
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}
.cart-close {
  background: none; border: none;
  cursor: pointer; color: var(--text-sub);
  font-size: 1.1rem; padding: 4px;
  transition: color 0.2s;
}
.cart-close:hover { color: var(--text); }
.cart-body { flex: 1; overflow-y: auto; padding: 1rem 1.5rem; }
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 0.8rem;
  color: var(--text-sub);
}
.cart-empty p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
}
.cart-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item-thumb {
  width: 64px; height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.cart-item-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}
.cart-item-price {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.78rem;
  color: var(--price);
  font-weight: 600;
}
.cart-item-remove {
  background: none; border: none;
  cursor: pointer; color: var(--text-sub);
  font-size: 0.7rem; padding: 4px;
  transition: color 0.2s; flex-shrink: 0;
}
.cart-item-remove:hover { color: var(--danger); }
.cart-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}
.cart-hint {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--accent);
  min-height: 1.5em;
  margin-bottom: 0.6rem;
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}
.cart-total-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  color: var(--text-sub);
}
.cart-total-price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--price);
}
.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: var(--text);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-checkout:hover { background: #5a4f48; }

/* ===== Email Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58,53,48,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  box-shadow: 0 8px 40px rgba(58,53,48,0.15);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.modal-desc {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-bottom: 18px;
  line-height: 1.7;
}
.modal-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 6px;
}
.modal-input:focus { border-color: var(--accent); }
.modal-error {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--danger);
  min-height: 1.4em;
  margin-bottom: 16px;
}
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-modal-cancel {
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-sub);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-modal-cancel:hover { border-color: var(--text-sub); }
.btn-modal-confirm {
  padding: 10px 22px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-modal-confirm:hover { background: #8a7d90; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--text);
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.82rem;
  padding: 0.75rem 1.5rem;
  border-radius: 99px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 400;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Footer ===== */
footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}
footer p {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  color: var(--text-sub);
  line-height: 2;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .hero { padding: 2.5rem 1.2rem 2rem; }
  .lesson-grid { grid-template-columns: 1fr 1fr; gap: 0.9rem; padding: 1.2rem 1rem 4rem; }
  .card-desc { display: none; }
  .card-body { padding: 0.7rem 0.8rem 0.85rem; }
  .card-title { font-size: 0.85rem; }
  .price-guide { gap: 6px; }
  .pg-item { min-width: 90px; padding: 10px 12px; }
}
