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

/* =============================================================================
   AAFE Feature Tabs Widget — style.css
   ============================================================================= */

/* --- Font Assignments -------------------------------------------------------- */
.aafe-feature-tabs__wrapper h1,
.aafe-feature-tabs__wrapper h2,
.aafe-feature-tabs__wrapper h3,
.aafe-feature-tabs__wrapper h4,
.aafe-feature-tabs__wrapper h5,
.aafe-feature-tabs__wrapper h6 {
    font-family: 'Sora', sans-serif;
}

.aafe-feature-tabs__wrapper p,
.aafe-feature-tabs__wrapper span,
.aafe-feature-tabs__wrapper li,
.aafe-feature-tabs__wrapper a,
.aafe-feature-tabs__wrapper button {
    font-family: 'Inter', sans-serif;
}

/* =============================================================================
   WRAPPER
   ============================================================================= */
.aafe-feature-tabs__wrapper {
    background-color: #16231b;
    padding: 80px 32px;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* =============================================================================
   GRID — Mobile First
   ============================================================================= */
.aafe-feature-tabs__grid {
    display: grid;
    /* Default to 1fr (stacked). Responsive classes will override this. */
    grid-template-columns: 1fr;
    gap: var(--grid-gap, 40px);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
}

/* =============================================================================
   RESPONSIVE LAYOUT CLASSES (Elementor Prefix Classes)
   ============================================================================= */

/* Desktop / Base */
.aafe-feature-tabs__wrapper[data-img-pos="left"] .aafe-feature-tabs__grid { grid-template-columns: 1fr var(--content-width, 50%); }
.aafe-feature-tabs__wrapper[data-img-pos="left"] .aafe-feature-tabs__left { order: 2; }
.aafe-feature-tabs__wrapper[data-img-pos="left"] .aafe-feature-tabs__right { order: 1; }

.aafe-feature-tabs__wrapper[data-img-pos="right"] .aafe-feature-tabs__grid { grid-template-columns: var(--content-width, 50%) 1fr; }
.aafe-feature-tabs__wrapper[data-img-pos="right"] .aafe-feature-tabs__left { order: 1; }
.aafe-feature-tabs__wrapper[data-img-pos="right"] .aafe-feature-tabs__right { order: 2; }

.aafe-feature-tabs__wrapper[data-img-pos="top"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
.aafe-feature-tabs__wrapper[data-img-pos="top"] .aafe-feature-tabs__left { order: 2; }
.aafe-feature-tabs__wrapper[data-img-pos="top"] .aafe-feature-tabs__right { order: 1; }

.aafe-feature-tabs__wrapper[data-img-pos="bottom"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
.aafe-feature-tabs__wrapper[data-img-pos="bottom"] .aafe-feature-tabs__left { order: 1; }
.aafe-feature-tabs__wrapper[data-img-pos="bottom"] .aafe-feature-tabs__right { order: 2; }

/* Tablet */
@media (max-width: 1024px) {
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="left"] .aafe-feature-tabs__grid { grid-template-columns: 1fr var(--content-width, 50%); }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="left"] .aafe-feature-tabs__left { order: 2; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="left"] .aafe-feature-tabs__right { order: 1; }

    .aafe-feature-tabs__wrapper[data-img-pos-tablet="right"] .aafe-feature-tabs__grid { grid-template-columns: var(--content-width, 50%) 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="right"] .aafe-feature-tabs__left { order: 1; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="right"] .aafe-feature-tabs__right { order: 2; }

    .aafe-feature-tabs__wrapper[data-img-pos-tablet="top"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="top"] .aafe-feature-tabs__left { order: 2; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="top"] .aafe-feature-tabs__right { order: 1; }

    .aafe-feature-tabs__wrapper[data-img-pos-tablet="bottom"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="bottom"] .aafe-feature-tabs__left { order: 1; }
    .aafe-feature-tabs__wrapper[data-img-pos-tablet="bottom"] .aafe-feature-tabs__right { order: 2; }
}

/* Mobile */
@media (max-width: 767px) {
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="left"] .aafe-feature-tabs__grid { grid-template-columns: 1fr var(--content-width, 50%); }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="left"] .aafe-feature-tabs__left { order: 2; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="left"] .aafe-feature-tabs__right { order: 1; }

    .aafe-feature-tabs__wrapper[data-img-pos-mobile="right"] .aafe-feature-tabs__grid { grid-template-columns: var(--content-width, 50%) 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="right"] .aafe-feature-tabs__left { order: 1; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="right"] .aafe-feature-tabs__right { order: 2; }

    .aafe-feature-tabs__wrapper[data-img-pos-mobile="top"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="top"] .aafe-feature-tabs__left { order: 2; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="top"] .aafe-feature-tabs__right { order: 1; }

    .aafe-feature-tabs__wrapper[data-img-pos-mobile="bottom"] .aafe-feature-tabs__grid { grid-template-columns: 1fr; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="bottom"] .aafe-feature-tabs__left { order: 1; }
    .aafe-feature-tabs__wrapper[data-img-pos-mobile="bottom"] .aafe-feature-tabs__right { order: 2; }
}

/* =============================================================================
   LEFT COLUMN
   ============================================================================= */
.aafe-feature-tabs__left {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Header ------------------------------------------------------------------ */
.aafe-feature-tabs__header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: flex-start;
}

/* =============================================================================
   LABEL BADGE
   ============================================================================= */
.aafe-feature-tabs__label-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 100px;
    padding: 4px 16px;
    color: #f9f5eb;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 16px;
}

/* =============================================================================
   HEADINGS
   — Scroll animation: only fires on FRONTEND (not in editor)
   — In editor: headings are always fully visible
   ============================================================================= */

.aafe-feature-tabs__heading-wrap {
    max-width: 528px;
}

.aafe-feature-tabs__heading-line {
    overflow: hidden;
    padding-bottom: 4px;
}

.aafe-feature-tabs__heading {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: clamp(32px, 5vw, 72px);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 0.95;
    color: #f9f5eb;
    display: block;
}

/* =============================================================================
   TAB MENU
   ============================================================================= */
.aafe-feature-tabs__tab-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.aafe-feature-tabs__tab-link {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: rgba(249, 245, 235, 0.70);
    padding: 16px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    -webkit-transition: all 0.25s ease;
}

.aafe-feature-tabs__tab-link:hover,
.aafe-feature-tabs__tab-link:focus-visible {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f9f5eb;
    outline: none;
}

.aafe-feature-tabs__tab-link:hover .aafe-feature-tabs__tab-icon,
.aafe-feature-tabs__tab-link:focus-visible .aafe-feature-tabs__tab-icon {
    color: #f9f5eb;
}

.aafe-feature-tabs__tab-link.is-active {
    background-color: rgba(255, 255, 255, 0.16);
    color: #f9f5eb;
}

/* Active left indicator */
.aafe-feature-tabs__tab-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 55%;
    background-color: #f9f5eb;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.aafe-feature-tabs__tab-link.is-active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Autoplay Progress Bar */
.aafe-feature-tabs__progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aafe-feature-tabs__wrapper[data-autoplay="yes"] .aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__progress-track {
    opacity: 1;
}

.aafe-feature-tabs__progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background-color: #f9f5eb;
}

.aafe-feature-tabs__wrapper[data-autoplay="yes"] .aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__progress-fill {
    animation: aafeProgressFill var(--autoplay-speed, 3000ms) linear forwards;
}

.aafe-feature-tabs__wrapper.is-paused .aafe-feature-tabs__progress-fill {
    animation-play-state: paused;
}

@keyframes aafeProgressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Accordion row */
.aafe-feature-tabs__accordion-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

/* Icon */
.aafe-feature-tabs__tab-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(249, 245, 235, 0.70);
    transition: color 0.25s ease;
    -webkit-transition: color 0.25s ease;
}

.aafe-feature-tabs__tab-icon i {
    font-size: 22px;
    line-height: 1;
}

.aafe-feature-tabs__tab-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__tab-icon {
    color: #f9f5eb;
}

/* Tab title */
.aafe-feature-tabs__tab-title {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.aafe-feature-tabs__tab-title-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: left;
}

.aafe-feature-tabs__tab-desc {
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(249, 245, 235, 0.6);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    white-space: normal;
    word-wrap: break-word;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
    -webkit-transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.aafe-feature-tabs__tab-link.is-active .aafe-feature-tabs__tab-desc {
    max-height: 200px;
    opacity: 1;
    margin-top: 8px;
}

/* =============================================================================
   RIGHT COLUMN — Panels
   ============================================================================= */
.aafe-feature-tabs__right {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/*
 * PANELS CONTAINER
 * — Uses position: relative so it holds natural document height
 * — Active panel is position: relative (in flow), contributes to height
 * — Inactive panels are position: absolute, overlapping the active one
 * — This avoids the "zero-height container" bug
 */
.aafe-feature-tabs__panels {
    position: relative;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* ALL panels: start as absolutely positioned, invisible */
.aafe-feature-tabs__panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 500ms ease,
                transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-transition: opacity 500ms ease,
                        -webkit-transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

/* 1. FADE & ZOOM (Default) */
.aafe-feature-tabs__wrapper[data-anim="fade-zoom"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: scale(0.97) translateY(8px);
}

/* 2. SLIDE RIGHT */
.aafe-feature-tabs__wrapper[data-anim="slide-right"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: translateX(40px);
}

/* 3. SLIDE UP */
.aafe-feature-tabs__wrapper[data-anim="slide-up"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: translateY(40px);
}

/* 4. 3D FLIP */
.aafe-feature-tabs__wrapper[data-anim="flip"] .aafe-feature-tabs__panels {
    perspective: 1000px;
}
.aafe-feature-tabs__wrapper[data-anim="flip"] .aafe-feature-tabs__panel:not(.is-active) {
    transform: rotateX(15deg) scale(0.95);
    transform-origin: center center;
}

/* ACTIVE panel: pull back into flow so container gets height */
.aafe-feature-tabs__panel.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    flex-grow: 1;
}

/* Panel image container */
.aafe-feature-tabs__panel-wrap {
    position: relative;
    width: 100%;
    flex-grow: 1;
    border-radius: 12px;
    overflow: hidden;
}

/* Cover image / video */
.aafe-feature-tabs__panel-img,
.aafe-feature-tabs__panel-video {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.aafe-feature-tabs__wrapper[data-hover-zoom="yes"] .aafe-feature-tabs__panel-wrap:hover .aafe-feature-tabs__panel-img,
.aafe-feature-tabs__wrapper[data-hover-zoom="yes"] .aafe-feature-tabs__panel-wrap:hover .aafe-feature-tabs__panel-video {
    transform: scale(1.06);
}

lottie-player {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

/* =============================================================================
   OVERLAY BADGE (Glassmorphism)
   ============================================================================= */
.aafe-feature-tabs__overlay-badge {
    position: absolute;
    width: var(--badge-width, auto);
    max-width: calc(100% - (var(--badge-ml, 0px) + var(--badge-mr, 0px)));
    margin: var(--badge-mt, 0px) var(--badge-mr, 0px) var(--badge-mb, 0px) var(--badge-ml, 0px);
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    color: #f9f5eb;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    letter-spacing: 0.07px;
    text-transform: uppercase;
    z-index: 2;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.25s, transform 0.4s ease 0.25s;
    -webkit-transition: opacity 0.4s ease 0.25s, -webkit-transform 0.4s ease 0.25s;
}

.aafe-feature-tabs__panel.is-active .aafe-feature-tabs__overlay-badge {
    opacity: 1;
    transform: translateY(0);
}

/* Position variants */
.aafe-feature-tabs__overlay-badge--top-right    { top: var(--legacy-badge-offset, 0px); right: var(--legacy-badge-offset, 0px); bottom: auto; left: auto; }
.aafe-feature-tabs__overlay-badge--top-left     { top: var(--legacy-badge-offset, 0px); left: var(--legacy-badge-offset, 0px); bottom: auto; right: auto; }
.aafe-feature-tabs__overlay-badge--bottom-right { bottom: var(--legacy-badge-offset, 0px); right: var(--legacy-badge-offset, 0px); top: auto; left: auto; }
.aafe-feature-tabs__overlay-badge--bottom-left  { bottom: var(--legacy-badge-offset, 0px); left: var(--legacy-badge-offset, 0px); top: auto; right: auto; }

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 767px) {
    .aafe-feature-tabs__wrapper {
        padding: 48px 16px;
    }

    /* panel-wrap uses height: 100% globally */

    .aafe-feature-tabs__panels {
        min-height: 380px;
    }

    .aafe-feature-tabs__tab-title {
        font-size: 16px;
    }

    .aafe-feature-tabs__tab-icon {
        width: 20px;
        height: 20px;
    }

    .aafe-feature-tabs__tab-icon i {
        font-size: 18px;
    }

    .aafe-feature-tabs__overlay-badge {
        font-size: 10px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .aafe-feature-tabs__wrapper {
        padding: 64px 24px;
    }

    .aafe-feature-tabs__grid {
        column-gap: 48px;
    }

    /* panel-wrap uses height: 100% globally */

    .aafe-feature-tabs__panels {
        min-height: 480px;
    }
}

/* =============================================================================
   ELEMENTOR EDITOR FIXES
   ============================================================================= */
/* Fix for overflow issues in editor */
.elementor-editor-active .elementor-element:has(.aafe-feature-tabs__wrapper),
.elementor-editor-active .elementor-widget-wrap:has(.aafe-feature-tabs__wrapper),
.elementor-editor-active .elementor-widget-container:has(.aafe-feature-tabs__wrapper),
.elementor-editor-active .elementor-section-wrap:has(.aafe-feature-tabs__wrapper) {
    overflow: visible !important;
}
