/* ====== spinner.css の変数/アニメーション参照用（未定義ならフォールバック） ====== */
:root {
    --spinner-size: 22px; /* 直径 */
    --spinner-border: 3px; /* 太さ */
    --spinner-gap: 16px; /* スピナーとテキスト間隔 */
    --spinner-base: #f3f3f3;
    --spinner-accent: #6b7280; /* 灰寄りの色（spinner.css 側で上書き可） */
}
/* フォールバックの回転アニメ（spinner.css に定義済みならそれが優先） */
@keyframes spin {
    from {
        transform: rotate(0);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ====== 背面スクロール抑止（モーダル表示時に body に付与） ====== */
body.no-scroll {
    overflow: hidden;
    touch-action: none;
}

/* ====== モーダル全体 ====== */
.iframe-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none; /* is-open で表示 */
}
.iframe-modal.is-open {
    display: block;
}

/* 半透明の背景 */
.iframe-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.iframe-modal.is-open .iframe-modal__backdrop {
    opacity: 1;
}

/* 中央寄せパネル（カードを中央に） */
.iframe-modal__panel {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 6vh 16px; /* 画面端の余白 */
    pointer-events: none; /* カード外クリック検出用 */
}

/* カード本体（max 800px） */
.iframe-modal__card {
    position: relative;
    pointer-events: auto;
    width: min(92vw, 800px);
    height: min(88vh, 900px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.iframe-modal.is-open .iframe-modal__card {
    opacity: 1;
    transform: translateY(0);
}

/* 右上の白丸×ボタン */
.iframe-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px !important;
    height: 34px;
    border-radius: 9999px;
    background: #fff;
    font-size: 100% !important;
    font-weight: 600;
    border: 1px solid #6b7280; /* #ddd */
    color: #6b7280; /* 灰色 × */
    display: grid;
    place-items: center;
    justify-content: center !important;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    z-index: 999;
}
.iframe-modal__close:hover {
    background: #f9fafb;
    color: #374151;
}
.iframe-modal__close:focus {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
}

@media screen and (max-width: 768px) {
    button.iframe-modal__close{
        min-width:0;
    }
}

/* iframe（ロード完了まで非表示） */
.iframe-modal__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: none; /* ロード完了で block に */
}

/* ロード中レイヤー（スピナー＋文言） */
.iframe-modal__loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    row-gap: var(--spinner-gap);
    background: #fff;
}

/* spinner.css の .loader 相当（変数で見た目共通化） */
.iframe-modal__loader .loader {
    width: var(--spinner-size);
    height: var(--spinner-size);
    border-radius: 9999px;
    border: var(--spinner-border) solid var(--spinner-base);
    border-top-color: var(--spinner-accent);
    animation: spin 1.2s linear infinite;
}

/* “loading...” テキスト */
.iframe-modal__loader .loader-text {
    margin: 0;
    padding: 0 16px;
    text-align: center;
    font-size: 12px;
    color: #374151;
}

/* 小さめ画面でボタンをわずかに広げる */
@media (max-width: 480px) {
    .iframe-modal__close {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}


/* カートページ */
body#EST_SPS_cart .login-container{
    max-width:800px;
    width:100%;
    margin:0 auto;
    text-align:center;
}

body#EST_SPS_cart .login-container a.modal-login-button{
    padding:15px;
    max-width:400px;
    width:100%;
    background:#007bff;
    color:#fff !important;
    text-decoration: none;
    font-size: 15px;
    border-radius: 3px;
    margin: 15px auto;
    display: block;
}

body#EST_SPS_cart .login-container a.modal-login-button:hover{
    text-decoration: none;
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body#EST_SPS_cart .login-container p{
    font-size:18px;
    padding:10px;
}

body#EST_SPS_cart .login-container p.login-note{
    font-size:14px;
}