/* --- Widget Wrapper --- */
.p2d-process-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    position: relative;
    width: 100%;
    align-items: flex-start;
}

/* --- Layout Columns --- */
.p2d-process-left {
    width: calc(50% - 20px);
    position: sticky;
    top: 10vh; /* Adjust sticky positioning vertically */
    height: max-content;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.p2d-process-right {
    width: calc(50% - 20px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

/* --- Header & Typography --- */
.p2d-small-label {
    display: inline-block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #FF7B54;
    border: 1px solid #FFE3D8;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
}

.p2d-main-heading {
    font-size: 38px;
    line-height: 1.2;
    font-weight: 500;
    color: #1A1A1A;
    margin-bottom: 15px;
}

.p2d-main-heading span {
    color: #5C67F2; /* Optional highlight color */
}

.p2d-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* --- Circle Container --- */
.p2d-circle-container {
    --circle-size: 380px; /* Default size, can be overridden by Elementor controls */
    width: var(--circle-size);
    height: var(--circle-size);
    position: relative;
    margin: 20px auto;
    max-width: 100%;
}

/* The fixed ring background */
.p2d-circle-track-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 30px solid transparent;
    /* Soft gradient ring mimicking the premium design */
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, #E6E8FB, #FFEBE1) border-box;
    opacity: 0.8;
}

/* The rotating track */
.p2d-circle-track {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    /* Smooth transform for rotating the whole wheel */
    transform: rotate(calc(var(--wheel-rot) * 1deg));
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 2;
}

/* Individual item positioned on the circle */
.p2d-circle-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-left: -30px;
    
    /* Magic positioning:
       1. Rotate to item's angle
       2. Translate Outward to edge of circle (radius = size / 2)
       3. Counter-rotate to stay upright (cancel out item angle AND current wheel rotation)
    */
    transform: 
        rotate(calc(var(--item-angle) * 1deg)) 
        translateX(calc(var(--circle-size) / 2)) 
        rotate(calc((var(--item-angle) + var(--wheel-rot, 0)) * -1deg));
    
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon internal styling */
.p2d-icon-inner {
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 2px solid #E6E8FB;
    color: #8C94F5;
    font-size: 22px;
    transition: all 0.4s ease;
}

.p2d-icon-inner svg {
    width: 24px;
    height: 24px;
    fill: #8C94F5;
    transition: all 0.4s ease;
}

/* Active Icon State */
.p2d-circle-item.is-active {
    z-index: 10;
}
.p2d-circle-item.is-active .p2d-icon-inner {
    transform: scale(1.3);
    background-color: #5C67F2;
    border-color: #5C67F2;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(92, 103, 242, 0.3);
}
.p2d-circle-item.is-active .p2d-icon-inner svg {
    fill: #ffffff;
}

/* --- Center Text --- */
.p2d-center-text-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
    width: 60%;
}

.p2d-center-text-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%) translateY(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
}

.p2d-center-text-item.is-active {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
}

.p2d-center-text-item h3 {
    margin: 0;
    font-size: 24px;
    color: #1A1A1A;
    font-weight: 500;
}

/* --- Right Side Cards --- */
/* Spacers to allow smooth scrolling triggering */
.p2d-cards-spacer {
    height: 35vh; /* Provides runway for intersection observer */
}

.p2d-process-card {
    padding: 30px;
    border-radius: 16px;
    background-color: transparent;
    transition: all 0.4s ease;
    border: 1px solid transparent;
}

.p2d-card-title {
    font-size: 22px;
    margin-bottom: 12px;
    color: #333;
    transition: color 0.4s ease;
}

.p2d-card-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* Active Card State */
.p2d-process-card.is-active {
    background-color: #F4F5FB;
    border-color: #E6E8FB;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
}

.p2d-process-card.is-active .p2d-card-title {
    color: #1A1A1A;
}

/* --- Responsive Adjustments --- */
@media (max-width: 991px) {
    .p2d-process-wrapper {
        flex-direction: column;
    }
    
    .p2d-process-left, 
    .p2d-process-right {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .p2d-process-left {
        margin-bottom: 40px;
        align-items: center;
        text-align: center;
    }
    
    /* Disable excessive runway on mobile */
    .p2d-cards-spacer {
        height: 20px; 
    }
}

@media (max-width: 767px) {
    .p2d-circle-container {
        --circle-size: 280px;
    }
    .p2d-main-heading {
        font-size: 28px;
    }
}