@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

.aafe-morphing-feature-pills-wrapper h1,
.aafe-morphing-feature-pills-wrapper h2,
.aafe-morphing-feature-pills-wrapper h3,
.aafe-morphing-feature-pills-wrapper h4,
.aafe-morphing-feature-pills-wrapper h5,
.aafe-morphing-feature-pills-wrapper h6 {
    font-family: 'Inter Tight', sans-serif;
}

.aafe-morphing-feature-pills-wrapper p,
.aafe-morphing-feature-pills-wrapper span,
.aafe-morphing-feature-pills-wrapper li,
.aafe-morphing-feature-pills-wrapper a,
.aafe-morphing-feature-pills-wrapper label,
.aafe-morphing-feature-pills-wrapper input,
.aafe-morphing-feature-pills-wrapper button {
    font-family: 'Inter', sans-serif;
}

/* Base Wrapper */
.aafe-morphing-feature-pills-wrapper {
    width: 100%;
}

/* Layout */
.aafe-morphing-feature-pills__container {
    display: grid;
    grid-template-columns: var(--aafe-mfp-col-left, 1fr) var(--aafe-mfp-col-right, 1fr);
    gap: var(--aafe-mfp-gap, 40px);
    align-items: stretch;
}
@media (max-width: 1024px) {
    /* Tablet inherits desktop grid and gap unless overridden by Elementor responsive controls */
}
@media (max-width: 767px) {
    .aafe-morphing-feature-pills__container {
        grid-template-columns: 1fr;
    }
}

/* Left Column */
.aafe-morphing-feature-pills__left {
    display: flex;
    flex-direction: column;
    gap: var(--aafe-mfp-item-gap, 16px);
    align-items: flex-start;
}

/* Pill Item */
.aafe-morphing-feature-pills__item {
    background-color: #2a2a2a; /* Default fallback */
    border-radius: var(--aafe-mfp-pill-radius, 40px);
    padding: var(--aafe-mfp-pill-padding, 12px 24px);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    max-width: min(var(--aafe-mfp-pill-max-width, 400px), 100%);
    transition: all var(--aafe-mfp-hover-duration, 0.4s) cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, max-width, padding, border-radius, background-color, border-color, box-shadow;
    width: fit-content;
    transform: var(--aafe-mfp-pill-transform, none);
}
.aafe-morphing-feature-pills__item.is-active {
    background-color: #2a2a2a; /* Default fallback */
    border-radius: var(--aafe-mfp-card-radius, 24px);
    padding: var(--aafe-mfp-card-padding, 24px);
    max-width: var(--aafe-mfp-card-max-width, 100%);
    cursor: default;
    width: 100%; /* Take full width when active */
    transform: none !important; /* Disable hover transform when active */
}

/* Content wrappers for smooth height swap */
.aafe-morphing-feature-pills__pill-wrapper {
    display: block;
}
.aafe-morphing-feature-pills__pill-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.aafe-morphing-feature-pills__card-wrapper {
    display: none; /* Managed by jQuery slideDown/slideUp */
}
.aafe-morphing-feature-pills__card-inner {
    width: 100%;
}

/* Typography */
.aafe-morphing-feature-pills__item:not(.is-active):hover {
    transform: var(--aafe-mfp-pill-transform-hover, translateY(-4px));
}

.aafe-morphing-feature-pills__pill-title {
    color: var(--aafe-mfp-pill-color, #fff);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--aafe-mfp-hover-duration, 0.4s) ease;
}
.aafe-morphing-feature-pills__item:not(.is-active):hover .aafe-morphing-feature-pills__pill-title {
    color: var(--aafe-mfp-pill-color-hover, var(--aafe-mfp-pill-color, #fff));
}

.aafe-morphing-feature-pills__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--aafe-mfp-icon-box-size, 24px);
    height: var(--aafe-mfp-icon-box-size, 24px);
    background-color: var(--aafe-mfp-icon-bg, rgba(255,255,255,0.1));
    border-radius: 50%;
    color: var(--aafe-mfp-icon-color, #aaa);
    font-size: var(--aafe-mfp-icon-size, 12px);
    transition: all var(--aafe-mfp-hover-duration, 0.4s) cubic-bezier(0.25, 1, 0.5, 1);
    flex-shrink: 0;
}
.aafe-morphing-feature-pills__item:not(.is-active):hover .aafe-morphing-feature-pills__icon {
    background-color: var(--aafe-mfp-icon-bg-hover, rgba(255,255,255,0.2));
    color: var(--aafe-mfp-icon-color-hover, var(--aafe-mfp-icon-color, #aaa));
}
.aafe-morphing-feature-pills__icon i, 
.aafe-morphing-feature-pills__icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}
.aafe-morphing-feature-pills__card-title {
    color: var(--aafe-mfp-card-title-color, #fff);
    margin: 0 0 var(--aafe-mfp-card-title-margin, 12px) 0;
}
.aafe-morphing-feature-pills__card-desc {
    color: var(--aafe-mfp-card-desc-color, #aaa);
    margin: 0;
}
.aafe-morphing-feature-pills__card-btn {
    display: inline-block;
    margin-top: var(--aafe-mfp-card-btn-margin-top, 16px);
    padding: var(--aafe-mfp-card-btn-padding, 12px 24px);
    background-color: var(--aafe-mfp-card-btn-bg, transparent);
    color: var(--aafe-mfp-card-btn-color, #ffffff);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px; /* overridden by elementor if set */
}
.aafe-morphing-feature-pills__card-btn:hover {
    background-color: var(--aafe-mfp-card-btn-bg-hover, transparent);
    color: var(--aafe-mfp-card-btn-color-hover, #ffffff);
}

/* Right Column */
.aafe-morphing-feature-pills__right {
    position: relative;
    border-radius: var(--aafe-mfp-media-radius, 24px);
    background-color: var(--aafe-mfp-media-bg, #1a1a1a);
    overflow: hidden;
    min-height: var(--aafe-mfp-media-min-height, 500px);
    display: flex;
    transition: all 0.3s ease;
}
@media (max-width: 1024px) {
    /* Tablet inherits desktop min-height unless overridden by Elementor */
}
@media (max-width: 767px) {
    .aafe-morphing-feature-pills__right {
        order: var(--aafe-mfp-mobile-order, -1); /* Move media to top or bottom on mobile */
    }
}

.aafe-morphing-feature-pills__close-btn {
    position: absolute;
    top: var(--aafe-mfp-close-pos-top, 24px);
    right: var(--aafe-mfp-close-pos-right, 24px);
    width: var(--aafe-mfp-close-size, 36px);
    height: var(--aafe-mfp-close-size, 36px);
    min-width: var(--aafe-mfp-close-size, 36px);
    min-height: var(--aafe-mfp-close-size, 36px);
    background-color: var(--aafe-mfp-close-bg, rgba(255,255,255,0.1));
    color: var(--aafe-mfp-close-color, #fff);
    /* font-size = icon size (Elementor 'Icon Size' control sets this directly) */
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
    transition: background-color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                border-color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
                box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    /* padding controlled by Elementor Dimensions control (sets padding directly) */
    padding: 0;
    border: 0px solid transparent;
    outline: none;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1;
}
/* Icon inside close button: size relative to font-size of the button */
.aafe-morphing-feature-pills__close-btn i {
    font-size: inherit;
    line-height: 1;
    display: block;
    pointer-events: none;
}
.aafe-morphing-feature-pills__close-btn svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
    pointer-events: none;
    flex-shrink: 0;
}
.aafe-morphing-feature-pills__right.has-active .aafe-morphing-feature-pills__close-btn {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
.aafe-morphing-feature-pills__close-btn:hover {
    background-color: var(--aafe-mfp-close-bg-hover, rgba(255,255,255,0.2));
    color: var(--aafe-mfp-close-color-hover, #fff);
}

/* Media Items */
.aafe-morphing-feature-pills__media {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    transition: all var(--aafe-morphing-feature-pills-media-duration, 0.6s) cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
}
.aafe-morphing-feature-pills__media.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}
.aafe-morphing-feature-pills__media img,
.aafe-morphing-feature-pills__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Animations */
@keyframes aafe-morphing-feature-pills-fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes aafe-morphing-feature-pills-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes aafe-morphing-feature-pills-slide-left {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes aafe-morphing-feature-pills-slide-right {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes aafe-morphing-feature-pills-scale-up {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes aafe-morphing-feature-pills-clip-reveal {
    from { clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0% 100%); opacity: 0; transform: translateY(10px); }
    to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); opacity: 1; transform: translateY(0); }
}
@keyframes aafe-morphing-feature-pills-flip {
    from { opacity: 0; transform: perspective(600px) rotateX(-20deg); }
    to { opacity: 1; transform: perspective(600px) rotateX(0deg); }
}

.aafe-morphing-feature-pills-wrapper [data-aafe-animate] {
    opacity: 0;
    animation-fill-mode: forwards;
}
.aafe-morphing-feature-pills-wrapper [data-aafe-animate].aafe-morphing-feature-pills--visible {
    animation-duration: var(--aafe-morphing-feature-pills-duration, 600ms);
    animation-timing-function: var(--aafe-morphing-feature-pills-ease, cubic-bezier(0.25, 1, 0.5, 1));
}
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="fade-up"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-fade-up; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="fade-in"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-fade-in; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="slide-left"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-slide-left; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="slide-right"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-slide-right; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="scale-up"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-scale-up; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="clip-reveal"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-clip-reveal; }
.aafe-morphing-feature-pills-wrapper [data-aafe-animate="flip"].aafe-morphing-feature-pills--visible { animation-name: aafe-morphing-feature-pills-flip; }
