:root {
    --site1: #0b4067;
    --primary-dark: hsl(215, 60%, 20%);
    --accent-color: #f9b237;
    --secondary-light: hsl(40, 100%, 97%);
    --white: #FFFFFF;
    --sand: #fff3db;
    --line-color: #153379;
    --mobile-header-bg: var(--white);
}

/* --- כללי לכרטיס (דסקטופ) --- */
.services-card {
    margin: 1rem 0;
    position: relative;
    display: flex;
    border-top: 1px solid #E0E0E0;
    padding: 3rem 0;
}
.image-title-wrapper {
    display: flex;
    flex-direction: column;
    width: 400px;
}
.services-card a {
    color: #2b2d71;
    font-size: 1.2rem;
}

/* --- כותרת הכרטיס והתמונה (.services-card-header) - דסקטופ --- */
.services-card-header {
    background-color: #ffffff;
    background-size: cover;
    background-position: center center;
    position: relative;
    z-index: 1;
    display: table-cell;
    padding: 1.5rem;
    min-height: 250px;
    width: 400px;
    filter: brightness(0.95) contrast(1.05);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 10px solid white;
    margin-right: -64px;
    box-shadow: 0px 8px 16px rgb(0 0 0 / 23%);
    position: relative;
    overflow: visible;
}

.services-card-header:after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: -35px;
    width: 0;
    height: 0;
    border-top: 25px solid #8e8faf;
    border-right: 25px solid transparent;
    border-left: 25px solid transparent;
    border-bottom: 25px solid transparent;
    transform: rotate(135deg);
    z-index: 99;
}


.service-card-title {
    background-color: #2b2d71;
    color: #ffffff;
    text-align: right;
    padding: 10px 3rem;
    margin: 2rem;
    width: 98%;
    position: relative;
}

.service-card-title h2 {
    margin: 0;
    font-weight: normal;
    font-size: 2.5rem;
    padding: 0;
    color: white;
}
 
.services-card-body {
    padding: 1.5rem;
    padding-top: 0;
    position: relative;
    min-height: 150px;
    z-index: 1;
    display: table-cell;
    width: 100%;
}

.right-services {
    transform: translateZ(0);
    -webkit-font-smoothing: subpixel-antialiased;
    width: 50%;
    border-right: 1px solid #e0e0e0;
    height: 100%;
}

.left-services {
    height: 100%;
    transform: translateZ(0);
    top: 0;
    left: 0;
    width: 45%;
    position: absolute;
    padding: 0;
    border-right: 1px solid #E0E0E0;
    border-left: 1px solid #E0E0E0;
    margin-right: 1rem;
    background-size: 30%;
    background-position: center center;
    background-repeat: no-repeat;
}
/* --- עיצוב כפתורי הקישורים הראשיים (H3 A) - דסקטופ --- */
.right-services h3 a.toggle-div {
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    text-align: right;
    width: 100%;
    padding: 0.8rem 1rem;
    height: auto;
    border: none;
    border-top: 1px solid #E0E0E0;
    border-right: none;
    border-radius: 0;
    color: #2b2d71;
    background-color: var(--white);
    box-shadow: none;
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: visible;
}

.right-services h3 a.toggle-div::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%);
    width: 80px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6; 
    z-index: 5;
} 

.right-services h3 a.toggle-div.opened::after {
    display: none;
}

.right-services h3 a.toggle-div:hover,
.right-services h3 a.toggle-div.opened {
    background-image: linear-gradient(to left, #ffde8e, #ffffff);
    color: var(--primary-dark);
    transform: none; 
    box-shadow: none;
}
.right-services h3 a.toggle-div:active {
    transform: translateY(0);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1) inset;
}

.right-services h3 a.toggle-div::before {
    content: "«"; 
    font-family: inherit;
    font-size: 1.2em;
    font-weight: normal; 
    margin-right: 0.5rem; 
    margin-left: 0; 
    color: #cccccc; 
    transition: transform 0.2s ease, color 0.2s ease;
}

.right-services h3 a.toggle-div:hover::before,
.right-services h3 a.toggle-div.opened::before {
    color: var(--accent-color); 
}

.right-services h3 a.toggle-div.opened::before {
    transform: rotate(-90deg); 
}

/* --- סגנונות כלליים --- */
.services-card-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.3rem;
}

.services-card-body ul li {
    margin-bottom: .5rem;
}

.services-card-body .toggle-btn {
    font-size: 1.3rem;
    background: var(--site1);
    color: var(--sand);
    display: inline-block;
    padding: .1rem .75rem;
    border-radius: 2rem;
    margin-top: .5rem;
}

.categories-container {
    padding: 1rem;
    padding-top: 3rem;
    list-style: none;
    margin: 0;
}
.services-card-header h2 span {
    border-bottom: var(--line-color) double 7px;
}
.category {
    width: 100%;
    overflow: hidden;
}

.right-services h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: normal;
}

.category-info {
    display: none;
    width: 100%;
    height: 100%;
    background: white;
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--primary-dark);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    margin-top: 10px;
    backface-visibility: initial;
    transform: none;
    -webkit-font-smoothing: initial;
}

.category-info h4 {
    text-align: right;
    font-weight: normal;
    border: 0;
    margin-bottom: 0;
}


.category-info h4 a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    font-weight: normal;
    text-align: right; 
    border: none;
    color: hsl(238.29deg 44.87% 30.59%);
    background-color: var(--white);
    transition: background-color 0.15s ease, color 0.15s ease;
}


.category-info h4 a:hover,
.category-info h4 a.active {
    background-image: linear-gradient(to left, #ffde8e, #ffffff);
    color: var(--primary-dark);
    border-left: 3px solid var(--accent-color); 
    padding-left: 0.75rem;
}

.category-info h4 a:hover em.fa-angle-double-left,
.category-info h4 a.active em.fa-angle-double-left {
    color: var(--accent-color);
}

@media (min-width: 768px) {
    .category-info h4 {
        width: 100%;
    }
}
    
.category-info.opened {
    display: block;
    padding: 1rem;
}

::-webkit-scrollbar-thumb {
    background-color: #ffdb85;
}
.category-info.category-info-show {
    display: block;
}

/* --- מדיה קוורי: טאבלט (עד 1024px) - פריסה אנכית וממורכזת --- */
@media only screen and (max-width: 1024px) {
    .services-card {
        display: block;
        max-width: 600px; 
        margin: 1rem auto;
    }

    .image-title-wrapper {
        width: 100%;
        margin-left: 0;
    }
    .services-card-header {
        display: block;
        width: 100%;
        min-height: auto;
        margin-right: 0;
        box-shadow: none;
        border: none;
        filter: none;
    }

    .services-card-header:after {
        display: none;
    }

    .left-services,
    .right-services {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-left: none;
        padding: 1rem;
        box-sizing: border-box;
        overflow-y: visible;
        min-height: 200px;
        margin-right: 0rem;
    }

    .left-services::before {
        opacity: 0.1;
    }

    .services-card-header h2 {
        text-align: center;
    }

    .service-card-title {
        width: 90%;
        margin: 1rem auto;
        text-align: center;
    }

    .services-card-body {
        display: block;
        padding: 1.5rem;
    }
    
    .right-services {
        column-count: 1 !important; 
    }
}

/* --- מדיה קוורי: מובייל (עד 700px) - סגנון ספציפי למובייל קטן --- */
@media only screen and (max-width: 700px) {

    .services-card-body {
        padding: 1rem;
        padding-top: 0;
    }

    /* כותרת */
    .services-card-header {
        min-height: 75px;
        background: var(--mobile-header-bg);
    }
    
    .services-card-header h2 {
        position: static;
        background: none;
        padding: 1rem 1rem 0;
        font-size: 1.8rem;
        color: var(--primary-dark);
        text-shadow: none;
    }
    
    .services-card-header h2 span {
        border-bottom: var(--primary-dark) double 4px;
    }

    /* תוכן קטגוריה */
    .category-info {
        position: inherit;
        height: 140px;
        overflow-y: auto;
        border: 1px solid var(--primary-dark);
        box-shadow: 0 1px 5px rgba(0,0,0,0.1);
        padding: 0.5rem 1rem;
        margin-top: 10px;
        backface-visibility: initial;
        transform: none;
        -webkit-font-smoothing: initial;
    }

    .right-services {
        padding: 0 1rem;
        column-count: 1;
    }
    
    /* כפתורי H3 */
    .right-services h3 a.toggle-div {
        border-right: none;
        white-space: normal;
        height: auto;
    }

    .right-services h3 a.toggle-div::before {
        color: var(--primary-dark);
    }
}

.left-services {
    opacity: 0.3; 
    transition: opacity 0.4s ease-in-out; 
}
.left-services.content-active {
    opacity: 1; 
}