/**
 * Doctors Slider - Universal styles
 * Based on doctor.html design
 */

:root {
  --doc-color-blue: #45BEDB;
  --doc-color-red: #FD2629;
  --doc-color-dark: #0f172a;
}

/* ========== SECTION WRAPPER ========== */
.doctors-section {
  max-width: 1240px;
  margin: 40px auto;
  position: relative;
  padding: 0 50px;
}

.doctors-section .section-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--doc-color-dark);
}

/* ========== CAROUSEL ========== */
.doctors-carousel-window {
  position: relative;
  padding: 20px 10px 40px 10px;
  overflow: hidden;
}

.doctors-carousel-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ========== DOCTOR CARD ========== */
.doctor-card {
  min-width: 300px;
  max-width: 300px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(69, 190, 219, 0.3);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Photo wrapper */
.doctor-card__photo-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  height: 250px;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

img.doctor-card__photo {
  width: auto;
  height: 100% !important;
  object-fit: cover;
  object-position:center;
  transition: transform 0.5s ease;
}

.doctor-card:hover .doctor-card__photo {
  transform: scale(1.05);
}

/* Logo badge */
.doctor-card__logo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 10px;
  border-radius: 8px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doctor-card__logo-badge img {
  height: 22px;
  max-height: 22px;
  width: auto;
  max-width: 30px;
  display: block;
}

.doctor-card__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.doctor-card__logo-clinic {
  color: var(--doc-color-blue);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.doctor-card__logo-name {
  color: var(--doc-color-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Experience badge */
.doctor-card__exp-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--doc-color-blue);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 8px rgba(69, 190, 219, 0.4);
  z-index: 2;
}

/* Card body */
.doctor-card__body {
  padding: 15px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background: #fff;
}

.doctor-card__name {
  font-family: 'Uni Neue', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--doc-color-dark);
  margin: 0 0 4px 0;
  line-height: 1.2;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: color 0.3s ease;
}

.doctor-card__name:hover {
  color: var(--doc-color-blue);
}

.doctor-card__spec {
  font-size: 11px;
  color: var(--doc-color-blue);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 700;
}

/* Contacts block */
.doctor-card__contacts {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
}

/* Main button */
.doctor-card__main-btn {
  background: var(--doc-color-red);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: center;
  padding: 0 12px;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  transition: background 0.3s;
  box-shadow: 0 4px 10px rgba(253, 38, 41, 0.2);
  border: none;
  cursor: pointer;
}

.doctor-card__main-btn:hover {
  background: var(--doc-color-blue);
  color: #fff;
}

/* Icons group */
.doctor-card__icons-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Icon buttons */
.doctor-card__icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: transparent;
}

.doctor-card__icon-btn:hover {
  border-color: var(--doc-color-blue);
  color: var(--doc-color-blue);
  background: #f0fbff;
}

.doctor-card__icon-svg {
  width: 20px;
  height: 20px;
  min-width: 20px;
  max-width: 20px;
  min-height: 20px;
  max-height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Ensure SVG path inherits fill */
.doctor-card__icon-btn svg {
  width: 20px;
  height: 20px;
}

.doctor-card__icon-btn svg path {
  fill: currentColor;
}

/* Phone button (hidden on desktop) */
.doctor-card__icon-btn--phone {
  display: none;
  border-color: var(--doc-color-red);
  color: var(--doc-color-red);
}

.doctor-card__icon-btn--phone:hover {
  background: var(--doc-color-red);
  color: #fff;
}

/* WhatsApp button */
.doctor-card__icon-btn--whatsapp:hover {
  border-color: #25D366;
  color: #25D366;
  background: rgba(37, 211, 102, 0.1);
}

/* Telegram button */
.doctor-card__icon-btn--telegram:hover {
  border-color: #0088cc;
  color: #0088cc;
  background: rgba(0, 136, 204, 0.1);
}

/* ========== NAVIGATION BUTTONS ========== */
.doctors-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  margin-top: -10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--doc-color-blue);
  background: #fff;
  color: var(--doc-color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.doctors-nav-btn:hover:not(.disabled) {
  background: var(--doc-color-blue);
  color: #fff;
}

.doctors-nav-btn--prev {
  left: 0;
}

.doctors-nav-btn--next {
  right: 0;
}

.doctors-nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
  border-color: #cbd5e1;
}

/* ========== VIEW ALL LINK ========== */
.doctors-section__view-all {
  text-align: center;
  margin-top: 20px;
}

.doctors-section__view-all-link {
  display: inline-block;
  color: var(--doc-color-blue);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--doc-color-blue);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.doctors-section__view-all-link:hover {
  background: var(--doc-color-blue);
  color: #fff;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .doctors-section {
    padding: 0 50px;
  }

  .doctor-card {
    min-width: 280px;
    max-width: 280px;
  }
}

@media (max-width: 768px) {
  .doctors-section {
    padding: 0 15px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .doctors-nav-btn {
    display: none;
  }

  /* Spacer after last card so border is visible */
  .doctors-carousel-track::after {
    content: '';
    flex-shrink: 0;
    min-width: 15px;
  }

  .doctor-card {
    min-width: 260px;
    max-width: 260px;
  }

  .doctor-card__photo-wrapper {
    height: 210px;
  }

  .doctor-card__name {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .doctor-card__body {
    padding: 12px;
  }

  /* Change contacts layout to column */
  .doctor-card__contacts {
    flex-direction: column;
    gap: 10px;
  }

  .doctor-card__main-btn {
    width: 100%;
    height: auto;
    padding: 12px 0;
    font-size: 10px;
  }

  .doctor-card__icons-group {
    width: 100%;
    justify-content: space-between;
  }

  .doctor-card__icon-btn {
    flex: 1;
    width: auto;
    height: 44px;
  }

  /* Show phone button */
  .doctor-card__icon-btn--phone {
    display: flex;
  }
}

@media (max-width: 567px) {
  .doctor-card {
    min-width: 240px;
    max-width: 240px;
  }

  .doctor-card__photo-wrapper {
    height: 200px;
  }

  .doctors-carousel-window {
    padding: 10px 5px 30px 5px;
  }
}

/* ========== GRID MODE (страница всех врачей) ========== */
.doctors-section--grid .doctors-carousel-track {
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.doctors-section--grid .doctor-card {
  flex: 0 0 calc(33.333% - 14px);
  min-width: 0;
  max-width: calc(33.333% - 14px);
}

@media (max-width: 1024px) {
  .doctors-section--grid .doctor-card {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

@media (max-width: 640px) {
  .doctors-section--grid .doctor-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ========== CENTERED MODE (when all cards fit) ========== */
/* JS добавляет этот класс когда все карточки помещаются в контейнер */
.doctors-section--centered .doctors-carousel-track {
  justify-content: center;
}

.doctors-section--centered .doctors-nav-btn {
  display: none !important;
}

/* ========== FIX UNWANTED TAGS FROM WYSIWYG ========== */
/* Hide empty <p> tags inside doctor cards */
.doctor-card p:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}

/* Hide <p> tags inside icons group and logo badge (WordPress adds them) */
.doctor-card__icons-group > p,
.doctor-card__logo-badge > p,
.doctor-card__photo-wrapper > p {
  display: contents !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hide <br> tags in specific places (but keep them in main button) */
.doctor-card__icons-group > br,
.doctor-card__contacts > br,
.doctor-card__logo-badge > br {
  display: none !important;
}

/* Hide comment nodes that appear as text (if any) */
.doctor-card__icons-group > br:first-child {
  display: none !important;
}

.doctor-card__logo-text br{
  display: none !important;
}

/* ========== SIDEBAR DOCTOR CARD (New Design) ========== */
.sidebar-doctor-card-wrapper {
  margin-bottom: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.sidebar-doctor-card-wrapper--top {
  /* Normal flow */
}

.sidebar-doctor-card-wrapper--bottom {
  /* Normal flow, becomes sticky via JS */
}

/* When sticky is active - fixed to viewport */
.sidebar-doctor-card-wrapper--bottom.is-sticky {
  position: fixed;
  top: 100px;
  z-index: 100;
}

/* When reached end of sidebar - stop at bottom */
.sidebar-doctor-card-wrapper--bottom.is-stopped {
  position: absolute;
  bottom: 0;
  top: auto !important;
  left: 0 !important;
  width: 100% !important;
}

/* SDC = Sidebar Doctor Card */
.sdc {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #f1f5f9;
  position: relative;
  transition: all 0.3s ease;
}

.sdc:hover {
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
  border-color: #e0f2fe;
}

/* Verified Badge */
.sdc__verified-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sdc__verified-badge svg {
  flex-shrink: 0;
}

/* Photo Section */
.sdc__photo-section {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f8fafc;
}

.sdc__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.7s ease;
}

.sdc:hover .sdc__photo {
  transform: scale(1.05);
}

/* Logo Badge */
.sdc__logo-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 10px;
  border-radius: 8px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdc__logo-badge img {
  height: 22px;
  max-height: 22px;
  width: auto;
  max-width: 30px;
  display: block;
}

.sdc__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.sdc__logo-clinic {
  color: var(--doc-color-blue);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sdc__logo-name {
  color: var(--doc-color-red);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Experience Badge */
.sdc__exp-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sdc__exp-icon {
  background: #dcfce7;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdc__exp-icon svg {
  color: #16a34a;
}

.sdc__exp-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.sdc__exp-label {
  font-size: 9px;
  color: #6b7280;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sdc__exp-value {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

/* Content Section */
.sdc__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Rating */
.sdc__rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sdc__stars {
  display: flex;
  gap: 2px;
}

.sdc__stars svg {
  color: #facc15;
}

.sdc__reviews {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
}

/* Name */
.sdc__name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  text-align: center;
  line-height: 1.3;
  text-decoration: none;
  display: block;
  transition: color 0.3s;
}

.sdc__name:hover {
  color: #2563eb;
}

/* Specialization */
.sdc__spec {
  font-size: 11px;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-align: center;
}

/* Description */
.sdc__desc {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* CTA Button */
.sdc__cta-btn {
  width: 100%;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.sdc__cta-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.sdc__cta-btn:active {
  transform: scale(0.98);
}

.sdc__cta-btn svg {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Contact Buttons */
.sdc__contacts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sdc__contact-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  text-decoration: none;
  transition: all 0.3s;
  gap: 4px;
}

.sdc__contact-btn:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
}

.sdc__contact-btn--phone {
  grid-column: span 2;
  flex-direction: row;
  gap: 8px;
  padding: 12px;
}

.sdc__contact-btn--phone:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
}

/* Pulsing phone icon animation */
.sdc__phone-icon-pulse {
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

.sdc__contact-btn--whatsapp:hover {
  background: #f0fdf4;
  border-color: #25D366;
  color: #25D366;
}

.sdc__contact-btn--telegram:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #2563eb;
}

.sdc__contact-label {
  font-size: 10px;
  font-weight: 500;
}

.sdc__contact-number {
  font-size: 13px;
  font-weight: 700;
  display: none;
}

@media (min-width: 1200px) {
  .sdc__contact-btn--phone .sdc__contact-label {
    display: none;
  }
  .sdc__contact-number {
    display: block;
  }
}

/* Footer: Online Status */
.sdc__footer {
  background: #f8fafc;
  padding: 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sdc__status-dot {
  position: relative;
  width: 8px;
  height: 8px;
}

.sdc__status-dot::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #22c55e;
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.sdc__status-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: #22c55e;
  border-radius: 50%;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.sdc__status-text {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
}

/* Cards hide together with sidebar (no separate breakpoint) */
