/* ===============================================================
    Product Showcase Index (cameras / recorders / related)
    - Page Header
    - Breadcrumbs
    - Layout
    - Sidebar (category nav)
    - Product list grid
    - Product card
    - Pagination
    - Responsive
================================================================ */

/* ---- Page header ---- */
.page-header {
    padding: 220px 0 120px;
    text-align: center;
}
.page-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.page-header__eyebrow {
    margin: 0 0 1em;
    font-size: var(--font-size-text-md);
    color: var(--color-text-sub);
}
.page-header__title {
    margin: 0;
    font-weight: 700;
    font-size: var(--font-size-title-hero);
    color: var(--color-text-accent);
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 24px;
}
.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-text-sm);
    color: #6b7280;
}
.breadcrumbs__item a {
    color: inherit;
    text-decoration: none;
}
.breadcrumbs__item:not(:last-child)::after {
    content: "ー";
    margin-left: 10px;
    color: #9ca3af;
}
.breadcrumbs__item.is-current {
    color: #111827;
}

/* ---- Layout ---- */
.product-index {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 120px;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: clamp(16px, 3vw, 28px);
}

/* ---- Sidebar (category nav) ---- */

.category-nav {
    position: sticky;
    top: 16px;
    background: var(--color-bg-card-white);
    border: 1px solid var(--color-bg-card-blue);
    border-radius: 10px;
    padding: 2em 1.5em;
}
.category-nav__title {
    margin: 0 0 1em;
    padding: 0 0 1em;
    font-size: var(--font-size-text-md);
    font-weight: 800;
    border-bottom: 1px solid var(--color-bg-card-blue);
}
.category-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.category-nav__link {
    display: block;
    position: relative;
    padding: 0.5em 0.8em;
    border-radius: 8px;
    color: #374151;
    line-height: 1.45;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
}
.category-nav__link:hover,
.category-nav__link:focus-visible {
    color: var(--color-text-link);
    background-color: var(--color-bg-card-sky);
}
.category-nav__link.is-current {
    color: var(--color-text-link);
    font-weight: 700;
}
.category-nav__link.is-current::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: var(--color-text-link);
    transform: translateY(-50%);
}

/* ---- Product list grid ---- */
.product-index__main { }

.product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch; /* 各列の高さを揃える */
}
.product-list__item {
    display: block;
    height: 100%;
}

/* ---- Product card ---- */
.product-card {
    height: 100%; /* 行の中で同じ高さに */
    display: grid;
    grid-template-rows: auto 1fr; /* 上段=画像、下段=本文 */
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-2px);
}
.product-card__media {
    margin: 0;
}
.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.product-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 1em 1em 2em;
    background-color: var(--color-bg-card-gray);
    min-height: 0; /* Safari対策 */
}
.product-card__title {
    margin: 0;
    font-weight: 400;
    font-size: var(--font-size-text-md);
    line-height: 1.5;
}

/* ---- Pagination ---- */
.pagination {
    margin-top: 80px;
    display: flex;
    justify-content: center;
}
.pagination__list {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: 1px solid  var(--color-bg-card-blue);
    border-radius: 8px;
    background:  var(--color-bg-card-white);
    text-decoration: none;
    color: var(--color-text-main);
    font-size: var(--font-size-text-md);
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.next.page-numbers {
    padding: 0 0.8em;

}
.page-numbers:hover,
.page-numbers:focus-visible {
    background: var(--color-bg-card-blue);
}
.page-numbers.current {
    background: var(--color-bg-card-blue);
    color: var(--color-text-main);
    border-color: transparent;
}
.page-numbers.dots {
    pointer-events: none;
    background: transparent;
    border: none;
    color: var(--color-text-main);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .page-header {
        padding: 180px 0 100px;
    }
    .product-index {
        grid-template-columns: 1fr;
    }
    .category-nav {
        position: static;
        display: grid;
        gap: 8px;
    }
    .category-nav__title {
        grid-column: 1 / -1;
    }
    .product-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .page-header { 
        padding: 140px 0 80px; 
    }
    .breadcrumbs {
        /* padding: 0px 24px ; */
    }
    .product-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .pagination {
        margin-top: 40px;
    }
    .product-index {
        padding: 0 24px 80px;
    }
    .page-numbers {
        min-width: 32px;
        height: 32px;
    }
}
@media (max-width: 420px) {
    .product-list {
        grid-template-columns: 1fr;
    }
}

/* 商品タイプ切替ナビ */
.product-type-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}
.product-type-nav__link {
  flex: 1;
  display: block;
  padding: 6px 4px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.product-type-nav__link:hover {
  background: #e8f0fe;
  color: #1a3a7a;
  border-color: #1a3a7a;
}
.product-type-nav__link.is-active {
  background: #1a3a7a;
  color: #fff;
  border-color: #1a3a7a;
}
