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

body {
    font-family: "Avenir Next", "Avenir", "Century Gothic", "Futura", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Arial", "Yu Gothic", "Meiryo", sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "palt";
}

/* ヘッダー */
.catalog-header {
    background: white;
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
    position: relative;
}

.catalog-header h1 {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 4px;
}

.catalog-header .logo {
    height: 24px;
    width: auto;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 12px;
    color: #666;
    letter-spacing: 1px;
}

.instagram-link {
    position: absolute;
    right: 20px;
    bottom: 10px;
}

/* タブレット以上でグリッドの右端に合わせる */
@media (min-width: 768px) {
    .instagram-link {
        right: 30px;
        bottom: 15px;
    }
}

@media (min-width: 1024px) {
    .instagram-link {
        right: calc(50% - 580px);
        bottom: 20px;
    }
}

.instagram-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.instagram-link:hover .instagram-icon {
    opacity: 1;
}

/* フィルター */
.filter-container {
    background: white;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.model-filter {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 12px;
}

.model-filter::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    background: #fff;
    border: 0.5px solid #000;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #000;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-chip:hover {
    background: #f8f8f8;
}

.filter-chip.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.color-filter {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.color-dot span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.color-dot.active {
    border-color: #333;
}

.all-colors {
    background: conic-gradient(
        from 0deg,
        #1a1a1a 0deg 51deg,
        #696969 51deg 102deg,
        #8b6f47 102deg 153deg,
        #c19a6b 153deg 204deg,
        #dcd5e0 204deg 255deg,
        #f0e68c 255deg 306deg,
        #7a9a7e 306deg 360deg
    );
}

/* カタロググリッド */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.catalog-sentinel {
    width: 100%;
    height: 1px;
}

.catalog-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.catalog-item:active {
    transform: scale(0.98);
}

.item-image {
    width: 100%;
    aspect-ratio: 1/1;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.image-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.image-slider picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-slider picture img {
    width: 107%;
    height: 107%;
    object-fit: cover;
    padding: 0;
    transform: scale(1.1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
}

.image-slider picture.active {
    opacity: 1;
}

.view-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.view-indicator .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.3s;
}

.view-indicator .dot.active {
    background: #333;
}

.item-info {
    padding: 12px;
}

.item-model {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.item-color {
    font-size: 12px;
    color: #666;
}

/* フッター */
.catalog-footer {
    padding: 20px;
    text-align: center;
    background: white;
    border-top: 1px solid #e0e0e0;
    margin-top: 40px;
}

.back-link {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* アニメーション */
.catalog-item {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* タブレット対応 */
@media (min-width: 768px) {
    .catalog-header h1 {
        font-size: 28px;
    }
    
    .catalog-header .logo {
        height: 28px;
    }
    
    .instagram-icon {
        width: 24px;
        height: 24px;
    }
    
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
        padding: 20px;
    }
    
    .catalog-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
}

/* デスクトップ対応 */
@media (min-width: 1024px) {
    .catalog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        padding: 32px;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .filter-container {
        padding: 24px 24px;
    }
    
    .model-filter {
        max-width: 1200px;
        margin: 0 auto;
        justify-content: flex-start;
        padding-left: 20px;
    }
    
    .color-filter {
        max-width: 1200px;
        margin: 16px auto 0;
        justify-content: center;
    }
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}


.modal-close {
    position: fixed;
    top: calc(50vh - 45vh + 20px);  /* 画像の上端から少し下 */
    right: calc(50vw - 45vw + 20px);  /* 画像の右端から少し内側 */
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.5);
    color: white;
}

.modal-slider {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent;
}

.modal-image {
    width: 110%;
    height: 110%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.modal-image.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.3);
}

.modal-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.modal-prev,
.modal-next {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-prev:hover,
.modal-next:hover {
    background: #f5f5f5;
}

.modal-indicator {
    display: flex;
    gap: 8px;
}

.modal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-dot.active {
    background: #333;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
    }
    to { 
        opacity: 1;
    }
}

/* タブレット以上で一覧の斜め画像を左にずらす */
@media (min-width: 768px) {
    .image-slider picture.side-view img {
        transform: translate(-55%, -50%) scale(1.1);
    }
}

/* タブレット対応 */
@media (min-width: 768px) and (max-width: 1023px) {
    .modal-close {
        top: 40px;
        right: 40px;
    }
    
    .modal-image {
        width: 100%;
        height: 100%;
        transform: translate(-50%, -50%) scale(1.0);
    }
    
    .modal-image.active {
        transform: translate(-50%, -50%) scale(1.0);
    }
}

/* デスクトップ対応 */
@media (min-width: 1024px) {
    .modal-close {
        top: 60px;
        right: 60px;
    }
    
    .modal-image {
        width: 102%;
        height: 102%;
        transform: translate(-50%, -50%) scale(1.0);
    }
    
    .modal-image.active {
        transform: translate(-50%, -50%) scale(1.0);
    }
}

/* モバイルで操作しやすいように調整 */
@media (max-width: 767px) {
    .modal-close {
        top: 20px;
        right: 20px;
    }
    
    .modal-image {
        width: 120%;
        height: 120%;
        transform: translate(-50%, -50%) scale(1.3);
        object-fit: contain;
    }
    
    .modal-image.active {
        transform: translate(-50%, -50%) scale(1.3);
    }
    
    .modal-controls {
        bottom: 20px;
        padding: 8px 16px;
    }
    
    .modal-prev,
    .modal-next {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
