/**
 * Karacter Size Guide — buton și modal pe pagina de produs.
 *
 * @author Karacter (Rares Cioran)
 */

.krcsg-wrap {
  margin-top:10px;
  margin-bottom:5px;
  text-align: right;
}

.krcsg-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: .9375rem;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.krcsg-trigger:hover,
.krcsg-trigger:focus {
  opacity: .7;
}

.krcsg-icon {
  width: 20px;
  height: 18px;
  flex: 0 0 auto;
}

/* ------------------------------------------------------------------ modal */

.krcsg-overlay {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .6);
}

.krcsg-overlay[hidden] {
  display: none;
}

/* Blochează derularea paginii din spate cât timp modalul e deschis. */
body.krcsg-open {
  overflow: hidden;
}

.krcsg-modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.krcsg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e5e5;
}

.krcsg-modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.krcsg-modal-close {
  border: 0;
  background: none;
  color: inherit;
  font-size: 1.75rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.krcsg-modal-body {
  padding: 18px;
  overflow-y: auto;
}

.krcsg-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.krcsg-image + .krcsg-image,
.krcsg-pdf-link + .krcsg-image,
.krcsg-image + .krcsg-pdf {
  margin-top: 18px;
}

.krcsg-pdf {
  display: block;
  width: 100%;
  height: 70vh;
  border: 1px solid #e5e5e5;
}

.krcsg-pdf-link {
  display: inline-block;
  margin-top: 8px;
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .krcsg-overlay {
    padding: 0;
  }

  .krcsg-modal {
    max-width: none;
    height: 100%;
    max-height: none;
  }

  /* Pe mobil un viewer PDF încorporat e inutilizabil; îl reducem la o bandă
     minimă, iar greutatea cade pe linkul de deschidere în filă nouă. */
  .krcsg-pdf {
    height: 45vh;
  }
}
