/* ---------------------------------------------------------------
   Fitting Instructions
   Masthead search, category rail, the PDF list and the tray that
   appears once something is ticked for download.
--------------------------------------------------------------- */

.ins-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Masthead */

.ins-mast .cat-mast__title {
  color: var(--text-white);
}

.ins-mast .cat-mast__lede {
  max-width: 68ch;
}

.ins-search {
  display: flex;
  align-items: center;
  gap: var(--sp3);
  max-width: 760px;
  margin-top: var(--sp6);
  padding: var(--sp2) var(--sp2) var(--sp2) var(--sp5);
  background: var(--white);
  border: 2px solid transparent;
  transition: border-color .42s cubic-bezier(0.16, 1, 0.3, 1);
}

.ins-search:focus-within {
  border-color: var(--orange);
}

.ins-search__go {
  flex: none;
}

.ins-search__icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}

.ins-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: none;
  border: 0;
  outline: none;
}

.ins-search__input:focus::placeholder {
  color: transparent;
}

/* Layout */

.ins-band {
  padding-top: var(--sp7);
  scroll-margin-top: 110px;
}

.ins {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: var(--sp7);
  align-items: start;
}

.ins__rail {
  position: sticky;
  top: 172px;
  display: grid;
  gap: var(--sp6);
}

.ins__rail-title {
  display: block;
  margin: 0 0 var(--sp3);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ins-cats {
  display: grid;
  gap: 2px;
  margin: calc(var(--sp3) * -1) 0 0;
  padding: 0;
  list-style: none;
}

.ins__rail-title + .ins-cats {
  margin-top: 0;
}

.ins-cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp3);
  width: 100%;
  padding: 10px var(--sp3);
  font: inherit;
  font-size: var(--fs-utility);
  line-height: 1.35;
  text-align: left;
  color: var(--text);
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .42s cubic-bezier(0.16, 1, 0.3, 1), border-color .42s cubic-bezier(0.16, 1, 0.3, 1);
}

.ins-cat:hover {
  background: rgba(0, 0, 0, .04);
}

.ins-cat[aria-pressed="true"] {
  font-weight: 700;
  background: var(--white);
  border-left-color: var(--orange);
}

.ins-cat:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}

.ins-cat__n {
  flex: none;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--text-muted);
}

.ins-cat[disabled] {
  color: #9a9a9a;
  cursor: default;
}

.ins-cat[disabled]:hover {
  background: none;
}

.ins-make select {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 var(--sp3);
  font: inherit;
  font-size: var(--fs-utility);
  color: var(--text);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 16px no-repeat;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  appearance: none;
  cursor: pointer;
}

.ins-make select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -1px;
}

/* Toolbar above the list */

.ins-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp3) var(--sp5);
  min-height: 56px;
  padding: var(--sp2) var(--sp5);
  background: var(--white);
  border: 1px solid var(--nav-border);
  border-bottom: 0;
}

.ins-bar__all {
  display: inline-flex;
  align-items: center;
  gap: var(--sp3);
  font-size: var(--fs-utility);
  font-weight: 700;
  cursor: pointer;
}

.ins-bar__count {
  margin: 0;
  font-size: var(--fs-utility);
  color: var(--text-muted);
}

.ins-bar__reset {
  margin-left: auto;
  padding: 0;
  font: inherit;
  font-size: var(--fs-utility);
  font-weight: 700;
  color: var(--text);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--orange);
  cursor: pointer;
}

.ins-bar__reset:hover {
  color: var(--orange);
}

/* Checkboxes, list and toolbar share one look */

.ins input[type="checkbox"] {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin: 0;
  background: var(--white);
  border: 1.5px solid #9a9a9a;
  border-radius: 4px;
  appearance: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.ins input[type="checkbox"]:hover {
  border-color: var(--text);
}

.ins input[type="checkbox"]:checked,
.ins input[type="checkbox"]:indeterminate {
  background: var(--orange) center / 14px no-repeat;
  border-color: var(--orange);
}

.ins input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

.ins input[type="checkbox"]:indeterminate {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}

.ins input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* The list */

.ins-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--nav-border);
}

.ins-row {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp4);
  padding: var(--sp4) var(--sp5);
  border-top: 1px solid var(--nav-border);
  transition: background .3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ins-row[hidden],
.ins-list[hidden] {
  display: none;
}

.ins-row:hover,
.ins-row.is-picked {
  background: #fff8f2;
}

.ins-row__pick {
  display: grid;
  place-items: center;
  margin: -10px;
  padding: 10px;
  cursor: pointer;
}

.ins-row__pdf {
  width: 34px;
  height: 41px;
}

.ins-pdf__sheet {
  fill: var(--white);
  stroke: #b9b9b9;
  stroke-width: 2;
}

.ins-pdf__fold {
  fill: #ececec;
  stroke: #b9b9b9;
  stroke-width: 2;
}

.ins-pdf__tag {
  fill: var(--orange);
}

.ins-pdf__text {
  font-family: var(--font, Inter, sans-serif);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  fill: var(--white);
}

.ins-row__body {
  min-width: 0;
}

.ins-row__title {
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  text-wrap: pretty;
}

.ins-row__code {
  font-weight: 700;
  white-space: nowrap;
}

.ins-row__title:hover .ins-row__name,
.ins-row__title:focus-visible .ins-row__name {
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

.ins-row__title:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.ins-row__meta {
  margin: 2px 0 0;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--text-muted);
}

.ins-row__tag + .ins-row__tag::before {
  content: "\00b7";
  margin: 0 6px 0 2px;
}

.ins-row__actions {
  display: flex;
  gap: var(--sp2);
}

.ins-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp2);
  height: 40px;
  padding: 0 var(--sp4);
  font-size: var(--fs-utility);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
  transition: background .42s cubic-bezier(0.16, 1, 0.3, 1), border-color .42s cubic-bezier(0.16, 1, 0.3, 1), color .42s cubic-bezier(0.16, 1, 0.3, 1);
}

.ins-act:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.ins-act--view {
  color: var(--text);
  background: var(--white);
  border: 1px solid #cfcfcf;
}

.ins-act--view:hover {
  border-color: var(--text);
}

.ins-act--get {
  color: var(--white);
  background: var(--blue);
  border: 1px solid transparent;
}

.ins-act--get:hover {
  background: var(--btn-blue-hover);
}

.ins-act--get[aria-busy="true"] {
  opacity: .7;
  pointer-events: none;
}

.ins-get-icon {
  width: 18px;
  height: 18px;
}

/* Nothing found */

.ins-empty {
  padding: var(--sp7) var(--sp5);
  text-align: center;
  background: var(--white);
  border: 1px solid var(--nav-border);
  border-top: 0;
}

.ins-empty__title {
  margin: 0 0 var(--sp2);
  font-size: var(--fs-cta-title);
  font-weight: 700;
}

.ins-empty__text {
  max-width: 52ch;
  margin: 0 auto var(--sp5);
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Download tray */

.ins-tray {
  position: fixed;
  z-index: 40;
  right: 0;
  bottom: 0;
  left: 0;
  color: var(--text-white);
  background: var(--header-bg);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  animation: ins-tray-in .5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ins-tray[hidden] {
  display: none;
}

.ins-tray__in {
  display: flex;
  align-items: center;
  gap: var(--sp5);
  min-height: 72px;
}

.ins-tray__count {
  margin: 0 auto 0 0;
  font-size: var(--fs-body);
}

.ins-tray__clear {
  padding: 0;
  font: inherit;
  font-size: var(--fs-utility);
  font-weight: 700;
  color: rgba(255, 255, 255, .8);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .4);
  cursor: pointer;
}

.ins-tray__clear:hover {
  color: var(--white);
}

.ins-tray__go {
  display: inline-flex;
  align-items: center;
  gap: var(--sp2);
  height: 48px;
  padding: 0 var(--sp5);
  font: inherit;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--white);
  background: var(--orange);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background .42s cubic-bezier(0.16, 1, 0.3, 1);
}

.ins-tray__go:hover {
  background: color-mix(in srgb, var(--orange) 85%, black);
}

.ins-tray__go[aria-busy="true"] {
  opacity: .75;
  pointer-events: none;
}

.ins-tray__go .ins-get-icon {
  width: 20px;
  height: 20px;
}

.ins-page .whatsapp {
  transition: translate .5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ins-page.has-ins-tray .whatsapp {
  translate: 0 -80px;
}

@keyframes ins-tray-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

/* Fallback when the browser cannot bundle the files */

.ins-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(560px, calc(100vw - 32px));
  height: fit-content;
  max-height: min(80vh, 720px);
  padding: var(--sp6);
  color: var(--text);
  border: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}

.ins-dialog::backdrop {
  background: rgba(0, 0, 0, .5);
}

.ins-dialog__title {
  margin: 0 0 var(--sp2);
  font-size: var(--fs-cta-title);
}

.ins-dialog__text {
  margin: 0 0 var(--sp5);
  color: var(--text-muted);
}

.ins-dialog__list {
  display: grid;
  gap: var(--sp2);
  margin: 0 0 var(--sp5);
  padding: 0;
  list-style: none;
}

.ins-dialog__list a {
  display: block;
  padding: var(--sp3) var(--sp4);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  background: var(--page-bg);
}

.ins-dialog__list a:hover {
  color: var(--orange);
}

.ins-dialog__close {
  height: 44px;
  padding: 0 var(--sp5);
  font: inherit;
  font-weight: 700;
  color: var(--white);
  background: var(--header-bg);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

/* Smaller screens */

@media (max-width: 1000px) {
  .ins {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp5);
  }

  .ins__rail {
    position: static;
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: end;
    gap: var(--sp4);
  }

  .ins__rail > .ins__rail-title {
    display: none;
  }

  .ins-cats {
    grid-column: 1 / -1;
    display: flex;
    gap: var(--sp2);
    margin: 0;
    padding: 0 0 var(--sp1);
    overflow-x: auto;
    scrollbar-width: none;
  }

  .ins-cats::-webkit-scrollbar {
    display: none;
  }

  .ins-cat {
    width: auto;
    padding: 8px var(--sp4);
    white-space: nowrap;
    background: var(--white);
    border: 1px solid var(--nav-border);
    border-radius: 999px;
  }

  .ins-cat[aria-pressed="true"] {
    color: var(--white);
    background: var(--text);
    border-color: var(--text);
  }

  .ins-cat[aria-pressed="true"] .ins-cat__n {
    color: rgba(255, 255, 255, .7);
  }

  .ins-make {
    grid-column: 1 / -1;
  }

  .ins-make .ins__rail-title {
    display: none;
  }
}

@media (max-width: 700px) {
  .ins-row {
    grid-template-columns: auto 28px minmax(0, 1fr);
    gap: var(--sp3);
    padding: var(--sp4);
  }

  .ins-row__pdf {
    width: 28px;
    height: 34px;
  }

  .ins-row__actions {
    grid-column: 3;
  }

  .ins-act {
    height: 36px;
    padding: 0 var(--sp3);
  }

  .ins-bar {
    padding: var(--sp2) var(--sp4);
  }

  .ins-tray__in {
    gap: var(--sp4);
    min-height: 64px;
  }

  .ins-tray__go {
    height: 44px;
    padding: 0 var(--sp4);
    font-size: var(--fs-utility);
  }

  .ins-search {
    flex-wrap: wrap;
    padding: var(--sp2) var(--sp2) var(--sp2) var(--sp4);
  }

  .ins-search__input {
    flex-basis: calc(100% - 40px);
    font-size: var(--fs-body);
  }

  .ins-search__go {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ins-tray { animation: none; }
}
