/* =========================================================
   products.css（products.html 専用 / body.productsPage 固定）
   ========================================================= */

/* ページ見出し */
body.productsPage .pageTitle{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:16px 0 12px;
}
body.productsPage .pageTitle h1{
  margin:0;
  font-family:"Yomogi", cursive;
  font-size: clamp(22px, 3vw, 34px);
  font-weight:900;
}
body.productsPage .pageTitle p{
  margin:0;
  opacity:.75;
  font-weight:800;
}

/* 検索・フィルタ */
body.productsPage .finder{padding:16px}
body.productsPage .finderTop{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
body.productsPage .search{
  flex:1 1 320px;
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.72);
}
body.productsPage .search input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  font:inherit;
  font-weight:800;
}

/* カテゴリチップ */
body.productsPage .chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
body.productsPage .chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.72);
  font-weight:900;
  cursor:pointer;
}
body.productsPage .chip[aria-pressed="true"]{
  background: linear-gradient(
    135deg,
    rgba(255,210,77,.60),
    rgba(255,120,173,.45)
  );
  border-style:solid;
}

/* 件数・フィルタ表示 */
body.productsPage .metaBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding:10px 12px;
  border-radius:18px;
  border:2px dashed rgba(58,47,42,.25);
  background: rgba(255,255,255,.55);
  font-weight:900;
}

/* 商品グリッド（products用だけ） */
body.productsPage .grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
@media (max-width:1100px){
  body.productsPage .grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:820px){
  body.productsPage .grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:520px){
  body.productsPage .grid{grid-template-columns:1fr}
}

/* 商品カード中身（.crayon / .card は共通を活かす） */
body.productsPage .product{
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}

/* 画像を“できるだけ全部表示”したい（正方形画像向け） */
body.productsPage .productCard .photo{
  margin: 0;
  border: 0;
  border-radius: calc(var(--r) - 2px);
  overflow: hidden;

  height: auto;            /* ← 固定高をやめる */
  aspect-ratio: 1 / 1;     /* ← 正方形枠（keshifujiに最適） */

  /* 余白が出た時も可愛く見える背景 */
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.75), transparent 55%),
    linear-gradient(135deg, rgba(255,210,77,.18), rgba(103,183,255,.14));
}

body.productsPage .productCard .photo img{
  width: 100%;
  height: 100%;
  object-fit: contain;     /* ← これが肝：全部見せる */
  object-position: center;
  display: block;
}


/* タグ */
body.productsPage .pill{
  padding:6px 10px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.7);
  font-weight:900;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
body.productsPage .pill.new{
  background: linear-gradient(
    135deg,
    rgba(255,210,77,.70),
    rgba(255,120,173,.55)
  );
  border-style:solid;
}

/* ボタン列 */
body.productsPage .product .row{
  display:flex;
  gap:10px;
  margin-top:auto;
  flex-wrap:wrap; /* スマホで折り返せるように */
}
body.productsPage .btn.small{
  padding:9px 12px;
}

/* 注文する（青系） */
body.productsPage .btn.order{
  background: linear-gradient(135deg, #67b7ff, #9ad0ff);
}
body.productsPage .btn.order:hover{filter:brightness(1.05)}

/* =========================================================
   productCard 背景方式（CSS層を“1枚”で安定）
   - HTMLで style="--bg:url('...')" を渡す
   ========================================================= */
body.productsPage .productCard{
  position:relative;
  overflow:hidden;
}
body.productsPage .productCard::before{
  content:"";
  position:absolute;
  inset:0;
  background: var(--bg) center / cover no-repeat;
  opacity:.18;
  filter:saturate(.95);
  transform: scale(1.03);
  pointer-events:none;
  z-index:0;
}
body.productsPage .productCard > *{
  position:relative;
  z-index:1;
}
/* カードの余白は消して、画像を端まで */
body.productsPage .productCard.card{
  padding: 0;              /* ←これで赤が黄色まで伸びる */
  overflow: hidden;        /* 角丸からはみ出さない */
}

/* 中身（テキスト・ボタン）の余白を復活 */
body.productsPage .productCard .product{
  padding: 16px;           /* ←元の .card の padding と同値 */
}

/* 画像ブロックは “余白なし” にしたいので上書き */
body.productsPage .productCard .photo{
  margin: 0;               /* 念のため */
  border: 0;               /* 二重枠防止（カード枠だけにする） */
  border-radius: calc(var(--r) - 2px); /* 上の角丸をカードに合わせる */
  height: 190px;           /* 好みで。170のままでもOK */
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(255,210,77,.35),
    rgba(103,183,255,.22)
  );
}

/* 画像はそのままフィット */
body.productsPage .productCard .photo img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* pillの行が詰まらないように（ついで） */
body.productsPage .kicker{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
/* ================================
   FIX: productsページは「画像を全部見せる」
   style.css の .photo / .photo img を強制で上書き
================================ */
body.productsPage .productCard .photo{
  height: auto !important;        /* 固定高を潰す */
  aspect-ratio: 1 / 1 !important; /* 正方形枠（keshifuji向け） */
  border: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: calc(var(--r) - 2px) !important;

  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.75), transparent 55%),
    linear-gradient(135deg, rgba(255,210,77,.18), rgba(103,183,255,.14)) !important;
}

body.productsPage .productCard .photo img{
  position: static !important;    /* style.cssの absolute を潰す */
  inset: auto !important;         /* 念のため */
  width: 100% !important;
  height: 100% !important;

  object-fit: contain !important; /* ← 全部表示 */
  object-position: center !important;

  opacity: 1 !important;          /* 薄くなるのを潰す */
  filter: none !important;        /* 彩度調整を潰す（必要なら） */
  display: block !important;
}
/* 画像を少し小さくして、説明文の余白を増やす */
body.productsPage .productCard .photo{
  max-height: 180px;   /* ← ここを調整（例：160〜190） */
}
/* ===== Modal ===== */
body.productsPage .modal[hidden]{ display:none; }

body.productsPage .modal{
  position:fixed;
  inset:0;
  z-index:999;
}

body.productsPage .modal__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}

body.productsPage .modal__panel{
  position:relative;
  width:min(980px, calc(100% - 24px));
  margin: 18px auto;
  max-height: calc(100dvh - 36px);
  overflow:auto;
}

body.productsPage .modal__close{
  position:sticky;
  top:10px;
  margin-left:auto;
  display:block;
  width:54px;
  height:54px;
  padding:0;
  font-size:28px;
  line-height:1;
  background:#fff;
}

body.productsPage .modal__body{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:14px;
  padding:16px;
}

body.productsPage .modal__media{
  border-radius:18px;
  overflow:hidden;
  border:3px solid rgba(58,47,42,.75);
  background: rgba(255,255,255,.6);
  aspect-ratio: 1 / 1;
}

body.productsPage .modal__media img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  background: rgba(255,255,255,.65);
}

body.productsPage .modal__content h2{
  margin:0 0 6px;
  font-weight:900;
}

body.productsPage .modal__content p{
  margin:0 0 10px;
  line-height:1.8;
  font-weight:800;
  opacity:.92;
}

body.productsPage .modal__cols{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:10px;
}

body.productsPage .modal__cols h3{
  margin:0 0 6px;
  font-weight:900;
  font-family:"Yomogi", cursive;
}

body.productsPage .modal__cols ul{
  margin:0;
  padding-left: 1.2em;
  line-height:1.8;
  font-weight:800;
}

body.productsPage .modal__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

body.productsPage .modal__more{
  margin-top:10px;
}

@media (max-width: 820px){
  body.productsPage .modal__body{
    grid-template-columns: 1fr;
  }
  body.productsPage .modal__cols{
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   商品一覧（products.html）専用
========================================================= */

/* ページタイトル */
.pageTitle{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:16px 0 12px;
}
.pageTitle h1{
  margin:0;
  font-family:"Yomogi", cursive;
  font-size: clamp(22px, 3vw, 34px);
  font-weight:900;
}
.pageTitle p{
  margin:0;
  opacity:.75;
  font-weight:800;
}

/* 検索・フィルタ */
.finder{padding:16px}
.finderTop{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}
.search{
  flex:1 1 320px;
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.72);
}
.search input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  font:inherit;
  font-weight:800;
}

/* カテゴリチップ */
.chips{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.72);
  font-weight:900;
  cursor:pointer;
}
.chip[aria-pressed="true"]{
  background: linear-gradient(
    135deg,
    rgba(255,210,77,.60),
    rgba(255,120,173,.45)
  );
  border-style:solid;
}

/* 商品グリッド */
.grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:14px;
  margin-top:14px;
}
@media (max-width:1100px){
  .grid{grid-template-columns:repeat(3,1fr)}
}
@media (max-width:820px){
  .grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:520px){
  .grid{grid-template-columns:1fr}
}

/* 商品カード */
.product{
  display:flex;
  flex-direction:column;
  gap:10px;
  height:100%;
}
.photo{
  width:100%;
  height:170px;
  border-radius:18px;
  border:3px solid rgba(58,47,42,.75);
  background: linear-gradient(
    135deg,
    rgba(255,210,77,.35),
    rgba(103,183,255,.22)
  );
  overflow:hidden;
}
.photo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* タグ */
.pill{
  padding:6px 10px;
  border-radius:999px;
  border:2px dashed rgba(58,47,42,.35);
  background: rgba(255,255,255,.7);
  font-weight:900;
  font-size:12px;
}
.pill.new{
  background: linear-gradient(
    135deg,
    rgba(255,210,77,.70),
    rgba(255,120,173,.55)
  );
  border-style:solid;
}

/* ボタン列 */
.product .row{
  display:flex;
  gap:10px;
  margin-top:auto;
}
.btn.small{
  padding:9px 12px;
}

/* 注文する（青系） */
.btn.order{
  background: linear-gradient(135deg, #67b7ff, #9ad0ff);
}
.btn.order:hover{
  filter:brightness(1.05);
}

/* 件数・フィルタ表示 */
.metaBar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding:10px 12px;
  border-radius:18px;
  border:2px dashed rgba(58,47,42,.25);
  background: rgba(255,255,255,.55);
  font-weight:900;
}
/* =========================
   会社概要モーダル専用
========================= */
body.productsPage .companyModalPanel{
  width: min(720px, calc(100% - 24px));
  max-height: none;
  overflow: visible;
}

body.productsPage .companyModalBody{
  display: block;
  padding: 32px 28px 28px;
}

body.productsPage .companyModalBody h2{
  margin: 0 0 16px;
  font-family: "Yomogi", cursive;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
}

body.productsPage .companyModalBody p{
  margin: 0;
  line-height: 2;
  font-weight: 800;
  font-size: 16px;
}

body.productsPage .companyModalPanel .modal__close{
  position: absolute;
  top: 14px;
  right: 14px;
  margin-left: 0;
}

@media (max-width: 640px){
  body.productsPage .companyModalBody{
    padding: 26px 18px 20px;
  }

  body.productsPage .companyModalBody h2{
    font-size: 24px;
  }

  body.productsPage .companyModalBody p{
    font-size: 15px;
    line-height: 1.9;
  }
}
body.productsPage .companyModalPanel{
  position: relative;
}

body.productsPage .companyModalPanel .modal__close{
  z-index: 20;
}
/* =========================
   会社概要テーブル
========================= */
.companyTable{
  width:100%;
  margin-top:20px;
  border-collapse:collapse;
  font-weight:800;
}

.companyTable th,
.companyTable td{
  padding:12px 10px;
  text-align:left;
  border-bottom:2px dashed rgba(58,47,42,.25);
}

.companyTable th{
  width:110px;
  white-space:nowrap;
  font-weight:900;
}

.companyTable td{
  line-height:1.8;
}
