/**
 * A2z Compare Widget Styles
 */

.a2z-compare-container {
    position: relative;
    width: 100%;
    max-width: 1152px;
    aspect-ratio: 1152 / 648;
    /* Exact 16:9 based on target resolution */
    margin: 0 auto;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    background-color: #f0f0f0;
    cursor: pointer;
}

/* Remove default Elementor padding */
.elementor-widget-a2z-compare .elementor-widget-container {
    --padding-top: 0px;
    --padding-right: 0px;
    --padding-bottom: 0px;
    --padding-left: 0px;
}

/**
 * Divider Title
 */
.a2z-compare-header-wrapper {
    width: 100%;
    margin-bottom: 15px;
    padding: 0;
}

.a2z-compare-header-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0;
    gap: 10px;
}

.a2z-compare-header-description {
    font-family: "Inter", sans-serif;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 24px;
    text-align: center;
    color: #7a7a7a;
    margin-top: 0 !important;
    padding: 0 60px 15px 60px;
    box-sizing: border-box;
}

.a2z-compare-header-divider::before,
.a2z-compare-header-divider::after {
    content: '';
    flex: 1;
    height: 2px;
    background-color: #d5d5d5;
}

.a2z-compare-header-title {
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 20px;
    font-family: 'Inter', sans-serif;
}

/**
 * Slider Container
 */
.a2z-compare-before {
    position: relative;
    /* This defines the height of the container */
    width: 100%;
    display: block;
}

.a2z-compare-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.a2z-compare-container img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    pointer-events: none;
}

.a2z-compare-before {
    position: relative;
    width: 100%;
    height: 100%;
}

.a2z-compare-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.a2z-compare-after {
    z-index: 10;
}

/* Labels */
.a2z-compare-label {
    position: absolute;
    bottom: 20px;
    z-index: 20;
    pointer-events: none;
}

.a2z-compare-before-label {
    left: 20px;
}

.a2z-compare-after-label {
    right: 20px;
}

.a2z-compare-label span {
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* Handle */
.a2z-compare-handle {
    position: absolute;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: #fff;
    z-index: 30;
    cursor: pointer;
    outline: none;
    touch-action: none;
    pointer-events: auto;
    /* Center the line itself */
    transform: translateX(-50%);
    /* Robust centering for children (SVG) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.a2z-compare-handle:focus {
    filter: drop-shadow(0 0 3px rgba(0, 123, 255, 0.5));
}

.a2z-compare-handle::before,
.a2z-compare-handle::after {
    display: none;
}

.a2z-compare-handle-svg {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
    z-index: 40;
    margin: 0;
}

.a2z-compare-handle-svg svg path {
    fill: #2b2b2b;
}

.a2z-compare-handle-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Responsive adjustments if needed */
@media (max-width: 768px) {
    .a2z-compare-main-wrapper {
        padding: 0 12px;
    }

    .a2z-compare-header-title {
        font-size: 20px;
    }

    .a2z-compare-header-description {
        font-size: 14px !important;
        padding: 0;
    }

    .a2z-compare-header-wrapper {
        padding: 0;
    }

    .a2z-compare-label span {
        font-size: 12px;
        padding: 5px 10px;
    }
}