/**
 * Doctors Grid & Carousel — clean fixed version
 * Карточки врачей для [hec_doctors] и [hec_doctors_archive]
 */

/* ============================================
   WRAPPER / TRACK
   ============================================ */

.hec-doctors {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.hec-doctors__track {
    display: grid;
    grid-template-columns: repeat(var(--hec-doctors-cols, 4), 1fr);
    gap: 24px;
}

.hec-doctors--carousel .hec-doctors__track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hec-doctors--carousel .hec-doctors__track::-webkit-scrollbar {
    display: none;
}

.hec-doctors--carousel .hec-doctor-card {
    flex: 0 0 calc((100% - 72px) / 4);
    scroll-snap-align: start;
}

/* ============================================
   DOCTOR CARD — COMPACT DESIGN
   ============================================ */

.hec-doctor-card {
    background: var(--color-white, #ffffff);
    border: 0;
    border-radius: var(--radius-md, 8px);
    padding: 24px 40px 20px;
    box-shadow: none;
    overflow: visible;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.hec-doctor-card:hover {
    box-shadow: none;
    transform: none;
}

.hec-doctor-card__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    color: inherit;
    flex: 1;
}

.hec-doctor-card__link:hover {
    text-decoration: none !important;
}

/* ============================================
   PHOTO
   ============================================ */

.hec-doctor-card__photo {
    position: relative;
    width: 180px;
    height: 180px;
    padding-top: 0;
    margin: 0 auto 32px;
    border-radius: 9999px;
    overflow: hidden;
    background: var(--color-bg-alt, #DCE0CF);
    flex: 0 0 auto;
}

.hec-doctor-card__photo img {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9999px;
    transition: none;
}

.hec-doctor-card:hover .hec-doctor-card__photo img {
    transform: none;
}

.hec-doctor-card__placeholder {
    width: 100%;
    height: 100%;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary, #4E5B31);
}

.hec-doctor-card__placeholder .dashicons {
    font-size: 42px;
    width: 42px;
    height: 42px;
}

/* ============================================
   TAGS
   Fixed: имя и профессия больше не подпрыгивают,
   даже если у врача нет тегов стажа/онлайн.
   ============================================ */

.hec-doctor-card__tags {
    position: absolute;
    top: 172px;
    left: 0;
    right: 0;
    z-index: 4;
    height: 24px;
    min-height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin: 0 auto;
    flex-wrap: nowrap;
    pointer-events: none;
}

.hec-doctor-card__tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 5px 8px;
    border-radius: 9999px;
    background: var(--color-primary-light, #DCE0CF);
    color: var(--color-primary-dark, #212B10);
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
    white-space: nowrap;
    pointer-events: auto;
}

.hec-doctor-card__tag--experience {
    background: var(--color-primary-light, #DCE0CF);
    color: var(--color-primary-dark, #212B10);
}

.hec-doctor-card__tag--online {
    background: var(--color-accent-light, #E2E868);
    color: var(--color-primary-dark, #212B10);
}

/* ============================================
   INFO
   ============================================ */

.hec-doctor-card__info {
    width: 100%;
    padding: 0;
    margin: 0;
}

.hec-doctor-card__name {
    min-height: 48px;
    margin: 0 0 10px;
    color: var(--color-title-card-doctor, #212121);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hec-doctor-card__position {
    min-height: 32px;
    margin: 0;
    color: var(--color-title-card-experience, #212121);
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    text-align: center;
}

/* ============================================
   CTA
   ============================================ */

.hec-doctor-card__cta {
    padding: 18px 0 0;
    display: flex;
    justify-content: center;
    margin-top: auto;
}

.hec-doctor-card__cta .hec-btn {
    width: 100%;
    min-height: 36px;
    padding: 8px 20px;
    border-radius: 9999px;
    border: 1px solid var(--color-primary, #4E5B31);
    background: var(--color-primary, #4E5B31);
    color: var(--color-white, #ffffff) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hec-doctor-card__cta .hec-btn:hover {
    background: var(--color-primary-dark, #212B10);
    border-color: var(--color-primary-dark, #212B10);
    color: var(--color-white, #ffffff) !important;
    text-decoration: none !important;
}

/* ============================================
   CAROUSEL NAVIGATION / PROGRESS
   ============================================ */

.hec-doctors__nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.hec-doctors__prev,
.hec-doctors__next {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 9999px;
    border: 1px solid var(--color-border-light, #e8e4dc);
    background: var(--color-bg-light, #F6F1EA);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-primary, #505E2C);
    line-height: 1;
    box-shadow: none;
}

.hec-doctors__prev:hover,
.hec-doctors__next:hover {
    background: var(--color-primary, #505E2C);
    color: var(--color-white, #ffffff);
    border-color: var(--color-primary, #505E2C);
}

.hec-doctors__prev:disabled,
.hec-doctors__next:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--color-bg-light, #F6F1EA);
    color: var(--color-primary, #505E2C);
    border-color: var(--color-border-light, #e8e4dc);
}

.hec-doctors__prev svg,
.hec-doctors__next svg,
.hec-doctors__prev .dashicons,
.hec-doctors__next .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
}

.hec-doctors--carousel .hec-doctors__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 0 2px 0 0;
}

.hec-doctors--carousel .hec-doctors__bottom .hec-doctors__nav {
    margin-top: 0;
    flex-shrink: 0;
}

.hec-doctors--carousel .hec-doctors__progress {
    position: relative;
    width: calc(100% - 88px);
    height: 2px;
    background: #eee9dd;
    overflow: hidden;
}

.hec-doctors--carousel .hec-doctors__progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: #c9c0ad;
    transition: width 0.2s ease;
}

/* ============================================
   ARCHIVE FILTER
   ============================================ */

.hec-doctors-filter {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 28px;
    margin: 0 0 38px;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--color-accent, #505E2C);
}

.hec-doctors-filter__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    padding: 0 0 12px;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #2f2f2f;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.hec-doctors-filter__item::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent, #505E2C);
    transform: translateX(-50%);
    transition: width 0.2s ease;
}

.hec-doctors-filter__item:hover,
.hec-doctors-filter__item.is-active {
    color: #505E2C;
    text-decoration: none !important;
}

.hec-doctors-filter__item:hover::after,
.hec-doctors-filter__item.is-active::after {
    width: 18px;
}

/* ============================================
   PAGINATION
   ============================================ */

.hec-doctors-pagination {
    margin-top: 36px;
    margin-bottom: 20px;
}

.hec-doctors-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.hec-doctors-pagination .page-numbers li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hec-doctors-pagination .page-numbers a,
.hec-doctors-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e8e4dc;
    border-radius: 9999px;
    background: #ffffff;
    color: #505E2C;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    transition: all 0.2s ease;
}

.hec-doctors-pagination .page-numbers a:hover,
.hec-doctors-pagination .page-numbers .current {
    background: #505E2C;
    border-color: #505E2C;
    color: #ffffff;
    text-decoration: none !important;
}

.hec-doctors-pagination .page-numbers .dots {
    border-color: transparent;
    background: transparent;
    color: #505E2C;
}

.hec-doctors-archive a,
.hec-doctors-grid a,
.hec-doctor-card a {
    text-decoration: none !important;
}



/* ============================================
   DOCTORS ARCHIVE CONTROLS
   category select + search by name
   ============================================ */

.hec-doctors-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin: 0 0 32px;
}

.hec-doctors-controls__select,
.hec-doctors-controls__input {
    appearance: none;
    -webkit-appearance: none;
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 9999px;
    background-color: #ffffff;
    color: #212121;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hec-doctors-controls__select {
    min-width: 210px;
    padding: 0 44px 0 20px;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #212121 50%),
        linear-gradient(135deg, #212121 50%, transparent 50%);
    background-position:
        calc(100% - 24px) 50%,
        calc(100% - 18px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.hec-doctors-controls__search {
    position: relative;
    display: flex;
    align-items: center;
}

.hec-doctors-controls__input {
    width: 260px;
    padding: 0 18px 0 44px;
}

.hec-doctors-controls__input::placeholder {
    color: #707070;
    opacity: 1;
}

.hec-doctors-controls__select:hover,
.hec-doctors-controls__select:focus,
.hec-doctors-controls__input:hover,
.hec-doctors-controls__input:focus {
    border-color: var(--color-border-light, #e8e4dc);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.hec-doctors-controls__search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    border: 1.7px solid #707070;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.hec-doctors-controls__search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -4px;
    width: 6px;
    height: 1.7px;
    background: #707070;
    border-radius: 999px;
    transform: rotate(45deg);
}

.hec-doctors-controls__submit {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* когда doctors archive стоит под заголовком страницы */
.hec-doctors-archive .hec-doctors-controls {
    margin-top: 20px;
}








@media (max-width: 768px) {
    .hec-doctors-controls {
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 24px;
    }

    .hec-doctors-controls__select,
    .hec-doctors-controls__search,
    .hec-doctors-controls__input {
        width: 100%;
        min-width: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .hec-doctors__track {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }

    .hec-doctors--carousel .hec-doctor-card {
        flex: 0 0 calc((100% - 48px) / 3);
    }

    .hec-doctor-card {
        padding: 22px 16px 18px;
    }

    .hec-doctor-card__photo {
        width: 118px;
        height: 118px;
        margin-bottom: 32px;
    }

    .hec-doctor-card__tags {
        top: 110px;
        gap: 4px;
    }

    .hec-doctor-card__tag {
        font-size: 11px;
        padding: 5px 7px;
        min-height: 23px;
    }

    .hec-doctor-card__name {
        font-size: 20px;
        min-height: 42px;
    }
}

@media (max-width: 768px) {
    .hec-doctors__track {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .hec-doctors--carousel .hec-doctor-card {
        flex: 0 0 calc((100% - 16px) / 2);
    }

    .hec-doctors-filter {
        justify-content: flex-start;
        gap: 22px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 22px 0 20px;
        margin-bottom: 28px;
    }

    .hec-doctors-filter__item {
        white-space: nowrap;
        font-size: 14px;
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .hec-doctors__track {
        grid-template-columns: 1fr;
    }

    .hec-doctors--carousel .hec-doctor-card {
        flex: 0 0 82%;
    }

    .hec-doctors--carousel .hec-doctors__track {
        gap: 16px;
        padding-left: 20px;
        padding-right: 20px;
        scroll-padding-left: 20px;
    }

    .hec-doctor-card {
        padding: 22px 16px 18px;
    }

    .hec-doctor-card__photo {
        width: 250px;
        height: 250px;
        margin-bottom: 32px;
    }

    .hec-doctor-card__tags {
        top: 240px;
    }

    .hec-doctor-card__tag {
        font-size: 12px;
        min-height: 23px;
        padding: 8px 10px;
    }
}


/* ============================================
   DOCTORS ARCHIVE TOP: title + controls
   ============================================ */

.hec-doctors-archive__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin: 0 0 32px;
}

.hec-doctors-archive__title {
    margin: 0;
    color: #212121;
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
    font-size: 48px;
    line-height: 1.16;
    letter-spacing: -0.02em;
}

.hec-doctors-archive__top .hec-doctors-controls {
    margin: 0;
    flex-shrink: 0;
}

/* tablet */
@media (max-width: 1024px) {
    .hec-doctors-archive__top {
        align-items: flex-start;
        gap: 24px;
    }

    .hec-doctors-archive__title {
        font-size: 40px;
        line-height: 1.16;
    }
}

/* mobile */
@media (max-width: 767px) {
    .hec-doctors-archive__top {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        margin-bottom: 24px;
    }

    .hec-doctors-archive__title {
        font-size: 32px;
        line-height: 1.18;
        letter-spacing: -0.02em;
    }

    .hec-doctors-archive__top .hec-doctors-controls {
        width: 100%;
    }
}

/* small mobile */
@media (max-width: 480px) {
    .hec-doctors-archive__title {
        font-size: 28px;
        line-height: 1.2;
    }
}


/* ============================================
   HERO CARD FOR SINGLE DOCTOR
   Использует существующие стили карточек
   ============================================ */

.hec-doctor-card--hero {
    position: relative;
    overflow: hidden;

    width: 100%;
    max-width: 305px;
    min-height: 305px;
    margin-left: auto;
    margin-right: auto;

    padding-left: 0;
    padding-right: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
}

/* декоративный фон справа снизу */
.hec-doctor-card--hero::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 230px;
    height: 120px;
    background: url('/wp-content/uploads/2026/05/doc_bagraund_plashka.png') no-repeat right bottom;
    background-size: contain;
    pointer-events: none;
    z-index: 0;
}

.hec-doctor-card--hero > * {
    position: relative;
    z-index: 1;
}

.hec-doctor-card--hero .hec-doctor-card__link {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.hec-doctor-card--hero .hec-doctor-card__photo {
    position: relative;
    width: 250px;
    height: 250px;
    padding-top: 0;
    margin: 0 auto 50px;
    border-radius: 9999px;
    overflow: hidden;
    background: var(--color-bg-alt, #DCE0CF);
    flex: 0 0 auto;
    transform: none;
}

.hec-doctor-card--hero .hec-doctor-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.hec-doctor-card--hero .hec-doctor-card__tags {
    top: 240px;
}

.hec-doctor-card--hero .hec-doctor-card__cta {
    padding: 0;
}

.hec-doctor-card--hero .hec-doctor-card__cta .hec-btn {
    width: 160px;
}

.hec-doctor-card--hero .hec-btn {
    gap: 16px;
}

.hec-doctor-card--hero .hec-btn__arrow-img {
    width: 14px;
    height: 14px;
    display: block;
    object-fit: contain;
    flex: 0 0 auto;

    transform: translate3d(0, 0, 0);
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.hec-doctor-card--hero .hec-btn:hover .hec-btn__arrow-img {
    transform: translate3d(7px, 0, 0);
}

/* iPad / tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .hec-doctor-card--hero .hec-doctor-card__photo {
        width: 150px;
        height: 150px;
        margin: 0 auto 50px;
    }

    .hec-doctor-card--hero .hec-doctor-card__tags {
        top: 140px;
    }
}

@media (max-width: 767px) {
    .hec-doctor-card--hero .hec-doctor-card__photo {
        width: 180px;
        height: 180px;
        margin-bottom: 40px;
    }

    .hec-doctor-card--hero .hec-doctor-card__tags {
        top: 170px;
    }
}