/**
 * Impacto CPT - Rueda Interactiva Styles
 */

.elementor-widget-impacto,
.elementor-widget-impacto > .elementor-widget-container,
.elementor-widget-impacto_widget,
.elementor-widget-impacto_widget > .elementor-widget-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding: 0 !important;
}

/* Sección principal */
.impacto-section {
    width: 100%;
    /* background: white; */
    margin: 0 auto;
}

.impacto-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    
    box-sizing: border-box;
    
}

/* Contenedor de la rueda */
.impacto-wheel-container {
    position: relative;
    width: 884px; /* VER, ajustar */
    flex-shrink: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    max-height: 884px;
    /* padding: 190px 0;  */
    
}

/* Contenedor de ambas capas (rueda + texto exterior) */
.impacto-wheel-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

 /* Capas superpuestas */
.impacto-wheel-rotating,
 .impacto-wheel-outside {
     position: absolute;
     inset: 0;
}
 
  /* separacion entre capas */
.impacto-wheel-rotating {
     inset: 2.2%;
     z-index: 1;
}
 
.impacto-wheel-outside {
    z-index: 5;
    pointer-events: none;
}

/* SVGs dentro de las capas */
.impacto-wheel-rotating svg,
.impacto-wheel-outside svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* SVG de la rueda */
.impacto-wheel-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Grupo rotable de segmentos */
#wheel-container {
    transform-origin: 575px 575px;
    transition: transform 0.6s ease-in-out;
    will-change: transform;
}

/* Grupo fijo del centro (no rota) */
#wheel-center-fixed {
    pointer-events: none;
}

/* Flecha fija posicionada al centro-derecha apuntando hacia el contenido */
#flecha {
    position: absolute;
    top: 50%;
    right: -50px;
    transform: translateY(-50%);
    z-index: 10;
    pointer-events: none;
    width: 40px;
    height: auto;
    /* z-index: 999; */
}

/* Segmentos clickeables */
.impacto-segment {
    cursor: pointer;
    pointer-events: all;
}

.impacto-wheel-container,
.impacto-wheel-container * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.impacto-segment .segment-path {
    transition: fill 0.3s ease;
    pointer-events: all;
}

.impacto-segment .segment-background {
    transition: fill 0.3s ease;
    pointer-events: none;
}

/* Permitir que los clics pasen a través de los íconos y títulos */
#wheel-container > path,
#wheel-container > g:not(#segment-backgrounds) path,
#wheel-container > g:not(#segment-backgrounds) {
    pointer-events: none;
}

/* Segmento activo - cambiar color de fondo a verde */
.impacto-segment.active .segment-background {
    fill: #4C9F38 !important;
}

/* Selector más específico para asegurar que funcione */
#segment-backgrounds .impacto-segment.active .segment-background {
    fill: #4C9F38 !important;
}

g.impacto-segment.active path.segment-background {
    fill: #4C9F38 !important;
}


/*---------------------- Contenido derecha */
.impacto-content {
    flex: 1;
    max-width: 650px;
    position: relative;
}

.impacto-content-item {
    display: none;
    animation: fadeIn 0.5s ease;
}

.impacto-content-item.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

 /* Badge superior (verde) */
.impacto-badge {
    display: inline-block;
    background: #006A24;
    color: #fff;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 15px;
    font-weight: 550;
    line-height: 145%;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 10px 23px;
    border-radius: 1000px;
    margin-bottom: 24px;
    justify-content: center;
    align-items: center;
}

 /* Título */
.impacto-title {
    color: #000;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 40px;
    font-weight: 700;
    line-height: 112%;
    letter-spacing: 0.4px;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 534px;
}

.impacto-arrow {
    flex-shrink: 0;
}

 /* Excerpt (subtítulo) */
.impacto-excerpt {
    color: #000;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 110%;
    letter-spacing: 0.44px;
    margin: 0 0 20px 0;
    max-width: 534px;
}

 /* Descripción */
.impacto-description {
    color: #000;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 16px;
    font-weight: 550;
    line-height: 123%;
    letter-spacing: 0.32px;
    margin: 0 0 24px 0;
    max-width: 534px;
}

 /* Badge inferior */
.impacto-badge-bottom {
    display: inline-block;
    color: #000;
    font-family: var(--e-global-typography-text-font-family), sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 100%;
    letter-spacing: 0.26px;
    text-transform: uppercase;
    padding: 9px 29px;
    border-radius:  1000px;
    border: 1.8px solid #000;
    background: transparent;
    justify-content: center;
    align-items: center;
}

.impacto-readmore {
    display: none;
}

.impacto-mobile-modal {
    display: none;
}

.impacto-mobile-logo {
    display: none;
}

.impacto-mobile-discover {
    display: none;
}

@media (max-width: 1899px) and (min-width: 1200px) {
    .impacto-container {
        width: 100%;
        max-width: 1500px;
        flex-direction: row;
        gap: 60px;
        padding: 90px 40px;
    }
}

@media (max-width: 1199px) {
    .impacto-section {
        overflow: hidden;
        min-height: auto;
        /* background-color: #E3E2E2; */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .impacto-container {
        position: relative;
        padding: 60px 40px;
        gap: 30px;
        min-height: auto;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        /* background-color: #E3E2E2; */
        overflow: hidden;
    }

    .impacto-mobile-logo {
        display: block;
        position: relative;
        z-index: 3;
        margin-bottom: 40px;
        align-self: flex-start;
    }

    .impacto-mobile-logo img {
        height: 24px;
        width: auto;
    }

    .impacto-wheel-container {
        position: absolute;
        top: calc(45% + 0px);
        right: 0;
        height: 520px;
        width: 520px;
        transform: translate(65%, -50%);
        z-index: 4;
    }

    .impacto-badge {
        width: 100%;
        max-width: 270px;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
        padding: 10px 18px;
        font-size: 13px;
        line-height: 130%;
    }

    .impacto-title,
    .impacto-excerpt,
    .impacto-description,
    .impacto-badge-bottom {
        width: 100%;
        max-width: 600px;
        box-sizing: border-box;
    }

    .impacto-title{
        font-size: 32px;
        width: 500px;
    }

    .impacto-excerpt{
     font-size: 22px;
     width: 400px;
    }

    .impacto-description{
        font-size: 16px;
        width: 400px;
    }

    .impacto-badge-bottom{
        width: 100%;
        max-width: 280px;
        white-space: normal;
        overflow-wrap: anywhere;
        text-align: center;
        padding: 10px 18px;
        font-size: 13px;
        line-height: 130%;
    }

    /* para evitar el tap highlight del navegador */
    .impacto-wheel-container,
    .impacto-wheel-container svg,
    .impacto-segment,
    .impacto-segment * {
        -webkit-tap-highlight-color: transparent;
        outline: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }

    /* darle zoom en version tablet */
    .impacto-wheel-stage {
        transform: scale(1.15);
        transform-origin: 50% 50%;
    }

    .impacto-wheel-outside {
        transform: rotate(280deg);
        transform-origin: 50% 50%;
    }

    #wheel-center-fixed > * {
        display: none;
    }

    #wheel-center-fixed > path:first-of-type {
        display: block;
    }

    .impacto-content {
        position: relative;
        z-index: 2;
        max-width: 100%;
        width: 100%;
        pointer-events: none;
    }

    .impacto-content-item,
    .impacto-readmore,
    .impacto-mobile-modal,
    .impacto-mobile-modal * {
        pointer-events: auto;
    }

    .impacto-content-item.active {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 200px);
    }

    .impacto-main-content {
        width: 320px;
        max-width: 320px;
    }
}

@media (max-width: 767px) {
    .impacto-section {
        overflow: hidden;
        min-height: 100vh;
        background-color: #E3E2E2;
    }

    .impacto-container {
        position: relative;
        padding: 40px 20px 0 20px;
        gap: 20px;
        min-height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        background-color: #E3E2E2;
        overflow: hidden;
    }

    .impacto-mobile-logo {
        display: block;
        position: relative;
        z-index: 3;
        margin-bottom: 40px;
        align-self: flex-start;
    }

    .impacto-mobile-logo img {
        height: 24px;
        width: auto;
    }
     
    .impacto-wheel-container {
        position: absolute;
        top: calc(45% + 54px);
        right: 0;
        height: 450px;
        width: 450px;
        transform: translate(70%, -50%); /* VER, ajustar en caso de ser necesario */
        z-index: 4;
    }
    /* invertida en mobile */
    #flecha {
        display: block;
        left: 19px;
        right: auto;
        top: 60%;
        transform: translateY(-50%) rotate(180deg);
        transform-origin: 50% 50%;
        z-index: 10;
        width: 11px;
        height: 9;
    }

    /* para evitar el tap highlight del navegador */
    .impacto-wheel-container,
    .impacto-wheel-container svg,
    .impacto-segment,
    .impacto-segment * {
        -webkit-tap-highlight-color: transparent;
        outline: none;
        -webkit-user-select: none;
        user-select: none;
        touch-action: manipulation;
    }

    /* darle zoom en version mobile */
    .impacto-wheel-stage {
        transform: scale(1.3); /* Ajustar zoom */
        transform-origin: 50% 50%;
    }

    .impacto-wheel-outside {
        transform: rotate(280deg);
        transform-origin: 50% 50%;
    }

    #wheel-center-fixed > * {
        display: none;
    }

    #wheel-center-fixed > path:first-of-type {
        display: block;
    }

    .impacto-content {
        position: relative;
        z-index: 2;
        /* padding-right: 55vw; */
        max-width: 100%;
        width: 100%;
        pointer-events: none;
    }

    .impacto-content-item,
    .impacto-mobile-logo,
    .impacto-readmore,
    .impacto-mobile-modal,
    .impacto-mobile-modal * {
        pointer-events: auto;
    }

    .impacto-content-item.active {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 160px);
    }

    .impacto-main-content {
        width: 240px;
        max-width: 240px;
    }

    .impacto-title{
        color: black;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 18px;
        font-style: normal;
        font-weight: 700;
        line-height: 120%; 
        min-height: 88px;
        width: 300px;

    }

    .impacto-badge {
        display: none;
    }

    .impacto-description {
        display: none;
    }
    
    .impacto-excerpt {
        display: none;
    }
    .impacto-mobile-modal .impacto-excerpt { 
        display: block; 
    }
    
    .impacto-mobile-modal .impacto-mobile-modal-badge {
        display: none;
    }

    .impacto-readmore {
        display: flex;
        width: 111px;
        box-sizing: border-box;
        padding: 10px 0;
        justify-content: center;
        align-items: center;
        gap: 10px;
        border-radius: 1000px;
        border: 1.8px solid #006A24;
        background: transparent;
        color: #006A24;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 16px;
        font-weight: 700;
        line-height: 100%;
        letter-spacing: 0.26px;
        margin: 20px 0;
        cursor: pointer;
    }

    .impacto-badge-bottom {
        margin-top: auto;
        margin-bottom: 130px;
        display: flex;
        width: 198px; /* En figma es 188, pero ajusto en caso de texto más largo */
        padding: 10px 23px;
        justify-content: center;
        align-items: center;
        gap: 10px;
        border-radius: 1000px;
        border: 1.8px solid #006A24;
        background-color: #00682D;
        color: #F0F0F0;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 10px;
        font-style: normal;
        font-weight: 550;
        line-height: 145%;
        letter-spacing: 0.2px;
        text-transform: uppercase;
    }

    .impacto-mobile-discover {
        display: block;
        width: 115px;
        color: #000;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 700;
        line-height: 100%;
        letter-spacing: 0.16px;
        text-transform: uppercase;
        margin-top: 290px;
    }

    .impacto-mobile-modal {
        display: none;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        background: #E3E2E2;
        z-index: 9999;
    }

    .impacto-mobile-modal.is-open {
        display: block;
    }

    .impacto-mobile-modal-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 22px 24px;
        background: transparent;
        z-index: 1;
    }

    .impacto-mobile-modal-close {
        background: transparent;
        border: 0;
        padding: 0;
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
        color: #000;
    }

    .impacto-mobile-modal-body {
        position: absolute;
        top:  px;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        overflow: auto;
        padding: 0 24px 48px;
        text-align: left;
    }


    .impacto-mobile-modal-description {
        width: 100%;
        max-width: 350px;
    }

    .impacto-mobile-modal-excerpt {
        width: 100%;
        max-width: 350px;
    }

    .impacto-mobile-modal .impacto-mobile-modal-badge-bottom {
        display: flex;
        padding: 10px 23px;
        justify-content: center;
        align-items: center;
        gap: 10px;
        border-radius: 1000px;
        border: 1.8px solid #006A24;
        background-color: #00682D;
        color: #F0F0F0;
        width: fit-content;
        margin: 0 0 24px 0;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 10px;
        font-style: normal;
        font-weight: 550;
        line-height: 145%; 
        letter-spacing: 0.2px;
        text-transform: uppercase;
    }

    .impacto-mobile-modal .impacto-mobile-modal-title {
        color: var(--black, #000);
        color: var(--black, color(display-p3 0 0 0));
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 22px;
        font-style: normal;
        font-weight: 700;
        line-height: 110%;
        letter-spacing: 0.44px;
        margin: 0 0 20px 0;
    }

    .impacto-mobile-modal .impacto-mobile-modal-excerpt {
        color: #000;

        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 700;
        line-height: 123%;
        letter-spacing: 0.32px;
        margin: 0 0 24px 0;
    }

    .impacto-mobile-modal .impacto-mobile-modal-description {
        color:  #000;
        font-family: var(--e-global-typography-text-font-family), sans-serif;
        font-size: 16px;
        font-style: normal;
        font-weight: 550;
        line-height: 123%;
        letter-spacing: 0.32px;
        margin: 0;
    }

    .impacto-mobile-modal .impacto-description {
        display: block;
    }
     
    /* .impacto-title {
        font-size: 28px;
    } */
    
    /* .impacto-excerpt {
        font-size: 18px;
    }
    
    .impacto-description {
        font-size: 14px;
    } */
}
