/* ==========================================================================
   Departments & Medical Specialties Carousel Section (Figma Spec Matched)
   Matching Figma Node 26:17 (Rectangle 11), 26:6, 85:368 (Frame 7)
   ========================================================================== */

.gr-departments-section {
    width: 100%;
    background-color: var(--gr-primary-blue, #2A3EC0);
    margin-top: -260px;
    padding-top: 340px;
    padding-bottom: 110px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.gr-departments-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 31px;
    box-sizing: border-box;
}

/* Header: Title Block, Book Appointment Button, and Far-Right Arrows */
.gr-departments-header {
    margin-bottom: 48px;
    width: 100%;
}

.gr-departments-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    width: 100%;
}

.gr-departments-left-content {
    display: flex;
    align-items: flex-start;
    gap: 36px;
    flex: 1;
    min-width: 0;
}

.gr-departments-title-block {
    max-width: 620px;
}

.gr-departments-title {
    font-family: var(--gr-font-family, 'Instrument Sans', sans-serif);
    font-size: clamp(32px, 3.4vw, 54px);
    font-weight: 400;
    line-height: 1.08;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    margin: 0;
}

.gr-departments-subtitle {
    font-family: var(--gr-font-family, 'Instrument Sans', sans-serif);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.88);
    max-width: 580px;
    margin: 18px 0 0 0;
}

.gr-departments-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 190px;
    height: 44px;
    background-color: #FFFFFF;
    color: var(--gr-primary-blue, #2A3EC0);
    font-family: var(--gr-font-family, 'Instrument Sans', sans-serif);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 0;
    flex-shrink: 0;
    margin-top: 6px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.gr-departments-book-btn:hover {
    background-color: #f0f3fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gr-departments-arrows-group {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    margin-top: 6px;
}

.gr-departments-arrow-btn {
    width: 44px;
    height: 44px;
    background-color: transparent;
    border: 1px solid #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0;
    color: #FFFFFF;
    transition: all 0.2s ease;
}

.gr-departments-arrow-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Slider Track & Cards: Exactly 4 Cards View on Desktop */
.gr-departments-slider-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

.gr-departments-slider-wrapper:active {
    cursor: grabbing;
}

.gr-departments-slider-track {
    display: flex;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
    user-select: none;
}

/* Department Card: Compact refined sizing (380px height, 4 visible per view) */
.gr-dept-card {
    flex: 0 0 calc((100% - 45px) / 4);
    width: calc((100% - 45px) / 4);
    max-width: 340px;
    height: 380px;
    position: relative;
    overflow: hidden;
    background-color: #121A4E;
    text-decoration: none;
    display: block;
    border-radius: 0;
    transition: box-shadow 0.35s ease;
}

.gr-dept-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.gr-dept-card-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 190px;
    background: linear-gradient(180deg, rgba(30, 30, 30, 0) 0%, rgba(30, 30, 30, 0.95) 100%);
    pointer-events: none;
}

.gr-dept-card-title {
    position: absolute;
    bottom: 34px;
    left: 24px;
    right: 20px;
    font-family: var(--gr-font-family, 'Instrument Sans', sans-serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.1;
    color: #FFFFFF;
    margin: 0;
    transform: translateY(0);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), color 0.2s ease;
}

/* Card Hover State - Zoom thumbnail image and move title smoothly */
.gr-dept-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.gr-dept-card:hover .gr-dept-card-img {
    transform: scale(1.10);
}

.gr-dept-card:hover .gr-dept-card-title {
    transform: translateY(-8px);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .gr-departments-section {
        margin-top: -180px;
        padding-top: 240px;
    }
    
    .gr-departments-container {
        padding: 0 24px;
    }

    .gr-dept-card {
        flex: 0 0 calc((100% - 30px) / 3);
        width: calc((100% - 30px) / 3);
        height: 390px;
    }
}

@media (max-width: 992px) {
    .gr-departments-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .gr-departments-left-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        width: 100%;
    }

    .gr-departments-arrows-group {
        align-self: flex-start;
    }
}

@media (max-width: 768px) {
    .gr-departments-section {
        margin-top: -60px;
        padding-top: 100px;
        padding-bottom: 70px;
    }
    
    .gr-departments-container {
        padding: 0 16px;
    }
    
    .gr-dept-card {
        flex: 0 0 calc((100% - 15px) / 2);
        width: calc((100% - 15px) / 2);
        min-width: 220px;
        height: 310px;
    }
    
    .gr-dept-card-title {
        font-size: 20px;
        bottom: 20px;
        left: 20px;
    }
    
    .gr-departments-header-top {
        flex-direction: column;
        gap: 20px;
    }

    .gr-departments-left-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        width: 100%;
    }

    .gr-departments-book-btn {
        margin-top: 0;
    }
}
