/**
 * Craft Inside 共通スタイル
 * Phase 0: 静的HTML事前整理で各ページから抽出した共通CSS
 * Tailwind のカスタムクラスおよびページ共通のスタイルを定義
 */

/* ===== ベース・レイアウト ===== */
body {
    background-color: #fcfbf9;
    color: #2c2c2c;
    line-height: 1.8;
    overflow-x: hidden;
}

/* ===== ヘッダー・セーフエリア（ベストプラクティス） ===== */
/* ノッチ付きデバイス対応: iOS safe-area-inset */
.safe-area-header {
    padding-top: env(safe-area-inset-top, 0);
}

/* スマホ: ヘッダー高さに合わせて main の余白を調整（8pxグリッド: 56px+24px=80px→5rem） */
@media (max-width: 767px) {
    main {
        padding-top: calc(5rem + env(safe-area-inset-top, 0)) !important;
        padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0)) !important;
    }
}

/* ===== パンくずリスト（ベストプラクティス） ===== */
/* 8pxグリッド: 左右16px(モバイル)/24px(デスクトップ), 下16px(モバイル)/24px(デスクトップ) */
/* タッチターゲット: Apple推奨44px以上 */
.page-breadcrumb {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 1rem;
}
@media (min-width: 768px) {
    .page-breadcrumb {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        margin-bottom: 1.5rem;
    }
}
.page-breadcrumb a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0;
    margin: -0.25rem 0;
}

html {
    scroll-behavior: smooth;
}

/* ===== トップページ ヒーロースライダー ===== */
.hero-slide {
    transition: opacity 0.8s ease-in-out;
}
.hero-dot {
    transition: background-color 0.3s, width 0.3s;
}

/* ===== フェードインアニメーション ===== */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 背景・装飾 ===== */
.bg-gradient-mesh {
    background: radial-gradient(circle at 50% 50%, rgba(207, 166, 112, 0.08) 0%, rgba(255, 255, 255, 0) 50%);
}

.grid-lines {
    background-image: linear-gradient(to right, rgba(0,0,0,0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 80px 80px;
}

.vertical-rl {
    writing-mode: vertical-rl;
}

/* 2行で省略表示（カート商品名など） */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== ボタン・カードホバー ===== */
.btn-hover-slide {
    position: relative;
    overflow: hidden;
    transition: color 0.4s;
}
.btn-hover-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: #1e2832;
    transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}
.btn-hover-slide:hover::before {
    left: 0;
}
.btn-hover-slide:hover {
    color: #fff;
}

.category-card {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-card:hover {
    transform: translateY(-5px);
}

/* ===== 商品カード ===== */
.product-card {
    background: #fff;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border-color: #e8e6e1;
}

/* 商品一覧のサムネイル：表示領域に収まるよう contain で全体表示 */
.product-image-container {
    position: relative;
    overflow: hidden;
    background-color: #f4f4f2;
    padding-bottom: 100%;
    width: 100%;
    max-width: 100%;
}
.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}
.product-card:hover .product-image {
    transform: scale(1.03);
}

/* ===== フィルターUI ===== */
.filter-pill,
.filter-tag {
    transition: all 0.3s ease;
}
.filter-pill:hover,
.filter-pill.active,
.filter-tag:hover,
.filter-tag.active {
    background-color: #1e2832;
    color: #fff;
    border-color: #1e2832;
}

/* ===== テーブル ===== */
.custom-table th,
.custom-table td,
.spec-table th,
.spec-table td {
    border-bottom: 1px solid #e5e5e5;
    padding: 1.2rem 1rem;
}
.custom-table th,
.spec-table th {
    text-align: left;
    font-weight: 500;
    color: #1e2832;
    vertical-align: top;
}
.custom-table th {
    width: 20%;
}
.spec-table th {
    width: 30%;
    background-color: rgba(232, 230, 225, 0.2);
}

.company-table th,
.company-table td {
    border-bottom: 1px solid #e5e5e5;
    padding: 1.5rem 1rem;
    text-align: left;
}
.company-table th {
    font-weight: 500;
    color: #1e2832;
    width: 30%;
    background-color: rgba(232, 230, 225, 0.1);
}

.legal-table th,
.legal-table td {
    border-bottom: 1px solid #e5e5e5;
    padding: 1.25rem 1rem;
    text-align: left;
    font-size: 0.875rem;
}
.legal-table th {
    font-weight: bold;
    color: #1e2832;
    width: 25%;
    background-color: rgba(232, 230, 225, 0.15);
    white-space: nowrap;
}
.legal-table td {
    color: #666666;
    line-height: 1.8;
}
@media (max-width: 640px) {
    .legal-table th,
    .legal-table td {
        display: block;
        width: 100%;
    }
    .legal-table th {
        border-bottom: none;
        padding-bottom: 0.5rem;
        background-color: transparent;
    }
    .legal-table td {
        padding-top: 0;
        padding-left: 1.5rem;
    }
}

/* ===== 画像ギャラリー（商品詳細） ===== */
/* メイン画像：表示領域に収まるよう contain で全体表示 */
.main-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: opacity 0.3s ease;
}
/* サムネイル：表示領域に収まるよう contain で全体表示 */
.product-thumbnail-wrap {
    position: relative;
    min-width: 0;
}
.product-thumbnail-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}
.thumbnail {
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.thumbnail:hover,
.thumbnail.active {
    border-color: #1e2832;
    opacity: 0.8;
}

/* ===== アコーディオン（FAQ等） ===== */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}
.accordion-toggle.active + .accordion-content {
    max-height: 500px;
    transition: max-height 0.3s ease-in-out;
}
.accordion-icon {
    transition: transform 0.3s ease;
}
.accordion-toggle.active .accordion-icon {
    transform: rotate(180deg);
}

/* ===== フォーム要素（お問い合わせ・チェックアウト） ===== */
.form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e5e5;
    background-color: #fff;
    padding: 0.75rem 1rem;
    color: #2c2c2c;
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 16px; /* iOS: 16px未満だとフォーカス時にズームされる */
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: #1e2832;
    box-shadow: 0 0 0 1px rgba(30, 40, 50, 0.1);
}
@media (min-width: 768px) {
    .form-input {
        font-size: inherit;
    }
}
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e2832;
    margin-bottom: 0.5rem;
}
.required-mark {
    color: #cfa670;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

/* チェックアウトフォーム：モバイルでオーバーフロー防止 */
.checkout-form {
    box-sizing: border-box;
}
.checkout-form input,
.checkout-form select {
    box-sizing: border-box;
}

/* ===== アンカーセクション（固定ヘッダー用） ===== */
.anchor-section {
    scroll-margin-top: 120px;
}

/* ===== サイドバーナビのアクティブ状態 ===== */
.nav-link.active {
    color: #cfa670;
    font-weight: bold;
    border-left-color: #cfa670;
}

/* ===== モバイルメニュー ===== */
#mobile-menu {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
#mobile-menu.hidden-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#mobile-menu.visible-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ===== プライバシーポリシー ===== */
.policy-p {
    margin-bottom: 1rem;
    line-height: 1.9;
}
.policy-section {
    margin-bottom: 2rem;
}
.policy-h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e2832;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e5e5;
}
.policy-list {
    list-style: disc;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.policy-list li {
    margin-bottom: 0.5rem;
}
.policy-h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e2832;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
