.doctors-section {
    padding: clamp(36px, 3.4vw, 64px) 0 var(--section-gap);
}

/* The aside rides alongside the directory on desktop and drops under it
   on tablets, where a 360px column would squeeze the cards too far. */
.doctors-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 24vw, 340px);
    gap: clamp(18px, 2vw, 36px);
    align-items: start;
}

/* ---- heading row --------------------------------------------------- */

.doctors-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(16px, 1.6vw, 26px);
}

.doctors-head__sub {
    margin-top: 6px;
    font-size: clamp(16px, 1vw, 17px);
    color: var(--text-soft);
}

/* ---- grid / list toggle -------------------------------------------- */

.view-toggle {
    display: flex;
    flex-shrink: 0;
    padding: 4px;
    border-radius: 10px;
    background: #EEF0F6;
}

.view-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: clamp(6px, .6vw, 10px) clamp(12px, 1.1vw, 18px);
    border: 0;
    border-radius: 7px;
    background: none;
    font: inherit;
    font-size: clamp(12px, .92vw, 15px);
    color: var(--text-soft);
    cursor: pointer;
    transition: background .2s, color .2s;
}

    .view-toggle__btn.is-active {
        background: var(--navy);
        color: var(--white);
    }

/* ---- filters ------------------------------------------------------- */

.doctors-filters {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(8px, .8vw, 14px);
}

.doctors-search {
    position: relative;
    flex: 1 1 260px;
    display: flex;
    align-items: center;
}


[dir="rtl"] .doctors-search i {
    left: 20px;
    right: auto;
}

.doctors-search i {
    position: absolute;
    inset-inline-start: clamp(14px, 1.1vw, 18px);
    color: var(--text-soft);
    font-size: .9em;
    pointer-events: none;
    z-index: 66555;
}

.doctors-search input {
    width: 100%;
    padding: clamp(9px, .85vw, 14px) clamp(14px, 1.1vw, 18px);
    padding-inline-start: clamp(36px, 2.8vw, 46px);
    border: 1px solid #DDE0EA;
    border-radius: 999px;
    /*background: var(--white);*/
    font: inherit;
    font-size: clamp(15px, .95vw, 16px);
    color: var(--text);
}

.doctors-select {
    flex: 0 1 170px;
    display: flex;
}

    /* `background-position` takes no logical keyword, so the chevron is the
   one thing mirrored by hand at the end of this file. */
    .doctors-select select,
    .doctors-sort select {
        width: 100%;
        padding: clamp(9px, .85vw, 14px) clamp(14px, 1.1vw, 18px);
        padding-inline-end: clamp(34px, 2.6vw, 42px);
        border: 1px solid #DDE0EA;
        border-radius: 999px;
        background-color: var(--white);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23141C38' stroke-width='1.6' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: 11px 7px;
        background-position: right clamp(14px, 1.1vw, 18px) center;
        font: inherit;
        font-size: clamp(15px, .95vw, 16px);
        color: var(--text);
        appearance: none;
        cursor: pointer;
    }

        .doctors-search input:focus-visible,
        .doctors-select select:focus-visible,
        .doctors-sort select:focus-visible {
            outline: 2px solid var(--navy);
            outline-offset: 2px;
        }

/* ---- result count + sort ------------------------------------------- */

.doctors-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: clamp(14px, 1.3vw, 22px) 0;
    font-size: clamp(13px, .9vw, 15px);
    color: var(--text-soft);
}

.doctors-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .doctors-sort label {
        width: 85px;
    }

    .doctors-sort select {
        border: 1px solid #e5e5e5;
        padding-block: 4px;
        padding-inline: 4px clamp(22px, 1.8vw, 28px);
        background-position: right 4px center;
        font-size: inherit;
        color: var(--heading);
        padding-inline-start: 15px;
    }

/* ---- the cards ----------------------------------------------------- */

.doctor-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(12px, 1.2vw, 22px);
}

.doctor-card {
    display: flex;
    flex-direction: column;
    padding: clamp(10px, .9vw, 15px);
    border: 1px solid #EDEFF5;
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 2px 12px rgba(31, 49, 99, .06);
}

/* Slightly taller than square: a portrait crop keeps the face centred
   instead of cutting it at the chin the way a 1:1 box does. */
.doctor-card__media {
    position: relative;
    border-radius: 14px;
    aspect-ratio: 7 / 8;
}

.doctor-card__photo {
    border-radius: inherit;
}

/* Biased above centre: portraits put the face in the upper third, so a
   plain `center` crop clips foreheads on the wider photos. */
.doctor-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 25%;
}

/* The specialty badge sits on the foot of the portrait, tucked against the
   reading-start edge, with a white ring so it reads as a separate token
   rather than a sticker painted onto the photo. */
.doctor-card__badge {
    position: absolute;
    z-index: 1;
    inset-inline-start: clamp(8px, .7vw, 13px);
    bottom: calc(clamp(34px, 2.7vw, 44px) / -2);
    display: grid;
    place-items: center;
    width: clamp(34px, 2.7vw, 44px);
    height: clamp(34px, 2.7vw, 44px);
    border: 3px solid var(--white);
    border-radius: 50%;
    background: var(--badge-bg, #EEF0F6);
    color: var(--badge-fg, var(--navy));
    font-size: clamp(13px, 1vw, 17px);
}

/* The badge hangs half below the photo, so the body starts clear of it:
   half the badge plus the breathing room the design shows. */
.doctor-card__body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: clamp(9px, .85vw, 14px);
    padding: calc(clamp(34px, 2.7vw, 44px) / 2 + clamp(12px, 1.1vw, 20px)) clamp(6px, .5vw, 10px) 0;
}

.doctor-card__name {
    margin-bottom: clamp(2px, .25vw, 4px);
    font-size: clamp(20px, 1.32vw, 23px);
    font-weight: 600;
    line-height: 1.25;
    color: var(--navy);
}

/* Three tones rather than one grey: the specialty sits closest to the name,
   the experience line a touch lighter, the languages lighter again — so the
   block reads top-down instead of as a flat paragraph. */
.doctor-card__role,
.doctor-card__years,
.doctor-card__langs {
    font-size: clamp(12px, .93vw, 16px);
    line-height: 1.4;
}

.doctor-card__role {
    color: #4A5C85;
}

.doctor-card__years {
    color: #5C6C90;
}

.doctor-card__langs {
    color: #6E7C9C;
}

.doctor-card__years b {
    font-weight: 700;
    color: var(--navy);
}

/* The last line before the button; `margin-top: auto` on the button only
   absorbs leftover space, so the minimum gap has to be stated here. */
.doctor-card__langs {
    margin-bottom: clamp(10px, .95vw, 16px);
}

/* `margin-top: auto` pins the button to the foot of the card, so a doctor
   with a longer title does not push their neighbour's button out of line. */
.doctor-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: auto;
    padding-block: clamp(12px, 1.05vw, 18px);
    padding-inline: clamp(12px, 1.1vw, 18px);
    border: 1px solid #E4E7F0;
    border-radius: 12px;
    font-size: clamp(13px, 1vw, 17px);
    font-weight: 500;
    color: var(--navy);
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

    .doctor-card__cta:hover {
        border-color: var(--navy);
        background: #F5F6FA;
        color: var(--navy);
    }

/* ---- list view ----------------------------------------------------- */

/* One class on the container swaps the whole directory over, so the
   toggle never has to touch the cards themselves. */
.doctor-cards.is-list {
    grid-template-columns: 1fr;
}

    .doctor-cards.is-list .doctor-card {
        flex-direction: row;
        align-items: center;
        gap: clamp(12px, 1.2vw, 22px);
    }

    .doctor-cards.is-list .doctor-card__media {
        flex-shrink: 0;
        width: clamp(96px, 9vw, 140px);
    }

    .doctor-cards.is-list .doctor-card__body {
        padding-block: 0;
    }

    /* In a row the badge has no seam to straddle — hanging it below the photo
   would poke past the foot of the card, so it sits inside instead. */
    .doctor-cards.is-list .doctor-card__badge {
        bottom: clamp(8px, .7vw, 12px);
    }

    .doctor-cards.is-list .doctor-card__cta {
        align-self: flex-start;
        margin-top: 10px;
        padding-inline: clamp(18px, 1.6vw, 28px);
    }

/* ---- badge accents -------------------------------------------------- */

.doctor-card--rose {
    --badge-bg: #FBE9EC;
    --badge-fg: #B11A18;
}

.doctor-card--lilac {
    --badge-bg: #EEECFA;
    --badge-fg: #6C4AB6;
}

.doctor-card--green {
    --badge-bg: #E4F3ED;
    --badge-fg: #1a906e;
}

.doctor-card--red {
    --badge-bg: #FBE3E3;
    --badge-fg: #C0392B;
}

.doctor-card--amber {
    --badge-bg: #FDF0DF;
    --badge-fg: #C77B16;
}

.doctor-card--blue {
    --badge-bg: #E7EDFA;
    --badge-fg: #1F3163;
}

/* ---- empty state ---------------------------------------------------- */

.doctors-empty {
    margin-top: clamp(20px, 2vw, 34px);
    font-size: var(--fs-sub);
    color: var(--text-soft);
    text-align: center;
}

/* ---- aside ---------------------------------------------------------- */

.doctors-aside {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.2vw, 22px);
    position: sticky;
    top: 24px;
}

.side-card {
    padding: clamp(16px, 1.5vw, 26px);
    border: 1px solid #E7E9F1;
    border-radius: 16px;
    background: var(--white);
}

.side-card--help {
    border-color: #F6DFE3;
    background: #FDF3F5;
    --rule: rgba(177, 26, 24, .12);
}

.side-card--promise {
    border-color: #E2E8F6;
    background: #F2F5FC;
    --rule: rgba(31, 49, 99, .12);
}

/* Two-tone, like every other heading on the site: the first word in navy,
   the rest carrying the maroon gradient. `display: inline` is needed because
   `.grad-text` clips its background to the text box. */
.side-card h3 {
    font-size: clamp(16px, 1.25vw, 22px);
    font-weight: 700;
    color: var(--heading);
}

    .side-card h3 b {
        font-weight: 700;
    }

    /* The site gradient only reaches maroon at its 100% stop, so across a word
   or two it reads as plain navy and the heading loses its two-tone. At this
   size the end colour on its own is what the design shows. */
    .side-card h3 .grad-text {
        display: inline;
        background: none;
        color: #A11D2B;
    }

.side-card__text {
    margin: 10px 0 clamp(12px, 1.1vw, 18px);
    font-size: clamp(14px, .85vw, 14px);
    line-height: 1.6;
    color: var(--text-soft);
}

.check-list {
    display: flex;
    flex-direction: column;
    margin: clamp(12px, 1.1vw, 18px) 0 0;
    padding: 0;
    list-style: none;
}

    .check-list li {
        display: flex;
        align-items: flex-start;
        gap: 9px;
        padding-block: clamp(15px, .62vw, 11px);
        font-size: clamp(14px, .85vw, 14px);
        line-height: 1.5;
        color: var(--text);
    }

        /* A hairline between rows rather than a plain gap — it reads as a list of
   promises instead of a loose stack. `li + li` keeps the first row flush
   with the heading above and leaves no rule under the last one. */
        .check-list li + li {
            border-block-start: 1px solid var(--rule, rgba(31, 49, 99, .10));
        }

    .check-list i {
        flex-shrink: 0;
        margin-top: 2px;
        color: #1a906e;
        font-size: .95em;
    }

.btn-book {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: clamp(14px, 1.3vw, 22px);
    padding: clamp(10px, .95vw, 15px);
    border-radius: 10px;
    background: var(--navy);
    font-size: clamp(12px, .92vw, 15px);
    color: var(--white);
    text-decoration: none;
    transition: opacity .2s;
}

    .btn-book:hover {
        opacity: .9;
        color: var(--white);
    }

.side-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: clamp(10px, .95vw, 15px) clamp(12px, 1.1vw, 18px);
    border-radius: 10px;
    background: var(--white);
    text-decoration: none;
}

    .side-contact + .side-contact {
        margin-top: 10px;
    }

.side-contact__label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: clamp(14px, .85vw, 14px);
}

.side-contact__value {
    padding-inline-start: calc(clamp(11px, .85vw, 14px) + 8px);
    font-size: clamp(14px, .8vw, 13px);
    color: var(--text-soft);
}

.side-contact--phone .side-contact__label {
    color: #C0392B;
}

.side-contact--whatsapp .side-contact__label {
    color: #1a906e;
}

/* ---- RTL ------------------------------------------------------------ */

[dir="rtl"] .doctors-select select,
[dir="rtl"] .doctors-sort select {
    background-position: left clamp(14px, 1.1vw, 18px) center;
}

[dir="rtl"] .doctors-sort select {
    background-position: left 4px center;
}

/* Arrows point "forward", which is leftward in Arabic. */
[dir="rtl"] .doctor-card__cta i,
[dir="rtl"] .btn-book i {
    transform: scaleX(-1);
}

/* ---- responsive ------------------------------------------------------ */

@media (max-width: 1199.98px) {
    .doctors-layout {
        grid-template-columns: 1fr;
    }

    .doctors-aside {
        position: static;
    }
}

@media (max-width: 767.98px) {
    .doctor-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .doctors-select {
        flex-basis: calc(50% - 7px);
    }

    .doctor-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 479.98px) {
    .doctor-cards {
        grid-template-columns: 1fr;
    }

    .doctors-select {
        flex-basis: 100%;
    }

    .doctor-cards.is-list .doctor-card {
        flex-direction: column;
        align-items: stretch;
    }

    .doctor-cards.is-list .doctor-card__media {
        width: 100%;
    }
}

.ssList {
    font-size: .9em;
}

#preloader .loading {
    top: 70% !important;
    left: 58% !important;
}
