/* =========================================
   Products page
   - カーテン演出
   - 背景帯
   - 商品カテゴリ
   - Artページと同サイズのカルーセル
========================================= */

/* --- カーテン --- */
.curtain-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  z-index: 9999;
  pointer-events: none;
}

.curtain-panel {
  flex: 1;
  background: #111;
  transition: transform 1.15s cubic-bezier(.8, 0, .2, 1);
}

.curtain-overlay.open .curtain-panel.left {
  transform: translateX(-100vw);
}

.curtain-overlay.open .curtain-panel.right {
  transform: translateX(100vw);
}

/* --- ページ固有のトップバー変数 --- */
:root {
  --topbar-height: 54px;
  --topbar-blur: 4px;
  --topbar-bg: rgba(255, 255, 255, 0.35);

  /* Artと統一 */
  --work-carousel-width-desktop: min(50vw, 900px);
  --work-carousel-width-mobile: calc(100vw - 16px);
  --work-carousel-ratio-desktop: 5 / 4;
  --work-carousel-ratio-mobile: 4 / 3;
}

/* --- ベース --- */
body {
  margin: 0;
  background: #fff;
  overflow-x: hidden;
}

.bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../images/products/products_main.webp') center center / cover no-repeat;
  transition: height 1s cubic-bezier(.77, 0, .25, 1), box-shadow .5s;
  height: 100vh;
  box-shadow: none;
  pointer-events: none;
}

/* bg-image.fixed は style.css 側を利用 */

/* --- 初期メニュー色 --- */
.products-menu:not(.fixed) .menu-item {
  color: #f0eff0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}

.menu-item:hover {
  border-bottom-color: #222;
}

.menu-item.back-home {
  padding: 0 .3rem;
}

.back-icon {
  height: 28px;
  width: auto;
  display: block;
}

/* --- コンテンツ領域 --- */
.products-area {
  position: fixed;
  left: 0;
  right: 0;
  top: 100vh;
  bottom: 0;
  z-index: 20;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: top 1s cubic-bezier(.7, .1, .3, 1), opacity .6s;
  background: linear-gradient(#ffffff, #f9f9f7);
}

.products-area.show {
  opacity: 1;
  pointer-events: auto;
}

/* --- セクション --- */
.category-section {
  max-width: 900px;
  margin: 0 auto 64px;
  padding: 0 12px;
}

.cat-title {
  font-size: 1.6rem;
  letter-spacing: .1em;
  font-weight: 600;
  margin: 18px 0 12px;
}

.cat-note {
  opacity: .7;
  font-size: .95rem;
}

/* --- カルーセル（Artと同サイズに統一） --- */
.products-carousel {
  position: relative;
  width: var(--work-carousel-width-desktop);
  margin: 0 auto 16px;
  overflow: hidden;
}

.products-carousel-track {
  display: flex;
  width: 100%;
  aspect-ratio: var(--work-carousel-ratio-desktop);
  transition: transform .4s ease;
  touch-action: pan-y;
}

.products-carousel-track picture {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: block;
}

.products-carousel-track picture img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: var(--work-carousel-ratio-desktop);
  object-fit: cover;
  background: #23201c;
}

.products-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: none;
  border: none;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
  color: #a38c54;
  cursor: pointer;
  user-select: none;
}

.products-carousel-prev {
  left: 10px;
}

.products-carousel-next {
  right: 10px;
}

/* --- テキスト --- */
.category-section article p {
  line-height: 1.85;
  letter-spacing: .02em;
}

/* --- 商品グリッド --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 14px;
}

.product-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
  overflow: hidden;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.product-card figcaption {
  padding: 10px 12px;
  font-size: .95rem;
  letter-spacing: .04em;
}

.placeholder {
  background: repeating-linear-gradient(135deg, #f1f1ef 0 12px, #e6e4df 12px 24px);
}

/* --- レスポンシブ --- */
@media (max-width: 980px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .products-carousel {
    width: var(--work-carousel-width-mobile);
    margin: 0 auto 12px;
  }

  .products-carousel-track {
    width: 100%;
    aspect-ratio: var(--work-carousel-ratio-mobile);
    transition: transform .35s ease;
  }

  .products-carousel-track picture img {
    aspect-ratio: var(--work-carousel-ratio-mobile);
    object-fit: cover;
  }

  .products-carousel-btn {
    font-size: 1.5rem;
  }

  .products-carousel-prev {
    left: 6px;
  }

  .products-carousel-next {
    right: 6px;
  }
}

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

  .cat-title {
    font-size: 1.3rem;
  }

  .category-section {
    padding: 0 8px;
  }
}
/* MOBILE NAV ADJUSTMENT */
@media (max-width:768px){

.art-menu.fixed,
.archive-menu.fixed,
.products-menu.fixed{
  min-height:56px;
  padding:6px 10px;
  gap:8px;
}

.art-menu.fixed .menu-item,
.archive-menu.fixed .menu-item,
.products-menu.fixed .menu-item{
  min-height:40px;
  padding:8px 8px;
  font-size:0.9rem;
  line-height:1;
  letter-spacing:0.04em;
  white-space:nowrap;
}

.art-menu.fixed img,
.archive-menu.fixed img,
.products-menu.fixed img{
  height:26px;
  width:auto;
}

}