@import "../../tokens.css";

@import "../button/layout.css";

[data-slot="sheet-overlay"] {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(0 0 0/var(--ui-sheet-backdrop-opacity));
}

[data-slot="sheet-content"] {
  box-sizing: border-box;
  position: fixed;
  z-index: 51;
  display: flex;
  flex-direction: column;
  gap: var(--ui-sheet-gap);
  min-inline-size: 0;
  background: var(--ui-color-background);
  color: var(--ui-color-foreground);
  font-family: var(--ui-font-family),var(--ui-font-fallback),sans-serif;
  font-size: var(--ui-font-size-body);
  line-height: var(--ui-line-height-body);
  border: var(--ui-border-width) solid var(--ui-color-border);
  border-radius: var(--ui-sheet-radius);
  outline: none;
  max-block-size: calc(100dvh - 32px);
  overflow: auto;
  overflow-wrap: anywhere;
}

[data-slot="sheet-content"][data-side="right"],
[data-slot="sheet-content"][data-side="left"] {
  inset-block: 0;
  inline-size: min(100vw,var(--ui-sheet-max-width));
  max-block-size: 100dvh;
}

[data-slot="sheet-content"][data-side="right"] {
  right: 0;
}

[data-slot="sheet-content"][data-side="left"] {
  left: 0;
}

[data-slot="sheet-content"][data-side="top"],
[data-slot="sheet-content"][data-side="bottom"] {
  inset-inline: 0;
  inline-size: 100%;
}

[data-slot="sheet-content"][data-side="top"] {
  top: 0;
}

[data-slot="sheet-content"][data-side="bottom"] {
  bottom: 0;
}

[data-slot="sheet-header"] {
  display: flex;
  flex-direction: column;
  gap: var(--ui-sheet-header-gap);
  min-inline-size: 0;
}

[data-slot="sheet-header"] {
  padding: var(--ui-sheet-padding);
}

[data-slot="sheet-title"] {
  margin: 0;
  font-size: var(--ui-sheet-title-size);
  line-height: var(--ui-sheet-title-line-height);
  font-weight: var(--ui-sheet-title-weight);
}

[data-slot="sheet-description"] {
  margin: 0;
  color: var(--ui-color-muted-foreground);
  font-size: var(--ui-font-size-body);
  line-height: var(--ui-line-height-body);
}

[data-slot="sheet-footer"] {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

[data-slot="sheet-footer"] {
  margin-block-start: auto;
  flex-direction: column;
  padding: var(--ui-sheet-footer-padding);
}

[data-slot="sheet-close"].cn-sheet-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 12px;
}

[data-slot="sheet-header"] {
  padding-inline-end: 32px;
}

[data-slot="sheet-close"] svg {
  inline-size: 16px;
  block-size: 16px;
}

[data-slot="sheet-close"] .sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

[data-slot="sheet-trigger"]:disabled {
  opacity: 0.5;
}
