/*
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
*/

/* 検索フィルター（PC版） */
.search-filters {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    margin: 20px 0;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* フィルターオプション - 文字位置修正版 */
.filter-option {
    display: flex;
    align-items: center;
    justify-content: center; /* 中央寄せを追加 */
    background: white;
    border: 2px solid #e3e3e3;
    border-radius: 25px;
    padding: 10px 16px; /* 左右均等に調整 */
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.3px;
    line-height: 1; /* ラインハイトを1に設定 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    white-space: nowrap; /* テキストの改行を防ぐ */
    flex-shrink: 0; /* フレックスアイテムの縮小を防ぐ */
    text-align: center; /* テキスト中央寄せ */
}

/* カラードット - 位置調整 */
.filter-option[data-color]::before {
    content: '';
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0; /* ドットのサイズを固定 */
    margin-top: -1px; /* 微調整：ドットを少し上に */
}

/* カラー定義 - ドット用 */
.filter-option[data-color="violet"]::before { background: #743d8a; }
.filter-option[data-color="lavender"]::before { background: #987fc8; }
.filter-option[data-color="pink"]::before { background: #ff95bc; }
.filter-option[data-color="red"]::before { background: #e8321f; }
.filter-option[data-color="orange"]::before { background: #fb7f24; }
.filter-option[data-color="yellow"]::before { background: #f9d95a; }
.filter-option[data-color="matt"]::before { background: #8fbd94; }
.filter-option[data-color="green"]::before { background: #409d67; }
.filter-option[data-color="ash"]::before { background: #7690ac; }
.filter-option[data-color="blue"]::before { background: #3767b3; }
.filter-option[data-color="silver"]::before { background: #bdc3c7; }
.filter-option[data-color="brown"]::before { background: #a6755c; }
.filter-option[data-color="pinkbeige"]::before { background: #ceadad; }
.filter-option[data-color="greige"]::before { background: #b8a99a; }
.filter-option[data-color="beige"]::before { background: #d0b498; }
.filter-option[data-color="navy"]::before { background: #1F1C6A; }
.filter-option[data-color="black"]::before { background: #222; }

.filter-option:hover {
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.filter-option:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
}

.filter-option.active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.2);
}

.filter-option.active:active {
    transform: translateY(0);
}

/* アクティブ状態 - カラー別背景 */
.filter-option[data-color="violet"].active { background: #743d8a; border-color: #743d8a; color: white; }
.filter-option[data-color="lavender"].active { background: #987fc8; border-color: #987fc8; color: white; }
.filter-option[data-color="pink"].active { background: #ff95bc; border-color: #ff95bc; color: white; }
.filter-option[data-color="red"].active { background: #e8321f; border-color: #e8321f; color: white; }
.filter-option[data-color="orange"].active { background: #fb7f24; border-color: #fb7f24; color: white; }
.filter-option[data-color="yellow"].active { background: #f9d95a; border-color: #f9d95a; color: #333; }
.filter-option[data-color="matt"].active { background: #8fbd94; border-color: #8fbd94; color: white; }
.filter-option[data-color="green"].active { background: #409d67; border-color: #409d67; color: white; }
.filter-option[data-color="ash"].active { background: #7690ac; border-color: #7690ac; color: white; }
.filter-option[data-color="blue"].active { background: #3767b3; border-color: #3767b3; color: white; }
.filter-option[data-color="silver"].active { background: #bdc3c7; border-color: #bdc3c7; color: #333; }
.filter-option[data-color="brown"].active { background: #a6755c; border-color: #a6755c; color: white; }
.filter-option[data-color="pinkbeige"].active { background: #ceadad; border-color: #ceadad; color: #333; }
.filter-option[data-color="greige"].active { background: #b8a99a; border-color: #b8a99a; color: white; }
.filter-option[data-color="beige"].active { background: #d0b498; border-color: #d0b498; color: #333; }
.filter-option[data-color="navy"].active { background: #1F1C6A; border-color: #1F1C6A; color: white; }
.filter-option[data-color="black"].active { background: #222; border-color: #222; color: white; }

/* 明度フィルター（カラーなし）のアクティブ状態 */
.filter-option:not([data-color]).active {
    background: #222;
    border-color: #222;
    color: white;
}

/* アクティブ時はドットを非表示（背景色で十分わかるため） */
.filter-option[data-color].active::before {
    display: none;
}

.filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
    left: -9999px;
}

.clear-filters {
    margin-top: 25px;
    text-align: center;
}

.clear-button {
    background: none;
    border: none;
    color: #666;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: underline;
    text-underline-offset: 7px;
    text-decoration-thickness: 2px;
}

.clear-button:hover {
    color: #000;
    text-decoration-color: #000;
}

/* モバイル用フィルター */
.mobile-filters {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 0;
    margin: 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: none;
    visibility: hidden;
}

.mobile-filters.active {
    display: block !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    margin-bottom: 15px;
}

.close-filters {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-filters:hover {
    background: #f5f5f5;
    color: #000;
}

.mobile-filter-group {
    margin-bottom: 25px;
    padding: 0 20px;
}

.mobile-filter-label {
    margin-bottom: 10px;
    display: block;
}

.mobile-filters .filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    justify-content: flex-start; /* 左寄せで統一 */
}

.mobile-filters .filter-option {
    padding: 10px 14px; /* モバイルでは少し調整 */
/*    font-size: 15px;*/
    border-radius: 20px;
    min-height: 40px;
    flex: none; /* フレックス拡張を無効化 */
    width: auto; /* 幅を自動調整 */
    max-width: calc(50% - 4px); /* 最大幅を制限 */
    margin: 0;
    justify-content: center; /* モバイルでも中央寄せ */
    line-height: 1;
}

.mobile-filters .filter-option[data-color]::before {
    width: 10px;
    height: 10px;
    margin-right: 6px;
    margin-top: -0.5px; /* モバイルでは少し控えめに */
}

.filter-actions {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.apply-button {
    flex: 1;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-button:hover {
    background: #333;
    transform: translateY(-1px);
}

.filter-actions .clear-button {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    border-radius: 8px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-actions .clear-button:hover {
    border-color: #999;
    color: #333;
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    visibility: hidden;
}

.filter-overlay.active {
    display: block !important;
    visibility: visible !important;
}

/* フローティングフィルターボタン */
.filter-toggle {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    display: none;
}

.filter-toggle:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.filter-count {
    background: #8a8a8a;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 3px;
    min-width: 18px;
    text-align: center;
}

/* 結果表示 */
.results-info {
    text-align: center;
    margin: 30px 0;
    color: #888;
/*    font-size: .9em;*/
}

/* ギャラリーグリッド */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-bottom: 60px;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    background-color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* 画像の遅延読み込み対応 */
.gallery-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1200/909;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0; /* 初期状態は透明 */
}

/* 画像読み込み完了時 */
.gallery-item img.loaded,
.gallery-item img[src]:not([src*="data:image/svg"]):not([src*="data:image/png"]) {
    opacity: 1;
}

/* プレースホルダー画像のスタイル */
.gallery-item img[data-src] {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    background-size: 400% 400%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.gallery-item:hover img {
    transform: scale(1.02);
}

/* カラーライン */
.color-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 2;
    display: flex;
}

.color-segment {
    height: 100%;
}

/* カラー定義 */
.color-red { 
    background: #e8321f;
}
.color-orange { 
    background: #fb7f24;
}
.color-pink { 
    background: #ff95bc;
}
.color-yellow { 
    background: #f9d95a;
}
.color-green { 
    background: #409d67;
}
.color-blue { 
    background: #3767b3;
}
.color-beige { 
    background: #d0b498;
} 
.color-violet { 
    background: #743d8a;
}
.color-lavender { 
    background: #987fc8;
}
.color-matt { 
    background: #8fbd94;
}
.color-ash { 
    background: #7690ac;
}
.color-silver { 
    background: #bdc3c7;
}
.color-brown { 
    background: #a6755c;
}
.color-pinkbeige { 
    background: #ceadad;
}
.color-greige { 
    background: #b8a99a;
}
.color-navy { 
    background: #1F1C6A;
}
.color-black { 
    background: #222;
}

/* モーダル基本スタイル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(34, 34, 34, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    position: relative;
    margin: 0 auto;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    cursor: pointer;
    z-index: 1020;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 30px;
}

.modal-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
}

/* モーダル左側（画像エリア） */
.modal-left {
    width: 50%;
    position: relative;
    background-color: #e9e9e9;
}

.modal-images {
    position: relative;
    width: 100%;
    overflow: hidden;
	min-height: 300px;
}

.modal-images img,
.modal-images .slide-image {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: bottom;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
min-height: 200px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.modal-images img.active,
.modal-images .slide-image.active { /* activeクラスのスタイル追加 */
    opacity: 1;
}

.modal-images img.loaded,
.modal-images .slide-image.loaded {
    opacity: 1;
}

/* モーダル右側（テキストエリア） */
.modal-right {
    width: 50%;
    background-color: white;
    padding: 30px;
    position: relative;
    overflow-y: auto;
    max-height: 100%;
	line-height: 1.7;
	transition: height 0.3s ease, min-height 0.3s ease;
  }


.modal-title {
    font-size: 1.3em!important;
/*    margin-bottom: 20px;    font-weight: bold*/

}

.modal-description {
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section-title {
    font-weight: bold;
/*    font-size: 1.1em; margin-bottom: 10px;*/
}

.modal-recipe-item {
    margin-bottom: 15px;
}

.modal-recipe-step {
    margin-bottom: 10px;
    line-height: 1.5;
}

.diagram-container {
    text-align: center;
}

.diagram-image {
    width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* スライドナビゲーション（控えめ版） */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1010;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: color 0.2s ease;
}

.slide-prev {
    left: 10px;
}

.slide-next {
    right: 10px;
}

/* サムネイルナビゲーション（修正版） */
.thumbnail-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 1010; /* z-indexを上げる */
    padding: 10px 0;
}

.thumbnail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
}

.thumbnail-dot.active {
    background-color: white;
    transform: scale(1.2);
}

/* レスポンシブ */
@media (max-width: 768px) {
    /* PC版フィルターを隠す */
    .search-filters {
        display: none;
    }
    
    /* モバイル版フィルターボタンを表示 */
    .filter-toggle {
        display: block;
    }
    

    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* PCフィルターのモバイル対応 */
    .filter-options {
        justify-content: flex-start; /* 左寄せで統一 */
    }
    
    .filter-option {
        padding: 10px 14px; /* モバイルでは少し調整 */
/*        font-size: 13px;*/
        border-radius: 20px;
        min-height: 40px;
        flex: none; /* フレックス拡張を無効化 */
        width: auto; /* 幅を自動調整 */
        max-width: calc(50% - 4px); /* 最大幅を制限 */
        justify-content: center; /* モバイルでも中央寄せ */
        line-height: 1;
    }
    
    .filter-option[data-color]::before {
        width: 10px;
        height: 10px;
        margin-right: 6px;
        margin-top: -0.5px; /* モバイルでは少し控えめに */
    }
    
    .modal-inner {
        flex-direction: column;
    }
    
    .modal-left, .modal-right {
        width: 100%;
    }
    
    .modal-right {
        overflow-y: auto;
        padding: 20px;
        max-height: 50vh; /* 最大高さを制限 */
    }
    
    .modal-close {
        top: -40px;
        right: 0;
        z-index: 1020;
    }
    .thumbnail-dot {
        width: 8px;
        height: 8px;
        border-width: 1px;
    }
    
    .thumbnail-dot.active {
        transform: scale(1.2);
    }
    
    .diagram-image {
        width: 60%;
    }
    
    .modal-images img,
    .modal-images .slide-image {
        min-height: 150px; /* 150px → 120px に調整 */
    }
}

/* iPhone（縦）*/
@media (max-width: 667px) {
    .modal-images {
        min-height: 280px;
    }
}

/* iPhone（横）・iPad（縦）*/
@media (min-width: 668px) and (max-width: 1024px) {
    .modal-images {
        min-height: 250px; /* iPadの画像サイズに合わせて調整 */
    }
}

/* より小さい画面用 */
@media (max-width: 480px) {    
    .gallery {
        gap: 10px;
    }
    
    .filter-option {
/*        font-size: 12px;*/
        padding: 8px 12px;
        min-height: 36px;
        max-width: calc(50% - 4px);
        line-height: 1;
    }
    
    .filter-option[data-color]::before {
        width: 8px;
        height: 8px;
        margin-right: 5px;
        margin-top: -0.5px;
    }
    
    .mobile-filters .filter-option {
/*        font-size: 12px;*/
        padding: 8px 12px;
        min-height: 36px;
        max-width: calc(50% - 4px);
        line-height: 1;
    }
    
    .mobile-filters .filter-option[data-color]::before {
        width: 8px;
        height: 8px;
        margin-right: 5px;
        margin-top: -0.5px;
    }
    
     .modal-content {
        width: 95%;
    }
    
    .modal-close {
        top: -35px;
        right: 0;
        z-index: 1020;
    }
    
    .modal-right {
        padding: 15px;
        max-height: 40vh;
		font-size: 1.2em
    }
    
}

/* PC版での図解画像サイズ調整 */
@media (min-width: 769px) {
    .diagram-image {
        width: 60%;
    }
}

/* スタイリスト名のスタイル */
.modal-stylist {
    text-align: right;
    font-style: italic;
    margin-top: 30px;
    color: #666;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-stylist {
        margin-top: 20px;
        font-size: 13px;
    }
}