/*
 * Профил на лекар (templates/public/lekar_details.php) — /lekars/{slug}. Стойностите са измерени от досегашния изглед
 * (изчислените стилове, 21.10.2026), за да е „същото на око“. Компютър — .lekar-profile--desktop, телефон — --mobile
 * (сървърът решава кой вариант, $mobile). Календарът е FullCalendar (неговият CSS идва с библиотеката) + правилата долу.
 */
.page-profile { background: #f8fafc; }

/* ── Общи за двата варианта ───────────────────────────────────────────────── */
.lekar-profile__link { color: inherit; }
.lekar-profile__link:hover, .lekar-profile__link:focus { color: var(--ink-link); text-decoration: underline; }
.lekar-profile__photo { display: block; width: 200px; height: 250px; border: 1px solid var(--color-border); border-radius: 10px; object-fit: cover; }
.lekar-profile__name { color: var(--ink-heading); font-weight: 700; }
.lekar-profile__specialties { color: var(--ink-body); }
.lekar-profile__specialties-label { color: var(--ink-muted); }

/* Уебсайт и мрежи (A16): иконите в цветовете на мрежите, Instagram — преливащ (градиентът е в шаблона) */
.lekar-profile__web { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-small); line-height: var(--lh-small); }
.lekar-profile__web > li { display: flex; }
.lekar-profile__web-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-link); font-weight: 600; }
.lekar-profile__web-link:hover { text-decoration: underline; }
.lekar-profile__web-icon { width: 18px; height: 18px; }
.lekar-profile__web-icon--globe { color: var(--color-slate-600); }
.lekar-profile__web-icon--facebook { color: #1877f2; }
.lekar-profile__web-icon--linkedin { color: #0a66c2; }
.lekar-profile__web-icon--instagram { color: #e1306c; fill: url(#lp-instagram-gradient); }

/* Няколко снимки — точки под снимката; плъзгането наляво/надясно сменя снимката (lekar-profile.js) → браузърът тук
   само превърта нагоре/надолу и приближава */
.photo-slides { position: relative; width: 200px; margin: 0 auto; padding-bottom: 20px; touch-action: pan-y pinch-zoom; }
.photo-slides__dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; }
.photo-slides__dot {
  width: 9px; height: 9px; margin: 0 4px; padding: 0; border: 0; border-radius: 50%;
  background: var(--color-border-strong); transition: background-color 0.2s;
}
.photo-slides__dot[aria-current="true"] { background: var(--color-primary); }
.photo-slides--small { width: 96px; padding-bottom: 14px; }
.photo-slides--small .photo-slides__dot { width: 6px; height: 6px; margin: 0 3px; }

/* Описанието (изчистен HTML от лекаря) */
/* междуредът е 1.5 от шрифта (и за вложен текст с друг размер); вложените елементи — Inter, самият блок — Helvetica (както досега) */
.lekar-profile__bio { color: var(--ink-body); font: var(--text-body); }
.lekar-profile__bio * { font-family: var(--font-text); }
.lekar-profile__bio p { margin: 0 0 10px; padding: 0; }
.lekar-profile__bio ul, .lekar-profile__bio ol { display: block; margin: 0 0 10px 25px; padding-left: 20px; }
.lekar-profile__bio ul { list-style: disc; }
.lekar-profile__bio ol { list-style: decimal; }
.lekar-profile__bio li { display: list-item; margin-bottom: 8px; padding-left: 5px; font-size: var(--fs-body); line-height: var(--lh-body); }

/* ── Графиците ────────────────────────────────────────────────────────────── */
.schedule { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.schedule__radio { flex: none; width: 13px; height: 13px; margin: 2px 0 0; cursor: pointer; }
.schedule__body { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: color 0.2s ease; }
.schedule__title { color: var(--ink-heading); font-size: var(--fs-body); font-weight: 600; line-height: var(--lh-body); }
.schedule__meta { display: flex; flex-direction: column; gap: 4px; color: var(--ink-body); font-size: var(--fs-note); line-height: var(--lh-note); }
.schedule__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.schedule__icon { flex: none; width: 15.2px; height: 15.2px; color: var(--color-primary); }
.schedule__meta .phone-links a { color: inherit; text-decoration: underline; }
.schedule__body.is-active .schedule__title, .schedule__body.is-active .schedule__meta { color: var(--ink-link); }
.schedule--single { flex-direction: column; align-items: stretch; gap: 6px; margin: 0; padding: 4px 0; }

/* Чиповете */
.lekar-profile__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px; padding: 0 16px 8px; line-height: 1; }
.lekar-profile__chip {
  display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid #bae6fd; border-radius: 6px;
  background: var(--color-primary-soft); color: var(--ink-link); font-size: var(--fs-tiny); font-weight: 600; line-height: var(--lh-tiny); white-space: nowrap;
}

/* „Моля позвънете“ (без иконката — Тео, 21.10.2026) */
.call-card {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 16px 20px;
  border: 1px solid #bae6fd; border-left: 4px solid var(--color-primary); border-radius: 6px; background: var(--color-primary-soft);
}
.call-card__body { flex: 1; }
.call-card__text { margin: 0 0 6px; color: var(--ink-body); font-weight: 500; }
.call-card__phone { color: var(--ink-link); font-size: var(--fs-h2); font-weight: 700; line-height: var(--lh-h2); }

/* „Промяна на час“ (лекар мести час на пациент) */
.reschedule-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 12px; padding: 9.6px 14.4px; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 6px;
  background: #fffbeb; color: #78350f; font-size: var(--fs-body); line-height: var(--lh-body);
}
.reschedule-banner__label {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: #f59e0b; color: var(--color-white);
  font-size: var(--fs-tiny); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; line-height: var(--lh-tiny);
}
.reschedule-banner__current { margin-left: 4px; color: #92400e; }
.reschedule-banner__cancel {
  padding: 5.6px 12.8px; border: 1px solid #f59e0b; border-radius: 6px; background: var(--color-white); color: #92400e;
  font-size: var(--fs-note); font-weight: 600; white-space: nowrap; line-height: var(--lh-note);
}
.reschedule-banner__cancel:hover { background: #fef3c7; }

/* „Важна информация“ и „Здравни фондове“ */
.notice { padding: 12px 16px; border-left: 4px solid var(--color-primary); border-radius: 4px; background: #f8fafc; }
.notice__title { margin-bottom: 4px; color: var(--ink-link); font-size: var(--fs-note); font-weight: 700; line-height: var(--lh-note); text-transform: uppercase; }
.notice__text { color: var(--ink-body); font-size: var(--fs-small); font-weight: 600; line-height: var(--lh-small); }
.funds {
  padding: 8px 12px; border: 1px solid #bae6fd; border-radius: 6px; background: var(--color-primary-soft);
  color: var(--ink-body); font-size: var(--fs-small); line-height: var(--lh-small);
}
.funds__title { display: flex; align-items: center; gap: 8px; color: var(--ink-heading); font-weight: 700; list-style: none; cursor: pointer; user-select: none; }
.funds__title::-webkit-details-marker { display: none; }
.funds__title::before { content: "▸"; color: var(--ink-link); transition: transform 0.2s ease; }
.funds[open] .funds__title::before { transform: rotate(90deg); }
.funds__text { padding: 6px 0 0 18px; }
/* всяко име цяло — редът се пренася само след запетаята (№ 9; най-дългото — 17 знака) */
.funds__name { white-space: nowrap; }

/* ── „Следващ свободен час“ (13.11.2026) ──────────────────────────────────── */
/* води до часа в графика (не записва) → светлосиньото --btn-main; на компютър — до снимката, на два реда; на телефон — над
   графика, по цялата ширина, на един ред (на 320px се пренася на два) */
.next-free {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: var(--radius-sm); background: var(--btn-main); color: var(--color-white);
  font: 600 var(--fs-small)/var(--lh-small) var(--font-text); cursor: pointer;
}
.next-free:hover { background: var(--btn-main-hover); }
.next-free__label, .next-free__time { white-space: nowrap; }
.next-free__time { display: inline-flex; align-items: center; gap: 6px; }
.next-free svg { flex: none; width: 1em; height: 1em; }
/* часът, до който води бутонът: общият контур (Обща визия т. 4), докато е на фокус */
.lekar-profile .fc-event.is-next-free, .slots-dialog__slot.is-next-free { outline: 2px solid var(--btn-main); outline-offset: 2px; }
/* само рамка: без тъмния слой, който FullCalendar слага върху час на фокус (часът би изглеждал като зает) */
.lekar-profile .fc-event.is-next-free::after { content: none; }

/* ── Календарът (FullCalendar) ────────────────────────────────────────────── */
.calendar { position: relative; }
.calendar__grid { height: 410px !important; }
.calendar-loading {
  position: absolute; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 6px; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(2px);
}
.calendar-loading__text { margin-top: 12px; color: var(--ink-body); font-size: var(--fs-small); font-weight: 500; line-height: var(--lh-small); }
.lekar-profile .fc { color: var(--ink-body); }
.lekar-profile .fc .fc-toolbar-title { color: var(--ink-heading); font: 500 var(--fs-h2)/var(--lh-h2) var(--font-text); letter-spacing: normal; }
.lekar-profile .fc .fc-event-time, .lekar-profile .fc .fc-event { font-size: var(--fs-tiny); }
.lekar-profile .fc-daygrid-event-dot, .lekar-profile .fc-event-title { display: none !important; }
.lekar-profile .fc-event { width: 100% !important; padding: 5px !important; border-radius: 5px !important; line-height: 20px !important; text-align: left !important; }
.lekar-profile .fc-event.busy { border: 1px solid gray !important; background-color: #fee2e2 !important; color: var(--ink-body)!important; cursor: pointer !important; }
.lekar-profile .fc-event.available { border: 1px solid #cbd1d6 !important; background-color: #dcfce7 !important; color: var(--ink-body)!important; cursor: pointer !important; }
.lekar-profile .fc-event.empty { background-color: #b1b3ae !important; color: var(--ink-muted)!important; cursor: default !important; }
.lekar-profile .fc-event.past { background-color: #d3d3d3 !important; color: #777 !important; pointer-events: none; opacity: 0.6; }
.lekar-profile .fc-daygrid-day-events .fc-event { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lekar-profile .fc-daygrid-day-events::before { content: none !important; display: none !important; }
.lekar-profile .fc .fc-daygrid-day-events.cols-1 { display: flex !important; flex-direction: column !important; gap: 6px !important; padding: 0 !important; }
.lekar-profile .fc .fc-daygrid-day-events.cols-2 {
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 6px 8px !important; padding: 5px !important;
}
.lekar-profile .fc .fc-daygrid-day-events.cols-1 .fc-event, .lekar-profile .fc .fc-daygrid-day-events.cols-1 .fc-daygrid-event-harness,
.lekar-profile .fc .fc-daygrid-day-events.cols-2 .fc-event, .lekar-profile .fc .fc-daygrid-day-events.cols-2 .fc-daygrid-event-harness { width: 100% !important; }
.lekar-profile a.fc-daygrid-more-link.fc-more-link {
  position: relative; z-index: 10; float: none !important; display: block !important; padding: 1px 4px !important; border-radius: 6px;
  color: var(--ink-link)!important; font-size: 12px !important; font-weight: 600; line-height: 1.2 !important;
}
.lekar-profile .fc-daygrid-day.day-empty { position: relative; border: 1px dashed var(--color-border-strong) !important; border-radius: 7px; background: #f8fafc !important; }
.lekar-profile .fc-daygrid-day.day-empty .fc-daygrid-day-events { display: flex !important; align-items: center; justify-content: center; min-height: 120px; }
.lekar-profile .fc-daygrid-day.day-empty::before {
  content: "Няма часове"; position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -50%);
  color: var(--ink-muted); font-size: var(--fs-note); font-weight: 500; white-space: nowrap; pointer-events: none; line-height: var(--lh-note);
}
.lekar-profile .fc-more-popover .fc-popover-body {
  display: grid !important; grid-template-columns: 1fr 1fr !important; grid-auto-flow: dense !important; gap: 8px !important;
  max-height: 400px !important; overflow-y: auto !important;
}
.lekar-profile .fc-more-popover .fc-event { padding: 6px !important; border-radius: 4px !important; break-inside: avoid !important; }

/* ── Диалозите (siteDialog) ───────────────────────────────────────────────── */
.count-dialog { width: 400px; }
.count-dialog__header { height: 48px; margin-bottom: 1px; border-radius: 6px 6px 0 0; background: var(--color-primary); }
.count-dialog__content { text-align: center; }
.count-dialog__message { color: var(--ink-heading); font: 600 var(--fs-h2)/var(--lh-h2) var(--font-text); letter-spacing: 0.5px; }
.count-dialog__ok {
  padding: 8px 16px; border: 0; border-radius: 4px; background: var(--btn-main); color: var(--color-white);
  font-size: var(--fs-small); font-weight: 600; line-height: var(--lh-small);
}
.count-dialog__ok:hover { background: var(--btn-main-hover); }
.slots-dialog { width: 85vw; max-width: 320px; max-height: 70vh; }
/* празното ::before (40px, както в Material) — заглавието е по средата между него и ✕ */
.slots-dialog__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 24px 9px; background: #e5e7eb; }
.slots-dialog__header::before { content: ""; display: inline-block; height: 40px; }
.slots-dialog__title { font-family: var(--font-text); }
.slots-dialog__close { padding: 0; border: 0; background: none; color: rgba(0, 0, 0, 0.87); font: 500 20px/32px var(--font-text); }
.slots-dialog__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.slots-dialog__slot {
  padding: 5px; border: 1px solid #cbd1d6; border-radius: 5px; background: #dcfce7; color: var(--ink-body);
  font: 600 var(--fs-tiny)/var(--lh-tiny) var(--font-text); letter-spacing: 0.5px; text-align: center;
}
.slots-dialog__slot.is-busy { border-color: gray; background: #fee2e2; opacity: 0.5; pointer-events: none; }

/* ══ Компютър ═════════════════════════════════════════════════════════════════ */
.lekar-profile--desktop .lekar-profile__page { width: 100%; max-width: 1800px; margin: 20px auto 40px; padding: 0 16px; }
/* Двете колони: описанието вляво (до 650px), графикът и календарът вдясно. Календарът иска поне 732px — под 1490px
   лявата колона се свива, под 1292px всичко е едно под друго (иначе календарът излизаше извън екрана; Тео, 21.10.2026). */
.lekar-profile__columns {
  position: relative; display: grid; grid-template-columns: minmax(0, 650px) minmax(732px, 1fr); gap: 30px;
  padding: 20px 24px; border-radius: 10px;
}
/* лявата колона — висока колкото съдържанието си, както дясната (.lekar-profile__booking): описанието е винаги на 34px
   под снимката (24 + 10, замисълът на старата); при по-висок график празното място остава под описанието (Тео, 27.10.2026) */
.lekar-profile__about { display: grid; grid-template-rows: auto auto; gap: 24px; align-self: start; min-width: 0; }
.lekar-profile--desktop .lekar-profile__head { display: grid; grid-template-columns: 200px 1fr; gap: 10px; }
.lekar-profile--desktop .lekar-profile__head > .lekar-profile__photo, .lekar-profile--desktop .photo-slides { align-self: start; } /* горе, до името — както в старата (одит 26.10) */
.lekar-profile--desktop .lekar-profile__intro { padding: 16px 10px 10px; color: var(--ink-body); font-size: var(--fs-small); line-height: var(--lh-small); }
.lekar-profile--desktop .lekar-profile__name { margin-bottom: 1px; font-size: var(--fs-h2); line-height: var(--lh-h2); }
.lekar-profile--desktop .lekar-profile__web { margin-top: 18px; }
/* под специалностите (и под връзките, ако има): 30px отгоре (Тео, 13.11.2026); малък надпис + датата и часът */
.lekar-profile--desktop .next-free { flex-direction: column; gap: 0; margin-top: 30px; padding: 6px 16px; }
.lekar-profile--desktop .next-free__label { font-size: var(--fs-tiny); font-weight: 500; line-height: var(--lh-tiny); }
.lekar-profile--desktop .lekar-profile__bio { padding: 10px 20px 10px 0; }
.lekar-profile__booking { display: flex; flex-direction: column; gap: 16px; align-self: start; min-width: 0; }
.lekar-profile__booking.is-sticky { position: sticky; top: 24px; }
.lekar-profile__booking-main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.lekar-profile__booking-extra { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.lekar-profile--desktop .schedules { padding: 16px; border-radius: 8px; }
.lekar-profile--desktop .schedule--single { padding: 20px 16px; }
.lekar-profile--desktop .schedule__meta { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; }
.lekar-profile--desktop .calendar { padding: 16px; border-radius: 8px; background: var(--color-white); }
.lekar-profile--desktop .calendar__grid { min-width: 700px; }
/* „Моля позвънете“ и „Здравни фондове“ преливат от светлосиньо към фона вдясно */
.lekar-profile--desktop .call-card { margin-left: 16px; }
.lekar-profile--desktop .call-card, .lekar-profile--desktop .funds {
  border-top: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 6px;
  background:
    linear-gradient(90deg, #bae6fd 0%, rgba(186, 230, 253, 0.55) 40%, rgba(186, 230, 253, 0) 100%) top / 100% 1px no-repeat,
    linear-gradient(90deg, #bae6fd 0%, rgba(186, 230, 253, 0.55) 40%, rgba(186, 230, 253, 0) 100%) bottom / 100% 1px no-repeat,
    linear-gradient(90deg, #e0f2fe 0%, #e5f4fe 20%, #ecf6fd 50%, #f4f9fc 78%, #f8fafc 100%);
}
/* една под друга (таблет, малък лаптоп): снимката и името → графикът и календарът → описанието (Тео, 21.10.2026 —
   повечето влизат да запазят час) */
@media (max-width: 1291px) {
  .lekar-profile__columns { grid-template-columns: minmax(0, 1fr); }
  .lekar-profile__about { display: contents; }
  .lekar-profile--desktop .lekar-profile__head { order: 1; }
  .lekar-profile--desktop .lekar-profile__booking { order: 2; }
  .lekar-profile--desktop .lekar-profile__bio { order: 3; }
  .lekar-profile__booking.is-sticky { position: static; }
}

/* ══ Телефон ══════════════════════════════════════════════════════════════════ */
.lekar-profile--mobile .lekar-profile__page { margin: 10px auto; padding: 0 10px; }
.lekar-profile--mobile .back-link { margin-bottom: 10px; }
.lekar-profile__card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); }
.lekar-profile--mobile .lekar-profile__head { display: flex; align-items: flex-start; gap: 12px; padding: 12px 10px 0; }
.lekar-profile__photo--small { flex: 0 0 96px; width: 96px; height: 96px; border: 0; border-radius: 6px; object-position: top center; }
.lekar-profile--mobile .lekar-profile__intro { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lekar-profile--mobile .lekar-profile__name { font-size: var(--fs-h2); line-height: var(--lh-h2); }
.lekar-profile--mobile .lekar-profile__specialties { white-space: pre-line; }
/* под „Здравни фондове“, преди описанието (№ 8): отстъпът — като на описанието, отгоре — разстоянието на картата */
.lekar-profile--mobile .lekar-profile__web { padding: 0 5px 0 10px; }
.lekar-profile--mobile .lekar-profile__booking { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 20px; padding: 10px; }
.lekar-profile--mobile .schedule__clinic { display: block; }
.lekar-profile--mobile .lekar-profile__chips { margin: 0; padding: 0; }
/* „Моля позвънете“ — текстът по средата (без иконката; Тео, 21.10.2026) */
.lekar-profile--mobile .call-card { text-align: center; }
/* името и всеки телефон не се разделят на два реда */
.lekar-profile--mobile .call-card__name, .lekar-profile--mobile .call-card__phone a { white-space: nowrap; }
.lekar-profile--mobile .next-free { flex-wrap: wrap; gap: 0 6px; width: 100%; margin: 0 0 12px; padding: 10px 16px; }
.lekar-profile--mobile .calendar { overflow-x: auto; }
.lekar-profile--mobile .calendar__grid { width: 100%; }
.lekar-profile--mobile .fc .fc-daygrid-day-events.cols-1 { padding: 10px !important; }
.lekar-profile--mobile .fc-daygrid-day.day-empty::before { content: "Няма\A график"; white-space: pre; text-align: center; }
.lekar-profile--mobile .lekar-profile__bio { padding: 0 5px 0 10px; }

/* Сензорен екран: зона за докосване поне 44px (Обща визия) */
@media (pointer: coarse) {
  .lekar-profile .fc .fc-button { min-width: 44px; min-height: 44px; }
  .funds__title { min-height: 44px; }
  /* точките под снимките — видът същият, полето за пръст 44px (одит 26.10); центровете на 44px, за да не се
     застъпват полетата — иначе следващата точка е отгоре и отваря друга снимка (Тео 30.10) */
  .photo-slides__dot { position: relative; margin: 0 17.5px; }
  .photo-slides__dot::after { content: ""; position: absolute; inset: -17.5px; }
  .photo-slides--small .photo-slides__dot { margin: 0 19px; }
  .photo-slides--small .photo-slides__dot::after { inset: -19px; }
}
