@charset "utf-8";

/* ========================================================================== 
   menu-page.css
   うどん・丼もの店「うどんどん」お品書き専用スタイル
   ========================================================================== */

#wrapper {
    width: 100%;
    overflow-x: hidden; /* 横揺れを絶対に許さない安全弁 */
}

/* 00. 安全リセット */
.menu-page-main,
.menu-page-main *,
.menu-page-main ::before,
.menu-page-main ::after {
    box-sizing: border-box !important;
}

/* 01. 変数定義 */
:root {
    --color-primary: #1a3d32;      /* 深緑 */
    --color-accent: #8b5e3c;       /* ゴールド・茶 */
    --color-border: #e0d5c5;       /* 淡いベージュ */
    --color-bg-light: #fbf9f6;     /* 和紙調の白 */
    --color-text-main: #333333;    /* 墨色 */
    --color-text-sub: #666666;     /* 補助 */
    --font-sans: 'Noto Sans JP', sans-serif;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4%;
}

.menu-page-main {
    background-color: var(--color-bg-light);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    padding-bottom: 40px; /* フッターとの間の巨大な隙間を解消 */
    position: relative;
}

/* 02. ページヘッダー */
.page-header {
    padding: 60px 0 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-indent: 0.3em;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.page-subtitle {
    font-size: 4.5rem;
    font-weight: 900;
    color: rgba(26, 61, 50, 0.03);
    letter-spacing: 0.1em;
    font-family: 'Montserrat', sans-serif;
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    white-space: nowrap;
    display: inline-block;
    padding: 0;
}

.page-subtitle::before,
.page-subtitle::after {
    display: none !important;
}

/* 03. メニュータブ */
.menu-tab-section {
    margin-bottom: 30px;
    position: relative; 
    scroll-margin-top: 100px; /* 固定ヘッダーの高さ分のジャンプ位置補正 */
}

.menu-tabs {
    display: flex;
    justify-content: center;
    gap: 0; 
    border-bottom: 2px solid var(--color-primary); 
    padding-bottom: 0; 
    margin-bottom: 60px;
    background-color: var(--color-bg-light); 
    
    /* 左右全幅への広がり（スクロールバーの幅を考慮した安全な指定） */
    margin-left: calc(-50vw + 50%);  
    margin-right: calc(-50vw + 50%); 
    padding-left: 4%;                
    padding-right: 4%;             
    padding-top: 15px;              
    box-shadow: 0 4px 12px rgba(26, 61, 50, 0.02); 
    
    position: relative;
    top: auto;
    z-index: 999;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out, background-color 0.3s;
    transform: translateY(0);
    opacity: 1;
}

/* スクロール時にJSで付与する固定クラス */
.menu-tabs.is-fixed {
    position: fixed;
    top: 70px; 
    left: 0;
    width: 100vw;
    margin: 0; 
    box-shadow: 0 4px 20px rgba(26, 61, 50, 0.08); 
    animation: slideDownIn 0.25s ease-out forwards;
}

@keyframes slideDownIn {
    0% { transform: translateY(-6px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.menu-tabs.is-bottom {
    display: none !important;
}

/* タブボタン */
.menu-tabs .tab-btn {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-bottom: none;
    cursor: pointer;
    padding: 14px 60px; 
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
    min-width: 180px;
}

/* 通常状態の「冷やしうどん」タブ */
.menu-tabs .tab-btn[data-tab="hiyashi-udon"] {
    background-color: #f0f7fa; 
    border-color: #cbdbe3;     
}

.menu-tabs .tab-btn[data-tab="hiyashi-udon"] .tab-text-ja {
    color: #4b758e;            
}

.menu-tabs .tab-btn:first-child { border-radius: 6px 0 0 0; }
.menu-tabs .tab-btn:last-child { border-radius: 0 6px 0 0; margin-left: -1px; }

.tab-text-ja {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text-sub);
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

/* ホバー時の挙動 */
@media (hover: hover) {
    .menu-tabs .tab-btn:hover .tab-text-ja { color: var(--color-accent); }
    .menu-tabs .tab-btn[data-tab="hiyashi-udon"]:hover .tab-text-ja { color: #2b5f7c; }
}

/* アクティブ（選択中） */
.menu-tabs .tab-btn.is-active {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    z-index: 2;
}

.menu-tabs .tab-btn.is-active[data-tab="hiyashi-udon"] {
    background-color: #2b5f7c !important;
    border-color: #2b5f7c !important;
}

.menu-tabs .tab-btn.is-active .tab-text-ja {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.15em;
}

.menu-tabs .tab-btn::after { display: none !important; }

/* 04. メニューパネル・グリッド */
.menu-panels {
    position: relative;
}

.menu-panel {
    display: none;
    opacity: 0;
}

.menu-panel.is-active {
    display: block;
}

/* フェードイン＆立ち上がりアニメーション（ホバーとの競合を避けるため親レイヤーで制御） */
.menu-panel.is-visible {
    animation: panelReveal 1.8s cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

@keyframes panelReveal {
    0% { opacity: 0; transform: translateY(15px); }
    100% { opacity: 1; transform: translateY(0); }
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 60px 30px;
    padding-top: 15px;
    width: 100%;
}

/* 05. メニューカード */
.menu-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding-top: 15px;
    padding-right: 35px; 
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

/* 冷やしうどんパネル専用配色 */
#js-panel-hiyashi-udon .menu-card {
    background: #ffffff !important;
    border-color: #cbdbe3 !important;
}

#js-panel-hiyashi-udon .menu-card .menu-info {
    background: #ffffff !important;
}

#js-panel-hiyashi-udon .menu-card .menu-item-title {
    color: #2b5f7c !important;
    background: #fbfdfe !important;
    border: 1px solid rgba(75, 117, 142, 0.3) !important;
    border-top: 3px solid #2b5f7c !important;
}

#js-panel-hiyashi-udon .menu-card .menu-item-price {
    color: var(--color-accent) !important;
}

#js-panel-hiyashi-udon .menu-card .menu-item-price .tax-in {
    color: var(--color-text-sub) !important;
}

#js-panel-hiyashi-udon .menu-card .menu-item-desc {
    color: var(--color-text-main) !important;
}

/* 冷やしうどん専用ホバー */
@media (hover: hover) {
    #js-panel-hiyashi-udon .menu-card:hover {
        border-color: #2b5f7c !important;
        box-shadow: 0 15px 35px rgba(43, 95, 124, 0.1) !important;
    }
    #js-panel-hiyashi-udon .menu-card:hover .menu-item-title {
        background: #ebf4f9 !important;
        border-color: #2b5f7c !important;
        box-shadow: 4px 8px 16px rgba(43, 95, 124, 0.15) !important;
    }
}

.menu-img-box {
    width: calc(100% - 15px);
    margin-left: 15px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f0f0f0;
}

.menu-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* 縦書き短冊タイトル */
.menu-item-title {
    position: absolute;
    top: -15px;       
    right: 5px; 
    z-index: 10;      
    
    writing-mode: vertical-rl; 
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.15em;
    line-height: 1.4;
    text-align: center;
    
    background: #fffdf9;                                                                                                                                                                                                                                                                                                                                                                                                                                    
    border: 1px solid rgba(139, 94, 60, 0.3);          
    border-top: 3px solid var(--color-accent);       
    padding: 18px 12px 15px 12px;
    min-height: 150px;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.4s ease;
}

.menu-info {
    padding: 6px 20px 15px 20px; 
    background: #ffffff;
    border-radius: 0 0 4px 4px;
    display: flex;
    flex-direction: column; 
    align-items: center;
    justify-content: center; 
    flex-grow: 1;
    margin-left: 35px;
}

.menu-item-price {
    font-size: 1.75rem; 
    font-weight: 700;
    color: var(--color-accent);
    display: flex;
    align-items: baseline;
    justify-content: center; 
    gap: 4px;
    line-height: 1.2; 
    margin-top: 5px; 
    margin-bottom: 8px;
}

.menu-item-price .tax-in {
    font-size: 0.8rem; 
    color: var(--color-text-sub);
    font-weight: 400;
}

.menu-item-desc {
    font-size: 1rem; 
    color: var(--color-text-sub);
    line-height: 1.5;
    text-align: center;
    margin: 0;
    padding: 0;
    word-break: break-all; 
}

/* 通常カードのホバー処理 */
@media (hover: hover) {
    .menu-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 15px 35px rgba(26, 61, 50, 0.08);
        border-color: var(--color-accent);
    }
    .menu-card:hover .menu-item-title {
        background: #fbf6ed;
        border-color: var(--color-accent);
        transform: translateY(-2px);
        box-shadow: 4px 8px 16px rgba(139, 94, 60, 0.12);
    }
    .menu-card:hover .menu-img-box img {
        transform: scale(1.04);
    }
}

/* 06. アニメーション補助 */
.reveal-up { opacity: 1; }

/* 07. レスポンシブ */
@media (max-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 50px 24px;
    }
    .page-header { 
        padding: 50px 0 25px; 
    }
    .page-title { 
        font-size: 2.2rem; 
    }
    .page-subtitle {
        font-size: 3.8rem;
    }
    
    /* === 【修正反映】タブレット環境でのタブ崩れ・変な改行を徹底対策 === */
    .menu-tabs {
        margin-bottom: 40px;
        padding-top: 10px;
        gap: 0; 
    }
    .menu-tabs .tab-btn {
        padding: 12px 8px; 
        flex: 1;           
        min-width: 0;      
        white-space: nowrap; 
    }
    .tab-text-ja {
        font-size: 1.05rem; 
    }
    .menu-tabs .tab-btn.is-active .tab-text-ja {
        font-size: 1.1rem !important;
        letter-spacing: 0.05em !important;
    }
    /* ================================================================ */

    .menu-card {
        padding-right: 24px; 
    }
    .menu-item-title {
        right: 2px; 
    }
}

@media (max-width: 576px) {
    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 45px 12px; 
    }
    .page-header {
        padding: 45px 0 20px; 
    }
    .page-title {
        font-size: 2rem;
        letter-spacing: 0.25em;
        text-indent: 0.25em;
    }
    .page-subtitle {
        font-size: 3.2rem;
    }
    .menu-tabs {
        gap: 10px;
        margin-bottom: 40px;
        padding-top: 10px;
    }
    .tab-btn {
        padding: 10px 4px 12px; 
        flex: 1;
        min-width: 0; 
        white-space: nowrap; 
    }
    .tab-text-ja { 
        font-size: 0.95rem; 
    }
    .menu-tabs .tab-btn.is-active .tab-text-ja {
        font-size: 0.95rem !important; 
        letter-spacing: 0.02em !important; 
    }
    .menu-card {
        padding-top: 12px;
        padding-right: 26px; 
    }
    .menu-img-box {
        width: calc(100% - 4px);
        margin-left: 4px;
    }
    .menu-info { 
        padding: 4px 8px 10px 8px; 
        margin-left: 22px; 
    }
    .menu-item-desc {
        font-size: 0.85rem; 
        line-height: 1.4;
    }
    .menu-item-title {
        font-size: 0.85rem; 
        min-height: 105px;  
        padding: 10px 4px 8px 4px;
        top: -12px;        
        right: 2px;        
        letter-spacing: 0.05em; 
        line-height: 1.2;
    }
    .menu-item-price { 
        font-size: 1.35rem; 
        margin-top: 5px; 
    }
}

/* ==========================================================================
   販売価格の一時非表示
   ========================================================================== */

/* クラスが付いていても強制的に表示（display: flex(表示) display: none(非表示)）にする */
.menu-item-price.is-hidden {
    display: flex !important;
}