/* ============================================================
   参考為替換算ブロック 基本スタイル
   ============================================================ */
.country_rate {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #eee;
    background: #fafafa;
    box-sizing: border-box;
}

/* ポップアップ内では背景や枠を消す */
.country_rate.popup-mode {
    margin-top: 0;
    padding: 0;
    border: none !important;
    background: transparent !important;
}

.country_rate h2 {
    font-size: 16px;
    margin: 0 0 15px 0;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.country_rate h2 small {
    font-weight: normal;
    font-size: 12px;
    color: #666;
    display: inline-block;
    margin-left: 5px;
}

/* 通貨リストのグリッド設定 */
.country_rate .cots {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    /* PCでは3列、画面幅に合わせて自動調整 */
    flex-wrap: wrap;
}

section#itemDetail-wrap .country_rate li.c {
    display: flex;
    align-items: center;
    font-size: 14px;
    width: 33.3%;
    margin: 5px 0;
}

.country_rate li.c .img {
    margin-right: 10px;
    display: flex;
    align-items: center;
}

.country_rate li.c .img img {
    width: 24px;
    height: auto;
    border: 1px solid #eee;
    display: block;
}

.country_rate li.c .rate {
    font-weight: bold;
    color: #333;
}

/* 下部注釈エリア */
.country_rate .des {
    font-size: 12px;
    color: #888;
    margin: 15px 0 0;
    line-height: 1.6;
}

.country_rate .timestamp {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #aaa;
    margin-top: 5px;
}

/* ============================================================
   「他の通貨を表示」ボタンとエリアの制御
   ============================================================ */
.more-currencies-wrapper {
    display: none; /* 初期は非表示 */
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
    transition: all 0.3s ease;
    opacity: 0;
}
.jp-currency-link + #currency-overlay .more-currencies-wrapper{
    margin-top: 0;
    padding-top: 0;
    border-top:none;
}
/* JSで is-expanded クラスがつくと表示 */
.more-currencies-wrapper.is-expanded {
    display: block;
    transition: all 0.3s ease;
    opacity: 1;
}

.btn-toggle-currency {
    display: block;
    margin: 15px auto 0;
    padding: 8px 25px;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.btn-toggle-currency:hover {
    background: #f0f0f0;
}

/* JSで is-hidden クラスがつくとボタン消滅 */
.btn-toggle-currency.is-hidden {
    display: none;
}

/* ============================================================
   日本IP向け：リンクとポップアップの制御
   ============================================================ */

/* ポップアップを呼ぶテキストリンク */
.jp-currency-link {
    font-size: 12px;
    color: #fff;
    cursor: pointer;
    margin: 0 0 15px;
    display: inline-block;
    padding: 3px 10px;
    background: #ff6105;
    letter-spacing: 1px;
    border-radius: 5px;
}
.jp-currency-link:before {
    content:"";
    display:inline-block;
    width: 0;
    height: 0;
    border-style: solid;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
    border-right: 0;
    margin: 0 5px 0 0;
}

.jp-currency-link:hover {
    background: #ff7e33;
}

/* ポップアップ外枠（背景） */
.currency-popup-overlay {
    visibility: hidden; /* 初期は隠す */
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* JSで is-visible クラスがつくとふわっと表示 */
.currency-popup-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

/* ポップアップの中身箱 */
.currency-popup-content {
    background: #fff;
    padding: 30px 20px 20px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* 閉じるボタン（×） */
.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 28px;
    color: #999;
    line-height: 1;
}

.popup-close:hover {
    color: #333;
}