@charset "UTF-8";

/* フォント Gen Interface JP（OFL 1.1）は header-products.php で
   jsDelivr CDN 経由に読み込まれている（unicode-range サブセット）。 */

/* ═══════════════════════════════════════
   Layer 1: Design Tokens
   ═══════════════════════════════════════ */
:root {
    --color-black: #2c2c2c;
    --color-gray: #8a8a8a;
    --color-offwhite: #f3f3f3;
    --color-white: #fafafa;
    --color-accent: #dd5a0f;
    --color-border: #e0e0e0;

    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 24px;
    --space-lg: 48px;
    --space-xl: 64px;

    --radius-sm: 16px;
    --radius-md: 24px;

    --header-height: 64px;
    --header-padding-x: 24px;
    --content-padding-x: 24px;
    --content-max-width: 800px;
}

/* ═══════════════════════════════════════
   Layer 2: Base (タイポグラフィ・ベース)
   ═══════════════════════════════════════ */
/* box-sizing をすべて border-box に統一。
   これがないと height と padding が加算され、カード(height:96px)が128px、
   記事リンク(min-height:48px)が72pxに膛らんでしまう。 */
.products-custom-design,
.products-custom-design *,
.products-custom-design *::before,
.products-custom-design *::after {
    box-sizing: border-box;
}

html, body.products-custom-design {
    margin: 0;
    padding: 0;
    font-family: 'Gen Interface JP', sans-serif;
    background-color: var(--color-offwhite);
    color: var(--color-black);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
}

/* 見出しも本文と同じ Gen Interface JP（標準版）。Display 版は字間が詰まりすぎて読みづらいため不使用。 */
h1, .products-h1 { font-family: 'Gen Interface JP', sans-serif; font-size: 28px; font-weight: 700; margin: 0 0 var(--space-md) 0; line-height: 1.8; color: var(--color-black); }
h2, .products-h2 { font-family: 'Gen Interface JP', sans-serif; font-size: 20px; font-weight: 700; margin: var(--space-xl) 0 var(--space-md) 0; line-height: 1.8; color: var(--color-black); }
h3, .products-h3 { font-family: 'Gen Interface JP', sans-serif; font-size: 18px; font-weight: 500; margin: 56px 0 var(--space-md) 0; line-height: 1.8; color: var(--color-black); }

/* line-height 1.8（180%）は行間として維持しつつ、
   ブロック先頭行の上・末尾行の下に乗る「ハーフレディング」を
   text-box-trim で除去してテキストボックスを字面にぴったり合わせる。
   対応: Chrome/Edge 133+・Safari 18.2+（Firefox 未対応時は従来の余白のまま）。
   ※ cap/alphabetic は欧文メトリクス基準のため、日本語見出しでは目視で微調整可。 */
h1, .products-h1,
h2, .products-h2,
h3, .products-h3,
.support-lead, .footer-lead {
    text-box-trim: trim-both;
    text-box-edge: cap alphabetic;
}
p { margin: 0 0 var(--space-md) 0; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; }

.text-detail { font-size: 14px; font-weight: 400; color: var(--color-gray); margin: 0 0 var(--space-md) 0; }

/* ═══════════════════════════════════════
   Layer 3: Layout
   ═══════════════════════════════════════ */
.products-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 var(--content-padding-x);
}

.products-main {
    padding-top: calc(var(--header-height) + var(--space-md) + env(safe-area-inset-top, 0px));
    padding-bottom: var(--space-md);
}

/* ---- Global Header ---- */
.products-global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: calc(var(--header-padding-x) + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--header-padding-x) + env(safe-area-inset-right, 0px));
    display: flex;
    align-items: center;
    z-index: 1000;
}

.products-global-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(
        to bottom,
        var(--color-offwhite) 0,
        var(--color-offwhite) env(safe-area-inset-top, 0px),
        rgba(243, 243, 243, 0.85) calc(env(safe-area-inset-top, 0px) + var(--space-xs)),
        rgba(243, 243, 243, 0) 100%
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(to bottom, black 0px, black calc(var(--space-md) + env(safe-area-inset-top, 0px)), transparent 100%);
    mask-image: linear-gradient(to bottom, black 0px, black calc(var(--space-md) + env(safe-area-inset-top, 0px)), transparent 100%);
}

.products-global-header a {
    display: block;
    border-radius: 0;
}

.header-logo {
    height: 16px;
    width: auto;
    display: block;
    border-radius: 0;
}

/* ═══════════════════════════════════════
   Layer 4: UI Components
   ═══════════════════════════════════════ */

/* ---- Button ---- */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--color-black);
    color: var(--color-white);
    font-size: 16px;
    font-weight: 400;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}
.btn-primary:hover {
    background-color: var(--color-gray);
    color: var(--color-white);
}

/* ---- Card Groups ---- */
.card-group-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
    margin-bottom: var(--space-md);
}

/* ---- Cards ---- */
.card-normal {
    display: flex;
    align-items: center;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    padding: 0 16px;
    color: var(--color-black);
    font-weight: 400;
    text-decoration: none;
    border: none;
    gap: var(--space-sm);
    transition: opacity 0.2s;
}
.card-normal:hover { opacity: 0.8; }

.card-rich {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    height: 96px;
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    padding: 16px;
    color: var(--color-black);
    font-weight: 400;
    text-decoration: none;
    border: none;
    transition: opacity 0.2s;
}
.card-rich:hover { opacity: 0.8; }

/* ---- Support Category Label ---- */
.support-category-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.support-category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background-color: var(--color-white);
    color: var(--color-gray);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

/* ---- Single Support Header ---- */
.single-support-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}
.single-support-header h1 { margin-bottom: var(--space-xs); }
.single-support-header .text-detail { margin-bottom: 0; }

/* ---- Prose (the_content 出力) ---- */
.prose a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}
.prose a:hover { opacity: 0.7; }

.prose img { max-width: 100%; height: auto; display: block; border-radius: var(--radius-sm); margin: var(--space-md) 0; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 var(--space-md) 0; }
.prose li { margin-bottom: var(--space-xs); }
.prose blockquote { border-left: 3px solid var(--color-gray); padding-left: 16px; color: var(--color-gray); margin: 0 0 var(--space-md) 0; }
.prose hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-lg) 0; }
.prose code { background-color: var(--color-white); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

/* ═══════════════════════════════════════
   Layer 5: Utilities
   ═══════════════════════════════════════ */
.u-mt-0  { margin-top: 0 !important; }
.u-mt-md { margin-top: var(--space-md) !important; }
.u-mt-lg { margin-top: var(--space-lg) !important; }
.u-mt-xl { margin-top: var(--space-xl) !important; }
.u-mb-0  { margin-bottom: 0 !important; }
.u-mb-md { margin-bottom: var(--space-md) !important; }
.u-mb-lg { margin-bottom: var(--space-lg) !important; }
.u-mb-xl { margin-bottom: var(--space-xl) !important; }

/* ═══════════════════════════════════════
   Layer 6: External Override Guard
   親テーマまたはプラグインの CSS が html / body に
   padding-top / margin-top を注入しているので、
   !important でねじ伏せる。これがないと
   モバイルでスクロールごとにドキュメントが 100px ジャンプする。
   ═══════════════════════════════════════ */
html,
body.products-custom-design {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* ═══════════════════════════════════════
   Layer 7: Product Components
   ═══════════════════════════════════════ */

/* ---- Single Product Header ---- */
.single-product-header { margin-bottom: var(--space-lg); }
.product-cover {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    margin-bottom: var(--space-md);
}
.product-cover-img,
.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.product-subtitle  { color: var(--color-gray); font-size: 16px; margin: 0 0 var(--space-xs) 0; }
.product-catchcopy { font-size: 18px; margin: 0 0 var(--space-md) 0; }

.product-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    background-color: var(--color-white);
    color: var(--color-gray);
    margin-bottom: var(--space-md);
}
.product-status--preparing { color: var(--color-accent); }

/* ---- Btn Secondary ---- */
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    color: var(--color-black);
    font-size: 16px;
    font-weight: 400;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    margin-top: var(--space-sm);
}
.btn-secondary:hover { opacity: 0.8; }

/* ---- Sub / Brand images ---- */
.product-images { display: flex; flex-direction: column; gap: var(--space-sm); margin: var(--space-lg) 0; }
.product-sub-img,
.product-brand-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-md);
    display: block;
}

/* ---- Variation Card ---- */
.variation-card { flex-direction: row; align-items: center; gap: var(--space-sm); height: auto; padding: 12px 16px; }
.variation-card img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }

/* ---- Archive Grid ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}
@media (max-width: 600px) {
    .product-grid { grid-template-columns: 1fr; }
}
.product-card {
    display: block;
    background-color: var(--color-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-black);
    transition: opacity 0.2s;
}
.product-card:hover { opacity: 0.8; }
.product-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--color-offwhite);
}
.product-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-card-body { padding: var(--space-md); }
.product-card-title { font-size: 18px; font-weight: 500; margin: 0 0 var(--space-xs) 0; }
.product-card-subtitle { font-size: 14px; color: var(--color-gray); margin: 0; }
.product-card--discontinued { opacity: 0.5; }
.product-card--discontinued:hover { opacity: 0.7; }

.product-section--discontinued { margin-top: var(--space-xl); }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    margin-top: var(--space-xs);
    background-color: var(--color-offwhite);
    color: var(--color-gray);
    border: 1px solid var(--color-border);
}
.badge-preparing { color: var(--color-accent); border-color: var(--color-accent); }

/* ---- Support Cover ---- */
.support-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}
.support-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Support Related Sections ---- */
.support-related-products,
.support-related-supports { margin-top: var(--space-lg); }

/* ═══════════════════════════════════════
   Layer 8: Support Archive (New Design)
   ═══════════════════════════════════════ */
.support-lead {
    font-size: 16px;
    color: var(--color-black);
    margin: 0 0 var(--space-md) 0;
}

.support-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
.support-quick-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 96px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s;
}
.support-quick-card:hover { opacity: 0.8; }
.support-quick-card svg { width: 20px; height: 20px; flex-shrink: 0; }

.support-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}
@media (max-width: 374px) {
    .support-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.support-category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 96px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s;
}
.support-category-card:hover { opacity: 0.8; }
.support-category-card svg { width: 20px; height: 20px; flex-shrink: 0; }

.support-cat-section {
    scroll-margin-top: calc(var(--header-height) + var(--space-md) + env(safe-area-inset-top, 0px));
    margin-bottom: var(--space-lg);
}
.support-article-block {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
}
.support-article-rail {
    width: 32px;
    min-width: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--color-black);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}
.support-article-rail svg { width: 20px; height: 20px; }
.support-article-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.support-article-link {
    min-height: 48px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background-color: var(--color-white);
    color: var(--color-black);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: opacity 0.2s;
}
.support-article-link:hover { opacity: 0.8; }
.support-article-title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    line-height: 1.6;
}
.support-article-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-gray);
}

/* ═══════════════════════════════════════
   Layer 9: Global Footer (New Design)
   ═══════════════════════════════════════ */
.products-global-footer {
    text-align: left;
    margin-top: var(--space-lg);
    padding: var(--space-lg) 0;
    background-color: var(--color-white);
    border-top: none;
    color: var(--color-black);
    font-size: 14px;
}
.products-global-footer .products-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.footer-logo-link { display: inline-block; line-height: 0; }
.footer-logo { height: 16px; width: auto; display: block; }
.footer-lead {
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-black);
    margin: 0;
}
.footer-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}
.footer-quick-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 96px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background-color: var(--color-offwhite);
    color: var(--color-black);
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.2s;
}
.footer-quick-card:hover { opacity: 0.8; }
.footer-quick-card svg { width: 20px; height: 20px; flex-shrink: 0; }

.footer-policy-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-policy-link {
    min-height: 32px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-gray);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.8;
}
.footer-policy-link span { flex: 1; min-width: 0; }
.footer-policy-link svg { width: 20px; height: 20px; color: var(--color-gray); flex-shrink: 0; }

.footer-copyright {
    color: var(--color-gray);
    font-size: 12px;
    margin: 0;
}