/* --- RESET WRAPPER --- */
.qtech-dual-wrapper,
.qtech-dual-wrapper * {
    box-sizing: border-box !important;
}

/* DESKTOP: MAIN CONTAINER */
.qtech-dual-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
    width: 100%;
    gap: 0;
    position: relative;
}

/* --- LEFT COLUMN: NAVIGATION --- */
.qtech-nav-col {
    width: 35% !important;
    min-width: 250px;
    flex-shrink: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    border-right: 1px solid rgba(255,255,255,0.1);
    margin-right: 40px;
}

.qtech-nav-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
    position: relative;
    padding: 15px 0 15px 25px;
}

.qtech-nav-item.active,
.qtech-nav-item:hover {
    opacity: 1;
}

.qtech-nav-line {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    height: 100%;
    width: 3px;
    background-color: currentColor;
    transition: transform 0.3s ease;
    transform-origin: center;
}

.qtech-nav-item.active .qtech-nav-line {
    transform: translateY(-50%) scaleY(0.6);
}

h3.qtech-nav-text {
    font-size: 20px !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: inherit;
}

/* --- RIGHT COLUMN --- */
.qtech-display-col {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* Individual Content Item — Desktop */
.qtech-display-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 1;
}

.qtech-display-item.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 2;
}

/* Accordion header — HIDDEN on desktop */
.qtech-accordion-header {
    display: none !important;
}

/* Accordion body — transparent passthrough on desktop */
.qtech-accordion-body {
    display: contents;
}

/* Text Wrapper */
.qtech-text-wrapper {
    flex: 1;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h3.qtech-display-title {
    font-size: 32px !important;
    line-height: 1.2 !important;
    font-weight: 700 !important;
    margin: 0 0 20px 0 !important;
}

.qtech-display-desc {
    font-size: 16px !important;
    line-height: 1.6 !important;
    opacity: 0.9;
}

/* Image Wrapper */
.qtech-img-wrapper {
    width: 250px !important;
    height: 250px !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qtech-img-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* =============================================
   VIDEO ITEM — Desktop
   ============================================= */
.qtech-display-item.is-video {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
}

/* Video wrapper: relative so overlay + text can sit on top */
.qtech-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.qtech-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 8px;
}

/* Gradient overlay between video and text — color set via Elementor controls (inline style) */
.qtech-video-overlay {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
}

/* Text overlaid on top of the video — same position as image text */
.qtech-video-text {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 55% !important;
    z-index: 2;
    padding: 30px !important;
    flex: none !important;
    padding-right: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

/* Always show title inside video text overlay */
.qtech-display-item.is-video .qtech-video-text .qtech-display-title {
    display: block !important;
    color: #ffffff !important;
}

.qtech-display-item.is-video .qtech-video-text .qtech-display-desc {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================================
   MOBILE <= 767px — exactly mirrors steps widget
   ============================================================ */
@media (max-width: 767px) {

    .qtech-dual-wrapper {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        overflow-x: hidden;
        overflow-y: visible;
        padding: 4px 0 16px;
    }

    .qtech-nav-col {
        display: none !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .qtech-display-col {
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 8px;
    }

    /* ALL cards base — mirrors .qtech-step-card mobile */
    .qtech-display-item {
        position: static !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 12px;
        background: #111111;
        border: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
        overflow: hidden !important;
        min-height: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        z-index: auto !important;
        display: block !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        transition:
            background 0.4s ease,
            border-color 0.4s ease,
            box-shadow 0.4s ease;
    }

    /* COLLAPSED — 48px pill, mirrors .qtech-step-card:not(.active) */
    .qtech-display-item:not(.active) {
        height: 48px !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .qtech-display-item:not(.active):active {
        background: #1c1c1c !important;
        transform: scale(0.99);
    }

    /* ACTIVE card — mirrors .qtech-step-card.active */
    .qtech-display-item.active {
        flex: 0 0 auto !important;
        width: 100%;
        height: auto !important;
        border-radius: 16px;
        background: linear-gradient(160deg, #1a1212 0%, #161616 60%, #111111 100%);
        border: 1px solid rgba(209, 159, 169, 0.2);
        box-shadow:
            0 0 0 1px rgba(209, 159, 169, 0.08),
            0 8px 32px rgba(0, 0, 0, 0.5),
            0 2px 12px rgba(209, 159, 169, 0.12);
        overflow: hidden !important;
        position: relative;
    }

    /* Top accent line — mirrors steps expandAccent */
    .qtech-display-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20px;
        right: 20px;
        height: 2px;
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(209, 159, 169, 0.6) 30%,
            rgba(209, 159, 169, 0.9) 50%,
            rgba(209, 159, 169, 0.6) 70%,
            transparent 100%
        );
        border-radius: 0 0 2px 2px;
        transform-origin: left center;
        animation: qtechExpandAccent 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
        z-index: 1;
    }

    @keyframes qtechExpandAccent {
        from { transform: scaleX(0); }
        to   { transform: scaleX(1); }
    }

    @keyframes qtechSlideInTitle {
        from { opacity: 0; transform: translateY(6px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes qtechFadeUpContent {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* ── ACCORDION HEADER (collapsed row) ──
       mirrors .qtech-step-card:not(.active) .qtech-step-inner */
    .qtech-accordion-header {
        all: unset !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 48px !important;
        padding: 0 16px !important;
        box-sizing: border-box !important;
        gap: 8px !important;
        overflow: hidden !important;
        cursor: pointer !important;
    }

    /* Accent dot — mirrors ::before on step-inner */
    .qtech-accordion-header::before {
        content: '';
        display: block;
        width: 5px;
        height: 5px;
        min-width: 5px;
        border-radius: 50%;
        background: rgba(209, 159, 169, 0.5);
        flex-shrink: 0;
    }

    /* Chevron — mirrors ::after on step-inner */
    .qtech-accordion-header::after {
        content: '';
        display: block;
        width: 6px;
        height: 6px;
        min-width: 6px;
        border-right: 1.5px solid rgba(255, 255, 255, 0.3);
        border-bottom: 1.5px solid rgba(255, 255, 255, 0.3);
        transform: rotate(-45deg);
        flex-shrink: 0;
        margin-left: auto;
    }

    /* Hide SVG chevron — using CSS ::after instead */
    .qtech-accordion-chevron {
        display: none !important;
    }

    /* Title in collapsed header */
    .qtech-accordion-header h3 {
        all: unset !important;
        display: block !important;
        flex: 1 1 0% !important;
        min-width: 0 !important;
        color: rgba(255, 255, 255, 0.85) !important;
        font-size: 13.5px !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        animation: none !important;
    }

    /* Active card — header becomes the title row inside */
    .qtech-display-item.active .qtech-accordion-header {
        height: auto !important;
        padding: 22px 20px 0 !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        position: relative !important;
        z-index: 1 !important;
        gap: 0 !important;
    }

    /* Hide dot and chevron when active */
    .qtech-display-item.active .qtech-accordion-header::before,
    .qtech-display-item.active .qtech-accordion-header::after {
        display: none !important;
    }

    /* Active title — mirrors .qtech-step-card.active .qtech-step-title */
    .qtech-display-item.active .qtech-accordion-header h3 {
        all: unset !important;
        display: block !important;
        font-size: 21px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        color: #ffffff !important;
        white-space: normal !important;
        width: 100% !important;
        animation: qtechSlideInTitle 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
    }

    /* ── ACCORDION BODY ── */
    .qtech-accordion-body {
        display: block !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
        padding: 0;
        position: relative;
        z-index: 1;
    }

    .qtech-display-item.active .qtech-accordion-body {
        max-height: 800px;
        padding: 14px 20px 24px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        margin: 0 20px;
    }

    /* Text wrapper — mirrors .qtech-step-card.active .qtech-step-body */
    .qtech-text-wrapper {
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        width: 100% !important;
        text-align: left !important;
        margin: 0 !important;
        opacity: 0;
        transform: translateY(12px);
        animation: qtechFadeUpContent 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) 0.12s forwards;
    }

    /* Hide title inside body on mobile (title is in header) */
    .qtech-text-wrapper .qtech-display-title {
        display: none !important;
    }

    .qtech-display-desc {
        font-size: 13.5px !important;
        line-height: 1.65 !important;
        color: rgba(255, 255, 255, 0.65) !important;
        margin: 0 !important;
    }

    .qtech-display-desc p {
        margin: 0 !important;
    }

    /* Image — mirrors .qtech-step-card.active .qtech-step-media */
    .qtech-img-wrapper {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        margin-top: 16px !important;
        flex-shrink: 0 !important;
        animation: qtechFadeUpContent 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) 0.22s both !important;
    }

    .qtech-img-wrapper img {
        width: 100% !important;
        height: auto !important;
        max-height: 240px !important;
        object-fit: contain !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        display: block !important;
    }

    /* ── VIDEO MOBILE ── */

    /* Strip the card's own background — video fills the whole card */
    .qtech-display-item.is-video.active {
        background: #111111 !important;
        border-color: rgba(209, 159, 169, 0.2) !important;
    }

    /* accordion body: no padding/margin/border — video goes edge-to-edge */
    .qtech-display-item.is-video.active .qtech-accordion-body {
        padding: 0 !important;
        margin: 0 !important;
        border-top: none !important;
        max-height: 800px;
    }

    /* Video wrapper: 16:9 with relative positioning for overlay + text */
    .qtech-display-item.is-video .qtech-video-wrapper {
        position: relative !important;
        width: 100% !important;
        padding-top: 56.25% !important;
        height: 0 !important;
        border-radius: 0 0 14px 14px !important;
        overflow: hidden !important;
    }

    .qtech-display-item.is-video .qtech-video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        object-fit: cover !important;
    }

    /* Overlay — color/direction controlled via Elementor (inline style), just ensure positioning */
    .qtech-display-item.is-video .qtech-video-overlay {
        position: absolute !important;
        inset: 0 !important;
        border-radius: 0 !important;
        z-index: 1 !important;
    }

    /* Text: sits at bottom of video, above overlay */
    .qtech-display-item.is-video .qtech-video-text {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        padding: 20px 18px 22px !important;
        z-index: 2 !important;
        justify-content: flex-end !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    /* Title inside video — shown (overrides the general hide rule) */
    .qtech-display-item.is-video .qtech-video-text .qtech-display-title {
        display: block !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        color: #ffffff !important;
        margin-bottom: 5px !important;
        animation: qtechSlideInTitle 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards !important;
    }

    /* Description inside video */
    .qtech-display-item.is-video .qtech-video-text .qtech-display-desc {
        font-size: 12px !important;
        line-height: 1.55 !important;
        color: rgba(255, 255, 255, 0.75) !important;
        margin: 0 !important;
        opacity: 0;
        animation: qtechFadeUpContent 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) 0.1s forwards !important;
    }

    .qtech-display-item.is-video .qtech-video-text .qtech-display-desc p {
        margin: 0 !important;
    }

    /* Accordion header on video: same collapsed pill as other cards */
    .qtech-display-item.is-video:not(.active) .qtech-accordion-header {
        height: 48px !important;
    }

    /* When video is active, hide the accordion header entirely —
       title lives inside the video overlay */
    .qtech-display-item.is-video.active .qtech-accordion-header {
        display: none !important;
    }
}

/* ===== TABLET 768px–1024px ===== */
@media (min-width: 768px) and (max-width: 1024px) {

    .qtech-dual-wrapper {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        overflow-x: hidden;
        padding: 4px 0 16px;
    }

    .qtech-nav-col {
        display: none !important;
        width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .qtech-display-col {
        width: 100% !important;
        height: auto !important;
        position: static !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px;
    }

    .qtech-display-item {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        display: block !important;
        padding: 0 !important;
        margin-bottom: 0 !important;
        background: rgba(255,255,255,0.02);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        overflow: hidden;
    }

    .qtech-accordion-header {
        display: flex !important;
        align-items: center;
        padding: 18px 20px;
        cursor: pointer;
        gap: 12px;
    }

    .qtech-accordion-header h3 {
        flex: 1;
        font-size: 16px !important;
        font-weight: 600 !important;
        margin: 0 !important;
        color: rgba(255,255,255,0.7);
    }

    .qtech-display-item.active .qtech-accordion-header h3 {
        color: #ffffff !important;
    }

    .qtech-accordion-chevron {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        opacity: 0.4;
        transition: transform 0.3s ease, opacity 0.3s ease;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .qtech-display-item.active .qtech-accordion-chevron {
        transform: rotate(180deg);
        opacity: 1;
    }

    .qtech-accordion-body {
        display: block !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }

    .qtech-display-item.active .qtech-accordion-body {
        max-height: 800px;
        padding: 0 20px 20px;
    }

    .qtech-text-wrapper {
        padding: 0 0 16px 0 !important;
        width: 100%;
        text-align: left;
        display: flex !important;
        flex-direction: column !important;
    }

    h3.qtech-display-title {
        font-size: 22px !important;
        margin-bottom: 12px !important;
    }

    .qtech-display-desc {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .qtech-img-wrapper {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 16px;
        order: -1;
        display: flex !important;
        justify-content: center !important;
    }

    .qtech-img-wrapper img {
        max-height: 220px !important;
        width: auto !important;
        object-fit: contain !important;
        border-radius: 12px !important;
    }

    /* Tablet video */
    .qtech-display-item.is-video.active .qtech-accordion-body {
        padding: 0 !important;
    }

    .qtech-display-item.is-video .qtech-video-wrapper {
        position: relative;
        width: 100%;
        padding-top: 56.25%;
        height: 0;
        overflow: hidden;
        border-radius: 0;
    }

    .qtech-display-item.is-video .qtech-video {
        position: absolute;
        top: 0; left: 0;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        border-radius: 0;
    }

    /* Overlay — positioning only; color/direction from inline style */
    .qtech-display-item.is-video .qtech-video-overlay {
        position: absolute;
        inset: 0;
        border-radius: 0;
        z-index: 1;
    }

    /* Tablet video text: anchored bottom */
    .qtech-display-item.is-video .qtech-video-text {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100% !important;
        padding: 20px 20px 24px !important;
        z-index: 2;
        justify-content: flex-end !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .qtech-display-item.is-video .qtech-video-text .qtech-display-title {
        display: block !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        margin-bottom: 8px !important;
    }

    .qtech-display-item.is-video .qtech-video-text .qtech-display-desc {
        font-size: 13.5px !important;
        color: rgba(255, 255, 255, 0.8) !important;
    }
}

/* ===== EXTRA SMALL <= 480px ===== */
@media (max-width: 480px) {

    .qtech-display-item:not(.active) {
        height: 44px !important;
    }

    .qtech-accordion-header {
        height: 44px !important;
        padding: 0 14px !important;
    }

    .qtech-accordion-header h3 {
        font-size: 12.5px !important;
    }

    .qtech-display-item.active:not(.is-video) .qtech-accordion-header {
        padding: 18px 16px 0 !important;
    }

    .qtech-display-item.active:not(.is-video) .qtech-accordion-header h3 {
        font-size: 18px !important;
    }

    .qtech-display-item.active:not(.is-video) .qtech-accordion-body {
        padding: 12px 16px 20px;
        margin: 0 16px;
    }

    /* Video: tighter text padding on very small screens */
    .qtech-display-item.is-video .qtech-video-text {
        padding: 14px 14px 18px !important;
    }

    .qtech-display-item.is-video .qtech-video-text .qtech-display-title {
        font-size: 15px !important;
    }

    .qtech-display-item.is-video .qtech-video-text .qtech-display-desc {
        font-size: 11px !important;
    }

    .qtech-display-desc {
        font-size: 12.5px !important;
    }

    .qtech-img-wrapper img {
        max-height: 200px !important;
    }
}