/* ═══════════════════════════════════════════════
   FICHA MÉDICA · Hero, agenda, contacto, contenido
   Cárgalo SOLO en páginas de perfil médico
   ═══════════════════════════════════════════════ */

/* Reserva espacio para el sticky CTA en móvil */
body { padding-bottom: calc(84px + var(--safe-bottom)); }

@media (min-width: 980px) {
  body { padding-bottom: 0; }
}

/* ────── HERO ────── */
.hero { padding: 16px 0 0; }

.hero__card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 14px;
  padding: 16px;
  align-items: center;
}

.hero__photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.hero__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 10.5px;
  font-weight: 600;
  width: fit-content;
}

.hero__name {
  margin: 0;
  font-size: clamp(20px, 5.5vw, 32px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero__specialty {
  margin: 0;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 600;
  color: var(--brand);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero__actions { display: none; }

@media (min-width: 640px) {
  .hero { padding: 24px 0 0; }
  .hero__card {
    grid-template-columns: 140px 1fr auto;
    gap: 24px;
    padding: 24px;
  }
  .hero__body { gap: 6px; }
  .hero__meta { font-size: 13px; }
  .hero__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
  }
}

@media (min-width: 980px) {
  .hero__card {
    grid-template-columns: 200px 1fr auto;
    gap: 28px;
    padding: 28px;
  }
  .hero__meta { font-size: 14px; }
}

@media (max-width: 380px) {
  .hero__card {
    grid-template-columns: 64px 1fr;
    padding: 14px;
    gap: 12px;
  }
  .hero__name { font-size: 19px; }
  .hero__specialty { font-size: 12.5px; }
  .hero__meta { font-size: 11px; gap: 3px 10px; }
}

/* ────── LAYOUT ────── */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px 0 24px;
}
.agenda { order: -1; }

@media (min-width: 640px) {
  .layout { gap: 20px; padding: 20px 0 32px; }
}

@media (min-width: 980px) {
  .layout {
    grid-template-columns: 1fr 420px;
    gap: 28px;
    padding: 28px 0 64px;
    align-items: start;
  }
  .agenda { order: 0; }
}

/* ────── CARDS ────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card + .card { margin-top: 16px; }

@media (min-width: 640px) {
  .card { padding: 24px; }
  .card + .card { margin-top: 20px; }
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
.section-title.mt { margin-top: 24px; }

/* ────── AGENDA ────── */
.agenda {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  border: 2px solid var(--brand-soft);
  position: static;
}

.agenda__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}

.agenda__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda__subtitle {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.agenda__nav { display: flex; gap: 6px; }

.agenda__nav button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--brand);
  font-size: 20px;
  font-weight: 600;
  transition: background .15s ease;
}
.agenda__nav button:hover:not(:disabled) { background: var(--brand-soft); }
.agenda__nav button:disabled { opacity: .35; cursor: not-allowed; }

.agenda__days-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -18px;
  padding: 0 18px 4px;
  scroll-snap-type: x mandatory;
}
.agenda__days-wrap::-webkit-scrollbar { display: none; }

.agenda__days {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
}

.day-col {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  scroll-snap-align: start;
}
.day-col__name { font-weight: 700; font-size: 13px; margin: 0; }
.day-col__date {
  font-size: 10.5px;
  color: var(--muted);
  margin: 2px 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  text-decoration: line-through;
  cursor: not-allowed;
  transition: all .15s ease;
  font-weight: 500;
}
.slot.active {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #c7ddfa;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}
.slot.active:hover { border-color: var(--brand); }
.slot.active:active { transform: scale(.97); }

.agenda__footer { margin-top: 12px; text-align: center; }
.agenda__footer button {
  background: none;
  border: 0;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 12px 8px;
  min-height: 44px;
}
.agenda__footer button:hover { text-decoration: underline; }

@media (min-width: 640px) {
  .agenda { padding: 20px; }
  .agenda__days-wrap { margin: 0 -20px; padding: 0 20px 4px; }
  .agenda__days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
  .agenda { position: sticky; top: calc(var(--header-h) + 24px); }
  .agenda__days-wrap {
    overflow: visible;
    margin: 0;
    padding: 0;
    scroll-snap-type: none;
  }
  .agenda__days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 380px) {
  .agenda__days { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .slot { font-size: 12.5px; min-height: 38px; }
}

/* ────── CONTACTO ────── */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.contact-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.contact-list__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 15px;
  flex-shrink: 0;
}
.contact-list__label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}
.contact-list__value {
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 500;
  margin-top: 2px;
  word-break: break-word;
}

/* ────── CONTENIDO ────── */
.quote-block {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  margin: 0;
}
.quote-block p { margin: 0; font-size: 14px; }
.quote-block p + p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.prose {
  font-size: 14.5px;
  color: #334155;
  line-height: 1.65;
  margin: 0;
}

/* ────── STICKY CTA MÓVIL ────── */
.sticky-cta {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + var(--safe-bottom));
  box-shadow: 0 -8px 24px rgba(15,23,42,.08);
  gap: 10px;
  z-index: 50;
}
.sticky-cta .btn { flex: 1; min-height: 48px; font-size: 15px; }

@media (min-width: 980px) {
  .sticky-cta { display: none; }
}

/* ────── MODAL ────── */

.contacto-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    background: rgba(15, 23, 42, 0.5);

    display: none;
    align-items: flex-end;
    justify-content: center;

    z-index: 9999;
    padding: 0;
}

.contacto-backdrop.open {
    display: flex;
}

.contacto-modal {
    position: relative;

    background: #fff;
    border-radius: 20px 20px 0 0;

    width: 100%;
    max-height: 90vh;
    overflow-y: auto;

    box-shadow: var(--shadow-lg);
    padding-bottom: var(--safe-bottom, 0px);

    animation: contactoSlideUp 0.25s ease;
}

@keyframes contactoSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.contacto-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 16px 20px;
    border-bottom: 1px solid var(--line);

    position: sticky;
    top: 0;

    background: #fff;
    z-index: 2;
}

.contacto-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.contacto-modal__close {
    background: none;
    border: 0;
    cursor: pointer;

    color: var(--muted);
    line-height: 1;

    width: 40px;
    height: 40px;
    border-radius: 10px;

    font-size: 24px;

    display: grid;
    place-items: center;
}

.contacto-modal__close:hover {
    background: var(--bg);
    color: var(--ink);
}

.contacto-modal__body {
    padding: 20px;
    min-height: 200px;
}

.contacto-modal__body iframe {
    width: 100%;
    height: 260px;
    border: 0;
    border-radius: 10px;
}

@media (min-width: 980px) {
    .contacto-backdrop {
        align-items: center;
        padding: 20px;
    }

    .contacto-modal {
        border-radius: var(--radius, 12px);
        width: 100%;
        max-width: 560px;

        animation: contactoFadeIn 0.2s ease;
    }

    @keyframes contactoFadeIn {
        from {
            opacity: 0;
            transform: scale(0.96);
        }

        to {
            opacity: 1;
            transform: scale(1);
        }
    }
}
