* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ギャラリーグリッド */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

/* 商品カード */
.product-card {
    position: relative;
    overflow: hidden;
    background-color: white;
    aspect-ratio: 2 / 3;
}

.product-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* ホバー時の動作（PC） */
.product-card:hover .product-image {
    transform: scale(1.05);
}

/* ホバー情報パネル - 画像全体に被せる */
.hover-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    gap: 10px;
}

.product-card:hover .hover-info {
    opacity: 1;
}

/* ホバー情報内のコンテンツ - 縦並び */
.hover-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ホバーアイテム - 横一行 */
.hover-item {
    display: grid;
    grid-template-columns: 1fr 80px 70px;
    gap: 10px;
    align-items: center;
}

.item-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
    line-height: 1.2;
    word-break: break-word;
}

/* 価格を白色に統一 */
.item-price {
    font-size: 13px;
    color: white;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

/* 詳細ページへのボタン */
.detail-btn {
    background-color: white;
    color: #333;
    border: none;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    white-space: nowrap;
}

/* ボタンのホバー - 色反転 */
.detail-btn:hover {
    background-color: #333;
    color: white;
    transform: translateY(-2px);
}

/* PC時のアイコン非表示 */
.detail-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 55px;
    height: 55px;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 10;
    display: none;
}

.detail-icon:hover {
    transform: scale(1.1);
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

/* モーダルコンテンツ - PCと同じデザイン */
.modal-content {
    position: relative;
    background-color: rgba(0, 0, 0, 0.8);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ✅ 閉じるボタン - ちらつき修正 */
.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: white;
    background: none;
    border: none;
    transition: color 0.2s ease;
    padding: 5px 10px;
    user-select: none;
}

/* ✅ ホバー時のみ色変更（ちらつき防止） */
.close:hover {
    color: white;
}

/* ✅ アクティブ状態（クリック時）でも色を変えない */
.close:active {
    color: white;
}

/* モーダル内のコンテンツ */
#modalBody {
    color: white;
}

/* タブレット対応 */
@media (max-width: 1024px) and (min-width: 769px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ✅ PC版のみ - ギャラリーに左右マージン追加 */
@media (min-width: 1025px) {
    .gallery {
        margin-left: 60px;
        margin-right: 60px;
    }
}

/* スマートフォン対応 */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* SP時はホバーを非表示 */
    .product-card:hover .hover-info {
        opacity: 0;
    }

    /* SP時のアイコン - 背景なし */
    .detail-icon {
        display: flex;
        justify-content: center;
        align-items: center;
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        background-color: transparent;
        border-radius: 50%;
    }

    .modal-content {
        width: 95%;
        padding: 25px;
    }

    .product-card {
        aspect-ratio: 2 / 3;
    }

    /* SP時は詳細ボタンを非表示 */
    .detail-btn {
        display: none;
    }
}
