/*-----共通-----*/
.content {
    max-width: 1000px;
    margin: auto;
}

.back-link {
    display: inline-block;
    font-size: 1.2rem;
    color: inherit;
    text-decoration: none;
    padding-top: 0;
}

.back-link:hover {
    text-decoration: underline;
    color: var(--main-color);
}

section h3 {
    font-family: 'Playfair Display', serif;
}




/*----------商品一覧ページ----------*/
.product-detail,
h4,
.menu-item {
    font-family: 'Playfair Display', serif;
}

#piece,
#whole,
#baked,
#gift {
    scroll-margin-top: 100px;
}

#piece2,
#whole2,
#baked2,
#gift2 {
    scroll-margin-top: 100px;
}

#gift {
    scroll-margin-top: 150px;
}

[id^="piece"],
[id^="whole"],
[id^="baked"],
[id^="gift"] {
    scroll-margin-top: 100px;
}


#product-detail {
    margin-top: 20px;
}









/*----商品カテゴリ----*/
.product-detail {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.product-detail a {
    text-decoration: underline;
    padding: 10px 20px;
    color: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
}

.product-detail a:hover {
    color: var(--main-color)
}


/*その他*/
.season {
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    text-align: center;
}

.special {
    font-family: 'Playfair Display', serif;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/*カテゴリ名*/
h4 {
    font-size: 25px;
    margin-top: 50px;
    margin-bottom: 15px;
}



/*----商品写真ほか-----*/
.menu {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-around;
}

.menu-item {
    width: 300px;
    overflow: visible;
}

.menu-item img {
    border-radius: 5px;
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}


.menu-item p {
    text-align: center;
    margin-top: 8px;
    margin-bottom: 8px;
    font-weight: bold;
}


.image-wrapper {
    position: relative;
    display: inline-block;
}







.ribbon {
    position: absolute;
    top: 5px;
    right: 0;
    background: var(--main-color);
    color: white;
    padding: 5px 10px;
    font-size: 1rem;
    font-weight: bold;
    z-index: 1;
    border-top-right-radius: 5px;
}

.image-wrapper,
.ribbon {
    transition: transform 0.3s ease;
}

.image-wrapper:hover,
.ribbon {
    transform: translateY(-5px);
}




/*--------商品詳細ページ-----------*/

#product-image {
    width: 65%;
    margin: 0 auto;
    border-radius: 10px;
    object-fit: cover;
}


.menu-item2 {
    display: flex;
    justify-content: center;
}

.product-text {
    margin: 0 auto;
    max-width: 650px;
}

.tables {
    max-width: 650px;
    margin: 3% auto;
    display: flex;
    flex-direction: column;
}

table {
    margin: 10px 0;
    border-collapse: collapse;
    table-layout: fixed;
}

th,
td {
    white-space: nowrap;
    border: 2px solid #e0c9b6;
    text-align: center;
    width: 70px;
    height: 35px;
    font-size: clamp(10px, 2vw, 16px);
}

th {
    font-weight: normal;
}




.decolation,
th {
    background-color: rgba(224, 201, 182, 0.6);
}

caption {
    text-align: left;
}




.whole-btn,
.piece-btn {
    display: block;
    width: 300px;
    margin: 40px auto 0;
    border: 1px solid var(--main-color);
    background: #FFF;
    border-radius: 30px;
    text-align: center;
    color: var(--main-color);
    transition: transform 0.3s;
}

.whole-btn:hover,
.piece-btn:hover {
    transform: scale(1.1);
}

.whole-btn a,
.piece-btn a {
    display: block;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
}




.thumbnail-list {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.thumb {
    cursor: pointer;
    width: 80px;
    height: auto;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumb:hover {
    border-color: var(--main-color);
}



/* オーバーレイ本体 */
.image-wrapper {
    display: inline-block;
}

/*一覧オーバーレイ*/
.overlay2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 5px;
    z-index: 2;
}

/*詳細オーバーレイ*/
.overlay3 {
    position: absolute;
    left: 50%;
    top: 49%;
    transform: translate(-50%, -50%);
    width: 65%;
    height: 98%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    border-radius: 5px;
    z-index: 2;
}


/* trueの場合常時表示する */
.always-visible {
    opacity: 1 !important;
}


@media (max-width: 768px) {
    section h3 {
        font-size: 22px;
    }

    #product-text {
        width: 100%;
    }

    #product-image {
        width: 90%;
    }

    .back-link {
        padding-bottom: 2%;
    }
}

@media (max-width: 639px) {
    .product-detail {
        display: block;
        text-align: center;
    }

    .product-detail a {
        display: block;
        text-align: center;
    }

    .overlay3 {
        width: 90%;
    }

}