/* =========================================
   Floating Banner v2 - Front Styles
   ========================================= */

.fb-banner,
.fb-banner * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Global Overlay ── */
#fb-global-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99997;
}

/* ── Base ── */
.fb-banner {
    font-family: "游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
    z-index: 99999;
}

/* ── Close ── */
.fb-close {
    position: absolute;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    color: #666;
    padding: 0;
    line-height: 1;
}

.fb-close:hover {
    opacity: 0.7;
}

/* ── Link ── */
.fb-banner-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.fb-banner-link:hover {
    opacity: 0.95;
}

/* ── Label ── */
.fb-banner-label {
    display: block;
    color: #b8960c;
    font-size: 14px;
    font-style: italic;
    font-family: "Times New Roman", "游明朝", YuMincho, serif;
    margin-bottom: 4px;
}

/* ── Title ── */
.fb-banner-title {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.08em;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #333;
    font-family: "Times New Roman", "游明朝", YuMincho, "Hiragino Mincho ProN", serif;
}

/* ── Description ── */
.fb-banner-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}

/* ── VIEW MORE (三角形) ── */
.fb-banner-btn-wrap {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 90px;
    height: 90px;
    pointer-events: none;
    z-index: 1;
}

.fb-banner-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #c9a84c, #a07c2e);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    pointer-events: auto;
}

.fb-banner-btn-text {
    position: absolute;
    color: #fff;
    font-size: 10px;
    font-family: "Times New Roman", serif;
    letter-spacing: 0.15em;
    white-space: nowrap;
    line-height: 1;
    top: 62%;
    left: 62%;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

/* ── Image ── */
.fb-banner-image img {
    width: 100%;
    height: auto;
    display: block;
}


/* =========================================
   Modal (画面中央)
   ========================================= */
.fb-type-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fb-type-modal .fb-banner-inner {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 99999;
    animation: fbFadeInUp 0.4s ease;
}

.fb-type-modal .fb-close {
    top: 12px;
    right: 12px;
}

.fb-type-modal .fb-banner-content {
    padding: 20px 24px 24px;
}

/* ── Modal Stacking (重ね表示) ── */
/* index=0 が最前面、1以降は後ろへ */
.fb-type-modal .fb-banner-inner {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fb-modal-0 { z-index: 100002; }
.fb-modal-1 { z-index: 100001; }
.fb-modal-1 .fb-banner-inner {
    transform: translate(16px, -16px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.fb-modal-2 { z-index: 100000; }
.fb-modal-2 .fb-banner-inner {
    transform: translate(32px, -32px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.fb-modal-3 { z-index: 99999; }
.fb-modal-3 .fb-banner-inner {
    transform: translate(48px, -48px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

/* 前面が閉じられた後、昇格アニメーション */
.fb-type-modal.fb-modal-promoted .fb-banner-inner {
    transform: translate(0, 0) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}


/* =========================================
   Popup (フローティング) - PC
   ========================================= */
.fb-type-popup {
    position: fixed;
    z-index: 99999;
    max-width: 420px;
    width: calc(50% - 36px);
}

.fb-type-popup .fb-banner-inner {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: stretch;
    animation: fbSlideIn 0.4s ease;
}

.fb-type-popup .fb-banner-link {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.fb-type-popup .fb-banner-image {
    width: 140px;
    min-height: 100%;
    flex-shrink: 0;
}

.fb-type-popup .fb-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fb-type-popup .fb-banner-content {
    padding: 14px 50px 14px 16px;
    flex: 1;
    min-width: 0;
}

.fb-type-popup .fb-close {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
}

.fb-type-popup .fb-close svg {
    width: 16px;
    height: 16px;
}

.fb-type-popup .fb-banner-title {
    font-size: 16px;
    letter-spacing: 0.06em;
}

.fb-type-popup .fb-banner-label {
    font-size: 12px;
}

.fb-type-popup .fb-banner-desc {
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fb-type-popup .fb-banner-btn-wrap {
    width: 72px;
    height: 72px;
}

.fb-type-popup .fb-banner-btn-text {
    font-size: 9px;
}

/* PC: 1つ目 → 右下 */
.fb-popup-first {
    bottom: 24px;
    right: 24px;
}

/* PC: 2つ目 → 左下 */
.fb-popup-second {
    bottom: 24px;
    left: 24px;
}


/* =========================================
   Animations
   ========================================= */
@keyframes fbFadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fbSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fbSlideInMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}


/* =========================================
   SP Styles
   ========================================= */
@media screen and (max-width: 768px) {

    /* Modal SP */
    .fb-type-modal .fb-banner-inner {
        max-width: 92%;
        border-radius: 10px;
    }

    .fb-type-modal .fb-banner-title {
        font-size: 17px;
    }

    .fb-type-modal .fb-banner-content {
        padding: 16px 20px 20px;
    }

    /* Modal SP: 重ねオフセット縮小 */
    .fb-modal-1 .fb-banner-inner {
        transform: translate(10px, -10px);
    }
    .fb-modal-2 .fb-banner-inner {
        transform: translate(20px, -20px);
    }
    .fb-modal-3 .fb-banner-inner {
        transform: translate(30px, -30px);
    }

    /* Popup SP: フッター固定 */
    .fb-type-popup {
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        transition: transform 0.3s ease;
    }

    .fb-type-popup .fb-banner-inner {
        border-radius: 12px 12px 0 0;
        animation: fbSlideInMobile 0.4s ease;
    }

    .fb-type-popup .fb-banner-image {
        width: 100px;
    }

    .fb-type-popup .fb-banner-title {
        font-size: 14px;
    }

    .fb-type-popup .fb-banner-label {
        font-size: 11px;
    }

    .fb-type-popup .fb-banner-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .fb-type-popup .fb-banner-btn-wrap {
        width: 56px;
        height: 56px;
    }

    .fb-type-popup .fb-banner-btn-text {
        font-size: 8px;
    }

    /* SP: 1つ目 → 前面 */
    .fb-popup-first {
        z-index: 100000;
    }

    /* SP: 2つ目 → 後ろに少し上にずらして見せる */
    .fb-popup-second {
        z-index: 99998;
        transform: translateY(-16px);
    }

    .fb-popup-second .fb-banner-inner {
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    }

    /* 1つ目が閉じられた後、2つ目を定位置に */
    .fb-popup-second.fb-popup-promoted {
        z-index: 100000;
        transform: translateY(0);
    }
}
