/**
 * Pretpot Interactive Vertical Menu 2 - Per-Item Icons
 */

.pivm2-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 180px;
    /* Background handled by Elementor group control */
}

.pivm2-viewport {
    position: relative;
    width: 100%;
    height: calc(var(--item-height, 60px) * 3 + var(--item-gap, 0px) * 2);
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.pivm2-container {
    --item-height: 60px;
    --item-gap: 0px;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Items */
.pivm2-item {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--item-height);
    display: flex;
    align-items: center;
    justify-content: center; /* Center content horizontally */
    margin: 0 !important;
    padding: 0 !important;
    border: none;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease;
    will-change: transform, opacity;
    box-sizing: border-box;
    line-height: 1;
}

/* The three visible positions */
.pivm2-item.is-prev {
    transform: translateY(0);
    opacity: 0.35;
}

.pivm2-item.is-active {
    transform: translateY(calc((var(--item-height) + var(--item-gap)) * 1));
    opacity: 1;
}

.pivm2-item.is-next {
    transform: translateY(calc((var(--item-height) + var(--item-gap)) * 2));
    opacity: 0.35;
}

/* Hidden items */
.pivm2-item.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc((var(--item-height) + var(--item-gap)) * 3));
    transition: none;
}

/* Link container - holds icon and text */
.pivm2-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 10px;
    margin: 0;
    border: none;
    color: inherit;
    /* Default gap, overridden by control */
    gap: 10px;
}

/* Icon - Hidden by default, shown only when active */
.pivm2-icon {
    font-size: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
    flex-shrink: 0;
    
    /* CRITICAL: Icon hidden on inactive items */
    opacity: 0;
    width: 0;
    overflow: hidden;
    transform: scale(0.8);
    transition: opacity 0.3s ease, 
                width 0.3s ease, 
                transform 0.3s ease,
                margin 0.3s ease;
}

.pivm2-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    display: block;
}

/* Icon visible only on active item */
.pivm2-item.is-active .pivm2-icon {
    opacity: 1;
    width: 1em; /* Restore width */
    transform: scale(1);
    margin-right: 0; /* Remove any compensation */
}

/* Text styling */
.pivm2-text {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1.2;
    white-space: nowrap;
    display: block;
    margin: 0;
    padding: 0;
}

/* Interaction */
.pivm2-item.is-active {
    cursor: pointer;
}

.pivm2-item:not(.is-active) {
    cursor: default;
    pointer-events: none;
}

/* Hover effect */
.pivm2-wrapper:hover .pivm2-item.is-active {
    filter: brightness(1.1);
}

/* Icon position variations */
.pivm2-icon-pos-right .pivm2-link {
    flex-direction: row-reverse;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .pivm2-item,
    .pivm2-icon {
        transition: none;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .pivm2-wrapper {
        min-height: 140px;
    }
    
    .pivm2-text {
        font-size: 0.9em;
    }
    
    .pivm2-icon {
        font-size: 20px;
    }
}