/* DAM floating selection bar — studio-action-bar chrome (Frontify-aligned) */

.dam-selection-bar {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1250;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 16px;
  max-width: min(1040px, calc(100vw - 24px));
  box-sizing: border-box;
}

.dam-selection-bar[hidden] {
  display: none !important;
}

.dam-selection-bar-lead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.dam-selection-bar-lead-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(11, 90, 59, 0.08);
  color: var(--green, #0b5a3b);
  flex-shrink: 0;
}

.dam-selection-bar-lead-icon .studio-icon {
  width: 18px;
  height: 18px;
}

.dam-selection-bar-thumbs {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.dam-selection-bar-main {
  flex: 1 1 auto;
  min-width: 0;
}

.dam-selection-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 1 420px;
  min-width: 0;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid rgba(27, 24, 20, 0.08);
}

.dam-selection-bar-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #fff;
  margin-left: -10px;
  background: #f3f1ee;
  box-shadow: 0 1px 4px rgba(27, 24, 20, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b6560;
}

.dam-selection-bar-thumbs .dam-selection-bar-thumb:first-child {
  margin-left: 0;
}

.dam-selection-bar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dam-selection-bar-thumb--more {
  background: #2d2a26;
  color: #fff;
  font-size: 0.72rem;
}

.dam-selection-bar-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  border: none;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.dam-selection-bar-ref[hidden] {
  display: none !important;
}

/* Action buttons — icon + label */
.dam-action-btn.studio-action-btn,
.dam-selection-bar-actions .studio-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.dam-action-btn .studio-icon,
.dam-selection-bar-actions .studio-action-btn .studio-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dam-action-btn-label {
  line-height: 1.2;
}

.dam-action-icon-close.studio-icon-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
}

.dam-selection-bar-actions .studio-action-btn--primary[data-dam-bulk-download-quick] {
  min-width: 108px;
}

.dam-bulk-drawer-header-actions .dam-action-btn.studio-action-btn {
  min-height: 36px;
}

.dam-selection-popover,
.dam-selection-popover.studio-popover {
  position: fixed;
  z-index: 1260;
  width: min(320px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(27, 24, 20, 0.1);
  background: #fff;
  box-shadow: 0 16px 48px rgba(27, 24, 20, 0.18);
}

.dam-selection-popover[hidden] {
  display: none !important;
}

.dam-selection-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dam-selection-popover-head h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.dam-selection-popover select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(27, 24, 20, 0.14);
  border-radius: 8px;
  background: #fff;
  font-size: 0.84rem;
}

.dam-selection-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dam-selection-ref-panel {
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  background: #faf9f7;
  max-height: 160px;
  overflow: auto;
}

.dam-selection-ref-panel ul {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 0.78rem;
  color: #6b6560;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-browse-body,
.dam-workspace.dam-workspace--bulk-select .dam-browse-body {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.dam-workspace.dam-workspace--has-asset-selection .dam-tile-hover-check,
.dam-workspace.dam-workspace--bulk-select .dam-tile-hover-check {
  opacity: 1;
  pointer-events: auto;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-folder-card:not(.is-selected):not(.is-partial-selected) .dam-folder-card-check {
  opacity: 0.55;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile:not(.is-selected) .dam-tile-hover-check {
  opacity: 0.55;
  pointer-events: auto;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile:hover .dam-tile-hover-check,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-tile-hover-check {
  opacity: 1;
}

@media (max-width: 900px) {
  .dam-selection-bar {
    padding: 10px 12px;
    gap: 8px;
    max-width: calc(100vw - 16px);
  }

  .dam-selection-bar-lead {
    flex: 1 1 100%;
  }

  .dam-selection-bar-actions {
    flex: 1 1 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .dam-selection-bar-actions .studio-action-btn:not([data-dam-selection-clear]):not([data-dam-bulk-download-quick]):not([data-dam-bulk-trash]):not([data-dam-selection-all]) {
    display: none;
  }

  .dam-selection-bar-actions .studio-action-btn--danger[data-dam-bulk-trash] {
    display: inline-flex;
  }
}
