/**
 * Pretpot Interactive Vertical Menu - Aligned Center Fix
 */

.pivm-wrapper {
    display: flex;
    align-items: center; /* Vertically centers icon and viewport */
    gap: 20px;
    min-height: 180px;
    position: relative;
    overflow: hidden;
}

.pivm-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center; /* Ensures icon is centered in its wrapper */
    justify-content: center;
    height: auto;
}

.pivm-icon {
    font-size: 28px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    line-height: 1;
    /* Ensure no extra spacing inside icon box */
    margin: 0;
    padding: 0;
}

.pivm-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    display: block; /* Remove descender space */
}

/* Viewport container */
.pivm-viewport {
    flex: 1;
    position: relative;
    /* Calculate exact height for 3 items + gaps */
    height: calc(var(--item-height, 60px) * 3 + var(--item-gap, 0px) * 2);
    overflow: hidden;
    /* No padding! Padding would push content down */
    padding: 0;
    margin: 0;
}

.pivm-container {
    --item-height: 60px;
    --item-gap: 0px;
    position: relative;
    width: 100%;
    height: 100%;
    /* Reset any inherited spacing */
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Items - Absolutely positioned with transform only (no margins) */
.pivm-item {
    position: absolute;
    left: 0;
    width: 100%;
    height: var(--item-height);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    
    /* CRITICAL: Remove all spacing that could cause offset */
    margin: 0 !important;
    padding: 0 !important;
    border: none;
    
    /* Positioning - uses transform only, no margins */
    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 slots - mathematically centered */
/* Formula: item moves down by (height + gap) * position_index */

/* Slot 0: Top item (prev) */
.pivm-item.is-prev {
    transform: translateY(0);
    opacity: 0.35;
}

/* Slot 1: Middle item (active) - exactly at 1/3 of total height if gap=0 */
.pivm-item.is-active {
    transform: translateY(calc((var(--item-height) + var(--item-gap)) * 1));
    opacity: 1;
}

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

/* Hidden items - move completely off-screen */
.pivm-item.is-hidden {
    opacity: 0;
    pointer-events: none;
    /* Move further down so there's no partial visibility */
    transform: translateY(calc((var(--item-height) + var(--item-gap)) * 3));
    transition: none; /* Instant hide */
}

/* Link and text - tight spacing */
.pivm-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    color: inherit;
}

.pivm-text {
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
    white-space: nowrap;
    display: block;
    margin: 0;
    padding: 0;
    /* Ensure text sits vertically centered in its line */
    vertical-align: middle;
}

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

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

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

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

/* Responsive adjustments */
@media (max-width: 767px) {
    .pivm-wrapper {
        min-height: 140px;
        gap: 10px;
    }
    
    .pivm-text {
        font-size: 0.9em;
    }
}