/**
 * Floating CTA — 共通スタイル
 *
 * 旧 romptn-popup-ads の floating スタイルを移植し、
 * .romptn-cta スコープ内で CSS 変数を定義。
 *
 * @package Romptn\CTA\Surfaces\Floating
 * @since   4.0.0
 */

/* ===================================================================
   Base — inherits tokens from base.css (:root)
   =================================================================== */

.romptn-cta-floating {
    font-family: var(--romptn-cta-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
}

/* ===================================================================
   Container
   =================================================================== */

.romptn-cta-floating {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    transform: translate(-50%, 0);
    z-index: 9998;
    width: min(440px, calc(100% - 32px));
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 1;
    transition: transform 400ms ease, opacity 400ms ease;
}

.romptn-cta-floating.is-hidden {
    transform: translate(-50%, 120%);
    opacity: 0;
    pointer-events: none;
}

/* ===================================================================
   Button
   =================================================================== */

.romptn-cta-floating__button {
    pointer-events: auto;
    width: 90%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--romptn-cta-space-xl);
    padding: 12px 18px;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
    font-size: var(--romptn-cta-font-md);
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.5);
    transition: transform 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
    position: relative;
    overflow: visible;
    text-align: center;
    cursor: pointer;
}

.romptn-cta-floating__button:focus-visible {
    outline: 2px solid rgba(11, 95, 255, 0.15);
    outline-offset: 3px;
}

/* ===================================================================
   Icon
   =================================================================== */

.romptn-cta-floating__icon-wrap {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    position: absolute;
    top: -10px;
    right: -8px;
}

.romptn-cta-floating__icon {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===================================================================
   Text
   =================================================================== */

.romptn-cta-floating__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.romptn-cta-floating__eyebrow {
    font-size: var(--romptn-cta-font-xs);
    font-weight: 700;
    line-height: 1.1;
    opacity: 0.95;
}

.romptn-cta-floating__label {
    display: inline-block;
    line-height: 1.2;
    font-size: var(--romptn-cta-font-sm);
    font-weight: 800;
}

/* ===================================================================
   Responsive
   =================================================================== */

@media (max-width: 480px) {
    .romptn-cta-floating {
        bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
        width: calc(100% - 24px);
    }
    .romptn-cta-floating__icon-wrap {
        width: 32px;
        height: 32px;
        top: -8px;
        right: -6px;
    }
}

@media (min-width: 768px) {
    .romptn-cta-floating {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .romptn-cta-floating {
        transition: none;
    }
    .romptn-cta-floating__button {
        transition: none;
    }
}
