/* =========================================================================
   CP2 FOR DIVERSITY - MASTER STYLESHEET
   Version: 1.21
   ========================================================================= */

/* --- 1. CORE WRAPPER & UTILITIES --- */
script[id^="Abi-"][type="application/json"] { 
    display: none !important; 
}

.cp2-wrapper { 
    margin: 20px 0; 
    margin-bottom: 20px;
    font-family: inherit; 
}

[data-cp2-rendered="true"] { 
    display: block; 
}

.cp2-section-title {
    text-align: center;
    margin-bottom: 25px;
    width: 100%;
    flex-basis: 100%;
}






/* --- CP2 GRID SYSTEM (Abi-Shopwindow / Abi-Grid) --- */

/* --- Centreringsfix för Innehåll --- */

/* Grundinställning: Centrera alltid innehåll vertikalt och horisontellt */
.cp2-slot-content {
    position: relative;
    z-index: 5;
    padding: 20px;
    width: 100%;
    height: 100%; /* Default till 100% för att centrera i hela rutan */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertikal centrering */
    align-items: center;     /* Horisontell centrering */
    text-align: center;
}

/* Standalone Mode: Justering när BÅDE bild och text finns */
.cp2-slot-standalone .cp2-slot-media-wrap {
    height: 50% !important;
    flex: 0 0 50% !important;
    width: 100%;
    overflow: hidden;
}

/* Om en standalone-slot har en bild, tvinga texten till nedre 50% */
.cp2-slot-standalone:has(.cp2-slot-media-wrap) .cp2-slot-content {
    height: 50% !important;
    flex: 0 0 50% !important;
}

/* Om en standalone-slot SAKNAR bild (som i ditt exempel), 
   låt innehållet ta 100% höjd så det centreras i mitten */
.cp2-slot-standalone:not(:has(.cp2-slot-media-wrap)) .cp2-slot-content {
    height: 100% !important;
    flex: 1 0 100% !important;
}

/* Inre wrapper-säkerhet */
.cp2-slot-content-inner {
    max-height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 1. Container - Hanterar rutnätet och de globala variablerna */
.cp2-grid-container {
    display: grid;
    gap: 15px; /* Standardgap, kan justeras */
    width: 100%;
    margin: 0 auto;
    /* Använder CSS-variabler injicerade från JS */
    grid-template-columns: repeat(var(--m-cols, 2), 1fr);
    /* Tvingar containern att hålla rätt ratio baserat på desktop/mobile */
}

/* 2. Slot - Grundstilen för varje ruta */
.cp2-slot {
    position: relative;
    overflow: hidden; /* Viktigt: klipper allt som flödar över */
    display: flex;
    flex-direction: column;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 4px;
    z-index: 1;
    transition: transform 0.2s ease-in-out;
    /* Default mobil ratio */
    aspect-ratio: var(--ratio-m, 4/3);
}

.cp2-slot:hover { 
    transform: scale(1.01); 
}

/* 3. Länk - Täcker hela ytan */
.cp2-slot-link {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 10; /* Ligger överst så hela ytan är klickbar */
    text-decoration: none;
}

/* 4. Innehållshantering - Text och layout */
.cp2-slot-content {
    position: relative;
    z-index: 5;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

/* Inre wrapper för att kontrollera textflöde */
.cp2-slot-content-inner {
    max-height: 100%;
    width: 100%;
    overflow: hidden;
}

/* 5. STANDALONE MODE - Strikt 50/50 vertikal fördelning */
.cp2-slot-standalone {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Bilden börjar i topp */
}

.cp2-slot-standalone .cp2-slot-media-wrap {
    height: 50% !important;
    flex: 0 0 50% !important; /* Tvingar exakt 50% höjd */
    width: 100%;
    overflow: hidden;
}

.cp2-slot-standalone .cp2-slot-img-standalone {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top; /* Som begärt: fokusera på toppen av bilden */
    display: block;
}

.cp2-slot-standalone .cp2-slot-content {
    height: 50% !important;
    flex: 0 0 50% !important; /* Tvingar exakt 50% höjd */
    overflow: hidden; /* Förhindrar att för mycket text trycker ut höjden */
    padding: 15px;
}

/* 6. BACKGROUND MODE - Texten täcker hela ytan */
.cp2-slot-background .cp2-slot-content {
    height: 100%;
    flex: 1;
}

/* 7. OVERLAYS - För bakgrundsbilder */
.cp2-overlay-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.cp2-overlay-light::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

/* 8. TEXTFÄRGER */
.cp2-text-light, 
.cp2-text-light .cp2-slot-content {
    color: #ffffff;
}

.cp2-text-dark, 
.cp2-text-dark .cp2-slot-content {
    color: #333333;
}

/* 9. RESPONSIVITET - Desktop-justeringar */
@media (min-width: 768px) {
    .cp2-grid-container {
        grid-template-columns: repeat(var(--cols, 4), 1fr);
    }
    
    .cp2-slot {
        aspect-ratio: var(--ratio-d, 16/9);
    }
}

.cp2-slot-content-inner h2 {font-size: 18px;margin-top: 0;}
.cp2-slot-content-inner p {margin-top: 0;}
/* --- CP2 GRID SPECIFIK KNAPPDESIGN --- */

/* Grunddesign för knappar enbart inuti Griden */
.cp2-slot-content .cp2-btn {
    display: inline-block;
    appearance: none;
    border: none;
    padding: 8px 18px; /* Mindre grundstorlek för grid */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    position: relative;
    z-index: 11;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    line-height: 1;
}

/* Färgteman isolerade till griddens textinställning */
.cp2-text-light .cp2-slot-content .cp2-btn { 
    background-color: #ffffff; 
    color: #1a1a1a; 
}

.cp2-text-dark .cp2-slot-content .cp2-btn { 
    background-color: #1a1a1a; 
    color: #ffffff; 
}

/* Hover-effekt enbart för grid-knappar */
.cp2-slot-content .cp2-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* --- Grid Layout fixar --- */
.cp2-slot-content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Avstånd mellan rubrik och knapp */
}

/* Justering av rubriker inuti griden för att matcha den mindre knappen */
.cp2-slot-content-inner h2 {
    margin: 0;
    font-size: 1.3rem; /* Något mer kompakt för grid */
    line-height: 1.2;
}
.cp2-slot-content-inner h2 { margin: 0; font-size: 1.4rem; }
.cp2-slot-content-inner p { margin: 0; font-size: 0.9rem; }







/* --- 3. ACCORDION (Abi-Faq) --- */
.cp2-accordion { 
    border: 1px solid #ddd; 
    border-radius: 4px; 
}

.cp2-acc-item { 
    border-bottom: 1px solid #eee; 
}

.cp2-acc-item:last-child { 
    border-bottom: none; 
}

.cp2-acc-header { 
    width: 100%; 
    text-align: left; 
    padding: 15px 20px; 
    background: #f9f9f9; 
    border: none; 
    cursor: pointer; 
    font-weight: bold; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    font-family: inherit;
}

.cp2-acc-header::after { 
    content: '+'; 
    font-size: 1.2rem; 
    transition: transform 0.2s;
}

.cp2-acc-item.active .cp2-acc-header::after { 
    content: '-';
    transform: rotate(180deg);
}

.cp2-acc-content { 
    display: none; 
    padding: 15px 20px; 
    background: #fff; 
    border-top: 1px solid #eee;
}

.cp2-acc-item.active .cp2-acc-content { 
    display: block; 
}

/* --- 4. VIDEO (Abi-Video) --- */
.cp2-video-wrapper { 
    width: 100%; 
    position: relative; 
    aspect-ratio: var(--video-ratio-d, 16/9); 
}

.cp2-video-resizer { 
    position: relative; 
    width: 100%; 
    height: 0; 
    background: #000;
    overflow: hidden;
    border-radius: 4px;
    padding-bottom: 56.25%; /* Fallback 16:9 */
}

.cp2-video-wrapper iframe,
.cp2-video-resizer iframe,
.cp2-responsive-video iframe { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    border: 0;
    display: block;
}

@media (max-width: 767px) { 
    .cp2-video-wrapper { 
        aspect-ratio: var(--video-ratio-m, 4/3); 
    } 
}

/* --- 5. SPACER (Abi-Spacer) --- */
.cp2-spacer { 
    width: 100%; 
    display: block; 
}

/* --- 6. SLIDESHOW (Abi-Slideshow) --- */
.cp2-slideshow-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px; /* Standard avrundning */
    background: #f8f9fa;
}

.cp2-slideshow-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; /* Tvingar slides att snäppa fast */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cp2-slideshow-track::-webkit-scrollbar {
    display: none;
}

.cp2-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    aspect-ratio: var(--ratio-m, 4/3); /* Mobil ratio från JS */
    display: flex;
    flex-direction: column;
}

/* --- Innehåll & Typografi --- */
.cp2-slide-content {
    position: relative;
    z-index: 5;
    padding: 30px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px; /* Avstånd mellan rubrik, text och knapp */
}

/* Grunddesign för textelementen */
.cp2-slide-content h2 { margin: 0; font-size: 2rem; font-weight: 700; line-height: 1.2; }
.cp2-slide-content h3 { margin: 0; font-size: 1.75rem; font-weight: 600; }
.cp2-slide-content p { margin: 0; font-size: 1.1rem; line-height: 1.5; max-width: 600px; }
/* --- CP2 SLIDESHOW SPECIFIK KNAPPDESIGN --- */

/* Grunddesign för knappar enbart inuti Slideshow */
.cp2-slide-content .cp2-btn {
    display: inline-block;
    appearance: none;
    border: none;
    padding: 14px 32px; /* Större padding för hjälteknappar */
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-top: 15px;
    position: relative;
    z-index: 11; /* Ligger ovanpå .cp2-slot-link (z-index 8) */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-decoration: none;
    line-height: 1;
}

/* Färgteman baserat på slideshowens textinställning */
.cp2-text-light .cp2-slide-content .cp2-btn {
    background-color: #ffffff;
    color: #1a1a1a;
}

.cp2-text-dark .cp2-slide-content .cp2-btn {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Hover-effekter för slideshow-knappar */
.cp2-slide-content .cp2-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 14px rgba(0,0,0,0.15);
    opacity: 1;
}

.cp2-text-light .cp2-slide-content .cp2-btn:hover {
    background-color: #f2f2f2;
}

.cp2-text-dark .cp2-slide-content .cp2-btn:hover {
    background-color: #333333;
}

/* Aktiv/Tryckt effekt */
.cp2-slide-content .cp2-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

/* Global länk-yta för slides (z-index lägre än knappen) */
.cp2-slide .cp2-slot-link {
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    z-index: 8;
    text-decoration: none;
}

/* --- Standalone Mode (Bild i topp, text i botten) --- */
.cp2-slide-standalone .cp2-slide-media-wrap {
    height: 50% !important;
    flex: 0 0 50% !important;
    width: 100%;
    overflow: hidden;
}

.cp2-slide-img-standalone {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Logik för vertikal 50/50-fördelning */
.cp2-slide-standalone:has(.cp2-slide-media-wrap) .cp2-slide-content {
    height: 50% !important;
    flex: 0 0 50% !important;
}

/* Centrera om bild saknas trots standalone-inställning */
.cp2-slide-standalone:not(:has(.cp2-slide-media-wrap)) .cp2-slide-content {
    height: 100% !important;
    flex: 1 0 100% !important;
}

/* --- Overlays & Kontrast --- */
.cp2-overlay-dark::before {
    content: ""; position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.4); z-index: 1;
}

.cp2-overlay-light::before {
    content: ""; position: absolute; inset: 0;
    background: rgba(255, 255, 255, 0.4); z-index: 1;
}

.cp2-text-light { color: #ffffff; }
.cp2-text-dark { color: #212529; }

/* --- Pilar & Dots --- */
.cp2-slideshow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
    border: none;
    color: #000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.cp2-slideshow-arrow.prev { left: 15px; }
.cp2-slideshow-arrow.next { right: 15px; }

.cp2-slideshow-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.cp2-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- Desktop-anpassning --- */
@media (min-width: 768px) {
    .cp2-slide { aspect-ratio: var(--ratio-d, 16/9); }
    .cp2-slide-content { padding: 60px; }
    .cp2-slide-content h2 { font-size: 3rem; }
}


/* --- 7. TESTIMONIALS (Abi-Testimonials) --- */
.cp2-testimonials-container {
    width: 100%;
    margin: 30px 0;
}

.cp2-testimonials-track {
    display: flex;
    gap: 20px;
    padding: 10px;
}

.cp2-review-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.cp2-review-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.cp2-review-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    margin-bottom: 15px;
    border: 3px solid #f8f9fa;
    flex-shrink: 0;
}

.cp2-review-rating {
    color: #ffc107;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.cp2-review-text {
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
    flex-grow: 1;
}

.cp2-review-author {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem;
}

.cp2-mode-list .cp2-testimonials-track {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 576px) {
    .cp2-mode-list .cp2-testimonials-track { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
    .cp2-mode-list .cp2-testimonials-track { grid-template-columns: repeat(4, 1fr); }
}

.cp2-mode-slider .cp2-testimonials-track {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.cp2-mode-slider .cp2-review-card {
    scroll-snap-align: center;
    flex: 0 0 85%;
}

@media (min-width: 768px) {
    .cp2-mode-slider .cp2-review-card { flex: 0 0 45%; }
}

.cp2-testimonials-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.cp2-nav-btn {
    background: #eee;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.cp2-nav-btn:hover { background: #ddd; }

/* --- 8. TABS (Abi-Tabs) --- */
.cp2-tabs-container { display: flex; flex-wrap: wrap; }
.cp2-tabs-container.cp2-tabs-vertical { display: flex; gap: 20px; }
.cp2-tabs-vertical .cp2-tabs-nav { display: flex; flex-direction: column; min-width: 200px; flex: 0 0 250px; }

.cp2-tab-trigger { padding: 10px 20px; cursor: pointer; border: 1px solid #ddd; background: #f9f9f9; font-family: inherit; }
.cp2-tab-trigger.active { background: #fff; border-bottom-color: transparent; font-weight: bold; }
.cp2-tabs-vertical .cp2-tab-trigger.active { border-bottom-color: #ddd;}

.cp2-tab-panel { display: none; padding: 20px; border: 1px solid #ddd; background: #fff; width: 100%; }
.cp2-tab-panel.active { display: block; }
.cp2-tab-panel-vertical { border: 0; }
.cp2-tabs-vertical .cp2-tabs-content { flex: 1; }

.cp2-tab-panel-inner { display: flex; gap: 20px; flex-wrap: wrap; }
.cp2-tab-panel-inner.img-pos-right { flex-direction: row-reverse; }
.cp2-tab-image { flex: 1; min-width: 250px; }
.cp2-tab-image img { width: 100%; height: auto; object-fit: cover; }
.cp2-tab-text { flex: 2; min-width: 250px; }

/* --- 9. FEATURE BLOCK (Abi-Feature) --- */
.cp2-feature-container {
    display: flex; gap: 40px; align-items: center; margin: 40px 0; flex-wrap: wrap;
}

.cp2-feature-container.cp2-pos-left { flex-direction: row-reverse; }
.cp2-feature-text, .cp2-feature-media { flex: 1; min-width: 300px; }
.cp2-feature-img { width: 100%; height: auto; border-radius: 8px; display: block; }

.cp2-responsive-video {
    position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 8px;
}

.cp2-feature-caption { font-size: 0.85em; color: #666; margin-top: 8px; text-align: center; }

@media (max-width: 768px) {
    .cp2-feature-container { gap: 20px; }
    .cp2-feature-container.cp2-pos-left, 
    .cp2-feature-container.cp2-pos-right { flex-direction: column; }
}

/* --- 10. BUTTON COMPONENT (Abi-Button) --- */
.cp2-button-container, .cp2-btn-container {
    width: 100%; display: flex; margin: 1.5rem 0;
}

.cp2-btn {
    display: inline-flex; align-items: center; justify-content: center;
    text-decoration: none; border-radius: 4px; font-family: inherit;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    border: 1px solid transparent; cursor: pointer; line-height: 1.2; text-align: center;
}

.cp2-btn:hover { transform: translateY(-1px); filter: brightness(0.9); opacity: 0.85; text-decoration: none; }

.cp2-btn-primary { background-color: #007bff; color: #ffffff !important; }
.cp2-btn-secondary { background-color: #6c757d; color: #ffffff !important; }
.cp2-btn-success { background-color: #28a745; color: #ffffff !important; }
.cp2-btn-info { background-color: #17a2b8; color: #ffffff !important; }
.cp2-btn-warning { background-color: #ffc107; color: #212529 !important; }
.cp2-btn-danger { background-color: #dc3545; color: #ffffff !important; }

.cp2-btn-link { background-color: transparent; color: #007bff; text-decoration: underline; }
.cp2-btn-link:hover { background-color: rgba(0, 123, 255, 0.08); filter: none; }

.cp2-btn-sm { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.cp2-btn-md { padding: 0.6rem 1.2rem; font-size: 1rem; }
.cp2-btn-lg { padding: 0.8rem 1.8rem; font-size: 1.25rem; font-weight: 600; }

.cp2-btn-block { width: 100%; display: flex; }

@media (max-width: 768px) { .cp2-btn { width: 100%; } }