/* Shared drawer: bottom sheet on mobile, right-side panel from 761px (tb-sheet spec). */
.type2-drawer {
  --type2-drawer-width: min(420px, calc(100vw - 56px));
  --type2-drawer-mobile-height: min(82vh, 760px);
  --type2-drawer-pad: 16px;
  position: fixed;
  inset: 0;
  z-index: var(--tibiu-layer-drawer, 1250);
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.28s;
}

.type2-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.type2-drawer-mask {
  position: absolute;
  inset: 0;
  background: var(--tb-mask, rgb(0 0 0 / 40%));
  opacity: 0;
  transition: opacity 0.24s ease;
}

.type2-drawer.is-open .type2-drawer-mask {
  opacity: 1;
}

.type2-drawer-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: auto;
  height: var(--type2-drawer-mobile-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--tb-surface, #fff);
  color: var(--tb-ink, #14171a);
  border-radius: var(--tb-radius-sheet, 16px) var(--tb-radius-sheet, 16px) 0 0;
  box-shadow: none;
  transform: translateY(100%);
  transform-origin: right center;
  transition: transform 0.28s ease, width 0.28s ease, height 0.28s ease, border-radius 0.28s ease;
}

.type2-drawer.is-open .type2-drawer-panel {
  transform: translateY(0);
}

.type2-drawer.is-fullscreen .type2-drawer-panel {
  height: 100dvh;
  border-radius: 0;
}

.type2-drawer-handle {
  flex: none;
  width: 36px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: var(--tb-line-strong, #d6d9dd);
}

.type2-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 4px 6px 4px var(--type2-drawer-pad);
  border-bottom: 0;
  flex: none;
}

.type2-drawer-title {
  min-width: 0;
  margin: 0;
  color: var(--tb-ink, #14171a);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0;
}

.type2-drawer-tools {
  display: flex;
  align-items: center;
  gap: 0;
  flex: none;
}

.type2-drawer-close {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--tb-ink-2, #4f555b);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.type2-drawer-close:hover {
  color: var(--tb-ink, #14171a);
}

.type2-drawer-close img,
.type2-drawer-close ti-icon:not(.ti-icon--btn) {
  --ti-icon-size: 24px !important;
  width: 24px;
  height: 24px;
  display: block;
}

.type2-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px var(--type2-drawer-pad) 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  overflow: auto;
  flex: 1;
}

:where(.type2-drawer) a {
  color: inherit;
  text-decoration: none;
}

@media (min-width: 761px) {
  .type2-drawer {
    --type2-drawer-pad: 20px;
  }

  .type2-drawer-panel {
    top: 0;
    left: auto;
    width: var(--type2-drawer-width);
    height: 100dvh;
    border-radius: var(--tb-radius-sheet, 16px) 0 0 var(--tb-radius-sheet, 16px);
    transform: translateX(100%);
  }

  .type2-drawer.is-open .type2-drawer-panel {
    transform: translateX(0);
  }

  .type2-drawer-handle {
    display: none;
  }

  .type2-drawer-head {
    min-height: 56px;
    padding: 6px 10px 6px var(--type2-drawer-pad);
  }
}
