/* =========================
   DEPARTMENTS — Warm UI
   (mirrors specialists style)
========================= */

/* ================================================
   FILTERS WRAPPER — banner gradient
   ================================================ */

.dep-filters-wrapper {
    margin-bottom: 0;
    border-radius: 0px 0px 28px 28px;
    background: linear-gradient(145deg, #ffbd56 0%, #efb27d 50%, #d14e4e 100%);
    padding: 20px 28px;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 8px 40px rgba(186,100,74,.28), 0 2px 8px rgba(0,0,0,.06);
    border: none;
    animation: dpSlideIn 0.5s ease both;
    transition: box-shadow 0.3s ease, border-radius 0.4s ease;
}

.dep-filters-wrapper::before {
    content: '';
    position: absolute;
    top: -60px; right: -40px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 65%);
    pointer-events: none;
}
.dep-filters-wrapper::after {
    content: '';
    position: absolute;
    bottom: -50px; left: 40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.10) 0%, transparent 70%);
    pointer-events: none;
}

.dep-filters-wrapper:hover {
    transform: none;
}

@keyframes dpSlideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Title */
.title-dep-fil {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -.02em;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,.12);
    white-space: nowrap;
    margin: 0;
}

/* ================================================
   SEARCH ROW
   ================================================ */

.dep-search-row {
    display: flex;
    gap: 10px;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.dep-search-row input {
    flex: 1;
    height: 40px !important;
    padding: 0 18px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #fff !important;
    background: rgba(255,255,255,.15) !important;
    border: 1px solid rgba(255,255,255,.30) !important;
    border-radius: 0px 14px 14px 14px !important;
    outline: none !important;
    font-family: inherit;
    min-width: 0;
    transition: background .22s ease, border-color .22s ease !important;
    box-shadow: none !important;
}
.dep-search-row input::placeholder { color: rgba(255,255,255,.60) !important; }
.dep-search-row input:focus {
    background: rgba(255,255,255,.22) !important;
    border-color: rgba(255,255,255,.70) !important;
    box-shadow: none !important;
}

.dep-clear-btn {
    flex-shrink: 0;
    width: 40px !important;
    height: 40px !important;
    border-radius: 0px 14px 14px 14px !important;
    border: 1px solid rgba(255,255,255,.35) !important;
    cursor: pointer !important;
    background: rgba(255,255,255,.18) !important;
    color: #fff !important;
    font-size: 22px !important;
    font-weight: 300 !important;
    font-family: inherit;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    user-select: none;
    transition: background .22s ease, transform .22s ease, border-color .22s ease !important;
    white-space: nowrap;
}
.dep-clear-btn:hover {
    background: rgba(255,255,255,.30) !important;
    border-color: rgba(255,255,255,.60) !important;
    transform: scale(1.08) !important;
}
.dep-clear-btn:active { transform: scale(0.96) !important; }

/* ================================================
   TOGGLE
   ================================================ */

.dep-filters-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    margin-bottom: 0;
    list-style: none;
}

.dep-filters-wrapper .tgl { display: none; }

.dep-filters-wrapper .tgl-ios + .tgl-btn {
    display: block;
    width: 4.3em;
    height: 2em;
    padding: 2px;
    border: 1px solid rgba(255,255,255,.35) !important;
    border-radius: 2em;
    background: rgba(255,255,255,.18) !important;
    cursor: pointer;
    position: relative;
    transition: background 0.3s ease, border-color 0.3s ease;
    flex-shrink: 0;
    box-shadow: none !important;
}
.dep-filters-wrapper .tgl-ios + .tgl-btn::after {
    content: '';
    position: absolute;
    display: block !important;
    top: 2px; left: 2px;
    width: calc(50% - 2px);
    height: calc(100% - 4px);
    border-radius: 2em;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 3px 0 rgba(0,0,0,0.08);
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dep-filters-wrapper .tgl-ios + .tgl-btn::before { display: none !important; }
.dep-filters-wrapper .tgl-ios:checked + .tgl-btn {
    background: rgba(255,255,255,.40) !important;
    border-color: rgba(255,255,255,.65) !important;
    box-shadow: none !important;
}
.dep-filters-wrapper .tgl-ios:checked + .tgl-btn::after { left: calc(50% + 2px); }
.dep-filters-wrapper .tgl-ios + .tgl-btn:active { box-shadow: none !important; }

.dep-filter-text {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
    margin-top: 0;
}

/* Badge знайдено */
.dep-found-badge {
    padding: 6px 14px;
    border-radius: 0px 14px 14px 14px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    margin: 0;
    margin-left: auto;
}

/* ================================================
   COLLAPSIBLE FILTERS CONTENT
   ================================================ */

.dep-filters-content {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 0.4s ease, opacity 0.35s ease, transform 0.35s ease;
}
.dep-filters-wrapper.active .dep-filters-content {
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}
.dep-filters-wrapper.active {
    padding-bottom: 4px;
}

.dep-filters-grid {
    display: flex;
    gap: 14px;
    padding: 16px 0 18px;
    flex-wrap: wrap;
}

.dep-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    flex: 1;
}

.dep-filter-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    padding-left: 4px;
    margin-bottom: 2px;
    line-height: 1;
}

.dep-filters-grid select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 0px 14px 14px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffffff' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    transition: background-color .22s ease, border-color .22s ease;
    margin: 0;
}
.dep-filters-grid select option { background: #a0602a; color: #fff; }
.dep-filters-grid select:hover {
    background-color: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.50);
}
.dep-filters-grid select:focus {
    background-color: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.70);
    box-shadow: none;
}

/* ================================================
   SORT BAR (окремий бар якщо є)
   ================================================ */

.dep-sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    animation: dpSlideIn 0.55s ease both;
    animation-delay: 0.05s;
}

.dep-sort-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    padding-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dep-sort-select {
    height: 40px;
    padding: 0 36px 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 0px 14px 14px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffffff' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    transition: background-color .22s ease, border-color .22s ease;
    min-width: 170px;
}
.dep-sort-select option { background: #a0602a; color: #fff; }
.dep-sort-select:hover {
    background-color: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.50);
}
.dep-sort-select:focus {
    background-color: rgba(255,255,255,.25);
    border-color: rgba(255,255,255,.70);
}
.dep-sort-select.is-active {
    background-color: rgba(255,255,255,.30);
    border-color: rgba(255,255,255,.70);
    font-weight: 700;
}

/* ================================================
   DEPARTMENTS CARDS GRID
   ================================================ */

.dep-cards-grid {
    display: grid;
    align-items: start;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 25px;
}

/* ================================================
   CARD — E3 Editorial Bold · Теплі градієнти
   ================================================ */

.dep-cards-grid { counter-reset: dep-counter; }

.dep-card {
    counter-increment: dep-counter;
    border-radius: 22px !important;
    padding: 20px 20px 18px !important;
    border: none !important;
    box-shadow: none !important;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform .35s cubic-bezier(.22,.68,0,1.2), box-shadow .35s ease;
}

/* ── Сірі картки — всі однакові ── */
.dep-cards-grid .dep-card {
    background: #f0f0f0 !important;
    box-shadow: 0 2px 14px rgba(0,0,0,.09) !important;
}
@media (hover: hover) {
    .dep-card:hover { transform: translateY(-5px) scale(1.015) !important; }
    .dep-cards-grid .dep-card:hover { box-shadow: 0 12px 36px rgba(0,0,0,.16) !important; }
}

/* Декоративний номер */
.dep-card::after {
    content: counter(dep-counter, decimal-leading-zero);
    position: absolute;
    font-size: 110px;
    font-weight: 800;
    line-height: 1;
    right: -4px;
    bottom: -14px;
    color: rgba(0,0,0,.06);
    pointer-events: none;
    letter-spacing: -.05em;
    user-select: none;
    z-index: 0;
}

/* Сяйво у верхньому куті */
.dep-card::before {
    content: '';
    position: absolute;
    top: -50px; right: -40px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.16) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

/* ================================================
   ІКОНКА — скляний бейдж
   ================================================ */

.dep-card-icon-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.dep-card-icon-wrap a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 0px 18px 18px 18px;
    background: linear-gradient(145deg, #f3b65d 0%, #eaa87d 50%, #f2a387 100%);
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    text-decoration: none;
    transition: background .25s ease, box-shadow .25s ease;
    flex-shrink: 0;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(234,168,125,.40);
}

/* SVG всередині бейджа — білий, чіткий */
.dep-card-icon-wrap a svg {
    width: 28px !important;
    height: 28px !important;
    display: block;
    flex-shrink: 0;
}
.dep-card-icon-wrap a svg *[stroke]:not([stroke="none"]) {
    stroke: rgba(255,255,255,.95) !important;
    stroke-width: 1.8px !important;
}
.dep-card-icon-wrap a svg *[fill]:not([fill="none"]) {
    fill: rgba(255,255,255,.95) !important;
}

/* FA іконки теж білі */
.dep-card-icon-wrap i {
    font-size: 24px;
    color: rgba(255,255,255,.95);
}

/* img у бейджі */
.dep-card-img-wrap {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}
.dep-card-img-wrap a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 0px 18px 18px 18px;
    background: rgba(255,255,255,.22);
    border: 1.5px solid rgba(255,255,255,.42);
    overflow: hidden;
    pointer-events: none;
}
.dep-card-img-wrap img {
    width: 60px; height: 60px;
    object-fit: cover;
    display: block;
    filter: brightness(0) invert(1);
    opacity: .9;
}

/* ================================================
   ТИП — pill зверху праворуч
   ================================================ */

.dep-card-type {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    font-size: 10px !important;
    font-weight: 800 !important;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(0,0,0,.08);
    color: rgba(0,0,0,.60) !important;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
}
.dep-card-label { display: none !important; }

/* ================================================
   НАЗВА
   ================================================ */

.dep-card-title {
    text-align: left;
    position: relative;
    z-index: 1;
    margin-top: 16px;
    margin-bottom: 0;
    flex: 1;
    display: flex;
    align-items: center;
}
.dep-card-title a {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: #1a1410 !important;
    text-decoration: none;
    line-height: 1.28;
    text-shadow: none;
    display: block;
    transition: opacity .2s;
}
.dep-card-title a:hover { color: #1a1410 !important; opacity: .70; }

/* ================================================
   DIVIDER / DESC — ховаємо
   ================================================ */
.dep-card-divider { display: none !important; }
.dep-card-desc    { display: none !important; }

/* ================================================
   КНОПКА — footer рядок з круглою стрілкою
   ================================================ */

.dep-card-btn {
    margin-top: 14px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.dep-card-btn a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    color: rgba(0,0,0,.45) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-decoration: none;
    transition: color .2s ease;
    box-shadow: none !important;
    transform: none !important;
}
.dep-card-btn a:hover {
    color: #1a1410 !important;
    background: none !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Кругла стрілка */
.dep-card-btn a::after {
    content: '';
    display: inline-flex;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,.10) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%231a1410' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'><polyline points='9 18 15 12 9 6'/></svg>") center/13px no-repeat;
    border: 1.5px solid rgba(0,0,0,.15);
    box-sizing: border-box;
    transition: background-color .2s, transform .2s;
}
.dep-card-btn a:hover::after {
    background-color: rgba(0,0,0,.18);
    transform: translateX(2px);
}

/* ================================================
   Скасовуємо стару анімацію іконки
   ================================================ */
@keyframes dpIconBreath  { 0%,100%{ opacity:1; } 50%{ opacity:1; } }
@keyframes depIconBreath { 0%,100%{ opacity:1; } 50%{ opacity:1; } }
@media (hover: hover) {
    .dep-card:hover .dep-card-icon-wrap a {
        background: linear-gradient(145deg, #f9c47a 0%, #f0b48a 50%, #f5b099 100%) !important;
        border: none !important;
        box-shadow: 0 6px 22px rgba(234,168,125,.55) !important;
        animation: none !important;
    }
    .dep-card-icon-wrap a:hover {
        background: linear-gradient(145deg, #f9c47a 0%, #f0b48a 50%, #f5b099 100%) !important;
        border: none !important;
        box-shadow: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* ================================================
   LOAD MORE BUTTON
   ================================================ */

.dep-load-more-wrapper {
    text-align: center;
    margin-top: 20px;
}
.dep-load-more-wrapper button,
#sp-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 0px 0px 20px 20px;
    padding: 13px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(145deg, #e5b05e 0%, #e5a267 50%, #ba644a 100%);
    color: #fff;
    font-family: inherit;
    letter-spacing: .02em;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.dep-load-more-wrapper button:hover,
#sp-load-more:hover {
    background: linear-gradient(145deg, #f3b65d 0%, #eaa87d 50%, #f2a387 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(196,192,187,0.58);
}
.dep-load-more-wrapper button:active,
#sp-load-more:active { transform: translateY(0); }

/* ================================================
   SHOWN COUNT
   ================================================ */

.dep-shown-count {
    text-align: center;
    margin-top: 26px;
    font-size: 14px;
    color: #554d49;
}

/* ================================================
   CONTAINER / ANIMATIONS
   ================================================ */

#departments-container { position: relative; }
.spmedical-departments { will-change: opacity, transform; }

@keyframes dpFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes dpFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(6px); }
}
@keyframes dpSortExit {
    0%   { opacity: 1; transform: scale(1)    translateY(0);     }
    100% { opacity: 0; transform: scale(0.88) translateY(-12px); }
}
@keyframes dpSortEnter {
    0%   { opacity: 0; transform: scale(0.88) translateY(16px); }
    100% { opacity: 1; transform: scale(1)    translateY(0);    }
}

.dep-card-enter  { animation: dpFadeUp   0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }
.dep-card-exit   { animation: dpFadeOut  0.2s  ease both; pointer-events: none; }
.dep-sort-exit   { animation: dpSortExit  180ms ease-in both; }
.dep-sort-enter  { animation: dpSortEnter 260ms cubic-bezier(0.22, 1, 0.36, 1) both; }

.dep-cards-grid.sorting {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ================================================
   dep-s-filters (secondary filters block)
   ================================================ */

.dep-s-filters-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding-top: 4px;
}
.dep-s-filter-field { display: flex; flex-direction: column; gap: 4px; }
.dep-s-filter-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .10em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    padding-left: 4px;
    margin-bottom: 2px;
    line-height: 1;
}
.dep-s-filters-grid select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 16px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background-color: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.30);
    border-radius: 0px 14px 14px 14px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffffff' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    transition: background-color .22s ease, border-color .22s ease;
    max-width: none;
}
.dep-s-filters-grid select option { background: #a0602a; color: #fff; }
.dep-s-filters-grid select:hover  { background-color: rgba(255,255,255,.22); border-color: rgba(255,255,255,.50); }
.dep-s-filters-grid select:focus  { background-color: rgba(255,255,255,.25); border-color: rgba(255,255,255,.70); box-shadow: none; }

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

@media (max-width: 1200px) {
    .dep-cards-grid { grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
    .dep-filter-field { min-width: 140px; }
}
@media (max-width: 900px) {
    .dep-cards-grid { grid-template-columns: repeat(2, 1fr); }
    .dep-filter-field { min-width: calc(50% - 7px); }
    .dep-s-filters-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .dep-filters-wrapper { flex-wrap: wrap; padding: 20px 22px 22px; gap: 14px; }
    .title-dep-fil { display: none; }
    .dep-search-row { flex: 1 1 100%; width: 100%; min-width: 0; }
    .dep-filters-toggle { flex: 1 1 auto; }
    .dep-found-badge { margin-left: auto; }
}
@media (max-width: 650px) {
    .dep-filters-wrapper { padding: 18px 16px 20px; gap: 12px; }
    .dep-sort-bar { gap: 6px; }
    .dep-sort-label { padding-left: 0; font-size: 11px; }
    .dep-sort-select { font-size: 14px; height: 40px; min-width: 0; flex: 1; }
    .dep-filters-grid { gap: 7px; padding: 12px 0 14px; flex-direction: column; }
    .dep-filter-field { flex-direction: row; align-items: center; gap: 8px; min-width: 0; }
    .dep-filter-label { flex: 0 0 90px; padding-left: 0; margin-bottom: 0; white-space: nowrap; }
    .dep-filter-field select { flex: 1; height: 40px; }
    .dep-s-filters-grid { grid-template-columns: 1fr; gap: 7px; }
    .dep-s-filter-field { flex-direction: row; align-items: center; gap: 8px; }
    .dep-s-filter-label { flex: 0 0 90px; padding-left: 0; margin-bottom: 0; white-space: nowrap; }
    .dep-s-filter-field select { flex: 1; height: 40px; }
}
@media (max-width: 600px) {
    .dep-cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }

    .dep-card {
        display: flex;
        flex-direction: column;
        min-height: 190px;
        padding: 16px !important;
    }
    .dep-card-icon-wrap a { width: 50px !important; height: 50px !important; }
    .dep-card-title a { font-size: 17.5px !important; line-height: 1.1; letter-spacing: -0.2px; }
    .dep-card-type { font-size: 9px !important; }
    .dep-card::after { font-size: 88px; }
    .dep-card-btn a { font-size: 13px !important; line-height: 1; }
    .spmedical-departments { padding: 10px !important; }
}
/* ================================================
   DEP_MODULE — SP Medical component overrides
   (перенесено з default-dp.php)
   ================================================ */

.spmedical-departments-list {
    --dp-accent:       linear-gradient(145deg, #e5b05e 0%, #e5a267 50%, #ba644a 100%);
    --dp-accent-h:     linear-gradient(145deg, #f3b65d 0%, #eaa87d 50%, #f2a387 100%);
    --dp-accent-solid: #e5a267;
    --dp-bg:           rgb(245,244,244);
    --dp-bg-card:      #ffffff;
    --dp-border:       rgba(0,0,0,0.06);
    --dp-text:         #1a1410;
    --dp-muted:        #554d49;
    --dp-radius:       0px 26px 26px 26px;
    --dp-radius-pill:  0px 14px 14px 14px;
    --dp-shadow:       0 2px 18px rgba(200,135,26,.07), 0 1px 4px rgba(0,0,0,.03), inset 0 1px 0 rgba(255,255,255,.75);
    --dp-shadow-h:     0 14px 42px rgba(196,192,187,0.58), 0 2px 10px rgba(0,0,0,.04), inset 0 1px 0 rgba(255,255,255,.88);
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
    font-family: inherit;
    animation: dpSlideIn 0.5s ease both;
}

.dep-cards-grid,
#departments-container .spmedical-departments-wrapper,
#departments-container > .spmedical-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 25px;
    align-items: start;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
}

.spmedical-departments {
    border-radius: 0px 22px 22px 22px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transition: transform .35s cubic-bezier(.22,.68,0,1.2), box-shadow .35s ease !important;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
    min-height: 220px;
}

.spmedical-departments.spmedical-col-xl-3,
.spmedical-departments.spmedical-col-lg-4,
.spmedical-departments.spmedical-col-md-6,
.spmedical-departments[class*="spmedical-col-"] {
    flex: none !important;
    max-width: none !important;
    width: 100% !important;
}

@media (hover: hover) {
    .spmedical-departments:hover {
        transform: translateY(-5px) scale(1.015) !important;
        box-shadow: none !important;
    }
}

.spmedical-departments .spmedical-department-wrap {
    border-radius: var(--dp-radius) !important;
    overflow: hidden;
}
.spmedical-departments .spmedical-department-wrap.has-image > a::before {
    background-image: linear-gradient(-180deg, rgba(229,162,103,0) 3%, #ba644a 98%) !important;
}
.spmedical-departments .spmedical-department-wrap.has-image:hover > a::before {
    background-color: #ba644a !important;
    opacity: .9;
}
.spmedical-departments .spmedical-department-wrap.has-icon .spmedical-department-icon-wrap {
    border-radius: var(--dp-radius) !important;
    border-color: var(--dp-border) !important;
    transition: .4s !important;
}
.spmedical-departments .spmedical-department-wrap.has-icon:hover .spmedical-department-icon-wrap {
    background-color: #c8671a !important;
    box-shadow: 0 15px 35px 0 rgba(0,0,0,.3) !important;
    border-color: #c8671a !important;
}
.spmedical-departments .spmedical-department-wrap.has-icon .spmedical-department-title a:hover {
    color: #c8671a !important;
}

.dep-load-more-wrapper { text-align: center; }

#sp-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    border-radius: 0px 0px 20px 20px;
    padding: 13px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(145deg, #ffbd56 0%, #e29f65 50%, #d14e4e 100%);
    color: #fff;
    font-family: inherit;
    letter-spacing: .02em;
    transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
#sp-load-more:hover {
    background: linear-gradient(145deg, #ffb23a 0%, #ffb473 50%, #ff4f4f 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(196,192,187,0.58);
}
#sp-load-more:active { transform: translateY(0); }

.dep-shown-count {
    text-align: center;
    margin-top: 26px;
    font-size: 14px;
    color: var(--dp-muted);
}

@media (max-width: 1200px) {
    .dep-cards-grid,
    #departments-container .spmedical-departments-wrapper,
    #departments-container > .spmedical-row {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 900px) {
    .dep-cards-grid,
    #departments-container .spmedical-departments-wrapper,
    #departments-container > .spmedical-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 860px) {
    .dep-filters-wrapper { flex-wrap: wrap; padding: 20px 22px 22px; gap: 14px; }
    .title-dep-fil { display: none; }
    .dep-search-row { flex: 1 1 100%; width: 100%; min-width: 0; }
    .dep-filters-toggle { flex: 1 1 auto; }
    .dep-found-badge { margin-left: auto; }
    .dep-filters-grid { flex-direction: column; gap: 8px; padding: 16px 0 18px; }
    .dep-filter-field { min-width: 0; }
}
@media (max-width: 600px) {
    #departments-container .spmedical-departments-wrapper,
    #departments-container > .spmedical-row {
        grid-template-columns: 1fr;
        margin-top: 0;
    }
    .dep-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 20px;
    }
    .dep-filters-wrapper { padding: 18px 16px 20px; gap: 12px; }
}