.itl-widget,
.itl-widget * {
    box-sizing: border-box;
}

.itl-widget {
    position: relative;
    width: 100%;
    color: #ffffff;
    font-family: inherit;
}

.itl-widget button {
    font: inherit;
    background: unset !important;
    border: 0 !important;
}

/* =========================
   TOP TIMELINE WRAP
   ========================= */

.itl-timeline-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 24px;
}

.itl-timeline {
    position: relative;
    width: 100%;
}

.itl-timeline__line {
    position: absolute;
    left: 28px;
    right: 28px;
    top: 69px;
    height: 2px;
    background: rgba(255, 255, 255, 0.75);
    z-index: 1;
}

.itl-timeline__track {
    display: grid;
    gap: 12px;
    align-items: start;
    width: 100%;
    position: relative;
    z-index: 2;
}

.itl-timeline--items-1 .itl-timeline__track {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.itl-timeline--items-2 .itl-timeline__track {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.itl-timeline--items-3 .itl-timeline__track {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.itl-timeline--items-4 .itl-timeline__track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.itl-timeline--items-5 .itl-timeline__track {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* powyżej 5 elementów timeline przechodzi w slider */
.itl-timeline--slider .itl-timeline__track {
    display: flex;
    gap: 12px;
    transition: transform 0.4s ease;
    will-change: transform;
}

.itl-timeline--slider .itl-timeline__item {
    flex: 0 0 20%;
    min-width: 20%;
    max-width: 20%;
}

/* =========================
   TOP TIMELINE ITEM
   ========================= */

.itl-timeline__item {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
    color: #ffffff !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    padding: 0 10px;
    min-width: 0;
    transition: transform 0.25s ease, color 0.25s ease;
}

/* =========================
   OPACITY LOGIC
   ========================= */

.itl-timeline__item .itl-timeline__date,
.itl-timeline__item .itl-timeline__title {
    opacity: 0.6;
    transition: opacity 0.25s ease;
}

.itl-timeline__item:hover .itl-timeline__date,
.itl-timeline__item:hover .itl-timeline__title,
.itl-timeline__item.is-current .itl-timeline__date,
.itl-timeline__item.is-current .itl-timeline__title {
    opacity: 1;
}

.itl-timeline__item:hover {
    color: #ffffff !important;
}

/* =========================
   TEXT
   ========================= */

.itl-timeline__date {
    display: block;
    font-size: 11px;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 18px;
    white-space: nowrap;
}

.itl-timeline__title {
    display: block;
    font-size: 11px;
    line-height: 1.15;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    max-width: 260px;
    min-height: 46px;
    text-wrap: balance;
}

/* =========================
   DOT WRAP
   ========================= */

.itl-timeline__dot-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 62px;
    margin-bottom: 18px;
    position: relative;
    z-index: 3;
}

/* =========================
   DOT
   ========================= */

.itl-timeline__dot {
    width: 52px;
    height: 52px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5d2a0b;
    position: relative;
    transition: all 0.25s ease;
    z-index: 3;
}

.itl-timeline__item:hover .itl-timeline__dot,
.itl-timeline__item.is-current .itl-timeline__dot {
    border-color: #ffffff;
}

.itl-timeline__dot-inner {
    width: 0;
    height: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: all 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}

.itl-timeline__item:hover .itl-timeline__dot-inner,
.itl-timeline__item.is-current .itl-timeline__dot-inner {
    background: #ffffff;
}

/* =========================
   LOADER
   ========================= */

.itl-timeline__loader {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.25s ease;
    animation: itl-spin 2s linear infinite;
    pointer-events: none;
    z-index: 4;
}

.itl-timeline__item:hover .itl-timeline__loader,
.itl-timeline__item.is-current .itl-timeline__loader {
    border-top-color: #ffffff;
}

/* =========================
   STATUS: PLANNED
   ========================= */

.itl-timeline__item.status-planned .itl-timeline__dot-inner {
    width: 24px;
    height: 24px;
    opacity: 1;
}

/* =========================
   STATUS: CURRENT
   ========================= */

.itl-timeline__item.status-current .itl-timeline__dot-inner {
    width: 24px;
    height: 24px;
    opacity: 0;
}

.itl-timeline__item.status-current .itl-timeline__loader {
    opacity: 1;
    transform: scale(1);
}

.itl-timeline__item.status-current:hover .itl-timeline__dot-inner,
.itl-timeline__item.status-current.is-current .itl-timeline__dot-inner {
    opacity: 0;
}

.itl-timeline__item.status-current .itl-timeline__dot {
    background: #5d2a0b;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
}

/* =========================
   STATUS: COMPLETED
   ========================= */

.itl-timeline__item.status-completed .itl-timeline__dot-inner {
    width: 24px;
    height: 24px;
    opacity: 1;
}

.itl-timeline__item.status-completed .itl-timeline__dot::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    color: #5b2a0b;
    z-index: 5;
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.25s ease;
}

.itl-timeline__item.status-completed:hover .itl-timeline__dot::after,
.itl-timeline__item.status-completed.is-current .itl-timeline__dot::after {
    opacity: 1;
}

/* =========================
   BOTTOM SLIDER
   ========================= */

.itl-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0px;
    width: 100%;
}

.itl-arrow {
    appearance: none;
    -webkit-appearance: none;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.itl-arrow span {
    font-size: 28px;
    fill: #f7f3e8;
    color: #f7f3e8;
    transition: fill 0.25s ease, transform 0.25s ease;
}

.itl-arrow:hover span {
    fill: #ffffff;
    transform: scale(1.1);
}

.itl-arrow:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

.itl-slider {
    flex: 1 1 auto;
    overflow: hidden;
    width: 100%;
}

.itl-track {
    display: flex;
    align-items: stretch;
    gap: 14px;
    will-change: transform;
    transition: transform 0.4s ease;
}

.itl-card {
    background: #f3efe7;
    color: #b1734f;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    min-height: 100%;
    opacity: 1;
}

.itl-card__image {
    aspect-ratio: 1.38 / 1;
    overflow: hidden;
    background: #e7e2d9;
}

.itl-card__image img {
    display: block;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.itl-card__content {
    padding: 18px 28px 26px;
}

.itl-card__date-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.itl-card__line {
    flex: 1 1 auto;
    height: 1px;
    background: currentColor;
    opacity: 0.55;
}

.itl-card__date {
    flex: 0 0 auto;
    font-size: 11px;
    line-height: 1.2;
    letter-spacing: 0.04em;
    font-weight: 500;
    white-space: nowrap;
}

.itl-card__description {
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.itl-card__description p {
    margin: 0 0 8px;
}

.itl-card__description p:last-child {
    margin-bottom: 0;
}

/* =========================
   PAGINATION
   ========================= */

.swiper-pagination {
    position: relative !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35) !important;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.swiper-pagination-bullet:hover {
    background: rgba(255, 255, 255, 0.7) !important;
    transform: scale(1.1);
}

.swiper-pagination-bullet-active {
    background: #ffffff !important;
    transform: scale(1.15);
}

/* =========================
   ANIMATIONS
   ========================= */

@keyframes itl-spin {
    from {
        transform: scale(1) rotate(0deg);
    }
    to {
        transform: scale(1) rotate(360deg);
    }
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1400px) {
    .itl-timeline__title {
        font-size: 11px;
    }

    .itl-card__description {
        font-size: 11px;
    }
}

@media (max-width: 1100px) {
    .itl-slider-wrap {
        gap: 16px;
    }

    .itl-track {
        gap: 20px;
    }

    .itl-timeline__line {
        left: 20px;
        right: 20px;
    }

    .itl-timeline--slider .itl-timeline__item {
        flex: 0 0 33.3333%;
        min-width: 33.3333%;
        max-width: 33.3333%;
    }
}

@media (max-width: 767px) {
    .itl-timeline-wrap {
        margin-bottom: 28px;
    }

    .itl-timeline__line {
        top: 51px;
    }

    .itl-timeline__date {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .itl-timeline__dot-wrap {
        height: auto;
        margin-bottom: 12px;
    }

    .itl-timeline__dot {
        width: 38px;
        height: 38px;
    }

    .itl-timeline__loader {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }

    .itl-timeline__item.status-planned .itl-timeline__dot-inner,
    .itl-timeline__item.status-completed .itl-timeline__dot-inner {
        width: 18px;
        height: 18px;
    }

    .itl-timeline__item.status-completed .itl-timeline__dot::after {
        font-size: 12px;
    }

    .itl-timeline__title {
        font-size: 11px;
        min-height: auto;
        max-width: 100%;
    }

    .itl-timeline--slider .itl-timeline__track {
        gap: 12px;
    }

    .itl-timeline--slider .itl-timeline__item {
        flex: 0 0 50%;
        min-width: 50%;
        max-width: 50%;
    }

    .itl-slider-wrap {
        gap: 10px;
    }

    .itl-arrow {
        width: 36px;
        min-width: 36px;
        height: 36px;
        font-size: 42px;
    }

    .itl-track {
        gap: 14px;
    }

    .itl-card__content {
        padding: 16px 18px 20px;
    }

    .itl-card__date {
        font-size: 11px;
    }

    .itl-card__description {
        font-size: 11px;
    }

    .swiper-pagination {
        margin-top: 36px;
        gap: 8px;
    }

    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
}