/* Container Setup */
.tg-ic-wrap {
    width: 100%;
    position: relative;
    --slider-pos: 50%;
}

.tg-ic-cont {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f1f1f1;
}

/* Image Layers */
.tg-ic-img-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* The Overlay Magic (Before Image clips to the left) */
.tg-ic-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    clip-path: polygon(0 0, var(--slider-pos) 0, var(--slider-pos) 100%, 0 100%);
    pointer-events: none;
}

/* Labels */
.tg-ic-label {
    position: absolute;
    top: 20px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.6); /* Default, can be overridden by Elementor */
    color: #fff; /* Default, can be overridden by Elementor */
    border-radius: 4px;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tg-ic-label-before { left: 20px; }
.tg-ic-label-after { right: 20px; z-index: 3; }

.tg-ic-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 2px;
}

.tg-ic-subtitle {
    font-size: 12px;
    opacity: 0.8;
}

/* The Handle UI */
.tg-ic-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--slider-pos);
    width: 2px;
    background: #fff;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 10;
}

.tg-ic-handle-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.tg-ic-handle-icon::before,
.tg-ic-handle-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    border: solid #333;
    border-width: 0 2px 2px 0;
    padding: 3px;
}

.tg-ic-handle-icon::before { right: 55%; transform: translateY(-50%) rotate(135deg); }
.tg-ic-handle-icon::after { left: 55%; transform: translateY(-50%) rotate(-45deg); }

/* The Invisible Range Input (FIXED FOR ELEMENTOR EDITOR) */
.tg-ic-slider-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 999; /* Forces input to the top to bypass Elementor drag events */
    margin: 0;
    pointer-events: auto; /* Ensures mouse events are captured */
    -webkit-appearance: none;
}