/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Error message styling */
.wsww-error {
    background: #fff0f0;
    border: 1px solid #ff4d4d;
    padding: 10px;
    margin: 15px 0;
    font-weight: bold;
    color: #ff4d4d;
}

/* Ensure spinner wrapper maintains its styles */
.wsww-shortcode-wrapper .spinner-wrapper {
    position: fixed !important;
    z-index: 9999 !important;
}

/* Ensure overlay is behind spinner but above page content */
.wsww-overlay {
    position: fixed !important;
    z-index: 9998 !important;
}

/* Prevent body scroll when spinner is open */
body.wsww-spinner-open {
    overflow: hidden !important;
}

/* Apply dynamic CSS variables to spinner elements */
.wsww-shortcode-wrapper{
    background: transparent !important; 
}
.wsww-shortcode-wrapper .spinner-wrapper {
    background: var(--card_background, #0b0b0c) !important;
    color: var(--card_color, #fff) !important;
}

.wsww-shortcode-wrapper {
    border-radius: var(--card_boder_radius, 0px);
    padding: var(--card_boder_padding, 0px);
}

/* Email wrapper styling with dynamic colors */
.email-wrapper {
    color: var(--card_color, #fff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    position: relative;
}

/* Keep layout when hiding form content during loader */
.wsww-form-content-hidden {
    visibility: hidden;
}

.email-wrapper form {
    text-align: left;
    width: 100%;
}

.email-wrapper .description {
    text-align: left;
}

.email-wrapper input,
.email-wrapper input[type="text"],
.email-wrapper input[type="email"],
.email-wrapper input[type="tel"] {
    text-align: left;
}

.email-wrapper button,
.email-wrapper .wsww-from-button,
.email-wrapper .wsww-tyl-btn {
    text-align: center;
    width: auto;
    align-self: flex-start;
}

.email-wrapper h3 {
    color: var(--card_color, #fff);
}

.email-wrapper p {
    color: var(--card_color, #fff);
}

/* Form button styling with dynamic colors */
.wsww-from-button {
    background-color: var(--from_button_background_color, #000) !important;
    color: var(--from_button_color, #ffcd30) !important;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: normal;
    text-transform: capitalize;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.wsww-from-button:hover {
    opacity: 0.9;
}

.wsww-from-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spin close button uses card color */
.spin-close svg g {
    fill: var(--card_color, #fff);
}

/* Ensure template classes work */
.template-1,
.template-2,
.template-3 {
    background: var(--card_background, #0b0b0c);
    color: var(--card_color, #fff);
}

/* Form field styling */
.email-wrapper input[type="text"],
.email-wrapper input[type="email"],
.email-wrapper input[type="tel"],
.email-wrapper .ff-field {
    background-color: #fff;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 6px 12px;
    border-radius: 0.25rem;
}

/* Description area */
.description {
    color: var(--card_color, #fff);
}

.description h3 {
    color: var(--card_color, #fff);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 30px;
    font-weight: normal;
}

.description p {
    color: var(--card_color, #fff);
    font-size: 14px;
}

/* Form alignment classes */
.form-alignment-left {
    text-align: left;
}

.form-alignment-center {
    text-align: center;
}

.form-alignment-right {
    text-align: right;
}

/*
 * Form design setting (Header/Details Align) — must beat stronger selectors that forced
 * left alignment: .spinner-wrapper.popup .email-wrapper, .email-wrapper .description, inputs.
 */
.spinner-wrapper.popup .email-wrapper.form-alignment-left,
.spinner-wrapper:not(.popup) .email-wrapper.form-alignment-left {
    text-align: left;
    align-items: flex-start;
}

.spinner-wrapper.popup .email-wrapper.form-alignment-center,
.spinner-wrapper:not(.popup) .email-wrapper.form-alignment-center {
    text-align: center;
    align-items: center;
}

.spinner-wrapper.popup .email-wrapper.form-alignment-right,
.spinner-wrapper:not(.popup) .email-wrapper.form-alignment-right {
    text-align: right;
    align-items: flex-end;
}

.email-wrapper.form-alignment-left .description,
.email-wrapper.form-alignment-left form {
    text-align: left;
}

.email-wrapper.form-alignment-center .description,
.email-wrapper.form-alignment-center form {
    text-align: center;
}

.email-wrapper.form-alignment-right .description,
.email-wrapper.form-alignment-right form {
    text-align: right;
}

.email-wrapper.form-alignment-center input[type="text"],
.email-wrapper.form-alignment-center input[type="email"],
.email-wrapper.form-alignment-center input[type="tel"],
.email-wrapper.form-alignment-center .ff-field {
    text-align: center;
}

.email-wrapper.form-alignment-right input[type="text"],
.email-wrapper.form-alignment-right input[type="email"],
.email-wrapper.form-alignment-right input[type="tel"],
.email-wrapper.form-alignment-right .ff-field {
    text-align: right;
}

.email-wrapper.form-alignment-center .wsww-from-button,
.email-wrapper.form-alignment-center button[type="submit"] {
    display: inline-block;
}

.email-wrapper.form-alignment-right .wsww-from-button,
.email-wrapper.form-alignment-right button[type="submit"] {
    display: inline-block;
}

/* Keep checkbox row aligned with Form Design alignment setting */
.email-wrapper .wsww-consent-wrapper {
    width: 100%;
}

.email-wrapper.form-alignment-left .wsww-consent-wrapper {
    text-align: left;
}

.email-wrapper.form-alignment-center .wsww-consent-wrapper {
    text-align: center;
}

.email-wrapper.form-alignment-right .wsww-consent-wrapper {
    text-align: right;
}

.template-1 .w-100 .email-wrapper.form-alignment-center,
.template-2 .w-100 .email-wrapper.form-alignment-center,
.template-spin-on-left .email-wrapper.form-alignment-center {
    align-items: center;
}

.template-1 .w-100 .email-wrapper.form-alignment-right,
.template-2 .w-100 .email-wrapper.form-alignment-right,
.template-spin-on-left .email-wrapper.form-alignment-right {
    align-items: flex-end;
}

/* Template classes */
.template-1,
.template-2,
.template-3 {
    background: var(--card_background, #0b0b0c) !important;
    color: var(--card_color, #fff) !important;
}

/* Shortcode wrapper */
.wsww-shortcode-wrapper {
    position: relative;
    width: 100%;
}

.wsww-shortcode-wrapper-center-auto {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}

/* Spin AJAX loader - full overlay on form */

.spin-ajax-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    align-items: center;
    justify-content: center;
    background: var(--card_background);
    display: none;
}
/* .spin-ajax-loader-spin-on-left{
    position: absolute;
    top: 0;
    right: auto;
    left: 31% !important;
    transform: translateY(-50%);
    z-index: 10001;
     display: none; 
    transform: translate(-50%, -500%) !important;
} */
.spin-ajax-loader img {
    width: 100px;
}
.spin-ajax-loader.show {
    display: flex;
}


/* Spin result message */
.spin-result-message {
    color: var(--card_color, #fff);
    padding: 20px;
    text-align: left;
    font-size: 18px;
    display: block;
    visibility: visible;
}

.spin-result-message.hide {
    display: none;
}

/* Ensure result message is always visible when not hidden */
.spin-result-message:not(.hide) {
    display: block !important;
    visibility: visible !important;
}

/* Status message */
.status-msg {
    color: #f29c2b;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Spin button */
.spin-btn {
    display: none;
}

.spin-btn.hide {
    display: none;
}

/* Additional form field styles */
.ff-field {
    width: 100%;
    margin-bottom: 15px;
    display: block;
}

/* WSWW button styles */
.wsww-tyl-btn {
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wsww-tyl-btn:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Button trigger spin card */
.button-tigger-spin-card {
    cursor: pointer;
    border: none;
    outline: none;
}

/* Show/hide classes for responsive */
.show-laptop {
    display: block;
}

.show-tablet {
    display: block;
}

.show-mobile {
    display: block;
}

@media (max-width: 991px) {
    .show-laptop {
        display: none;
    }
}

@media (max-width: 767px) {
    .show-tablet {
        display: none;
    }
}

@media (max-width: 575px) {
    .show-mobile {
        display: none;
    }
}

/* Chart and wheel styling */
#chart {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: auto;
    margin: 0 auto;
    overflow: visible;
}

#chart svg {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* Stacked layouts: chart follows SVG pixel width (not full panel) */
.w-100.template-spin-on-top #chart,
.w-100.template-spin-on-bottom #chart,
.w-100.template-3 #chart,
.spinner-wrapper.left .w-100 .wsww-chart-container #chart,
.spinner-wrapper.right .w-100 .wsww-chart-container #chart {
    width: auto;
    max-width: 100%;
}

.w-100.template-spin-on-top #chart svg,
.w-100.template-spin-on-bottom #chart svg,
.w-100.template-3 #chart svg,
.spinner-wrapper.left .w-100 .wsww-chart-container #chart svg,
.spinner-wrapper.right .w-100 .wsww-chart-container #chart svg {
    width: auto;
    height: auto;
    max-width: 100%;
}

/* Slice text styling */
.slice text {
    /* fill color is set per-segment via JavaScript, so we don't override it here */
    font-size: var(--wheel_stroke_font_size, 14px) !important;
    font-family: var(--wheel_stroke_font_family, Arial, sans-serif) !important;
    font-style: var(--wheel_stroke_font_style, normal) !important;
    font-weight: normal;
    pointer-events: none;
    user-select: none;
}

/* Arc/slice path styling */
.slice path {
    stroke: var(--wheel_stroke_border_color, #000) !important;
    stroke-width: var(--wheel_stroke_border_size, 2px) !important;
}

/* Center circle styling */
#chart circle[fill] {
    fill: var(--wheel_center_background, #fff) !important;
    stroke: var(--wheel_center_boder_color, #000) !important;
    stroke-width: var(--wheel_center_boder_width, 2px) !important;
}

/* Question/description area */
#question {
    position: relative;
    color: var(--card_color, #fff);
}

#question h1 {
    color: var(--card_color, #fff);
    font-size: 30px;
    font-weight: bold;
    padding-top: 30px;
}

/* Ensure all text in spinner uses card color */
.wsww-shortcode-wrapper * {
    color: inherit;
}

.wsww-shortcode-wrapper h1,
.wsww-shortcode-wrapper h2,
.wsww-shortcode-wrapper h3,
.wsww-shortcode-wrapper h4,
.wsww-shortcode-wrapper h5,
.wsww-shortcode-wrapper h6,
.wsww-shortcode-wrapper p,
.wsww-shortcode-wrapper span,
.wsww-shortcode-wrapper div {
    color: var(--card_color, #fff);
}

/* Input fields should remain white background */
.wsww-shortcode-wrapper input[type="text"],
.wsww-shortcode-wrapper input[type="email"],
.wsww-shortcode-wrapper input[type="tel"] {
    background-color: #fff !important;
    color: #495057 !important;
}

/* Ensure spinner wrapper maintains flex layout */
.spinner-wrapper {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Popup spinner wrapper - ensure no cropping */
.spinner-wrapper.popup {
    overflow: visible !important;
}

/* Ensure .w-100 container aligns its children vertically for all modes */
.spinner-wrapper .w-100 {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Smooth popup animation */
.spinner-wrapper.appear-on-popup {
    animation: popupFadeIn 0.4s ease-in-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Ensure popup has proper styling - let template classes control the layout */
.spinner-wrapper.appear-on-popup .w-100,
.spinner-wrapper.popup .w-100 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    gap: 5px;
    align-self: center;
    overflow: visible;
}

/* Ensure popup .w-100 container centers all children including chart */
.spinner-wrapper.popup .w-100 {
    justify-content: center !important;
    overflow: visible !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100 {
    justify-content: flex-start !important;
}

/* Ensure chart is centered in popup mode - override all template classes */
.spinner-wrapper.popup .w-100 #chart,
.spinner-wrapper.popup .template-1 .w-100 #chart,
.spinner-wrapper.popup .template-2 .w-100 #chart,
.spinner-wrapper.popup .template-3 .w-100 #chart,
.spinner-wrapper.popup .template-spin-on-left .w-100 #chart,
.spinner-wrapper.popup .template-spin-on-right .w-100 #chart {
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Center popup modal: align row from the start — no dead space outside wheel/form */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100 #chart,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .template-1 .w-100 #chart,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .template-2 .w-100 #chart,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .template-spin-on-left .w-100 #chart,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .template-spin-on-right .w-100 #chart {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Popup respects template classes - don't override flex-direction */
.spinner-wrapper.popup .template-spin-on-left .w-100,
.spinner-wrapper.popup .template-spin-on-right .w-100 {
    flex-direction: row;
    flex-wrap: nowrap;
}

.spinner-wrapper.popup .template-spin-on-right .w-100 {
    flex-direction: row-reverse;
}

/* DOM order is [wheel, form]: top = wheel first, bottom = form first (column-reverse) */
.spinner-wrapper.popup .w-100.template-spin-on-top,
.w-100.template-spin-on-top {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
}

.spinner-wrapper.popup .w-100.template-spin-on-bottom,
.w-100.template-spin-on-bottom {
    flex-direction: column-reverse !important;
    flex-wrap: nowrap !important;
}

/* Non-popup (inline / left / right sidebar) modes.
   Frontend DOM order inside .w-100 is [wheel, form]. Canonical semantics:
     spin-on-left   => row            (wheel left, form right)
     spin-on-right  => row-reverse    (wheel right, form left)
     spin-on-top    => column         (wheel top, form below)
     spin-on-bottom => column-reverse (wheel bottom, form above)
   Keep spin-on-left/top default; add reverse for right/bottom so sidebar
   modes behave the same as popup. */
.spinner-wrapper:not(.popup) .template-spin-on-right .w-100 {
    flex-direction: row-reverse !important;
}

.spinner-wrapper:not(.popup) .w-100.template-spin-on-bottom {
    flex-direction: column-reverse !important;
}

/* Chart (wheel) in popup - let it size naturally and align vertically */
.spinner-wrapper.popup #chart,
.spinner-wrapper.popup .template-1 #chart,
.spinner-wrapper.popup .template-2 #chart,
.spinner-wrapper.popup .template-3 #chart,
.spinner-wrapper.popup .template-spin-on-left #chart,
.spinner-wrapper.popup .template-spin-on-right #chart,
.spinner-wrapper.popup .template-spin-on-top #chart,
.spinner-wrapper.popup .template-spin-on-bottom #chart,
.spinner-wrapper.popup .template-1 .w-100 #chart,
.spinner-wrapper.popup .template-2 .w-100 #chart,
.spinner-wrapper.popup .template-3 .w-100 #chart {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    margin: 0 auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    position: relative;
}

/* SVG in popup - ensure it's not cropped and properly centered */
.spinner-wrapper.popup #chart svg,
.spinner-wrapper.popup .template-1 #chart svg,
.spinner-wrapper.popup .template-2 #chart svg,
.spinner-wrapper.popup .template-3 #chart svg,
.spinner-wrapper.popup .template-spin-on-left #chart svg,
.spinner-wrapper.popup .template-spin-on-right #chart svg,
.spinner-wrapper.popup .template-spin-on-top #chart svg,
.spinner-wrapper.popup .template-spin-on-bottom #chart svg {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    display: block !important;
    margin: 0 auto !important;
    overflow: visible !important;
}

/* Chart for non-popup modes (left/right) */
.spinner-wrapper:not(.popup) #chart {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding-left: 20px;
    padding-right: 0;
}

/* Email wrapper (form) in popup - let it size naturally and align vertically */
.spinner-wrapper.popup .email-wrapper {
    flex: 1 1 auto;
    padding: 15px 0;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: center;
    margin: 0 auto;
    text-align: left;
}

/* Popup up/down: form column matches wheel width */
.spinner-wrapper.popup .w-100.template-spin-on-top,
.spinner-wrapper.popup .w-100.template-spin-on-bottom,
.spinner-wrapper.popup .w-100.template-3 {
    width: fit-content !important;
    max-width: 100% !important;
    align-items: stretch !important;
}

.spinner-wrapper.popup .w-100.template-spin-on-top > .email-wrapper,
.spinner-wrapper.popup .w-100.template-spin-on-bottom > .email-wrapper,
.spinner-wrapper.popup .w-100.template-3 > .email-wrapper {
    flex: 0 0 auto;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Email wrapper for non-popup modes (left/right) */
.spinner-wrapper:not(.popup) .email-wrapper {
    flex: 1 1 auto;
    padding: 15px 20px 15px 0;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: center;
    text-align: left;
}

/* Popup responsive adjustments */
@media (max-width: 991px) {
    .spinner-wrapper.appear-on-popup .w-100,
    .spinner-wrapper.popup .w-100 {
        padding: 10px;
        gap: 10px;
    }
    
    /* On mobile, stack vertically regardless of template */
    .spinner-wrapper.popup .template-spin-on-left .w-100,
    .spinner-wrapper.popup .template-spin-on-right .w-100 {
        flex-direction: column !important;
    }
    
    .spinner-wrapper.popup #chart {
        max-width: 100% !important;
        width: auto !important;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: visible !important;
    }
    
    .spinner-wrapper.popup #chart svg {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        overflow: visible !important;
        margin: 0 auto !important;
    }
    
    .spinner-wrapper.popup .email-wrapper {
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
        padding: 15px 0;
        margin: 0 auto;
        align-items: flex-start;
        text-align: left;
    }

    .spinner-wrapper.popup .w-100.template-spin-on-top,
    .spinner-wrapper.popup .w-100.template-spin-on-bottom {
        width: fit-content !important;
        max-width: calc(100vw - 32px) !important;
        align-items: stretch !important;
    }

    .spinner-wrapper.popup .email-wrapper.form-alignment-center {
        text-align: center;
        align-items: center;
    }

    .spinner-wrapper.popup .email-wrapper.form-alignment-right {
        text-align: right;
        align-items: flex-end;
    }
    
    .popup {
        width: 95vw;
        max-width: 95vw;
    }
}

/* Template container - ensure vertical alignment of wheel and form */
.template-1 .w-100,
.template-2 .w-100,
.template-spin-on-left .w-100,
.template-spin-on-right .w-100 {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-self: center;
    gap: 25px !important;
    padding: 15px 0;
}

/* Template container for top/bottom layouts - center both horizontally and vertically */
.template-3 .w-100,
.w-100.template-spin-on-top,
.w-100.template-spin-on-bottom,
.w-100.template-3 {
    /* Shrink-wrap to wheel width; form stretches to same column width */
    width: fit-content;
    max-width: 100%;
    display: flex;
    align-items: stretch !important;
    justify-content: center !important;
    flex-wrap: nowrap;
    align-self: center;
    gap: 25px;
    padding: 0 !important;
    margin: 0 auto !important;
}

.w-100.template-spin-on-top {
    flex-direction: column !important;
}

.w-100.template-spin-on-bottom {
    flex-direction: column-reverse !important;
}

/* Sidebar up/down: chart sizes column; form fills that width */
.w-100.template-spin-on-top .wsww-chart-container,
.w-100.template-spin-on-bottom .wsww-chart-container,
.w-100.template-3 .wsww-chart-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: auto;
    max-width: 100%;
    align-self: stretch;
}

.w-100.template-spin-on-top .wsww-form-container,
.w-100.template-spin-on-bottom .wsww-form-container,
.w-100.template-3 .wsww-form-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
}

/* Ensure chart and email-wrapper are vertically aligned with equal side spacing */
/* Exclude popup mode from these rules */
.spinner-wrapper:not(.popup) .template-1 .w-100 #chart,
.spinner-wrapper:not(.popup) .template-2 .w-100 #chart,
.spinner-wrapper:not(.popup) .template-spin-on-left #chart {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 20px;
    padding-right: 0;
}

/* Chart for top/bottom layouts - centered with no padding */
.template-3 #chart,
.template-spin-on-top #chart,
.template-spin-on-bottom #chart {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
}

.template-1 .w-100 .email-wrapper,
.template-2 .w-100 .email-wrapper,
.template-spin-on-left .email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 0;
    padding-right: 20px;
    }

/* Email wrapper for top/bottom layouts - centered with no padding, match chart width */
.template-3 .email-wrapper,
.template-spin-on-top .email-wrapper,
.template-spin-on-bottom .email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    padding: 0 !important;
    width: fit-content;
    max-width: 100%;
    min-width: fit-content;
}

/* When inside wsww-form-container, fill container to match chart width */
.w-100.template-spin-on-top .wsww-form-container .email-wrapper,
.w-100.template-spin-on-bottom .wsww-form-container .email-wrapper,
.w-100.template-3 .wsww-form-container .email-wrapper,
.w-100.template-spin-on-top > .email-wrapper,
.w-100.template-spin-on-bottom > .email-wrapper,
.w-100.template-3 > .email-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Override any padding/margin for top/bottom layouts */
.template-3 .w-100 #chart,
.template-spin-on-top .w-100 #chart,
.template-spin-on-bottom .w-100 #chart {
    padding: 0 !important;
    margin: 0 auto !important;
}

.template-3 .w-100 .email-wrapper,
.template-spin-on-top .w-100 .email-wrapper,
.template-spin-on-bottom .w-100 .email-wrapper {
    padding: 0 !important;
    margin: 0 auto !important;
}

/* For template-spin-on-right, reverse the padding (chart on right, form on left) */
/* Exclude popup mode from these rules */
.spinner-wrapper:not(.popup) .template-spin-on-right #chart {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    padding-right: 20px;
}

.template-spin-on-right .email-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 20px;
    padding-right: 0;
}

/* Template containers in popup mode - respect template-spin-on-* classes */
.spinner-wrapper.popup .template-1 .w-100,
.spinner-wrapper.popup .template-2 .w-100,
.spinner-wrapper.popup .template-3 .w-100 {
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 991px) {
.template-1 .w-100,
.template-2 .w-100,
.template-3 .w-100 {
        flex-direction: column;
    }
    
    .spinner-wrapper.popup .template-1 .w-100,
    .spinner-wrapper.popup .template-2 .w-100,
    .spinner-wrapper.popup .template-3 .w-100 {
        flex-direction: column;
    }
    
    #chart {
        max-width: 100%;
    }
}

/* Bootstrap Modal Styling for Popup Mode
 * Maximum practical z-index so the wheel sits above Avada/Fusion sticky headers and similar.
 * Modal nodes are also moved to document.body via wsww-ajax.js to escape nested stacking contexts. */
body.modal-open .modal-backdrop,
body.modal-open .modal-backdrop.fade,
body.modal-open .modal-backdrop.show {
    z-index: 2147483646 !important;
}

.modal-backdrop.wsww-manual-modal-backdrop {
    z-index: 2147483646 !important;
    transition: opacity 0.28s ease-out !important;
    background-color: rgba(0, 0, 0, 0.58) !important;
}

body.modal-open .modal-backdrop.fade,
.modal-backdrop.fade {
    transition: opacity 0.28s ease-out !important;
}

.modal[id^="wsww-spin-modal-"] {
    z-index: 2147483647 !important;
    overflow: visible;
}

/*
 * Avada / Fusion and similar themes set header z-index at or above 1e6 with !important.
 * Our modal uses the same ceiling; tie-breaking can still paint the header on top.
 * While the spin modal is open, pull known header wrappers below the modal layer.
 */
body.wsww-spin-modal-active .fusion-header,
body.wsww-spin-modal-active .fusion-secondary-header,
body.wsww-spin-modal-active .fusion-header-wrapper,
body.wsww-spin-modal-active .fusion-sticky-header,
body.wsww-spin-modal-active .fusion-logo,
body.wsww-spin-modal-active .fusion-logo-wrapper,
body.wsww-spin-modal-active #fusion-header,
body.wsww-spin-modal-active .awb-header,
body.wsww-spin-modal-active .fusion-builder-header,
body.wsww-spin-modal-active .fusion-header-v1,
body.wsww-spin-modal-active .fusion-header-v2,
body.wsww-spin-modal-active .fusion-header-v3,
body.wsww-spin-modal-active .fusion-header-v4,
body.wsww-spin-modal-active .fusion-header-v5,
body.wsww-spin-modal-active .fusion-header-v6,
body.wsww-spin-modal-active .fusion-header-v7,
body.wsww-spin-modal-active .fusion-is-sticky,
body.wsww-spin-modal-active .fusion-header-sticky,
body.wsww-spin-modal-active .fusion-megamenu,
body.wsww-spin-modal-active .fusion-main-menu,
body.wsww-spin-modal-active #side-header,
body.wsww-spin-modal-active .side-header-wrapper,
body.wsww-spin-modal-active .fusion-top-header,
body.wsww-spin-modal-active .fusion-secondary-menu,
body.wsww-spin-modal-active .awb-above-header-wrapper,
body.wsww-spin-modal-active .awb-below-header-wrapper {
    z-index: 1000 !important;
}

body.wsww-spin-modal-active .elementor-location-header,
body.wsww-spin-modal-active .elementor-sticky,
body.wsww-spin-modal-active header.site-header,
body.wsww-spin-modal-active #masthead,
body.wsww-spin-modal-active .site-header {
    z-index: 1000 !important;
}

.modal[id^="wsww-spin-modal-"] .modal-dialog,
.modal[id^="wsww-spin-modal-"] .modal-dialog.modal-xl {
    width: auto;
    max-width: min(96vw, 1100px);
    margin: 1.75rem auto;
    overflow: visible;
    box-shadow: none !important;
    filter: none !important;
}

.modal[id^="wsww-spin-modal-"] .modal-content,
.modal[id^="wsww-spin-modal-"] .wsww-modal-content {
    width: fit-content;
    max-width: min(96vw, 1100px);
    background: var(--card_background, #0b0b0c);
    color: var(--card_color, #fff);
    border: none !important;
    border-radius: var(--card_boder_radius, 10px);
    box-shadow: none !important;
    outline: none !important;
    /* Bootstrap 5 modal shell — kill default hairline / shadow */
    --bs-modal-header-border-width: 0;
    --bs-modal-header-border-color: transparent;
    /* BS 5.2+ / theme may set modal shadow via variable + @media (min-width: 992px) */
    --bs-modal-box-shadow: none;
    --bs-modal-border-width: 0;
    --bs-modal-border-color: transparent;
    position: relative;
    overflow: visible;
}

/*
 * Beat theme + Bootstrap rules like @media (min-width: 992px) { .modal-content { box-shadow: … } }
 * that load after plugin CSS — higher specificity + same breakpoint.
 */
.modal[id^="wsww-spin-modal-"].modal .modal-dialog.modal-xl .modal-content.wsww-modal-content,
.modal[id^="wsww-spin-modal-"] .modal-dialog .modal-content.wsww-modal-content {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    filter: none !important;
}

@media (min-width: 992px) {
    .modal[id^="wsww-spin-modal-"].modal .modal-dialog.modal-xl .modal-content.wsww-modal-content,
    .modal[id^="wsww-spin-modal-"] .modal-dialog .modal-content.wsww-modal-content {
        box-shadow: none !important;
        border: none !important;
        filter: none !important;
    }
}

.modal[id^="wsww-spin-modal-"] .modal-body {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-top: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    overflow: visible;
    position: relative !important;
    width: fit-content;
    max-width: 100%;
}

.modal[id^="wsww-spin-modal-"] .modal-header {
    display: none !important;
}

.modal[id^="wsww-spin-modal-"] .wsww-modal-close {
    position: absolute !important;
    top: 8px !important;
    right: 10px !important;
    z-index: 999999999 !important;
    width: 40px;
    height: 40px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #111 !important;
    font-size: 32px;
    line-height: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1 !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: Arial, sans-serif !important;
    font-weight: 400 !important;
}

.modal[id^="wsww-spin-modal-"] .wsww-modal-close:hover {
    opacity: 0.75 !important;
}

.modal[id^="wsww-spin-modal-"] .wsww-modal-close:focus,
.modal[id^="wsww-spin-modal-"] .wsww-modal-close:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

/* Shortcode wrapper center auto styles */
/* Popup wrapper - same styling for both button click and auto popup */
.wsww-shortcode-wrapper-center-auto,
.wsww-shortcode-wrapper-center-button-click {
    width: 100vw;
    height: 100vh;
    background: transparent;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    overflow: hidden !important;
    display: none;
    align-items: center;
    justify-content: center;
}

.wsww-shortcode-wrapper-center-auto.spinner-open,
.wsww-shortcode-wrapper-center-button-click.spinner-open {
    display: flex;
}

/* Bootstrap Modal Content Styling - Override all hiding rules */
.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper {
    width: auto !important;
    height: auto !important;
    position: relative !important;
    display: block !important;
    visibility: visible !important;
    background: transparent !important;
}

/* Single card surface in modal — no second box on .spinner-wrapper */
.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper .spinner-wrapper,
.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper .spinner-wrapper.popup {
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-button-click,
.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-auto {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    z-index: auto !important;
    transform: none !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
}

/*
 * Center (inline) wheel position uses .appear-on-popup with popupFadeIn, which applies
 * translate(-50%, -50%) — correct for fixed full-screen popups, but inside a Bootstrap
 * modal it shifts content off-layout (often looks "hidden" or clipped). Reset here.
 */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.appear-on-popup {
    transform: none !important;
}

/* Smooth open transition for center popup inside Bootstrap modal */
@keyframes wswwModalPopupIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal[id^="wsww-spin-modal-"].show .spinner-wrapper.appear-on-popup,
.modal[id^="wsww-spin-modal-"].wsww-manual-modal-open .spinner-wrapper.appear-on-popup {
    animation: wswwModalPopupIn 0.32s ease-out !important;
    transform-origin: center top;
    will-change: transform, opacity;
}

/* Modal-only: neutralize older popup bounce rules that cause "jump" */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup.spinner-open {
    animation: none !important;
    transform: none !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-type-spin_button.appear-on-popup,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup.spinner-open.appear-on-popup {
    animation: wswwModalPopupIn 0.32s ease-out both !important;
    transform-origin: center top;
}

/* Add smooth shell entrance as modal opens */
@keyframes wswwModalDialogIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal[id^="wsww-spin-modal-"].show .modal-dialog,
.modal[id^="wsww-spin-modal-"].wsww-manual-modal-open .modal-dialog {
    animation: wswwModalDialogIn 0.28s ease-out;
    transform-origin: center center;
}

/* Ensure all content is visible in modal */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper .w-100 {
    display: flex !important;
    visibility: visible !important;
    position: relative !important;
    margin: 0 !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100 {
    width: auto !important;
    max-width: 100% !important;
    padding: 0 !important;
    justify-content: flex-start !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper #chart {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup #chart {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper .email-wrapper {
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    margin: 0 !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper .email-wrapper.form-alignment-left {
    align-items: flex-start;
    text-align: left;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper .email-wrapper.form-alignment-center {
    align-items: center;
    text-align: center;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper .email-wrapper.form-alignment-right {
    align-items: flex-end;
    text-align: right;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper form {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
}

/* Popup center row gap: template class lives on the same .w-100 node */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right {
    column-gap: 24px !important;
    row-gap: 24px !important;
}

/*
 * Center popup (Bootstrap modal): one card (.modal-content) — wheel + form inside.
 * .spinner-wrapper is layout-only (transparent); sizing lives on .modal-content.
 */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.appear-on-popup {
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 28px !important;
    align-items: center !important;
}

.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-auto .spinner-wrapper.popup,
.modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-button-click .spinner-wrapper.popup {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
    justify-content: flex-start !important;
    box-sizing: border-box;
}

/* Horizontal layout: tablet and up */
@media (min-width: 576px) {
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 32px !important;
        padding: 0 !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
        flex-direction: row-reverse !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup #chart {
        flex: 0 0 auto;
        width: auto !important;
        max-width: 450px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper {
        flex: 0 1 auto;
        min-width: 300px;
        max-width: 420px;
        width: 380px;
        padding: 15px 0 !important;
        margin: 0 !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper form,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper input[type="text"],
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper input[type="email"],
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper input[type="tel"] {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 992px) {
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
        padding: 22px 32px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
        gap: 36px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper {
        width: 400px;
        max-width: 440px;
    }
}

/* Narrow tablet: keep side-by-side, slightly smaller wheel */
@media (min-width: 576px) and (max-width: 767px) {
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
        padding: 16px 20px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
        gap: 24px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup #chart {
        max-width: 340px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper {
        min-width: 260px;
        width: 300px;
        max-width: 320px;
    }
}

/* Mobile: stack wheel above form */
@media (max-width: 575px) {
    .modal[id^="wsww-spin-modal-"] .modal-dialog,
    .modal[id^="wsww-spin-modal-"] .modal-dialog.modal-xl {
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        margin: 0.5rem auto;
    }

    .modal[id^="wsww-spin-modal-"] .modal-content,
    .modal[id^="wsww-spin-modal-"] .wsww-modal-content,
    .modal[id^="wsww-spin-modal-"] .modal-body {
        width: 100%;
        max-width: 100%;
    }

    .modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-auto,
    .modal[id^="wsww-spin-modal-"] .wsww-shortcode-wrapper-center-button-click {
        width: 100% !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
        width: 100% !important;
        padding: 14px 18px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-left,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-spin-on-right,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-1,
    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .w-100.template-2 {
        flex-direction: column !important;
        width: 100% !important;
        padding: 12px 14px !important;
        gap: 12px !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup #chart {
        max-width: 100% !important;
        width: 100% !important;
    }

    .modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup .email-wrapper {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        width: 100% !important;
        padding: 8px 0 4px !important;
    }
}

/* Spinner wrapper positioning */
.spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    width: 50vw;
    min-width: fit-content;
    height: 100%;
    z-index: 99999;
    box-shadow: 3px 0 5px rgba(255, 255, 255, 0.2);
    padding: var(--card_boder_padding);
    transition: 0.4s;
    box-sizing: border-box;
    overflow: auto !important;
    background: var(--card_background);
    border-radius: var(--card_boder_radius);
}

/* Left/right sidebar: fit viewport height; scroll inside panel if needed */
.spinner-wrapper.left,
.spinner-wrapper.right {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.spinner-wrapper.left .w-100,
.spinner-wrapper.right .w-100 {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    width: 100%;
    overflow: visible;
}

.spinner-wrapper.left .wsww-form-container,
.spinner-wrapper.right .wsww-form-container {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
}

.spinner-wrapper.left .wsww-form-container .email-wrapper,
.spinner-wrapper.right .wsww-form-container .email-wrapper {
    padding-top: 15px !important;
    padding-bottom: 12px !important;
}

/* Sidebar UP/DOWN templates — wheel on top */
.spinner-wrapper.left .w-100.template-spin-on-top,
.spinner-wrapper.left .w-100.template-3,
.spinner-wrapper.right .w-100.template-spin-on-top,
.spinner-wrapper.right .w-100.template-3 {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 18px !important;
    padding: 18px 20px !important;
}

/* Sidebar UP/DOWN templates — form on top, wheel on bottom */
.spinner-wrapper.left .w-100.template-spin-on-bottom,
.spinner-wrapper.right .w-100.template-spin-on-bottom {
    flex-direction: column-reverse !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 18px !important;
    padding: 18px 20px !important;
}

.spinner-wrapper.left .w-100.template-spin-on-top .wsww-chart-container,
.spinner-wrapper.left .w-100.template-spin-on-bottom .wsww-chart-container,
.spinner-wrapper.left .w-100.template-3 .wsww-chart-container,
.spinner-wrapper.right .w-100.template-spin-on-top .wsww-chart-container,
.spinner-wrapper.right .w-100.template-spin-on-bottom .wsww-chart-container,
.spinner-wrapper.right .w-100.template-3 .wsww-chart-container {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    max-height: min(52dvh, calc(100dvh - 300px));
    padding: 0 !important;
    overflow: hidden;
}

.spinner-wrapper.left .w-100.template-spin-on-top #chart,
.spinner-wrapper.left .w-100.template-spin-on-bottom #chart,
.spinner-wrapper.left .w-100.template-3 #chart,
.spinner-wrapper.right .w-100.template-spin-on-top #chart,
.spinner-wrapper.right .w-100.template-spin-on-bottom #chart,
.spinner-wrapper.right .w-100.template-3 #chart,
.spinner-wrapper.left .w-100.template-spin-on-top #chart svg,
.spinner-wrapper.left .w-100.template-spin-on-bottom #chart svg,
.spinner-wrapper.left .w-100.template-3 #chart svg,
.spinner-wrapper.right .w-100.template-spin-on-top #chart svg,
.spinner-wrapper.right .w-100.template-spin-on-bottom #chart svg,
.spinner-wrapper.right .w-100.template-3 #chart svg {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(52dvh, calc(100dvh - 300px)) !important;
    margin: 0 auto !important;
}

.spinner-wrapper.left .w-100.template-spin-on-top .wsww-form-container,
.spinner-wrapper.left .w-100.template-spin-on-bottom .wsww-form-container,
.spinner-wrapper.left .w-100.template-3 .wsww-form-container,
.spinner-wrapper.right .w-100.template-spin-on-top .wsww-form-container,
.spinner-wrapper.right .w-100.template-spin-on-bottom .wsww-form-container,
.spinner-wrapper.right .w-100.template-3 .wsww-form-container {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0 !important;
    margin: 0 auto !important;
    align-self: stretch;
}

/* Sidebar LEFT/RIGHT templates (wheel beside form) */
.spinner-wrapper.left .w-100.template-spin-on-left,
.spinner-wrapper.left .w-100.template-spin-on-right,
.spinner-wrapper.left .w-100.template-1,
.spinner-wrapper.left .w-100.template-2,
.spinner-wrapper.right .w-100.template-spin-on-left,
.spinner-wrapper.right .w-100.template-spin-on-right,
.spinner-wrapper.right .w-100.template-1,
.spinner-wrapper.right .w-100.template-2 {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 14px !important;
    padding: 18px 20px !important;
    height: auto;
    min-height: 0;
}

.spinner-wrapper.left .w-100.template-spin-on-right,
.spinner-wrapper.left .w-100.template-2,
.spinner-wrapper.right .w-100.template-spin-on-right,
.spinner-wrapper.right .w-100.template-2 {
    flex-direction: row-reverse !important;
}

.spinner-wrapper.left .w-100.template-spin-on-left .wsww-chart-container,
.spinner-wrapper.left .w-100.template-spin-on-right .wsww-chart-container,
.spinner-wrapper.left .w-100.template-1 .wsww-chart-container,
.spinner-wrapper.left .w-100.template-2 .wsww-chart-container,
.spinner-wrapper.right .w-100.template-spin-on-left .wsww-chart-container,
.spinner-wrapper.right .w-100.template-spin-on-right .wsww-chart-container,
.spinner-wrapper.right .w-100.template-1 .wsww-chart-container,
.spinner-wrapper.right .w-100.template-2 .wsww-chart-container {
    flex: 1 1 58%;
    min-width: 0;
    max-width: 64%;
    max-height: none !important;
    padding: 0 12px !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

.spinner-wrapper.left .w-100.template-spin-on-left .wsww-form-container,
.spinner-wrapper.left .w-100.template-spin-on-right .wsww-form-container,
.spinner-wrapper.left .w-100.template-1 .wsww-form-container,
.spinner-wrapper.left .w-100.template-2 .wsww-form-container,
.spinner-wrapper.right .w-100.template-spin-on-left .wsww-form-container,
.spinner-wrapper.right .w-100.template-spin-on-right .wsww-form-container,
.spinner-wrapper.right .w-100.template-1 .wsww-form-container,
.spinner-wrapper.right .w-100.template-2 .wsww-form-container {
    flex: 0 1 38%;
    min-width: 220px;
    max-width: 400px;
    width: auto;
    padding: 0 12px !important;
    margin: 0 !important;
    overflow: visible !important;
}

.spinner-wrapper.left .w-100.template-spin-on-left #chart,
.spinner-wrapper.left .w-100.template-spin-on-right #chart,
.spinner-wrapper.left .w-100.template-1 #chart,
.spinner-wrapper.left .w-100.template-2 #chart,
.spinner-wrapper.right .w-100.template-spin-on-left #chart,
.spinner-wrapper.right .w-100.template-spin-on-right #chart,
.spinner-wrapper.right .w-100.template-1 #chart,
.spinner-wrapper.right .w-100.template-2 #chart {
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 auto !important;
    overflow: visible !important;
}

.spinner-wrapper.left .w-100.template-spin-on-left #chart svg,
.spinner-wrapper.left .w-100.template-spin-on-right #chart svg,
.spinner-wrapper.left .w-100.template-1 #chart svg,
.spinner-wrapper.left .w-100.template-2 #chart svg,
.spinner-wrapper.right .w-100.template-spin-on-left #chart svg,
.spinner-wrapper.right .w-100.template-spin-on-right #chart svg,
.spinner-wrapper.right .w-100.template-1 #chart svg,
.spinner-wrapper.right .w-100.template-2 #chart svg {
    max-width: 100% !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

.spinner-wrapper.left .w-100.template-spin-on-left .wsww-form-container .email-wrapper,
.spinner-wrapper.left .w-100.template-spin-on-right .wsww-form-container .email-wrapper,
.spinner-wrapper.left .w-100.template-1 .wsww-form-container .email-wrapper,
.spinner-wrapper.left .w-100.template-2 .wsww-form-container .email-wrapper,
.spinner-wrapper.right .w-100.template-spin-on-left .wsww-form-container .email-wrapper,
.spinner-wrapper.right .w-100.template-spin-on-right .wsww-form-container .email-wrapper,
.spinner-wrapper.right .w-100.template-1 .wsww-form-container .email-wrapper,
.spinner-wrapper.right .w-100.template-2 .wsww-form-container .email-wrapper {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 992px) {
    .spinner-wrapper.left .w-100.template-spin-on-left,
    .spinner-wrapper.left .w-100.template-spin-on-right,
    .spinner-wrapper.left .w-100.template-1,
    .spinner-wrapper.left .w-100.template-2,
    .spinner-wrapper.right .w-100.template-spin-on-left,
    .spinner-wrapper.right .w-100.template-spin-on-right,
    .spinner-wrapper.right .w-100.template-1,
    .spinner-wrapper.right .w-100.template-2 {
        gap: 20px !important;
        padding: 20px 24px !important;
    }

    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: min(62vw, 960px);
    }
}

@media (min-width: 1200px) {
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: min(58vw, 1000px);
    }
}

/* iPad Pro portrait (1024px width x 1366px height) - 70% width, vertical layout */
@media (min-width: 1024px) and (max-width: 1024px) and (min-height: 1366px) {
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: 70vw;
        max-width: none;
    }
    
    .spinner-wrapper.left .w-100:not(.template-spin-on-bottom),
    .spinner-wrapper.right .w-100:not(.template-spin-on-bottom) {
        flex-direction: column;
        gap: 15px;
        padding: 10px 8px;
    }

    .spinner-wrapper.left .w-100.template-spin-on-bottom,
    .spinner-wrapper.right .w-100.template-spin-on-bottom {
        flex-direction: column-reverse !important;
        gap: 15px;
        padding: 10px 8px;
    }
    
    .spinner-wrapper.left .wsww-chart-container,
    .spinner-wrapper.right .wsww-chart-container {
        padding-left: 10px;
        padding-right: 0;
    width: 100%;
    }
    
    .spinner-wrapper.left .wsww-form-container,
    .spinner-wrapper.right .wsww-form-container {
        padding-left: 0;
        padding-right: 10px;
        width: 100%;
    }
}

/* iPad Pro landscape (1366px width x 1024px height) - 80% width */
@media (min-width: 1366px) and (max-width: 1366px) and (max-height: 1024px) {
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: 80vw;
        max-width: none;
    }
    
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100 {
        flex-direction: row;
        gap: 15px;
        padding: 10px 8px;
    }
    
    .spinner-wrapper.left .wsww-chart-container,
    .spinner-wrapper.right .wsww-chart-container {
        padding-left: 15px;
        padding-right: 0;
    }
    
    .spinner-wrapper.left .wsww-form-container,
    .spinner-wrapper.right .wsww-form-container {
        padding-left: 0;
        padding-right: 15px;
    }
}

/* General tablet range (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: min(56vw, 720px);
    }

    /* UP/DOWN templates on narrower tablets */
    .spinner-wrapper.left .w-100.template-spin-on-top,
    .spinner-wrapper.left .w-100.template-3,
    .spinner-wrapper.right .w-100.template-spin-on-top,
    .spinner-wrapper.right .w-100.template-3 {
        flex-direction: column !important;
        gap: 15px;
        padding: 14px 16px !important;
    }

    .spinner-wrapper.left .w-100.template-spin-on-bottom,
    .spinner-wrapper.right .w-100.template-spin-on-bottom {
        flex-direction: column-reverse !important;
        gap: 15px;
        padding: 14px 16px !important;
    }
}

/* For popup mode, position relative to parent wrapper for centering */
.wsww-shortcode-wrapper-center-button-click .spinner-wrapper,
.wsww-shortcode-wrapper-center-auto .spinner-wrapper {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: 1400px;
    margin: auto;
    flex-shrink: 0;
    overflow: visible;
}

/* Ensure popup content fits properly - let template classes control layout */
.wsww-shortcode-wrapper-center-button-click .spinner-wrapper.popup,
.wsww-shortcode-wrapper-center-auto .spinner-wrapper.popup {
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: fit-content;
    max-width: 100%;
}

.left {
    left: -100%;
    right: auto !important;
}

.right {
    right: -100%;
    left: auto !important;
}

/* Ensure vertical alignment for left and right modes */
.spinner-wrapper.left .w-100,
.spinner-wrapper.right .w-100 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
    padding: 15px 0;
    gap: 25px !important;
}

/* Sidebar up/down: column width follows the wheel, not the panel */
.spinner-wrapper.left .w-100.template-spin-on-top,
.spinner-wrapper.left .w-100.template-spin-on-bottom,
.spinner-wrapper.left .w-100.template-3,
.spinner-wrapper.right .w-100.template-spin-on-top,
.spinner-wrapper.right .w-100.template-spin-on-bottom,
.spinner-wrapper.right .w-100.template-3 {
    width: fit-content !important;
    max-width: calc(100% - 40px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    align-items: stretch !important;
}

.spinner-wrapper.left .w-100.template-spin-on-top .email-wrapper,
.spinner-wrapper.left .w-100.template-spin-on-bottom .email-wrapper,
.spinner-wrapper.left .w-100.template-3 .email-wrapper,
.spinner-wrapper.right .w-100.template-spin-on-top .email-wrapper,
.spinner-wrapper.right .w-100.template-spin-on-bottom .email-wrapper,
.spinner-wrapper.right .w-100.template-3 .email-wrapper {
    min-width: 0 !important;
    width: 100% !important;
}

/* Chart container for left/right modes - equal space from left */
.spinner-wrapper.left .wsww-chart-container,
.spinner-wrapper.right .wsww-chart-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 40px;
    padding-right: 0;
    min-width: 0;
    margin-right: 0;
}

/* Form container for left/right modes - equal space from right */
.spinner-wrapper.left .wsww-form-container,
.spinner-wrapper.right .wsww-form-container {
    flex: 0 0 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0;
    padding-right: 40px;
    min-width: 0;
    max-width: 480px;
    width: 100%;
    margin-left: auto;
}

/* Chart and form containers for template-spin-on-left - remove left margin/padding from form */
.template-spin-on-left .wsww-chart-container,
.template-1 .wsww-chart-container,
.template-2 .wsww-chart-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 40px;
    padding-right: 0;
    min-width: 0;
    margin-right: 0;
}

.template-spin-on-left .wsww-form-container,
.template-1 .wsww-form-container,
.template-2 .wsww-form-container {
    flex: 0 0 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 40px;
    min-width: 0;
    max-width: 480px;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0;
}

/* Chart and form containers for top/bottom layouts - centered horizontally, no padding, same width */
.template-spin-on-top .wsww-chart-container,
.template-spin-on-bottom .wsww-chart-container,
.template-3 .wsww-chart-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 auto !important;
    min-width: 0;
    width: auto;
    max-width: 100%;
}

.template-spin-on-top .wsww-form-container,
.template-spin-on-bottom .wsww-form-container,
.template-3 .wsww-form-container {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    margin: 0 auto !important;
    min-width: 0;
    width: auto;
    max-width: 100%;
}

/* Up/down layouts: shared column width (wheel defines width, form stretches) */
.w-100.template-spin-on-top .wsww-chart-container,
.w-100.template-spin-on-bottom .wsww-chart-container,
.w-100.template-3 .wsww-chart-container,
.w-100.template-spin-on-top .wsww-form-container,
.w-100.template-spin-on-bottom .wsww-form-container,
.w-100.template-3 .wsww-form-container {
    box-sizing: border-box;
}

/* Chart determines its natural width */
.template-spin-on-top .wsww-chart-container #chart,
.template-spin-on-bottom .wsww-chart-container #chart,
.template-3 .wsww-chart-container #chart {
    width: auto;
    max-width: 100%;
}

/* Form wrapper fills its container to match chart width */
.template-spin-on-top .wsww-form-container .email-wrapper,
.template-spin-on-bottom .wsww-form-container .email-wrapper,
.template-3 .wsww-form-container .email-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Responsive adjustments for left/right modes */
@media (min-width: 1201px) {
    /* Large screens - fixed gap */
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100,
    .template-spin-on-left .w-100,
    .template-spin-on-right .w-100,
    .template-1 .w-100,
    .template-2 .w-100,
    .template-3 .w-100 {
        gap: 25px !important;
    }
}

/* Mobile devices - all screens up to 767px should be vertical (up/down layout) */
@media (max-width: 767px) {
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100,
    .w-100.template-spin-on-left,
    .w-100.template-spin-on-right,
    .w-100.template-spin-on-top,
    .w-100.template-1,
    .w-100.template-2,
    .w-100.template-3 {
        flex-direction: column !important;
        gap: 15px;
    }

    .spinner-wrapper.left .w-100.template-spin-on-bottom,
    .spinner-wrapper.right .w-100.template-spin-on-bottom,
    .w-100.template-spin-on-bottom {
        flex-direction: column-reverse !important;
        gap: 15px;
    }
    
    /* Horizontal sidebar templates: full-width columns on mobile */
    .spinner-wrapper.left .w-100.template-spin-on-left .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-spin-on-right .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-1 .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-2 .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-spin-on-left .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-spin-on-right .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-1 .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-2 .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.left .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.left .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.left .w-100.template-2 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.right .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-2 .wsww-form-container {
        width: 100% !important;
    }

    /* Sidebar uses full viewport on phones */
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: 100vw !important;
        max-width: 100vw !important;
    }

    /* Stacked sidebar/popup: wheel-sized column, centered */
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100,
    .spinner-wrapper.popup .w-100 {
        width: fit-content !important;
        max-width: calc(100vw - 32px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-items: stretch !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .spinner-wrapper.left .w-100 .wsww-chart-container #chart,
    .spinner-wrapper.right .w-100 .wsww-chart-container #chart,
    .spinner-wrapper.left .w-100.template-spin-on-top #chart,
    .spinner-wrapper.left .w-100.template-spin-on-bottom #chart,
    .spinner-wrapper.right .w-100.template-spin-on-top #chart,
    .spinner-wrapper.right .w-100.template-spin-on-bottom #chart,
    .spinner-wrapper.popup .w-100.template-spin-on-top #chart,
    .spinner-wrapper.popup .w-100.template-spin-on-bottom #chart {
        width: auto !important;
        max-width: 100% !important;
    }

    .spinner-wrapper.left #chart svg,
    .spinner-wrapper.right #chart svg,
    .spinner-wrapper.popup .w-100.template-spin-on-top #chart svg,
    .spinner-wrapper.popup .w-100.template-spin-on-bottom #chart svg {
        width: auto !important;
        height: auto !important;
        max-width: calc(100vw - 48px) !important;
    }

    .spinner-wrapper.left .wsww-form-container .email-wrapper,
    .spinner-wrapper.right .wsww-form-container .email-wrapper,
    .spinner-wrapper.left .w-100 .email-wrapper,
    .spinner-wrapper.right .w-100 .email-wrapper,
    .spinner-wrapper.popup .w-100.template-spin-on-top > .email-wrapper,
    .spinner-wrapper.popup .w-100.template-spin-on-bottom > .email-wrapper {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .spinner-wrapper.left .w-100.template-spin-on-top #chart svg,
    .spinner-wrapper.left .w-100.template-spin-on-bottom #chart svg,
    .spinner-wrapper.right .w-100.template-spin-on-top #chart svg,
    .spinner-wrapper.right .w-100.template-spin-on-bottom #chart svg {
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: min(46dvh, calc(100dvh - 320px)) !important;
    }
}

@media (max-width: 1200px) {
    .spinner-wrapper.left .wsww-chart-container,
    .spinner-wrapper.right .wsww-chart-container {
        padding-left: 30px;
    }
    
    .spinner-wrapper.left .wsww-form-container,
    .spinner-wrapper.right .wsww-form-container {
        padding-right: 30px;
    }
    
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100,
    .template-spin-on-left .w-100,
    .template-spin-on-right .w-100,
    .template-1 .w-100,
    .template-2 .w-100,
    .template-3 .w-100 {
        gap: 20px;
    }
}

/* Tablet sidebar: horizontal templates stay side-by-side with tighter columns */
@media (min-width: 768px) and (max-width: 1024px) {
    .spinner-wrapper.left .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.left .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.left .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.left .w-100.template-2 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.right .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-2 .wsww-form-container {
        flex: 0 1 44%;
        min-width: 180px;
        max-width: 280px;
    }
}

/* Narrow sidebar: horizontal templates fall back to UP/DOWN stack */
@media (max-width: 640px) {
    .spinner-wrapper.left .w-100.template-spin-on-left,
    .spinner-wrapper.left .w-100.template-spin-on-right,
    .spinner-wrapper.left .w-100.template-1,
    .spinner-wrapper.left .w-100.template-2,
    .spinner-wrapper.right .w-100.template-spin-on-left,
    .spinner-wrapper.right .w-100.template-spin-on-right,
    .spinner-wrapper.right .w-100.template-1,
    .spinner-wrapper.right .w-100.template-2 {
        flex-direction: column !important;
        padding: 16px 18px !important;
        gap: 16px !important;
    }

    .spinner-wrapper.left .w-100.template-spin-on-left .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-spin-on-right .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-1 .wsww-chart-container,
    .spinner-wrapper.left .w-100.template-2 .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-spin-on-left .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-spin-on-right .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-1 .wsww-chart-container,
    .spinner-wrapper.right .w-100.template-2 .wsww-chart-container {
        flex: 0 1 auto;
        max-width: 100%;
        max-height: min(48dvh, calc(100dvh - 280px)) !important;
    }

    .spinner-wrapper.left .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.left .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.left .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.left .w-100.template-2 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-left .wsww-form-container,
    .spinner-wrapper.right .w-100.template-spin-on-right .wsww-form-container,
    .spinner-wrapper.right .w-100.template-1 .wsww-form-container,
    .spinner-wrapper.right .w-100.template-2 .wsww-form-container {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }
}

/* Galaxy S8+ and similar small mobile devices (340px × 740px) - full screen, vertical layout */
@media (min-width: 320px) and (max-width: 360px) and (min-height: 700px) {
    .spinner-wrapper.left,
    .spinner-wrapper.right {
        width: 100vw;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100 {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
        width: 100%;
    }
    
    .spinner-wrapper.left .wsww-chart-container,
    .spinner-wrapper.right .wsww-chart-container {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    .spinner-wrapper.left .wsww-form-container,
    .spinner-wrapper.right .wsww-form-container {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .spinner-wrapper.left .w-100,
    .spinner-wrapper.right .w-100 {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
        flex-wrap: nowrap;
    }
    
    .spinner-wrapper.left .wsww-chart-container,
    .spinner-wrapper.right .wsww-chart-container {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
    
    .spinner-wrapper.left .wsww-form-container,
    .spinner-wrapper.right .wsww-form-container {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }
}

/* Chart inside container */
.spinner-wrapper.left .wsww-chart-container #chart,
.spinner-wrapper.right .wsww-chart-container #chart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

/* Email wrapper inside form container */
.spinner-wrapper.left .wsww-form-container .email-wrapper,
.spinner-wrapper.right .wsww-form-container .email-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    min-width: 0;
}

.left-auto {
    left: 0;
    max-width: none;
    width: fit-content;
    min-width: fit-content;
}

.right-auto {
    right: 0;
    max-width: none;
    width: fit-content;
    min-width: fit-content;
}

.center-auto {
    display: flex !important;
    justify-content: center;
    flex-direction: column;
}

.popup {
    display: none;
    margin: auto;
    position: relative;
    width: fit-content;
    min-width: fit-content;
    max-width: 95vw;
    height: auto;
    min-height: 500px;
    border-radius: 10px;
    overflow: visible;
}

.popup.spinner-open {
    display: flex !important;
    align-items: center;
    justify-content: center;
    transform: scale(1);
    opacity: 1;
    animation: popupBounce 0.4s ease-out;
}

/* In Bootstrap modal, popup should always be visible (no second .popup card shell) */
.modal[id^="wsww-spin-modal-"] .spinner-wrapper.popup {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
}

/* Popup bounce animation */
@keyframes popupBounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    60% {
        transform: scale(1.05);
        opacity: 1;
    }
    100% {
        transform: scale(1);
    }
}

@media (min-width: 1000px) {
    .popup {
        width: 95vw;
        max-width: 1400px;
    }
    
    .wsww-shortcode-wrapper-center-button-click .spinner-wrapper.popup,
    .wsww-shortcode-wrapper-center-auto .spinner-wrapper.popup {
        max-width: 1400px;
    }
    
    /* Ensure template classes work in popup at larger screens */
    .popup .template-spin-on-left {
        flex-direction: row;
    }
    
    .popup .template-spin-on-right {
        flex-direction: row-reverse;
    }
}

@media (max-width: 999px) {
    .popup {
        width: 95vw;
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .popup {
        width: 98vw;
        max-width: 98vw;
    }
}

.spinner-type-spin_button.appear-from-right {
    right: 0 !important;
    left: auto !important;
}

.spinner-type-spin_button.appear-from-left {
    left: 0 !important;
    right: auto !important;
}

.spinner-type-spin_button.appear-on-popup {
    display: flex;
    transform: scale(1);
    opacity: 1;
    animation: popupBounce 0.4s ease-out;
}

.spinner-wrapper * {
    box-sizing: border-box;
}

.d-lg-flex {
    display: flex;
}

svg:not(:root) {
    overflow: visible;
}

/* Chart styling */
    #chart {
    position: relative;
    top: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#question {
    top: 0;
    left: 520px;
}

#question h1 {
    font-size: 30px;
    font-weight: bold;
    padding-top: 30px;
}

/* Email wrapper responsive */
@media (max-width: 1399px) {
    .email-wrapper {
        max-width: 40vw;
    }
}

.email-wrapper .description {
    margin-bottom: 16px;
}

.description {
    color: var(--card_color) !important;
}

.email-wrapper h3 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 30px;
    color: var(--card_color);
    font-weight: normal;
    line-height: 1;
}

.email-wrapper .description p {
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
}

.email-wrapper input[type='email'],
.email-wrapper input[type='text'] {
    display: block;
    margin-bottom: 15px;
    width: 100%;
    height: 40px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.email-wrapper p {
    font-size: 14px;
    margin-bottom: 0px;
    color: var(--card_color) !important;
}

.wsww-consent-label{
    margin-bottom: 15px;
    color: var(--card_color) !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

.wsww-consent-label span {
    font: inherit;
    color: inherit;
}

/* Spin close button - top right of container */
.spin-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: var(--card_color);
    z-index: 100000;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

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

.spin-close>div {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spin-close svg {
    width: 100%;
    height: 100%;
        max-width: 100%;
    }

/* Try button styling */
.wsww-try-btn {
    display: inline-block;
    padding: 5px;
    border-radius: 10px;
    overflow: hidden;
    transition: 0.4s;
    background: #262626;
    background: linear-gradient(135deg, #262626 0%, #999999 50%, #262626 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr="#262626", endColorstr="#262626", GradientType=1);
    outline: 0;
}

.wsww-try-btn span {
    border-radius: 8px;
    display: inline-block;
    padding: 6px 12px;
    background-color: #000;
    color: #ffcd30;
    font-size: 14px;
    font-weight: normal;
    text-transform: capitalize;
}

/* Form error styling */
#spinForm .spin-email.error {
    background-color: #fbdf9d;
    border-color: #fbdf9d;
}

#spinForm .spin-email.error+.error {
    color: #f29c2b;
    line-height: 1;
}

#spinForm .status-msg {
    font-size: 14px;
    font-weight: normal;
    color: #ff0000;
    margin-bottom: 15px;
    margin-top: 20px;
}

#spinToWinModal {
    z-index: 99995;
}

.hide {
    display: none;
}

/* Ensure form is hidden when hide class is added */
#spinForm.hide,
.email-wrapper.hide {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure result message is visible even when form is hidden */
#spin-result-message:not(.hide) {
    display: block !important;
    visibility: visible !important;
}

/* Hide description when form is hidden */
#spinForm.hide .description,
.description.hide {
    display: none !important;
    visibility: hidden !important;
}

.align-items-center {
    align-items: center !important;
}

.spin-result-message {
    padding: 0;
    color: #8161FF;
    background-color: transparent;
    border: none;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow-x: hidden;
    max-height: 400px;
    overflow-y: auto;
    white-space: normal;
}

@media (min-width: 992px) {
    /* .d-lg-flex {
        display: flex !important;
    } */
}

@media (max-width: 500px) {
    .email-wrapper {
        max-width: 400px;
        width: 100%;
    }
}

@media (max-width: 380px) {
    .email-wrapper {
        width: 100%;
    }
}

@media (max-width: 991px) and (min-width: 450px) {
    .email-wrapper {
        padding-top: 30px;
        padding-left: 10px;
        padding-right: 10px;
        margin: 0 auto;
        min-width: 430px;
    }
}

@media (max-width: 991px) {
    #chart>svg {
        margin: 0 auto;
    }
    .spinner-wrapper {
        width: 100% !important;
        max-width: 800px;
    }
    #chart {
        width: 100%;
        height: auto;
        margin: 0 auto;
        text-align: center;
    }
    .spinner-type-spin_button.appear-on-popup {
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .email-wrapper {
        padding-top: 10px;
    }
    .email-wrapper h3 {
        font-size: 22px;
        margin-bottom: 10px;
    }
    .email-wrapper p {
        margin-bottom: 10px;
    }
    .slice text {
        font-size: 13px !important;
    }
}

@media (max-width: 400px) {
    .slice text {
        font-size: 11px !important;
    }
}

/* Landscape orientation */
@media only screen and (min-device-width: 320px) and (max-device-width: 992px) and (orientation: landscape) {
    .btn-try-luck {
        display: none;
    }
}

/* Button styling */
.wsww-tyl-btn {
    background: var(--from_button_background_color) !important;
    padding: 8px 20px;
    text-align: center;
    text-transform: uppercase;
    transition: 0.5s;
    background-size: 200% auto;
    color: var(--from_button_color) !important;
    border-radius: 10px;
    border: none;
    display: block;
    cursor: pointer;
}

.wsww-from-button {
    width: 100%;
    color: var(--from_button_color) !important;
    background: var(--from_button_background_color) !important;
    cursor: pointer;
}

.wsww-from-button.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
    color: transparent !important;
}

.wsww-from-button.is-loading::after {
    content: "";
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--from_button_color, #ffffff);
    border-top-color: transparent;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: wsww-button-spin 0.75s linear infinite;
}

@keyframes wsww-button-spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.wsww-tyl-btn:focus {
    outline: none;
}

/* Overlay */
.wsww-overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
}

@media only screen and (min-width: 451px) and (max-width: 768px) {
    .d-lg-flex {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 50px;
    }
    .slice text {
        font-size: 22px;
    }
}

@media only screen and (min-width: 0px) and (max-width: 450px) {
    .d-lg-flex {
        display: flex;
        flex-direction: column;
        align-content: center;
        align-items: center;
        width: 100%;
    }
}

/* Default: hide all */
.button-tigger-spin-card {
    display: none;
}

/* Show on laptop (≥1025px) */
@media (min-width: 1025px) {
    .btn-try-luck.show-laptop {
        display: inline-block;
    }
}

/* Show on tablet (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .btn-try-luck.show-tablet {
        display: inline-block;
    }
}

/* Show on mobile (≤767px) */
@media (max-width: 767px) {
    .btn-try-luck.show-mobile {
        display: inline-block;
    }
}

/* Template styling - ensure vertical alignment */
.template-spin-on-left,
.template-spin-on-right {
    margin: auto;
    overflow: auto;
    height: 100%;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-content: center;
    align-items: center; /* This ensures vertical alignment of children */
    padding: 15px 0;
}

/* Template styling for top/bottom - center both horizontally and vertically */
.template-spin-on-top,
.template-spin-on-bottom {
    margin: auto;
    overflow: auto;
    height: 100%;
    justify-content: center;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    align-content: center;
    align-items: center; /* This ensures horizontal alignment of children */
    padding: 0;
}

/* Reduce gap in modal for template classes */
.modal[id^="wsww-spin-modal-"] .template-spin-on-left,
.modal[id^="wsww-spin-modal-"] .template-spin-on-right,
.modal[id^="wsww-spin-modal-"] .template-spin-on-top,
.modal[id^="wsww-spin-modal-"] .template-spin-on-bottom {
    gap: 10px;
}

.template-spin-on-left::-webkit-scrollbar,
.template-spin-on-right::-webkit-scrollbar,
.template-spin-on-top::-webkit-scrollbar,
.template-spin-on-bottom::-webkit-scrollbar {
    width: 0px;
    height: 0px;
}

@media (min-width: 1100px) and (max-width: 1200px) {
    .template-spin-on-left,
    .template-spin-on-right {
        flex-wrap: wrap;
        width: 100%;
    }
    .popup .template-spin-on-left,
    .popup .template-spin-on-right {
        flex-wrap: nowrap;
        width: 100%;
    }
}

@media (min-width: 1201px) {
    .template-spin-on-left,
    .template-spin-on-right {
        flex-wrap: nowrap;
        width: 100%;
    }
    .template-spin-on-left {
        flex-direction: row;
    }
    .template-spin-on-right {
        flex-direction: row-reverse;
    }
}

@media (min-width: 1600px) {
    .template-spin-on-left,
    .template-spin-on-right {
        width: 90%;
    }
    .popup .template-spin-on-left,
    .popup .template-spin-on-right {
        width: 100%;
    }
}

@media (min-width: 1200px) and (max-width: 1500px) {
    .template-spin-on-left .email-wrapper {
        padding-right: 20px;
        padding-left: 0;
    }
    .template-spin-on-right .email-wrapper {
        padding-left: 20px;
        padding-right: 0;
    }
    .template-spin-on-left #chart {
        padding-left: 20px;
        padding-right: 0;
    }
    .template-spin-on-right #chart {
        padding-right: 20px;
        padding-left: 0;
    }
}

.w-100.template-spin-on-top,
.w-100.template-spin-on-bottom {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    padding: 0 !important;
    margin: 0 auto;
}

/* Form design alignment */
.form-alignment-left form {
    text-align: left;
}

.form-alignment-center form {
    text-align: center;
}

.form-alignment-right form {
    text-align: right;
}

/* Thank you message */
.wsww-win-static,
.wsww-loss-static {
    font-size: 48px !important;
    letter-spacing: 3%;
    line-height: 100%;
    display: block;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif !important;
    margin: 30px 0 !important;
}

.spin-message {
    font-size: 24px;
    line-height: 150%;
    letter-spacing: 3%;
    color: #000000 !important;
    font-family: 'Inter', sans-serif !important;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.win-card .wsww-loss-static {
    color: #8161FF !important;
}

.loss-card .wsww-loss-static {
    color: #F20044 !important;
}

.wsww-msg-icon {
    width: 100% !important;
}

.loss-card .wsww-msg-icon {
    height: 290px !important;
    object-fit: contain;
}

@media (max-width: 1199px) {
    .loss-card .wsww-msg-icon {
        height: 260px !important;
    }
    .wsww-win-static,
    .wsww-loss-static {
        font-size: 36px !important;
    }
    .spin-message {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .loss-card .wsww-msg-icon {
        height: 240px !important;
    }
    .wsww-win-static,
    .wsww-loss-static {
        font-size: 30px !important;
    }
    .spin-message {
        font-size: 18px;
    }
}

@media (max-width: 575px) {
    .wsww-loss-static .wsww-msg-icon {
        height: auto !important;
    }
    .wsww-win-static,
    .wsww-loss-static {
        font-size: 24px !important;
    }
    .spin-message {
        font-size: 16px;
    }
}
