/**
 * top.css - トップページ専用スタイル
 * customer.njk の styles: frontmatter でトップページにのみ読み込まれます
 */

/* ===== HERO SLIDER ===== */
.hero-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  background-color: #f5f5f5;
  padding: 20px 0;
}
.hero-slider .slides-track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
}
.hero-slider .slide-card {
  width: 500px;
  height: 500px;
  flex-shrink: 0;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #bbb;
  overflow: hidden;
  text-decoration: none;
}
.hero-slider .slide-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .85);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

/* ===== 2COL AREA (sidebar + main) ===== */
.two-col-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 30px;
  padding: 30px 20px;
}
.sidebar { width: 220px; flex-shrink: 0; }
.two-col-main { flex: 1; min-width: 0; }

/* ===== 1COL AREA ===== */
.one-col-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== SIDEBAR ===== */
.side-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.side-banner-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-light);
  text-decoration: none;
  transition: box-shadow .2s;
}
.side-banner-item:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); text-decoration: none; }

.side-section { margin-bottom: 16px; border: 1px solid var(--border); overflow: hidden; }
.side-section-title {
  background: var(--primary);
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.side-section-title::after { content: "＋"; font-size: 14px; }
.side-section.open .side-section-title::after { content: "－"; }
.side-section-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.side-section.open .side-section-body { max-height: 600px; }
.side-section-body ul { padding: 8px 0; list-style: none; margin: 0; }
.side-section-body li a {
  display: block;
  padding: 5px 14px 5px 24px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
}
.side-section-body li a::before { content: "›"; margin-right: 6px; color: var(--primary); }
.side-section-body li a:hover { background: var(--primary-light); text-decoration: none; }

/* ===== SECTION HEADINGS ===== */
.section-title {
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: center;
  margin: 36px 0 20px;
  padding-bottom: 10px;
  display: inline-block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* ===== GRIDS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 30px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }

/* ===== TOP PAGE CARDS ===== */
.card-top {
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow .2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card-top:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); text-decoration: none; color: var(--text); }
.card-top .card-img {
  aspect-ratio: 1;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 12px;
}
.card-top .card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-top .card-body { padding: 10px 12px; }
.card-top .card-body .name {
  font-size: 12px;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-top .card-body .price { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.card-top .card-body .price small { font-size: 10px; font-weight: 400; color: var(--text-light); }

/* ===== BANNER ===== */
.banner-card {
  background: var(--bg-gray);
  border: 1px solid var(--border);
  aspect-ratio: 16/5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  transition: box-shadow .2s;
  text-decoration: none;
}
.banner-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, .08); text-decoration: none; }

/* ===== BRAND ===== */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 30px;
}
.brand-item {
  aspect-ratio: 3/2;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #333;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s;
  text-decoration: none;
  text-align: center;
  padding: 8px;
}
.brand-item img { max-width: 80%; max-height: 60%; object-fit: contain; }
.brand-item:hover { border-color: var(--primary); text-decoration: none; color: var(--primary); }

/* ===== CATEGORY ===== */
.cat-section { margin-bottom: 4rem; }
.cat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-row + .cat-row { margin-top: 12px; }
.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  place-content: center;
  padding: 14px 16px;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  user-select: none;
}
.cat-item:hover { border-color: var(--primary); }
.cat-item.active { border-color: var(--primary); background: var(--primary-light); }
.cat-item .icon { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; }

/* PC: row-level sub (shared across 3 cols) */
.cat-sub-row {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: var(--bg-gray);
  padding: 0 16px;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  display: flex;
  transition: max-height .4s ease, opacity .4s ease, padding .4s ease, margin .4s ease;
  margin-top: 0;
}
.cat-sub-row.open { max-height: 200px; opacity: 1; padding: 16px; margin-top: 12px; }
.cat-sub-row a {
  display: inline-block;
  padding: 8px 20px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  transition: border-color .2s, background .2s;
  text-decoration: none;
}
.cat-sub-row a:hover { border-color: var(--primary); background: var(--primary-light); }

/* SP: col-level sub (per item) */
.cat-sub-col {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: var(--bg-gray);
  padding: 0 16px;
  gap: 10px;
  flex-wrap: wrap;
  display: none;
  transition: max-height .4s ease, opacity .4s ease, padding .4s ease, margin .4s ease;
  margin-top: 0;
}
.cat-sub-col.open { max-height: 200px; opacity: 1; padding: 16px; margin-top: 8px; }
.cat-sub-col a {
  display: inline-block;
  padding: 8px 20px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
  transition: border-color .2s, background .2s;
  text-decoration: none;
}
.cat-sub-col a:hover { border-color: var(--primary); background: var(--primary-light); }

/* ===== NEWS ===== */
.news-section { margin-bottom: 4rem; }
.news-section .section-title { margin-top: 20px; }
.news-list { border-top: 1px solid var(--border); list-style: none; margin: 0; padding: 0; }
.news-list li { border-bottom: 1px solid var(--border); }
.news-list li a {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 4px;
  color: var(--text);
  transition: background .2s;
  text-decoration: none;
}
.news-list li a:hover { background: var(--primary-light); text-decoration: none; }
.news-date { font-size: 12px; color: var(--text-light); flex-shrink: 0; width: 90px; }
.news-tag { font-size: 10px; color: #fff; background: var(--primary); padding: 2px 10px; flex-shrink: 0; }
.news-title { font-size: 1rem; flex: 1; }

/* ===== RANKING ===== */
.ranking-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 30px; }
.ranking-card { position: relative; }
.ranking-card .rank-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  z-index: 1;
}

/* ===== DESC BOX ===== */
.desc-box {
  background: var(--bg-gray);
  padding: 24px;
  margin: 30px 0;
  text-align: center;
}
.desc-box h2 { font-size: 16px; margin-bottom: 10px; color: var(--primary-dark); }
.desc-box p { font-size: 13px; color: var(--text-light); line-height: 2; }

/* ===== FAQ ===== */
.faq-list { margin-bottom: 30px; }
.faq-item { border: 1px solid var(--border); margin-bottom: 8px; overflow: hidden; }
.faq-q {
  padding: 14px 40px 14px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  user-select: none;
}
.faq-q::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.faq-q::after {
  content: "＋";
  position: absolute;
  right: 16px;
  font-size: 16px;
  color: var(--text-light);
  transition: transform .3s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  padding: 0 16px 0 52px;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
}
.faq-item.open .faq-a { max-height: 200px; padding: 0 16px 16px 52px; }

/* ===== CLINIC ===== */
.clinic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.clinic-card { border: 2px solid var(--primary-light); overflow: hidden; }
.clinic-card-img {
  aspect-ratio: 16/9;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 12px;
}
.clinic-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clinic-card-body { padding: 16px; text-align: center; }
.clinic-card-body h3 { font-size: 20px; line-height: 1.2; margin-bottom: 20px; color: var(--primary-dark); }
.clinic-card-body p { font-size: 11px; color: var(--text-light); line-height: 1.8; margin-bottom: 8px; }
.clinic-card-body .btn-outline {
  display: inline-block;
  padding: 6px 20px;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  transition: .2s;
  text-decoration: none;
}
.clinic-card-body .btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    z-index: 100;
    overflow-y: auto;
    padding: 20px 0;
    transition: left .3s ease;
  }
  .drawer-open .sidebar { left: 0; }
  .two-col-wrap { flex-direction: column; padding: 16px; gap: 0; }
  .two-col-main { width: 100%; }
  .one-col-wrap { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-2.banner-row { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-4, .ranking-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-row { grid-template-columns: 1fr; }
  .cat-sub-row { display: none !important; }
  .cat-sub-col { display: flex; }
  .clinic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-slider { padding: 16px 0; }
  .hero-slider .slide-card { width: 300px; height: 300px; }
  .section-title { font-size: 15px; }
}

@media (max-width: 480px) {
  .clinic-grid { grid-template-columns: 1fr; }
}
