/* Enwell Tabs – Frontend styles */

/* ====== KNAPPAR ====== */

.enwell-tabs {
    --enwell-btn-bg: #184969;
    --enwell-btn-bg-active: #516b5c;
    --enwell-btn-text: #ffffff;
    --enwell-btn-radius: 999px;
    --enwell-btn-gap: 12px;
    --enwell-btn-padding: 10px 30px;
    --enwell-btn-icon-size: 40px;
    --enwell-btn-font-size: 14px;
    --enwell-heading-width: 70%;
    --enwell-content-bg: #ffffff;

    width: 100%;
}

/* Heading-grid – 4 kolumner desktop, centrerat */
.enwell-tabs .e-n-tabs-heading {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: var(--enwell-heading-width);
    max-width: none;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

@media (max-width: 1024px) {
    .enwell-tabs {
        --enwell-heading-width: 100%;
    }
}

@media (max-width: 767px) {
    .enwell-tabs .e-n-tabs-heading {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Knappen */
.enwell-tabs .e-n-tab-title {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: var(--enwell-btn-gap);
    background: var(--enwell-btn-bg);
    color: var(--enwell-btn-text);
    border: none;
    border-radius: var(--enwell-btn-radius);
    padding: var(--enwell-btn-padding);
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 600;
    font-size: var(--enwell-btn-font-size);
    line-height: 1.2;
    transition: background 0.2s ease;
    width: 100%;
    text-align: left;
    box-shadow: none;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.enwell-tabs .e-n-tab-title:hover,
.enwell-tabs .e-n-tab-title:focus,
.enwell-tabs .e-n-tab-title[aria-selected="true"] {
    background: var(--enwell-btn-bg-active);
    outline: none;
}

/* Ikonen – SVG har egen vit cirkel inbyggd */
.enwell-tabs .e-n-tab-title .e-n-tab-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    background: transparent;
    line-height: 0;
}

.enwell-tabs .e-n-tab-title .e-n-tab-icon svg {
    width: var(--enwell-btn-icon-size);
    height: var(--enwell-btn-icon-size);
    display: block;
}

.enwell-tabs .e-n-tab-title .e-n-tab-title-text {
    flex: 1;
    text-align: left;
    color: inherit;
    padding: 0;
    margin: 0;
    line-height: 1.2;
}

/* Mobil – mindre text och ikon */
@media (max-width: 767px) {
    .enwell-tabs {
        --enwell-btn-font-size: 12px;
        --enwell-btn-icon-size: 20px;
        --enwell-btn-padding: 8px 16px;
        --enwell-btn-gap: 8px;
    }
}


/* ====== TAB-CONTENT (desktop inline) ====== */

.enwell-tabs .e-n-tabs-content {
    margin-top: 24px;
}

/* Tabpanel-bakgrund – ärvs av aktiv flik. Override:s i ditt tema vid behov. */
.enwell-tabs .e-n-tabs-content > [role="tabpanel"] {
    
}
.enwell-tabs .toggle-content > .elementor > .e-con-boxed.e-parent {
    background-color: #fff;
}

/* BILD I TAB CONTAINER */

@media (min-width: 768px) {
    /* Tvinga parent att stretcha kolumnerna */
    .enwell-tabs .toggle-content .e-con-inner {
        align-items: stretch !important;
    }

    /* Bildkolumnen fyller höjden */
    .enwell-tabs .toggle-content .e-con-inner > .e-con:first-child {
        align-self: stretch !important;
        height: auto !important;
    }

    /* Höjden ärvs ner till img */
    .enwell-tabs .toggle-content .e-con-inner > .e-con:first-child .elementor-widget-image,
    .enwell-tabs .toggle-content .e-con-inner > .e-con:first-child .elementor-widget-image > .elementor-widget-container {
        height: 100% !important;
    }

    .enwell-tabs .toggle-content .e-con-inner > .e-con:first-child img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* ====== MOBILE OFF-CANVAS OVERLAY ====== */

#enwell-mobile-overlay {
    /* Anpassa i ditt tema vid behov:
       #enwell-mobile-overlay { --enwell-overlay-top: 80px; } */
    --enwell-overlay-top: 0px;
    --enwell-overlay-width: 90%;
    --enwell-overlay-max-width: 480px;

    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* Fallback + dynamisk viewport som respekterar mobil URL-bar */
    height: 100vh;
    height: 100dvh;
    z-index: 9998;
    visibility: hidden;
    pointer-events: none;
}

#enwell-mobile-overlay.active {
    visibility: visible;
    pointer-events: auto;
}

#enwell-mobile-overlay .enwell-overlay-backdrop {
    position: absolute;
    top: var(--enwell-overlay-top);
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

#enwell-mobile-overlay.active .enwell-overlay-backdrop {
    opacity: 1;
}

#enwell-mobile-overlay .enwell-overlay-panel {
    position: absolute;
    top: var(--enwell-overlay-top);
    right: 0;
    bottom: 0;
    width: var(--enwell-overlay-width);
    max-width: var(--enwell-overlay-max-width);
    background: #fff;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Stoppa scroll-chaining till body */
    overscroll-behavior: contain;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    will-change: transform;
}

#enwell-mobile-overlay.active .enwell-overlay-panel {
    transform: translateX(0);
}

#enwell-mobile-overlay .enwell-overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}

#enwell-mobile-overlay .enwell-overlay-close:hover,
#enwell-mobile-overlay .enwell-overlay-close:focus {
    background: rgba(0, 0, 0, 0.85);
    outline: none;
}

/* Off-canvas-behållaren ska ha 0 padding/margin – innehållet styrs av Elementor-mallen */
#enwell-mobile-overlay .enwell-overlay-content,
#enwell-mobile-overlay .enwell-overlay-content > .enwell-mobile-tab-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* Body scroll-lock när overlay är öppen.
   Position-fixed-pattern hanteras av JS för att bevara scroll-position. */
body.enwell-overlay-active {
    overflow: hidden;
}

/* Desktop – overlay aldrig synlig */
@media (min-width: 768px) {
    #enwell-mobile-overlay {
        display: none;
    }
}
