:root {
    --nintendo-red: #E70009;
    --text-main: #414548;
    --text-sub: #989898;
    --bg-gray: #f8f8f8;
    --border-color: #E6E6E6;
    --gold: #ce9c00;
    --max-content-width: 1200px;
    --container-padding: 40px;
}

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

body {
    /* 日本語フォントスタック */
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "Meiryo", "MS PGothic", sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    background-color: #fff;
}

/* ヘッダー */
.global-header {
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    text-decoration: none;
    font-weight: 900;
    font-size: 1.2rem;
}

.logo-red { color: var(--nintendo-red); }
.logo-gray { color: var(--text-main); }

.header-nav { display: flex; gap: 20px; font-size: 1.2rem; cursor: pointer; }

/* ヒーローセクション (2カラム) */
.hero-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

@media (min-width: 768px) {
   .hero-section {
        grid-template-columns: 1.5fr 1fr; /* デスクトップの2次元レイアウト */
    }
    .l-container {
        --container-padding: 20px; /* モバイルでは余白を狭くする  */
    }
}

/* ギャラリー */
.slider-viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    border-radius: 12px;
    background: #000;
}

.slider-inner {
    display: flex;
    transition: transform 0.8s ease;
    width: 100%;
}

.slide {
    flex: 0 0 100%; /* 各スライドをコンテナ幅100%に固定  */
    width: 100%;
}

.slide img {
    width: 100%; /* 画像をスライド幅いっぱいに広げる */
    height: auto;
    display: block;
}

/* 左右ボタン共通のスタイル */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5); /* 半透明の黒  */
    color: #fff;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s, transform 0.1s;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nav-btn:active {
    transform: translateY(-50%) scale(0.9);
}

.prev-btn {
    left: 0;
    border-radius: 0 4px 4px 0;
}

.next-btn {
    right: 0;
    border-radius: 4px 0 0 4px;
}

.thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
}

.thumb.active {
    border-color: var(--nintendo-red);
}

/* 購入ボックス */
.breadcrumb { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 10px; }
.product-title { font-size: 2rem; font-weight: bold; margin-bottom: 5px; }
.product-subtitle { color: var(--text-sub); margin-bottom: 20px; }

.price-area { margin-bottom: 20px; }
.discount-tag {
    background: #FF4554;
    color: #fff;
    display: inline-block;
    padding: 2px 8px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-sub);
    margin-right: 10px;
}

.current-price {
    font-size: 2rem;
    color: var(--nintendo-red);
    font-weight: bold;
}

.current-price span { font-size: 1rem; margin-left: 4px; }

.points-info { margin-bottom: 30px; font-size: 0.9rem; }
.gold-text { color: var(--gold); font-weight: bold; }

/* ボタン */
.btn {
    width: 100%;
    padding: 18px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    border: none;
    margin-bottom: 10px;
    transition: transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--nintendo-red); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: #fff; color: var(--text-main); border: 2px solid var(--border-color); }

.rating-area {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.cero-icon {
    border: 3px solid #000;
    padding: 5px 10px;
    font-weight: bold;
    font-size: 1.5rem;
    border-radius: 4px;
}

/* 詳細テキスト */
.details-text {
    margin-bottom: 40px;
}

/* スペック表 */
.details-section h2 { border-bottom: 2px solid var(--text-main); padding-bottom: 10px; margin-bottom: 20px; }

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th {
    width: 30%;
    text-align: left;
    padding: 15px;
    background: var(--bg-gray);
    border-bottom: 1px solid #fff;
}

.specs-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* モバイル用スティッキーフッター */
.mobile-sticky-footer {
    display: none; /* デスクトップでは非表示 */
    position: fixed;
    bottom: 0;
    width: 100%;
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

/* 表示状態のクラス */
.mobile-sticky-footer.is-visible {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 767px) {
   .mobile-sticky-footer { display: flex; }
   .mobile-sticky-footer.btn { width: 60%; margin-bottom: 0; }
    body { padding-bottom: 80px; }
}

.global-footer {
    background: var(--bg-gray);
    padding: 40px 0;
    text-align: center;
    margin-top: 100px;
    color: var(--text-sub);
}

/* ハートのエフェクト用スタイル */
.heart-effect {
    position: absolute;
    color: #FF4554;
    font-size: 1.5rem;
    pointer-events: none;
    animation: heart-fly 0.8s ease-out forwards;
    z-index: 2;
}

@keyframes heart-fly {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -150%) scale(1.5);
        opacity: 0;
    }
}

/* 追加済みのボタン状態 */
.btn-secondary.is-added {
    background-color: var(--bg-gray);
    color: var(--text-main); /* 少し濃くして読みやすく */
    border-color: var(--border-color);
}

/* ボタン押下時のわずかな縮小フィードバック  */
.btn:active {
    transform: scale(0.95);
}

/* 追加済みのボタンのホバー状態（解除を促す） */
.btn-secondary.is-added:hover {
    background-color: #fff;
    border-color: var(--nintendo-red);
    color: var(--nintendo-red);
    cursor: pointer;
}

/* ヘッダーナビのアイコンスタイル */
.header-nav > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-main); /* 既存の変数を使用 */
    transition: color 0.2s ease, transform 0.1s ease;
}

.header-nav > div:hover {
    color: var(--nintendo-red); /* ホバー時に任天堂レッドへ [cite: 89] */
    transform: scale(1.1);
}

.header-nav svg {
    width: 22px; /* アイコンの視覚的な大きさを調整 */
    height: 22px;
}

/* アイコンのアニメーション設定  */
.menu-icon {
    position: relative;
}

.menu-icon line {
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
    transform-box: fill-box; 
}

/* メニュー展開時の「×」への変形 */
.menu-icon.is-active .line-top {
    transform: translateY(6px) rotate(45deg);
}
.menu-icon.is-active .line-mid {
    opacity: 0;
}
.menu-icon.is-active .line-bottom {
    transform: translateY(-6px) rotate(-45deg);
}

/* ドロワー本体（右側からスライドイン）*/
.nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100%;
    background-color: #FFF;
    padding: 80px 24px 40px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}

.nav-drawer.is-active {
    transform: translateX(-320px);
    z-index: 999;
}

.drawer-header {
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.drawer-title { font-weight: bold; font-size: 1.2rem; }

.drawer-list { list-style: none; }

.drawer-link {
    display: block;
    padding: 18px 0;
    color: var(--text-main);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.2s, padding-left 0.2s;
}

.drawer-link:hover {
    color: var(--nintendo-red);
    padding-left: 10px;
}

.drawer-note {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-sub);
    padding-top: 20px;
}

/* オーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 99;
}

.menu-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* コンテナ設計 */
.l-container {
    width: 100%;
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    box-sizing: border-box;
}

/* コンテナ */
.product-container {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* モーダル基本構造 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* モーダル表示時の状態 */
.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.is-active .modal-content img {
    transform: scale(1);
}

/* 閉じるボタン */
.modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--nintendo-red);
}

/* カルーセル内の画像にホバーした時の演出 */
.media-carousel .slide img {
    cursor: zoom-in;
    transition: opacity 0.3s ease;
}

.media-carousel .slide img:hover {
    opacity: 0.9;
}