.ersw {
    background: var(--ersw-bg, #efeadb);
    color: var(--ersw-text, #103c53);
    padding: 24px;
}

.ersw__layout {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 520px) 1fr;
    align-items: center;
    gap: 16px;
}

.ersw__labels {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: stretch;
}

/* Acerca las columnas de etiquetas a la rueda */
/* Pantallas grandes > 1366px */
.ersw__labels--left  { margin-right: -24px; padding-top: 70px; }
.ersw__labels--right { margin-left:  -24px; padding-top: 70px; }

/* Portátil 1025px – 1366px */
@media (min-width: 1025px) and (max-width: 1366px) {
    .ersw__labels--left  { margin-right: -15px; padding-top: 40px; }
    .ersw__labels--right { margin-left:  -15px; padding-top: 40px; }

    .ersw__labels--left  .ersw__label--2,
    .ersw__labels--right .ersw__label--5 {
        margin-top: 160px;
    }

    .ersw__labels--right .ersw__label--5 h3 {
        max-width: 8ch;
    }
}

/* Bajada progresiva para alinear con los segmentos */
.ersw__labels--left  .ersw__label--2,
.ersw__labels--right .ersw__label--5 {
    margin-top: 140px;
}

/* Aleja --2 y --5 horizontalmente de la rueda */
.ersw__labels--left  .ersw__label--2 { padding-right: 48px; }
.ersw__labels--right .ersw__label--5 { padding-left:  48px; }

.ersw__labels--left  .ersw__label--3,
.ersw__labels--right .ersw__label--6 {
    margin-top: 100px;
}

.ersw__labels--left  .ersw__label--3 { margin-right: -30px; }
.ersw__labels--right .ersw__label--6 { margin-left:  -30px; }

.ersw__labels--left .ersw__label {
    text-align: right;
}

.ersw__labels--right .ersw__label {
    text-align: left;
}

.ersw__label h3 {
    margin: 0 0 10px;
    color: var(--ersw-text, #103c53);
    font-size: clamp(22px, 1.9vw, 33px);
    line-height: 1.1;
    font-weight: 500;
}

.ersw__label p {
    margin: 0;
    color: var(--ersw-text, #103c53);
    font-size: clamp(15px, 1.3vw, 22px);
    line-height: 1.35;
}

.ersw__wheel-wrap {
    width: min(100%, 520px);
    margin: -60px auto 0;
    overflow: clip;
}

.ersw__wheel {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    container-type: inline-size;
    --ersw-icon-size: 56px;
    --ersw-icon-radius: 145px;
}

/* ─── SVG arcs ─── */

.ersw__arcs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ─── Icon overlays ─── */

.ersw__icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--ersw-icon-size);
    height: var(--ersw-icon-size);
    transform: translate(-50%, -50%)
               rotate(var(--angle))
               translate(0, calc(-1 * var(--ersw-icon-radius)))
               rotate(calc(-1 * var(--angle)));
    transform-origin: center;
    display: grid;
    place-items: center;
    z-index: 2;
}

.ersw__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@supports (width: 1cqi) {
    .ersw__wheel {
        --ersw-icon-size: 10.8cqi;
        --ersw-icon-radius: 38cqi;
    }
}

/* ─── Center circle ─── */

.ersw__center {
    position: absolute;
    inset: 31%;
    border-radius: 50%;
    background: var(--ersw-ring, #003a5a);
    display: grid;
    place-items: center;
    z-index: 3;
    padding: 45px;
    text-align: center;
}

.ersw__center img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ersw__center span {
    color: #fff;
    font-size: clamp(18px, 2.2vw, 44px);
    letter-spacing: 0.12em;
    font-weight: 700;
}

/* ─── Entrance Animations ─── */

@keyframes ersw-fade-left {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes ersw-fade-right {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes ersw-wheel-in {
    from { opacity: 0; transform: scale(0.78) rotate(-18deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes ersw-icon-pop {
    from { opacity: 0; transform: scale(0) rotate(-20deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes ersw-center-pop {
    0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
    75%  { opacity: 1; transform: scale(1.1) rotate(4deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Estado inicial oculto */
.ersw__labels--left .ersw__label,
.ersw__labels--right .ersw__label {
    opacity: 0;
}

.ersw__wheel-wrap {
    opacity: 0;
}

.ersw__icon img {
    opacity: 0;
}

.ersw__center {
    opacity: 0;
}

/* Disparado por JS al entrar al viewport */
.ersw--animated .ersw__labels--left .ersw__label {
    animation: ersw-fade-left 0.55s ease both;
}

.ersw--animated .ersw__labels--right .ersw__label {
    animation: ersw-fade-right 0.55s ease both;
}

.ersw--animated .ersw__label--1 { animation-delay: 0.05s; }
.ersw--animated .ersw__label--2 { animation-delay: 0.15s; }
.ersw--animated .ersw__label--3 { animation-delay: 0.25s; }
.ersw--animated .ersw__label--4 { animation-delay: 0.05s; }
.ersw--animated .ersw__label--5 { animation-delay: 0.15s; }
.ersw--animated .ersw__label--6 { animation-delay: 0.25s; }

.ersw--animated .ersw__wheel-wrap {
    animation: ersw-wheel-in 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

.ersw--animated .ersw__icon img {
    animation: ersw-icon-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.ersw--animated .ersw__icon--1 img { animation-delay: 0.55s; }
.ersw--animated .ersw__icon--2 img { animation-delay: 0.65s; }
.ersw--animated .ersw__icon--3 img { animation-delay: 0.75s; }
.ersw--animated .ersw__icon--4 img { animation-delay: 0.55s; }
.ersw--animated .ersw__icon--5 img { animation-delay: 0.65s; }
.ersw--animated .ersw__icon--6 img { animation-delay: 0.75s; }

.ersw--animated .ersw__center {
    animation: ersw-center-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s both;
}


@media (max-width: 1024px) {
    .ersw__layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Resetear todos los ajustes de posicionamiento de desktop */
    .ersw__labels--left,
    .ersw__labels--right {
        justify-content: flex-start;
        align-self: auto;
        gap: 20px;
        padding-top: 0;
        margin-right: 0;
        margin-left: 0;
    }

    .ersw__wheel-wrap {
        margin-top: 0;
    }

    .ersw__labels--left .ersw__label,
    .ersw__labels--right .ersw__label {
        text-align: center;
        margin-top: 0;
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .ersw__label h3 {
        font-size: clamp(18px, 4.5vw, 26px);
    }

    .ersw__label p {
        font-size: clamp(15px, 3.5vw, 20px);
    }
}
