/* =====================================================
   Posto Prospekt Widget – style
   ===================================================== */

/* Wrapper */
.pp-wrap {
    display: inline-block;
    width: 100%;
    max-width: 480px;
    font-family: inherit;
    position: relative;
}

/* ── Przycisk Toggle ─────────────────────────────── */
.pp-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #ffffff;
    color: #111111;
    border: 1px solid #111111 !important;
    border-style: solid !important;
    border-radius: 0;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
}

.pp-toggle:hover,
.pp-toggle:focus {
    background: #111111;
    color: #ffffff;
}

/* Ikona dokumentu */
.pp-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.pp-icon svg {
    stroke: currentColor;
}

/* Tytuł */
.pp-title {
    flex: 1;
}

/* Strzałka */
.pp-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.pp-arrow svg {
    stroke: currentColor;
}

.pp-wrap:not(.closed) .pp-arrow {
    transform: rotate(180deg);
}

/* ── Lista rozwijana – modal nad przyciskiem ─────── */
.pp-list {
    position: absolute;
    bottom: calc(100% + 8px);  /* 8px gap nad przyciskiem */
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    max-height: 0;
    border: 1px solid #111111;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15), 0 -2px 8px rgba(0,0,0,0.08);

    /* Animacja rozwijania ku górze */
    transform-origin: bottom center;
    transform: translateY(8px);
    transition:
        max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.pp-wrap:not(.closed) .pp-list {
    max-height: 60vh;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    overflow-y: auto;
    transition:
        max-height 0.36s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease,
        transform 0.2s ease;
}

/* Scrollbar styling */
.pp-list::-webkit-scrollbar {
    width: 6px;
}
.pp-list::-webkit-scrollbar-track {
    background: transparent;
}
.pp-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Pozycja listy */
.pp-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #111111;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.02em;
    line-height: 1.5;
    border-top: 1px solid #e8e8e8;
    transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.pp-list a:first-child {
    border-top: none;
}

.pp-list a:hover {
    background: #f5f5f5;
    color: #111111;
    padding-left: 26px;
}

/* Ikona pliku */
.pp-item-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0.5;
}
.pp-list a:hover .pp-item-icon {
    opacity: 0.8;
}

/* Etykieta */
.pp-item-label {
    flex: 1;
}

/* Ikona external link */
.pp-item-ext {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.15s, transform 0.15s;
}
.pp-list a:hover .pp-item-ext {
    opacity: 0.45;
    transform: translateX(0);
}

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
    .pp-wrap {
        max-width: 100%;
    }

    .pp-toggle {
        font-size: 13px;
        padding: 13px 16px;
    }

    .pp-list {
        position: fixed;
        bottom: auto;
        left: 12px;
        right: 12px;
        top: 50%;
        transform: translateY(-50%) scale(0.95);
        max-height: none;
        max-width: none;
        border-radius: 10px;
        box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    }

    .pp-wrap:not(.closed) .pp-list {
        max-height: 70vh;
        transform: translateY(-50%) scale(1);
        overflow-y: auto;
    }

    /* Overlay na mobilce */
    .pp-wrap:not(.closed)::before {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 999;
    }

    .pp-list a {
        padding: 14px 16px;
        font-size: 13px;
    }

    .pp-list a:hover {
        padding-left: 22px;
    }
}

/* ── Focus / Accessibility ───────────────────────── */
.pp-toggle:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.pp-list a:focus-visible {
    outline: 2px solid #111111;
    outline-offset: -2px;
}
