@charset "utf-8";

/* =========================
   フッターを常にビューポート下端に固定（sticky footer）
   header.php/footer.phpはbodyの直下にheader/main/footerが直接続く
   フラットな構造。taxonomy-product_category.php / single-products.php を
   <main>で囲むことで、このflex計算が正しく効くようになる。
   （.l_headerはposition:absoluteでレイアウトから外れているため、
   このflexの計算には影響しない）
========================= */
/* 
html, body {
    height: 100%;
} */

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

body > main {
    flex: 1 0 auto;
}

body > footer {
    flex-shrink: 0;
}

/* =========================
   タクソノミーアーカイブ 全体レイアウト
   （taxonomy-product_category.php 専用。
   serviceitems.css の .product-item 系クラスとは共存する前提）
========================= */

/* padding-topは付けない。style.css側の main { padding-top: 105px; }（レスポンシブ込み）に委ねる。
   このdivを<main>で囲むことが前提。
   左右の幅・余白はヘッダーの .l_header__inner と全く同じ数値に揃えている（左端を合わせるため） */
.taxonomy-archive-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px 30px;
}

.taxonomy-archive-main {
    flex: 1;
    min-width: 0;
}

.category-anchor-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 10px;
    margin: 20px 0 24px;
}

.category-anchor-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid #d7dee8;
    background: #fff;
    color: var(--cp-color, #282f88);
    font-weight: 700;
    text-decoration: none;
    line-height: 1.5;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.category-anchor-nav a > span:first-child {
    min-width: 0;
}

.category-anchor-nav a > span:last-child {
    flex-shrink: 0;
    color: var(--cp-lightblue, #0068b6);
}

.category-anchor-nav a:hover {
    border-color: var(--cp-color, #282f88);
    background: #f5f8ff;
}

.category-anchor-nav a:focus-visible {
    outline: 2px solid var(--cp-color, #282f88);
    outline-offset: 3px;
}

.taxonomy-archive-main #product-types,
.taxonomy-archive-main #product-list,
.taxonomy-archive-main #taxonomy-faq-title {
    scroll-margin-top: 120px;
}

@media screen and (max-width: 767.98px) {
    .category-anchor-nav {
        gap: 6px;
        margin: 16px 0 20px;
    }

    .category-anchor-nav a {
        min-height: 48px;
        padding: 10px 8px;
        gap: 4px;
        font-size: 12px;
        line-height: 1.4;
    }

    .taxonomy-archive-main #product-types,
    .taxonomy-archive-main #product-list,
    .taxonomy-archive-main #taxonomy-faq-title {
        scroll-margin-top: 85px;
    }
}

.product-quick-table__outer {
    position: relative;
}
.product-quick-table__hint {
    position: absolute;
    top: 70px;
    left: 50%;
    z-index: 2;
    margin: 0;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(38, 45, 130, .9);
    color: #fff;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 4px);
    transition: opacity .3s, transform .3s;
}
.product-quick-table__outer.is-hint-visible .product-quick-table__hint {
    opacity: 1;
    transform: translate(-50%, 0);
}

.product-quick-table__wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 32px;
}

.product-quick-table__wrap:focus-visible {
    outline: 2px solid #282f88;
    outline-offset: 3px;
}

.product-quick-table {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
    line-height: 1.8;
}

.product-quick-table th,
.product-quick-table td {
    padding: 16px 14px;
    border: 1px solid #dfe3eb;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.product-quick-table thead th {
    background: #282f88;
    color: #fff;
    font-weight: 700;
}

.product-quick-table thead th:nth-child(1) { width: 18%; }
.product-quick-table thead th:nth-child(2) { width: 18%; }
.product-quick-table thead th:nth-child(3) { width: 32%; }
.product-quick-table thead th:nth-child(4) { width: 32%; }

.product-quick-table tbody tr:nth-child(even) {
    background: #f7f9fc;
}

.product-quick-table__link {
    color: #282f88;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-quick-table__link:hover { color: #0068b6; }
.product-quick-table__link:focus-visible { outline: 2px solid #282f88; outline-offset: 3px; }
.product-quick-table__note { display: block; font-size: 12px; font-weight: 400; }

.taxonomy-section-label {
    font-size: 1.05rem;
    font-weight: bold;
    color: #282f88;
    border-left: 4px solid #282f88;
    padding-left: 12px;
    margin: 0 0 14px;
}

/* =========================
   サイドバー：タクソノミーメニュー
========================= */

.category-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f6f6f6;
    padding: 16px;
}

.category-sidebar__label {
    font-size: 0.8rem;
    font-weight: bold;
    color: #666;
    margin: 0 0 10px;
}

.category-sidebar__item {
    display: block;
    padding: 7px 10px;
    font-size: 0.85rem;
    color: #444;
    text-decoration: none;
}

.category-sidebar__item:hover {
    background: #f2f2f2;
}

.category-sidebar__item--lg.is-current {
    border-left: 2px solid #282f88;
    /* color: #fff; */
    font-weight: bold;
}

.category-sidebar__item--mid {
    font-size: 0.8rem;
}

.category-sidebar__item--mid.is-current {
    border-left: 2px solid #93c64c;
    /* color: #fff; */
    font-weight: bold;
}

.category-sidebar__item--sml {
    font-size: 0.75rem;
}

.category-sidebar__item--sml.is-current {
    border-left: 2px solid #0068b6;
    /* color: #fff; */
    font-weight: bold;
}

.category-sidebar__children {
    padding-left: 12px;
    margin-top: 2px;
}

.category-sidebar__children--nested {
    padding-left: 10px;
}

.category-sidebar__toggle {
    margin-top: 2px;
}

.category-sidebar__toggle-label {
    list-style: none;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 0.72rem;
    color: #888;
}

.category-sidebar__toggle-label::-webkit-details-marker {
    display: none;
}

.category-sidebar__toggle[open] > .category-sidebar__toggle-label::after {
    content: "（閉じる）";
}

.category-sidebar__toggle:not([open]) > .category-sidebar__toggle-label::after {
    content: "（開く）";
}

/* =========================
   分類ヘッダー（説明＋画像）
========================= */

.taxonomy-archive-title {
    color: #282f88;
    font-size: 2rem;
    margin: 0 0 14px;
}

.taxonomy-archive-lead {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    padding: 24px 28px;
    border: 1px solid #d7e4f3;
    background: linear-gradient(135deg, #f4f9ff 0%, #eef6ff 45%, #f8fbff 100%);
    margin-bottom: 24px;
}

.taxonomy-archive-desc {
    flex: 1;
    color: #29445f;
    line-height: 1.9;
    font-size: 0.95rem;
    margin: 0;
}

.taxonomy-archive-lead__image {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.taxonomy-archive-lead__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    border: 1px solid #eee;
    box-sizing: border-box;
}

/* =========================
   小分類タイプボタン
========================= */

.taxonomy-type-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.taxonomy-type-buttons__btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #444;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    text-decoration: none;
    transition: 0.2s;
}

.taxonomy-type-buttons__arrow {
    color: #999;
    margin-left: 8px;
}

.taxonomy-type-buttons__btn:hover .taxonomy-type-buttons__arrow {
    color: #0068b6;
}

.taxonomy-type-buttons__btn:hover {
    border-color: #0068b6;
    color: #0068b6;
}

/* =========================
   TDS未設定時の表示（serviceitems.cssの.tds-buttonに追加するモディファイア）
========================= */

.tds-button--disabled {
    background: #e0e0e0 !important;
    color: #999 !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================
   分類ごとのCTA
========================= */

.taxonomy-archive-cta {
    width: 100%;
    margin-top: 20px;
    padding: 40px 16px;
    background: #f6f6f6;
    text-align: center;
}

.taxonomy-archive-cta__inner {
    max-width: 760px;
    margin: 0 auto;
}

.taxonomy-archive-cta__text {
    margin: 0 0 16px;
    color: #333;
    font-size: 0.98rem;
    line-height: 1.8;
}

.taxonomy-archive-cta__btn {
    display: inline-block;
    padding: 12px 32px;
    background: #282f88;
    color: #fff !important;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.9rem;
}

.taxonomy-archive-cta__btn:hover {
    background: #1c2266;
}

/* =========================
   商品個別ページ（single-products.php）
========================= */

.spec-content.spec-content--always-open {
    display: block;
}

.product-detail-back {
    margin-top: 20px;
}

.product-detail-back a {
    color: #0068b6;
    text-decoration: none;
    font-size: 0.9rem;
}

.product-detail-back a:hover {
    text-decoration: underline;
}

.product-title a {
    color: inherit;
    text-decoration: none;
}

.product-title a:hover {
    text-decoration: underline;
}

/* 個別商品ページのCTAバナー。PCではサイドバーと同じ左カラムに、
   スマホでは order で本文の下（taxonomy-archive-ctaと同じ並び）に回す */
.product-detail-cta {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #282f88 0%, #0068b6 100%);
    padding: 28px 18px;
    display: flex;
    align-items: center;
}

.product-detail-cta__inner {
    width: 100%;
    text-align: center;
}

.product-detail-cta__text {
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.8;
    margin: 0 0 18px;
}

.product-detail-cta__btn {
    display: inline-block;
    width: 100%;
    padding: 12px 8px;
    background: #fff;
    color: #282f88 !important;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.85rem;
    box-sizing: border-box;
}

.product-detail-cta__btn:hover {
    background: #eef2ff;
}

/* =========================
   レスポンシブ
========================= */

/* タブレット以下：サイドバーを本文の下（フッターの直前）に回し、コンパクト化 */
@media screen and (max-width: 1024px) {
    .taxonomy-archive-layout {
        flex-direction: column;
        align-items: stretch; /* ← 追加 */
    }

    .taxonomy-archive-title {
        font-size: 1.6rem;
    }

    .taxonomy-archive-main {
        order: 1;
    }

    .category-sidebar {
        order: 2;
        width: 100%;
        padding: 10px 12px;
        margin-top: 8px;
    }

    .product-detail-cta {
        order: 2;
        width: 100%;
        margin-top: 20px;
        padding: 24px 16px;
    }

    .product-detail-cta__text {
        margin: 0 0 14px;
    }

    .product-detail-cta__btn {
        width: auto;
        padding: 12px 32px;
    }

    .category-sidebar__label {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }

    .category-sidebar__item {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .category-sidebar__item--sml {
        font-size: 0.7rem;
    }

    .category-sidebar__children {
        padding-left: 8px;
    }

    .category-sidebar__children--nested {
        padding-left: 6px;
    }

    .taxonomy-archive-lead {
        flex-direction: column;
    }

    .taxonomy-archive-lead__image {
        width: 100%;
        order: -1;
        display: grid;
        grid-template-columns: repeat(var(--img-cols, 3), 1fr);
        gap: 10px;
    }
}

/* FAQ：商品カテゴリーに直接登録した質問と回答 */
.taxonomy-archive-main .taxonomy-faq {
    margin-top: 56px;
    padding: 0 !important; /* 共通sectionの余白を解除 */
}

.taxonomy-faq__title {
    margin: 0 0 24px;
    color: #282f88;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    font-weight: 700;
}

.taxonomy-faq__list {
    display: grid;
    gap: 14px;
}

.taxonomy-faq__item {
    min-width: 0;
    background: #fff;
    border: 1px solid #e1e3e8;
    border-radius: 3px;
}

.taxonomy-faq__question {
    display: grid;
    grid-template-columns: 1.4em minmax(0, 1fr) 1em;
    align-items: baseline;
    gap: 12px;
    padding: 22px 24px;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.8;
}

.taxonomy-faq__question::-webkit-details-marker {
    display: none;
}

.taxonomy-faq__question:hover {
    background: #f6f7fb;
}

.taxonomy-faq__question:focus-visible {
    outline: 2px solid #282f88;
    outline-offset: 3px;
}

.taxonomy-faq__mark {
    color: #282f88;
    font-weight: 700;
}

.taxonomy-faq__mark--answer {
    color: #0068b6;
}

.taxonomy-faq__toggle::before {
    content: '+';
    color: #282f88;
}

.taxonomy-faq__item[open] .taxonomy-faq__toggle::before {
    content: '−';
}

.taxonomy-faq__answer {
    display: grid;
    grid-template-columns: 1.4em minmax(0, 1fr);
    gap: 12px;
    padding: 22px 24px;
    border-top: 1px solid #e1e3e8;
    line-height: 1.9;
}

.taxonomy-faq__question-text,
.taxonomy-faq__answer-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.taxonomy-faq__answer-text > :last-child {
    margin-bottom: 0;
}

.taxonomy-faq__answer-text a {
    color: #282f88;
    text-decoration: underline;
}

.taxonomy-faq__answer-text img {
    max-width: 100%;
    height: auto;
}

.taxonomy-faq__answer-text pre,
.taxonomy-faq__answer-text .wp-block-table {
    max-width: 100%;
    overflow-x: auto;
}

@media screen and (max-width: 768px) {
    .taxonomy-faq__question,
    .taxonomy-faq__answer {
        padding: 18px 14px;
        gap: 8px;
    }
}

/* ヘッダー側の .l_header__inner が768px以下で padding:5px になるのに合わせる */
@media screen and (max-width: 768px) {
    .taxonomy-archive-layout {
        padding-left: 5px;
        padding-right: 5px;
    }
}

@media screen and (max-width: 767.98px) {
    .taxonomy-archive-lead__image {
        grid-template-columns: repeat(2, 1fr);
    }
    .taxonomy-archive-lead__image.is-count-1 img,
    .taxonomy-archive-lead__image.is-count-3 img:first-child {
        grid-column: 1 / -1;
    }
}