.elementor-widget-shape-wrap-image {
    position: relative;
}

.shape-wrap-canvas {
    position: relative;
    min-height: 100px;
}

.shape-wrap-image-wrapper {
    position: relative;
}

/* Wrap-only mode: allow media to overflow the clipped wrapper boundary */
.shape-wrap-image-wrapper[data-wrap-mode="wrap-only"] {
    overflow: visible;
}

.shape-wrap-float-left {
    float: left;
    margin-left: 0;
}

.shape-wrap-float-right {
    float: right;
    margin-right: 0;
}

.shape-wrap-float-center {
    float: none;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Responsive alignment for tablet */
@media (max-width: 1024px) {
    .shape-wrap-float-tablet-left {
        float: left !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .shape-wrap-float-tablet-right {
        float: right !important;
        margin-right: 0 !important;
        margin-left: auto !important;
    }

    .shape-wrap-float-tablet-center {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
}

/* Responsive alignment for mobile */
@media (max-width: 767px) {
    .shape-wrap-float-mobile-left {
        float: left !important;
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .shape-wrap-float-mobile-right {
        float: right !important;
        margin-right: 0 !important;
        margin-left: auto !important;
    }

    .shape-wrap-float-mobile-center {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
}

.shape-wrap-image-wrapper img,
.shape-wrap-media {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.shape-wrap-media--video {
    background-color: transparent;
}

.shape-wrap-column-proxy-video {
    background-color: transparent;
}

.shape-wrap-video-player {
    position: relative;
}

.shape-wrap-video-player--is-playing .shape-wrap-media--video {
    opacity: 1;
}

.shape-wrap-video-player--playback-blocked .shape-wrap-media--video {
    outline: 2px dashed rgba(240, 90, 90, 0.6);
}

.shape-wrap-polygon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    z-index: 50;
}

.shape-wrap-overlay-handle {
    transition: fill 0.12s ease, stroke 0.12s ease;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

.shape-wrap-editing-active .shape-wrap-overlay-handle[data-handle-index] {
    pointer-events: all;
}

.shape-wrap-editing-active .shape-wrap-overlay-handle[data-handle-index]:hover {
    fill: #0a6ebd !important;
}

.shape-wrap-overlay-handle--primary {
    fill: #0091ea !important;
}

.shape-wrap-text-content,
.shape-wrap-text-columns,
.shape-wrap-text-item {
    position: relative;
    z-index: 20;
}

.shape-wrap-drawing-active .shape-wrap-polygon-overlay {
    pointer-events: auto;
    cursor: crosshair;
    background: rgba(0, 0, 0, 0.05);
}

.shape-wrap-text-content {
    --shape-wrap-text-item-spacing: 1.25em;
    --shape-wrap-text-paragraph-spacing: 1em;
    line-height: 1.6;
    text-align: justify;
}

.shape-wrap-text-animation {
    --shape-wrap-text-anim-delay: 0s;
    --shape-wrap-text-anim-duration: 0.6s;
    --shape-wrap-text-anim-timing: ease;
    --shape-wrap-text-anim-distance: 40px;
    opacity: 0;
    animation-name: none;
    animation-delay: var(--shape-wrap-text-anim-delay);
    animation-duration: var(--shape-wrap-text-anim-duration);
    animation-timing-function: var(--shape-wrap-text-anim-timing);
    animation-fill-mode: both;
    animation-iteration-count: 1;
    animation-play-state: paused;
    transform: none;
    transform-origin: center top;
    will-change: opacity, transform;
}

.shape-wrap-text-animation--play {
    animation-play-state: running;
}

.shape-wrap-text-animation--fade-in {
    animation-name: shape-wrap-text-fade-in;
}

.shape-wrap-text-animation--slide-up {
    animation-name: shape-wrap-text-slide-up;
}

.shape-wrap-text-animation--slide-down {
    animation-name: shape-wrap-text-slide-down;
}

.shape-wrap-text-animation--slide-left {
    animation-name: shape-wrap-text-slide-left;
}

.shape-wrap-text-animation--slide-right {
    animation-name: shape-wrap-text-slide-right;
}

.shape-wrap-text-animation--zoom-in {
    animation-name: shape-wrap-text-zoom-in;
}

@keyframes shape-wrap-text-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes shape-wrap-text-slide-up {
    from {
        opacity: 0;
        transform: translate3d(0, var(--shape-wrap-text-anim-distance, 40px), 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shape-wrap-text-slide-down {
    from {
        opacity: 0;
        transform: translate3d(0, calc(var(--shape-wrap-text-anim-distance, 40px) * -1), 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shape-wrap-text-slide-left {
    from {
        opacity: 0;
        transform: translate3d(calc(var(--shape-wrap-text-anim-distance, 40px) * -1), 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shape-wrap-text-slide-right {
    from {
        opacity: 0;
        transform: translate3d(var(--shape-wrap-text-anim-distance, 40px), 0, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes shape-wrap-text-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .shape-wrap-text-animation {
        animation-duration: 0.001s;
        animation-delay: 0s;
    }
}

.elementor-widget-shape-wrap-image[data-float-position="left"] .shape-wrap-text-content[style*=width] {
    float: right;
}

.elementor-widget-shape-wrap-image[data-float-position="right"] .shape-wrap-text-content[style*=width] {
    float: left;
}

.elementor-widget-shape-wrap-image[data-float-position="center"] .shape-wrap-text-content[style*=width] {
    float: none;
    margin-left: auto;
    margin-right: auto;
}

.shape-wrap-text-item {
    margin-bottom: var(--shape-wrap-text-item-spacing, 1.25em);
}

.shape-wrap-text-item:last-child {
    margin-bottom: 0;
}

.shape-wrap-text-item > p,
.shape-wrap-text-item > ul,
.shape-wrap-text-item > ol,
.shape-wrap-text-item > blockquote,
.shape-wrap-text-item > pre {
    margin-top: 0;
    margin-bottom: var(--shape-wrap-text-paragraph-spacing, 1em);
}

.shape-wrap-text-item > p:last-child,
.shape-wrap-text-item > ul:last-child,
.shape-wrap-text-item > ol:last-child,
.shape-wrap-text-item > blockquote:last-child,
.shape-wrap-text-item > pre:last-child {
    margin-bottom: 0;
}

.shape-wrap-text-item-placeholder {
    display: none;
}

.shape-wrap-text-content p:last-child {
    margin-bottom: 0;
}

.shape-wrap-editor-toolbar {
    margin-top: 15px;
    padding: 10px;
    background: transparent;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shape-wrap-editor-button {
    --md-sys-color-primary: #4a4f58;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d7d9dc;
    --md-sys-color-on-primary-container: #1a1c1f;
    --md-sys-elevation-level2: 0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
    --md-sys-elevation-level3: 0 4px 6px rgba(0, 0, 0, 0.16),
        0 1px 3px rgba(0, 0, 0, 0.32);
    padding: 10px 22px;
    min-width: 120px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    box-shadow: var(--md-sys-elevation-level2);
}

.shape-wrap-editor-button:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 90%, #ffffff);
    transform: translateY(-1px);
    box-shadow: var(--md-sys-elevation-level3);
}

.shape-wrap-editor-button:disabled {
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 70%, #ffffff);
    color: rgba(0, 0, 0, 0.38);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.shape-wrap-drawing-active .shape-wrap-image-wrapper {
    outline: 2px dashed #0073aa;
}

.shape-wrap-widget-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #555;
}

.shape-wrap-widget-version {
    font-weight: 600;
}

.shape-wrap-editing-active .shape-wrap-polygon-overlay {
    pointer-events: auto;
    cursor: move;
    background: rgba(0, 115, 170, 0.05);
}

.shape-wrap-editing-active .shape-wrap-image-wrapper {
    outline: 2px solid rgba(0, 115, 170, 0.4);
}

.shape-wrap-editor-button[data-action="adjust"] {
    --md-sys-color-primary: #5c636f;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #cfd3d9;
    --md-sys-color-on-primary-container: #171a1f;
}

.shape-wrap-editor-button[data-action="adjust"].shape-wrap-button-active {
    --md-sys-color-primary: #31363f;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #cacdd3;
    --md-sys-color-on-primary-container: #131318;
    transform: translateY(-1px);
    box-shadow: var(--md-sys-elevation-level3);
}

.shape-wrap-clearfix {
    clear: both;
}

.shape-wrap-centered-split {
    display: flex;
    justify-content: center;
}

.shape-wrap-centered-split .shape-wrap-text-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.shape-wrap-centered-split .shape-wrap-image-wrapper {
    float: none;
    margin: 0 auto;
    flex: 0 0 auto;
}

.shape-wrap-centered-split .shape-wrap-text-column {
    flex: 1 1 240px;
    max-width: 360px;
    padding: 0 10px;
    position: relative;
}

.shape-wrap-centered-split .shape-wrap-text-column-left {
    text-align: right;
}

.shape-wrap-centered-split .shape-wrap-text-column-right {
    text-align: left;
}

.shape-wrap-column-proxy {
    display: block;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    shape-margin: var(--shape-wrap-text-gap, 20px);
}

.shape-wrap-column-proxy-left {
    float: right;
}

.shape-wrap-column-proxy-right {
    float: left;
}

.shape-wrap-centered-split .shape-wrap-text-column::after {
    content: '';
    display: block;
    clear: both;
}

.shape-wrap-text-item-placeholder {
    display: none;
}

@media (max-width: 1024px) {
    .shape-wrap-centered-split .shape-wrap-text-columns {
        flex-direction: column;
        align-items: center;
    }

    .shape-wrap-centered-split .shape-wrap-text-column {
        max-width: 100%;
        text-align: center;
    }
}

/* Text visibility controls based on resolution */
/* Only hide when explicitly set to empty string or 'no', not when attribute is missing (legacy content) */
/* Desktop visibility - hide when explicitly set to empty or 'no' (only applies above tablet breakpoint) */
@media (min-width: 1025px) {
    .elementor-widget-shape-wrap-image[data-text-visibility=""] .shape-wrap-text-content,
    .elementor-widget-shape-wrap-image[data-text-visibility="no"] .shape-wrap-text-content {
        display: none !important;
    }
}

/* Tablet visibility - hide when explicitly set to empty or 'no' (only applies at tablet breakpoint) */
@media (min-width: 768px) and (max-width: 1024px) {
    .elementor-widget-shape-wrap-image[data-text-visibility-tablet=""] .shape-wrap-text-content,
    .elementor-widget-shape-wrap-image[data-text-visibility-tablet="no"] .shape-wrap-text-content {
        display: none !important;
    }
}

/* Mobile visibility - hide when explicitly set to empty or 'no' (only applies at mobile breakpoint) */
@media (max-width: 767px) {
    .elementor-widget-shape-wrap-image[data-text-visibility-mobile=""] .shape-wrap-text-content,
    .elementor-widget-shape-wrap-image[data-text-visibility-mobile="no"] .shape-wrap-text-content {
        display: none !important;
    }
}
