/* ホーム「PRODUCTS 取扱商品群」欄のタイル（includes/home-product-tiles.php）。大1＋小4。PCはカーソルで拡大 */

.p-homeProductTiles { padding: 0 15px; }
@media (min-width: 768px) { .p-homeProductTiles { max-width: 1240px; margin: 0 auto; padding: 0 40px; } }

.p-homeProductTiles__grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 200px; grid-auto-rows: 150px; }
.p-homeProductTile--big { grid-column: 1 / 3; }
@media (min-width: 768px) {
  .p-homeProductTiles__grid { gap: 14px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 190px 190px; grid-auto-rows: auto; }
  .p-homeProductTile--big { grid-column: auto; grid-row: 1 / 3; }
}

.p-homeProductTile {
  position: relative; display: block; overflow: hidden; border-radius: 12px; background: #fff;
  color: #fff !important; text-decoration: none !important;
  transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
}
.p-homeProductTile:focus-visible { outline: 3px solid #ffc61a; outline-offset: 2px; }

/* 写真：重ねる画像はここに <i> で入る。標準は1枚を全面に */
.p-homeProductTile__ph { position: absolute; inset: 0; display: block; transition: transform .5s ease; }
.p-homeProductTile__ph i { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }

/* S-Guard：本体にタグを重ねる。白い背景に影で浮かせる */
.p-homeProductTile--sg .p-homeProductTile__ph i { inset: auto; background-size: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .2)); }
.p-homeProductTile--sg .p-homeProductTile__ph i:nth-child(1) { left: 16%; top: 6%; width: 52%; height: 66%; }
.p-homeProductTile--sg .p-homeProductTile__ph i:nth-child(2) { right: 12%; bottom: 20%; width: 26%; height: 44%; z-index: 1; }

/* 防犯ゲート・タグ：左にゲート、右にタグ */
.p-homeProductTile--gt .p-homeProductTile__ph i { inset: auto; top: 0; bottom: 0; }
.p-homeProductTile--gt .p-homeProductTile__ph i:nth-child(1) { left: 0; width: 62%; }
.p-homeProductTile--gt .p-homeProductTile__ph i:nth-child(2) { right: 0; width: 38%; }

/* 防犯カメラ：白い背景に1台を収める */
.p-homeProductTile--cam .p-homeProductTile__ph i { inset: 4% 0 22% 0; background-size: contain; }

/* 文字：写真の下に黒い帯を敷いて読めるようにする */
.p-homeProductTile__in { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: block; padding: 34px 14px 12px; background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0)); }
.p-homeProductTile__name { display: block; font-weight: 700; font-size: 14px; line-height: 1.35; }
.p-homeProductTile__text { display: none; font-size: 12px; line-height: 1.5; margin-top: 2px; opacity: .9; }
.p-homeProductTile--big .p-homeProductTile__name { font-size: 18px; }
.p-homeProductTile--big .p-homeProductTile__text { display: block; font-size: 13px; }
@media (min-width: 768px) {
  .p-homeProductTile__name { font-size: 16px; }
  .p-homeProductTile__text { display: block; }
  .p-homeProductTile--big .p-homeProductTile__name { font-size: 22px; }
  .p-homeProductTile--big .p-homeProductTile__text { font-size: 14px; }
}

/* カーソルを乗せたタイルだけ拡大し、ほかは薄くする（カーソルのあるPCだけ） */
@media (hover: hover) {
  .p-homeProductTiles__grid:hover .p-homeProductTile { opacity: .6; }
  .p-homeProductTiles__grid .p-homeProductTile:hover { opacity: 1; transform: scale(1.06); z-index: 3; box-shadow: 0 10px 26px rgba(0, 0, 0, .28); }
  .p-homeProductTiles__grid .p-homeProductTile:hover .p-homeProductTile__ph { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .p-homeProductTile, .p-homeProductTile__ph { transition: none; }
  .p-homeProductTiles__grid .p-homeProductTile:hover, .p-homeProductTiles__grid .p-homeProductTile:hover .p-homeProductTile__ph { transform: none; }
}
