/* OneTwo storefront widgets — all selectors prefixed .otw- to avoid theme collisions. */

#otw-root,
#otw-root * {
    box-sizing: border-box;
}

#otw-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2147483640;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    color: #000;
}

#otw-root .otw-hidden {
    display: none !important;
}

/* Widget container — positioning. */
.otw-widget {
    position: fixed;
    pointer-events: auto;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.otw-widget[data-pos-desktop="br"] { right: 16px; bottom: 16px; flex-direction: row-reverse; }
.otw-widget[data-pos-desktop="bl"] { left: 16px;  bottom: 16px; flex-direction: row; }
.otw-widget[data-pos-desktop="bc"] { left: 50%;   bottom: 16px; transform: translateX(-50%); flex-direction: column; align-items: center; }

@media (max-width: 768px) {
    .otw-widget[data-pos-mobile="br"] { right: 16px; left: auto; bottom: 16px; transform: none; flex-direction: row-reverse; }
    .otw-widget[data-pos-mobile="bl"] { left: 16px;  right: auto; bottom: 16px; transform: none; flex-direction: row; }
    .otw-widget[data-pos-mobile="bc"] { left: 50%;   right: auto; bottom: 16px; transform: translateX(-50%); flex-direction: column; align-items: center; }
    .otw-widget[data-pos-mobile="hide"] { display: none !important; }

    /* On mobile, collapse the button to an icon-only circular FAB so the
       multi-word label doesn't wrap and eat vertical viewport. The aria-label
       still carries the full text for screen readers. */
    .otw-widget:not([data-pos-mobile="hide"]) .otw-btn {
        padding: 12px;
        border-radius: 50%;
        gap: 0;
    }
    .otw-widget:not([data-pos-mobile="hide"]) .otw-btn-text {
        display: none;
    }
    .otw-widget:not([data-pos-mobile="hide"]) .otw-icon {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
    }
}

/* Buttons. */
.otw-btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: #000;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    position: relative;
    text-decoration: none;
}

.otw-btn:hover { filter: brightness(1.1); }
.otw-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.otw-icon { width: 18px; height: 18px; flex: 0 0 18px; fill: currentColor; }

/* Wrapper that hosts the button + its small dismiss control. */
.otw-btn-wrap {
    position: relative;
    display: inline-flex;
}

.otw-widget-dismiss {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 28px;
    height: 28px;
    appearance: none;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.otw-widget-dismiss:hover { color: #000; background: #f0f0f0; }
.otw-widget-dismiss:focus-visible { outline: 2px solid #000; outline-offset: 1px; }

.otw-reddot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 10px;
    height: 10px;
    background: #ff3b30;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
    animation: otw-reddot-pulse 1.6s ease-in-out infinite;
}

/* Teaser bubble. */
.otw-teaser {
    background: #fff;
    color: #000;
    border-radius: 10px;
    padding: 8px 28px 8px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    max-width: 280px;
    font-size: 13px;
    position: relative;
    animation: otw-fade-in 0.4s ease-out both;
}

.otw-teaser-x {
    position: absolute;
    top: 4px;
    right: 4px;
    appearance: none;
    border: 0;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 2px 6px;
}

.otw-teaser-x:hover { color: #000; }

/* FAQ panel. */
.otw-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    padding: 12px 16px;
    animation: otw-slide-up 0.2s ease-out both;
}

.otw-panel ul { list-style: none; padding: 0; margin: 0; }
.otw-panel li { padding: 12px 0; border-bottom: 1px solid #eee; }
.otw-panel li:last-child { border-bottom: 0; }
.otw-panel h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: #000; }
.otw-panel p { margin: 0; font-size: 13px; color: #999; }

/* Animations. */
@keyframes otw-appear {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes otw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes otw-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes otw-toggle {
    0%, 90%, 100% { transform: scale(1); }
    95%           { transform: scale(1.06); }
}

@keyframes otw-reddot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.25); opacity: 0.7; }
}

.otw-widget--appearing .otw-btn { animation: otw-appear 0.6s ease-out both; }
.otw-widget--toggling .otw-btn  { animation: otw-toggle 0.8s ease-in-out 6s infinite; }

@media (prefers-reduced-motion: reduce) {
    .otw-widget--appearing .otw-btn,
    .otw-widget--toggling .otw-btn,
    .otw-reddot,
    .otw-teaser,
    .otw-panel {
        animation: none !important;
    }
}
