/* TM Innovations — services accordion carousel */

.tmi-svc-accordion-section {
    position: relative;
    padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 5rem);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 48%, #f8fafc 100%);
    overflow: hidden;
}

.tmi-svc-accordion-section .card_custom {
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.tmi-svc-accordion-section .card_custom h2 {
    color: #0f172a;
}

.tmi-svc-accordion-section .card_custom p {
    color: #64748b;
}

.tmi-svc-accordion-wrap {
    position: relative;
    z-index: 1;
}

.tmi-svc-accordion {
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-height: min(72vh, 620px);
    height: min(72vh, 620px);
    width: 100%;
    padding: 4px 0;
}

.tmi-svc-panel {
    position: relative;
    flex: 1 1 72px;
    min-width: 56px;
    max-width: 100%;
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
    transition:
        flex 0.72s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.45s ease,
        border-color 0.45s ease,
        transform 0.45s ease;
    background: #0c1222;
    isolation: isolate;
}

.tmi-svc-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 40px rgba(56, 189, 248, 0.35);
    transition: opacity 0.45s ease;
    z-index: 4;
}

.tmi-svc-panel.is-active {
    flex: 8 1 0%;
    min-width: min(42vw, 520px);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
}

.tmi-svc-panel.is-active::after {
    opacity: 1;
}

.tmi-svc-panel__bg {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.72) saturate(1.08);
    transform: scale(1.02);
    transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1), filter 0.7s ease;
    z-index: 0;
    will-change: transform;
}

.tmi-svc-panel.is-active .tmi-svc-panel__bg,
.tmi-svc-panel.is-hovered .tmi-svc-panel__bg {
    filter: brightness(0.88) saturate(1.12);
    transform: scale(1.18);
}

.tmi-svc-panel__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        rgba(8, 12, 28, 0.42) 0%,
        rgba(8, 12, 28, 0.22) 42%,
        rgba(8, 12, 28, 0.06) 100%
    );
    z-index: 1;
    transition: opacity 0.5s ease, background 0.5s ease;
}

.tmi-svc-panel:not(.is-active):not(.is-hovered) .tmi-svc-panel__overlay {
    background: linear-gradient(180deg, rgba(8, 12, 28, 0.2) 0%, rgba(8, 12, 28, 0.42) 100%);
}

/* Collapsed strip UI */
.tmi-svc-panel__strip {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 0.65rem;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tmi-svc-panel.is-active .tmi-svc-panel__strip {
    opacity: 0;
    visibility: hidden;
}

.tmi-svc-panel__strip-dot {
    display: none;
}

.tmi-svc-panel__strip-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    line-height: 1;
    text-align: center;
    max-height: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmi-svc-panel__strip-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1), width 0.4s ease, height 0.4s ease;
    font-weight: 300;
}

.tmi-svc-panel__strip-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.18);
    width: 54px;
    height: 54px;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Expanded content */
.tmi-svc-panel__content {
    position: relative;
    z-index: 3;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.5s ease 0.08s, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.tmi-svc-panel.is-active .tmi-svc-panel__content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tmi-svc-panel__tag {
    position: absolute;
    top: clamp(1rem, 2.5vw, 1.75rem);
    right: clamp(1rem, 2.5vw, 1.75rem);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

.tmi-svc-panel__tag-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.tmi-svc-panel__title {
    font-size: clamp(1.65rem, 3.2vw, 2.65rem);
    font-weight: 700;
    line-height: 1.12;
    color: #fff;
    margin: 0 auto 0.85rem;
    max-width: 22ch;
    text-align: center;
}

.tmi-svc-panel__desc {
    font-size: clamp(0.9rem, 1.35vw, 1.05rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 auto 1.35rem;
    max-width: min(32rem, 90%);
    text-align: center;
}

.tmi-svc-panel__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tmi-svc-panel__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    color: #0f172a;
}

.tmi-svc-panel__cta svg {
    width: 16px;
    height: 16px;
}

.tmi-svc-panel__sample {
    position: absolute;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(4.5rem, 12vw, 7rem);
    width: min(200px, 38%);
    z-index: 5;
    opacity: 0;
    transform: translateX(20px) scale(0.96);
    transition: opacity 0.55s ease 0.15s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
    pointer-events: none;
    display: none !important;
}

.tmi-svc-panel.is-active .tmi-svc-panel__sample {
    opacity: 0 !important;
    transform: translateX(0) scale(1);
    pointer-events: none;
    display: none !important;
}

.tmi-svc-panel__sample-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    padding: 0.65rem;
}

.tmi-svc-panel__sample-card img {
    width: 100%;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.tmi-svc-panel__sample-card p {
    margin: 0.55rem 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #334155;
    font-weight: 600;
}

/* Carousel controls */
.tmi-svc-accordion-nav {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tmi-svc-accordion-nav button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tmi-svc-accordion-nav button:hover:not(:disabled) {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.tmi-svc-accordion-nav button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.tmi-svc-accordion-hint {
    display: none;
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.75rem;
}

/* Hide legacy service grid decorations */
.tmi-svc-accordion-section .serviceanim,
.tmi-svc-accordion-section .path {
    display: none !important;
}

@media (max-width: 991.98px) {
    .tmi-svc-accordion-section {
        overflow-x: clip;
    }

    .tmi-svc-accordion {
        min-height: 400px;
        height: min(62vh, 520px);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding-bottom: 8px;
    }

    .tmi-svc-accordion::-webkit-scrollbar {
        display: none;
    }

    .tmi-svc-panel {
        flex: 0 0 64px;
        min-width: 64px;
        scroll-snap-align: start;
    }

    .tmi-svc-panel.is-active {
        flex: 0 0 min(88vw, 340px);
        min-width: min(88vw, 340px);
    }

    .tmi-svc-panel__sample {
        display: none;
    }

    .tmi-svc-accordion-hint {
        display: block;
    }

    .tmi-svc-accordion-nav {
        display: flex;
    }
}

@media (max-width: 575.98px) {
    .tmi-svc-accordion {
        min-height: 320px;
        height: min(52vh, 420px);
    }

    .tmi-svc-panel {
        flex: 0 0 52px;
        min-width: 52px;
    }

    .tmi-svc-panel.is-active {
        flex: 0 0 min(94vw, 280px);
        min-width: min(94vw, 280px);
    }

    .tmi-svc-panel__title {
        max-width: 100%;
        font-size: clamp(1.15rem, 4.8vw, 1.45rem);
    }

    .tmi-svc-panel__desc {
        font-size: 0.85rem;
    }
}

@media (hover: hover) and (pointer: fine) {
    .tmi-svc-accordion-hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmi-svc-panel,
    .tmi-svc-panel__bg,
    .tmi-svc-panel__content,
    .tmi-svc-panel__sample,
    .tmi-svc-panel__strip {
        transition-duration: 0.01ms !important;
    }

    .tmi-svc-panel__bg {
        transform: none !important;
    }
}
