/**
 * Demetz - Prescription info panel
 *
 * @author    JFO
 * @copyright 2026 Opal
 * @license   Proprietary - All rights reserved
 */

/*
 * F6 - "Prepare my visit" (panel_visit.tpl, demetzrxinfo-visit.js) + its print view: while the script prints,
 * <html> has the class drx-printing and only the sheet is printed (@media print below).
 */
.drx-root .drx-visit__intro {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
}

.drx-root .drx-visit__sheet {
  padding: 14px 16px;
  border: 1px dashed #8a8a8a;
  border-radius: 4px;
  background: #fafafa;
}

.drx-root .drx-visit__sheet-title {
  margin: 0 0 8px;
  color: #000;
  font-family: AktivGroteskCd, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.drx-root .drx-visit__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  padding: 3px 0;
  font-size: 14px;
  line-height: 1.45;
}

.drx-root .drx-visit__term {
  flex: 0 0 38%;
  min-width: 0;
  color: #555;
}

.drx-root .drx-visit__desc {
  flex: 1 1 50%;
  min-width: 0;
  color: #000;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.drx-root .drx-visit__url {
  font-weight: 400;
  font-size: 12px;
}

.drx-root .drx-visit__reminder {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e3e3e3;
  font-size: 13px;
  line-height: 1.4;
}

.drx-root .drx-visit__qr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.drx-root .drx-visit__qr-code {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
}

.drx-root .drx-visit__qr-code .drx-qr {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
}

.drx-root .drx-visit__qr-text {
  font-size: 13px;
  line-height: 1.4;
}

/* Compact buttons on one line, spread over the whole width (they grow to share the free space) */
.drx-root .drx-visit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.drx-root .drx-visit__action,
.drx-root a.drx-visit__action {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-sizing: border-box;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #000;
  border-radius: 18px;
  background: #fff;
  box-shadow: none;
  color: #000;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: 0.2px;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
}

.drx-root .drx-visit__action:hover,
.drx-root a.drx-visit__action:hover,
.drx-root .drx-visit__action[aria-expanded="true"] {
  background: #000;
  color: #fff;
  text-decoration: none;
}

.drx-root .drx-visit__action > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drx-root .drx-visit__icon {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

/* Narrow drawer (phones): 2 x 2 grid of equal buttons, a bit taller for the finger */
@media (max-width: 579.98px) {
  .drx-root .drx-visit__action,
  .drx-root a.drx-visit__action {
    flex-basis: calc(50% - 3px);
    min-height: 40px;
    padding: 6px;
  }
}

/* Small phones: the decorative icons give their room to the labels, which stay on one line */
@media (max-width: 389.98px) {
  .drx-root .drx-visit__icon {
    display: none;
  }
}

/* Very small phones: each button takes the width of its label, the rows still fill the width */
@media (max-width: 339.98px) {
  .drx-root .drx-visit__action,
  .drx-root a.drx-visit__action {
    flex-basis: auto;
  }
}

.drx-root .drx-visit__status {
  min-height: 18px;
  margin-top: 6px;
  color: #1f6b35;
  font-size: 13px;
  line-height: 18px;
}

.drx-root .drx-visit__clip {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* -- Print: only the sheet ------------------------------------------------------------ */
@media print {
  html.drx-printing,
  html.drx-printing body {
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }

  html.drx-printing body > :not(.drx-root),
  html.drx-printing .drx-root .drx-backdrop,
  html.drx-printing .drx-root .drx-panel > :not(.drx-body),
  html.drx-printing .drx-root .drx-body > :not(.drx-visit),
  html.drx-printing .drx-root .drx-visit > :not(.drx-visit__sheet) {
    display: none !important;
  }

  html.drx-printing .drx-root,
  html.drx-printing .drx-root .drx-panel,
  html.drx-printing .drx-root .drx-body {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
  }

  html.drx-printing .drx-root .drx-visit {
    margin: 0 !important;
  }

  html.drx-printing .drx-root .drx-visit__sheet {
    border: 1px solid #000;
    background: #fff;
    font-size: 12pt;
  }

  html.drx-printing .drx-root .drx-visit__row,
  html.drx-printing .drx-root .drx-visit__qr-text,
  html.drx-printing .drx-root .drx-visit__reminder {
    font-size: 12pt;
  }

  html.drx-printing .drx-root .drx-visit__qr-code {
    width: 40mm;
    height: 40mm;
  }
}
