/* Online appointment directory: reference-inspired doctor card, scoped away from public profiles. */
.doctor-page-section .doctor-card.directory-reference-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    gap: 8px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    padding: 13px;
    border: 1px solid #e8edf2;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(27,47,76,.045);
    color: #17253b;
    direction: rtl;
    text-align: right;
}
.doctor-page-section .directory-reference-card .directory-card-top {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 3px;
    padding-top: 24px;
    padding-left: clamp(144px, 36%, 175px);
    min-width: 0;
}
.doctor-page-section .directory-reference-card .card-top .doc-img.directory-avatar {
    width: 70px;
    height: 70px;
    flex: 0 0 70px;
    border-radius: 11px;
}
.doctor-page-section .directory-reference-card .directory-card-identity { flex: 1; min-width: 0; }
.doctor-page-section .directory-reference-card .directory-card-identity h3 {
    margin: 3px 0 0;
    color: #17253b;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.65;
}
.doctor-page-section .directory-reference-card .directory-card-header-specialty {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    margin: 3px 0 0;
    color: #57647a;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.doctor-page-section .directory-reference-card .directory-card-disclosure {
    position: absolute;
    inset: 6px 12px auto;
    z-index: 4;
    pointer-events: none;
}
.doctor-page-section .directory-reference-card .directory-card-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 9px;
    color: #65758d;
    cursor: pointer;
    pointer-events: auto;
}
.doctor-page-section .directory-reference-card .directory-card-pro-mark {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    color: #b9a7ff;
    stroke: currentColor;
}
.doctor-page-section .directory-reference-card .directory-card-pro-info {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    box-sizing: border-box;
    width: min(100%, 285px);
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fbfcfe;
    box-shadow: 0 4px 12px rgb(27 47 76 / 9%);
    color: #243650;
    font-size: 12px;
    line-height: 1.85;
    pointer-events: auto;
}
.doctor-page-section .directory-reference-card .directory-card-pro-info::before {
    content: "";
    position: absolute;
    top: -5px;
    right: 24px;
    width: 8px;
    height: 8px;
    transform: rotate(45deg);
    border-top: 1px solid #cbd5e1;
    border-left: 1px solid #cbd5e1;
    background: #fbfcfe;
}
/* Reuse profile favorite/share handlers; their accessible labels remain available. */
.doctor-page-section .directory-reference-card .directory-card-tools {
    position: absolute;
    top: 9px;
    left: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    direction: rtl;
    align-items: flex-start;
    gap: 5px;
    max-width: 165px;
}
.doctor-page-section .directory-reference-card .directory-card-tool {
    display: inline-flex;
    direction: rtl;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    min-height: 22px;
    padding: 1px 2px;
    background: transparent;
    color: #154f94;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
}
.doctor-page-section .directory-reference-card .directory-card-tool:hover { background: #eff6ff; }
.doctor-page-section .directory-reference-card [data-doctor-favorite][aria-pressed="true"] .doctor-ui-icon {
    color: #e33447;
    fill: currentColor;
}
.doctor-page-section .directory-reference-card .directory-card-tool-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}
@media (max-width: 400px) {
    .doctor-page-section .directory-reference-card .directory-card-tools {
        left: 9px;
    }
    .doctor-page-section .directory-reference-card .directory-card-tool {
        font-size: 13px;
        gap: 3px;
        padding: 1px;
    }
    .doctor-page-section .directory-reference-card .directory-card-tool-label {
        font-size: 9px;
    }
    .doctor-page-section .directory-reference-card .directory-card-top {
        padding-left: 120px;
    }
}
.doctor-page-section .directory-reference-card .doctor-ui-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 auto;
    vertical-align: middle;
}
.doctor-page-section .directory-reference-card .directory-card-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    direction: rtl;
    align-items: stretch;
    min-width: 0;
    padding: 9px 0 8px;
    background: #fff;
    border: 1px solid #e7ebf1;
    border-radius: 14px;
}
.doctor-page-section .directory-reference-card .directory-card-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 0 3px;
    text-align: center;
}
.doctor-page-section .directory-reference-card .directory-card-stat-value {
    display: inline-flex;
    direction: rtl;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 23px;
    white-space: nowrap;
}
.doctor-page-section .directory-reference-card .directory-card-stat + .directory-card-stat {
    border-right: 1px solid #e2e7ed;
}
.doctor-page-section .directory-reference-card .directory-card-stat-icon {
    width: 18px;
    height: 18px;
    font-size: 18px;
    flex: 0 0 auto;
}
.doctor-page-section .directory-reference-card .directory-card-stat-icon--star { color: #ffbd16; }
.doctor-page-section .directory-reference-card .directory-card-stat-icon--like { color: #0bba65; }
.doctor-page-section .directory-reference-card .directory-card-stat-icon--success { color: #08b7f3; }
.doctor-page-section .directory-reference-card .directory-card-stat-icon--comments { color: #1689e8; }
.doctor-page-section .directory-reference-card .directory-card-stat strong {
    color: #17253b;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}
.doctor-page-section .directory-reference-card .directory-card-stat small {
    color: #68758b;
    font-size: 10px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}
/* Large right-hand gray rise, with a white curved cutout for the green chips. */
.doctor-page-section .directory-reference-card .directory-card-feature {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    min-height: 0;
    margin-top: 3px;
    padding: 37px 12px 12px;
    border: 1px solid transparent;
    --notch-width: 45%;
    --feature-notch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 61' preserveAspectRatio='none'%3E%3Cpath d='M0 61C0 47 5 42 18 42H155C179 42 171 0 196 0H200V61Z'/%3E%3C/svg%3E");
}
.doctor-page-section .directory-reference-card .directory-card-feature::before,
.doctor-page-section .directory-reference-card .directory-card-feature::after {
    content: "";
    position: absolute;
    z-index: 0;
    pointer-events: none;
    mask:
        var(--feature-notch) left top / var(--notch-width) 40px no-repeat,
        linear-gradient(to right, transparent var(--notch-width), #000 var(--notch-width)),
        linear-gradient(to bottom, transparent 40px, #000 40px);
}
.doctor-page-section .directory-reference-card .directory-card-feature::before {
    inset: -1px;
    border-radius: 0 24px 24px 24px;
    background: linear-gradient(to bottom, #3c8fb6, #cddde6 27px, #e1e5eb 42px);
}
.doctor-page-section .directory-reference-card .directory-card-feature::after {
    inset: 0;
    border-radius: 0 23px 23px 23px;
    background:
        linear-gradient(to bottom, rgb(40 112 154 / 10%), transparent 4px),
        linear-gradient(to bottom, #e4f3fb, #f5f8fd 32px, #f8f9fb);
}
.doctor-page-section .directory-reference-card .directory-card-specialty,
.doctor-page-section .directory-reference-card .directory-card-services,
.doctor-page-section .directory-reference-card .directory-card-locations,
.doctor-page-section .directory-reference-card .directory-card-availability,
.doctor-page-section .directory-reference-card .directory-card-min-price {
    position: relative;
    z-index: 1;
}
.doctor-page-section .directory-reference-card .directory-card-badges {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 7px;
    width: calc(45% - 30px);
    display: flex;
    direction: rtl;
    overflow-x: auto;
    scrollbar-width: none;
    align-items: center;
    justify-content: safe flex-end;
    gap: 4px;
}
.doctor-page-section .directory-reference-card .directory-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 5px;
    line-height: 17px;
    border-radius: 999px;
    background: #e5f9ed;
    color: #15834e;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}
.doctor-page-section .directory-reference-card .directory-card-specialty {
    position: absolute;
    top: 7px;
    right: 12px;
    z-index: 1;
    width: calc(55% - 19px);
    height: 18px;
    min-width: 0;
    margin: 0;
    color: #17253b;
    font-size: 12px;
    line-height: 18px;
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.doctor-page-section .directory-reference-card .directory-card-services {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 0 10px;
    min-width: 0;
}
.doctor-page-section .directory-reference-card .directory-card-services span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: #334155;
    font-size: 11px;
    white-space: nowrap;
}
.doctor-page-section .directory-reference-card .directory-card-services .doctor-ui-icon {
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    padding: 4px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: #dff6e9;
    color: #15915b;
}
.doctor-page-section .directory-reference-card .directory-card-locations {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0 0 9px;
}
.doctor-page-section .directory-reference-card .directory-card-address {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid #dae0e9;
    border-radius: 999px;
    background: transparent;
    color: #405069;
    font-size: 11px;
}
.doctor-page-section .directory-reference-card .directory-card-address .doctor-ui-icon { color: #12844f; font-size: 16px; }
.doctor-page-section .directory-reference-card .directory-card-address > span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.doctor-page-section .directory-reference-card .directory-card-more-clinics {
    flex: 0 0 auto;
    border: 1px solid #d9e0e9;
    border-radius: 999px;
    padding: 7px 8px;
    background: #fff;
    color: #12844f;
    font-size: 10px;
    white-space: nowrap;
}
.doctor-page-section .directory-reference-card .directory-card-availability {
    display: flex;
    direction: rtl;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    column-gap: 7px;
    row-gap: 2px;
    margin: 0;
    color: #475569;
    font-size: 12px;
    line-height: 1.65;
}
.doctor-page-section .directory-reference-card .directory-card-availability strong { color: #14854f; font-weight: 400; }
.doctor-page-section .directory-reference-card .directory-card-min-price {
    margin: 3px 0 0;
    color: #64748b;
    font-size: 11px;
}
/* Tight transition from first availability to profile action. */
.doctor-page-section .directory-reference-card .directory-card-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0;
    min-width: 0;
}
.doctor-page-section .directory-reference-card .directory-card-profile,
.doctor-page-section .directory-reference-card .directory-card-primary-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 35px;
    box-sizing: border-box;
    border-radius: 10px;
    padding: 6px 8px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
    text-decoration: none;
    cursor: pointer;
}
.doctor-page-section .directory-reference-card .directory-card-profile {
    width: 100%;
    border: 1px solid #d2d8df;
    background: #fff;
    color: #26354b;
}
.doctor-page-section .directory-reference-card .directory-card-primary-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.doctor-page-section .directory-reference-card .directory-card-primary-actions.has-online {
    grid-template-columns: repeat(2,minmax(0,1fr));
}
.doctor-page-section .directory-reference-card .directory-card-primary-actions button {
    width: 100%;
    min-width: 0;
    border: 1px solid #208af0;
}
.doctor-page-section .directory-reference-card .directory-card-office {
    background: #208af0;
    color: #fff;
}
.doctor-page-section .directory-reference-card .directory-card-online {
    background: #fff;
    color: #208af0;
}
.doctor-page-section .directory-reference-card .directory-card-office:hover { background: #136ec9; }
.doctor-page-section .directory-reference-card .directory-card-online:hover { background: #eff7ff; }
.doctor-page-section .directory-reference-card .directory-card-profile:hover { border-color: #208af0; }
.doctor-page-section .directory-reference-card a:focus-visible,
.doctor-page-section .directory-reference-card button:focus-visible {
    outline: 2px solid #1688e8;
    outline-offset: 3px;
}
@media (max-width: 767px) {
    .doctor-page-section .doctor-card.directory-reference-card { padding: 12px; }
    .doctor-page-section .directory-reference-card .card-top .doc-img.directory-avatar {
        width: 65px;
        height: 65px;
        flex-basis: 65px;
    }
    .doctor-page-section .directory-reference-card .directory-card-identity h3 { font-size: 14px; }
    .doctor-page-section .directory-reference-card .directory-card-stat-value { gap: 4px; min-height: 20px; }
    .doctor-page-section .directory-reference-card .directory-card-stat strong { font-size: 13px; }
    .doctor-page-section .directory-reference-card .directory-card-stat-icon { width: 16px; height: 16px; font-size: 16px; }
    .doctor-page-section .directory-reference-card .directory-card-header-specialty { font-size: 11px; }
    .doctor-page-section .directory-reference-card .directory-card-specialty { font-size: 11px; }
    .doctor-page-section .directory-reference-card .directory-card-badge { font-size: 9px; padding: 2px 4px; }
    .doctor-page-section .directory-reference-card .directory-card-primary-actions button { font-size: 11px; }
}
@media (max-width: 360px) {
    .doctor-page-section .directory-reference-card .directory-card-stat small { font-size: 9px; }
    .doctor-page-section .directory-reference-card .directory-card-services span { font-size: 10px; }
    .doctor-page-section .directory-reference-card .directory-card-more-clinics { font-size: 9px; padding: 6px; }
}
@media (max-width: 991px) {
    [data-doctor-directory] > .mobile-filter-toolbar + .doctor-page-section {
        padding-top: 7px;
    }
    [data-doctor-directory] .doctors-list > .breadcrumb-top {
        padding-top: 13px;
    }
}

/* Mobile appointment directory: compact actions and a full-width clickable sort trigger. */
@media (max-width: 991px) {
    [data-doctor-directory] .mobile-filter-toolbar #openMobileFilter,
    [data-doctor-directory] .mobile-filter-toolbar .directory-mobile-sort-trigger {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 6px !important;
        min-height: 38px;
        padding: 7px 11px !important;
        box-sizing: border-box;
        font-family: var(--font-family);
        font-size: 11px !important;
        font-weight: 500;
        line-height: 1.4;
        white-space: nowrap;
        cursor: pointer;
    }
    [data-doctor-directory] .mobile-filter-toolbar .directory-mobile-sort {
        position: relative;
        flex: 0 0 auto;
        min-width: 0;
    }
    [data-doctor-directory] .directory-mobile-sort-trigger {
        list-style: none;
        user-select: none;
    }
    [data-doctor-directory] .directory-mobile-sort-trigger::marker { content: ""; }
    [data-doctor-directory] .directory-mobile-sort-trigger::-webkit-details-marker { display: none; }
    [data-doctor-directory] .directory-mobile-sort-icon,
    [data-doctor-directory] .directory-mobile-filter-icon {
        display: block;
        width: 19px;
        height: 19px;
        flex: 0 0 19px;
        color: #333;
    }
    [data-doctor-directory] .mobile-filter-toolbar .filter-badge .directory-mobile-filter-icon {
        width: 19px;
        height: 19px;
        color: #555;
    }
    [data-doctor-directory] .directory-mobile-sort-options {
        position: absolute;
        top: calc(100% + 7px);
        /* The sort button sits on the left in RTL; open towards the screen's right edge. */
        left: 0;
        right: auto;
        display: flex;
        flex-direction: column;
        gap: 2px;
        box-sizing: border-box;
        width: min(225px, calc(100vw - 32px));
        min-width: 0;
        max-width: calc(100vw - 32px);
        padding: 6px;
        direction: rtl;
        border: 1px solid #e2e5ea;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 8px 22px rgba(20, 39, 65, 0.12);
        z-index: 1002;
    }
    [data-doctor-directory] .directory-mobile-sort:not([open]) .directory-mobile-sort-options {
        display: none;
    }
    [data-doctor-directory] .directory-mobile-sort-option {
        display: block;
        width: 100%;
        padding: 9px 11px;
        box-sizing: border-box;
        border: 0;
        border-radius: 7px;
        background: transparent;
        color: #333;
        font-family: var(--font-family);
        font-size: 12px;
        text-align: right;
        cursor: pointer;
    }
    [data-doctor-directory] .directory-mobile-sort-option:hover,
    [data-doctor-directory] .directory-mobile-sort-option:focus-visible,
    [data-doctor-directory] .directory-mobile-sort-option.is-active {
        color: var(--primary-color);
        background: #f0f5ff;
    }
    [data-doctor-directory] .directory-mobile-sort-trigger:focus-visible,
    [data-doctor-directory] #openMobileFilter:focus-visible {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}
