/**
 * Pretpot Interactive Oval Scrolling Menu
 * Circular rotating carousel with slanted inactive items
 */

.piosm-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.piosm-viewport {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 20px;
    margin: 0 auto;
}

.piosm-container {
    --item-width: 80px; /* Reduced default width */
    --item-gap: 0px;
    --rotation-angle: 25;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Base item - NO hardcoded height, controlled by Elementor */
.piosm-item {
    position: absolute;
    width: var(--item-width);
    /* Height is controlled by Elementor selector inline style */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 0;
    padding: 0;
    transform-origin: bottom center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.4s ease;
    will-change: transform, opacity;
    /* Default height fallback only if nothing set */
    height: 140px;
}

/* Left item - slanted left */
.piosm-item.is-prev {
    transform: 
        translateX(calc((var(--item-width) * 0.6 + var(--item-gap)) * -1)) 
        rotate(calc(var(--rotation-angle) * -1deg));
    opacity: 0.35;
    z-index: 1;
}

/* Center item - upright */
.piosm-item.is-active {
    transform: 
        translateX(0) 
        rotate(0deg);
    opacity: 1;
    z-index: 3;
}

/* Right item - slanted right */
.piosm-item.is-next {
    transform: 
        translateX(calc(var(--item-width) * 0.6 + var(--item-gap))) 
        rotate(calc(var(--rotation-angle) * 1deg));
    opacity: 0.35;
    z-index: 1;
}

/* Hidden items */
.piosm-item.is-hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transform: 
        translateX(calc((var(--item-width) + var(--item-gap)) * 2)) 
        rotate(calc(var(--rotation-angle) * 2deg));
    transition: none;
}

/* Layout */
.piosm-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    padding: 0 5px;
    box-sizing: border-box;
    color: inherit;
    gap: 8px;
}

/* Vertical text */
.piosm-text {
    font-size: inherit;
    font-weight: inherit;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    line-height: 1;
    margin: 0;
}

/* Icon below text */
.piosm-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8) translateY(-5px);
    transition: opacity 0.3s ease, 
                transform 0.3s ease;
    height: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.piosm-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

/* Show icon on active only */
.piosm-item.is-active .piosm-icon {
    opacity: 1;
    transform: scale(1) translateY(0);
    height: auto;
}

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

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

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

/* Responsive */
@media (max-width: 767px) {
    .piosm-viewport {
        max-width: 300px;
        height: 160px;
    }
    
    .piosm-text {
        font-size: 0.85em;
    }
}