/* =========================================================
   Slide basket: the basket page, the floating basket button,
   the add-to-basket buttons in the library, and toasts.
   Uses the tokens defined in styles.css (--navy, --teal...).
========================================================= */

/* ---------- Library: add-to-basket buttons ---------- */

.lib-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lib-add {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #ffffff;
  background: var(--navy);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lib-add svg {
  width: 15px;
  height: 15px;
}

.lib-add:hover {
  background: #005865;
}

.lib-add.is-added {
  border-color: #bfe6df;
  color: #0b7d6f;
  background: var(--teal-soft);
}

.lib-add.is-added:hover {
  border-color: #f0c9c4;
  color: #b0392c;
  background: #fff4f2;
}

.lib-basket-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-bottom: 8px;
  border: 1px solid var(--navy);
  border-radius: 8px;
  color: #ffffff;
  background: var(--navy);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.lib-basket-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lib-basket-btn.is-secondary {
  color: var(--navy);
  background: #ffffff;
}

.lib-basket-btn.is-added {
  border-color: #bfe6df;
  color: #0b7d6f;
  background: var(--teal-soft);
}

.lib-basket-btn:disabled {
  border-color: var(--border);
  color: var(--muted);
  background: var(--section-bg);
  cursor: default;
}

/* ---------- Floating basket button ---------- */

.bsk-fab {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px 11px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--navy);
  box-shadow: 0 10px 26px rgba(0, 52, 75, 0.28);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bsk-fab:hover {
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 52, 75, 0.34);
}

.bsk-fab svg {
  width: 21px;
  height: 21px;
}

.bsk-fab-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  text-align: center;
}

.bsk-fab.has-items .bsk-fab-count {
  background: #00ceb7;
}

.bsk-fab.is-bumped {
  animation: bsk-bump 0.42s ease;
}

@keyframes bsk-bump {
  30% { transform: scale(1.12); }
  60% { transform: scale(0.96); }
}

/* ---------- Toast ---------- */

.bsk-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2600;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 10px;
  color: #ffffff;
  background: #0d2f3d;
  box-shadow: 0 12px 30px rgba(0, 25, 36, 0.3);
  font-size: 13.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bsk-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.bsk-toast.is-error {
  background: #8f2a20;
}

.bsk-toast-action {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  color: #00ceb7;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Basket page ---------- */

.bsk-hero {
  padding-bottom: 26px;
}

.bsk-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
  align-items: start;
  padding-top: 26px;
  padding-bottom: 60px;
}

.bsk-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.bsk-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -1px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bsk-tabs button.is-active {
  border-bottom-color: var(--teal-dark);
  color: var(--navy);
}

.bsk-tab-count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--navy);
  background: #e6eef0;
  font-size: 11.5px;
  text-align: center;
}

.bsk-tabs .is-active .bsk-tab-count {
  color: #ffffff;
  background: var(--teal-dark);
}

.bsk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.bsk-toolbar p {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
}

.bsk-toolbar-end {
  display: flex;
  gap: 8px;
}

.bsk-warn {
  color: #b0392c;
}

.bsk-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--navy);
  background: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.bsk-ghost svg {
  width: 16px;
  height: 16px;
}

.bsk-ghost:hover:not(:disabled) {
  border-color: var(--teal-dark);
}

.bsk-ghost.is-danger {
  color: #b0392c;
}

.bsk-ghost.is-danger:hover:not(:disabled) {
  border-color: #e5a59d;
  background: #fff4f2;
}

.bsk-ghost:disabled {
  opacity: 0.5;
  cursor: default;
}

.bsk-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.bsk-list,
.bsk-saved {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bsk-row,
.bsk-saved-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.bsk-row:hover,
.bsk-saved-row:hover {
  border-color: #c9dde1;
  box-shadow: 0 6px 18px rgba(0, 52, 75, 0.07);
}

.bsk-row.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.bsk-row.is-missing {
  border-color: #f0c9c4;
  background: #fffaf9;
}

.bsk-row.is-missing .bsk-row-body span {
  color: #b0392c;
}

.bsk-handle {
  display: inline-flex;
  color: #a5b6bc;
  cursor: grab;
}

.bsk-handle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.bsk-number {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--navy);
  background: var(--teal-soft);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

.bsk-thumb {
  position: relative;
  flex-shrink: 0;
  width: 168px;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(135deg, #eef4f5 0%, #f7fafb 100%);
  cursor: zoom-in;
}

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

.bsk-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
}

.bsk-row-body {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.bsk-row-body strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bsk-row-body span {
  color: var(--muted);
  font-size: 12px;
}

.bsk-row-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

.bsk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--navy);
  background: none;
  cursor: pointer;
}

.bsk-icon svg {
  width: 18px;
  height: 18px;
}

.bsk-icon:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--section-bg);
}

.bsk-icon.is-danger {
  color: #b0392c;
}

.bsk-icon.is-danger:hover {
  border-color: #f0c9c4;
  background: #fff4f2;
}

.bsk-icon:disabled {
  opacity: 0.3;
  cursor: default;
}

.bsk-empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  line-height: 1.8;
}

.bsk-empty svg {
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  color: #a5b6bc;
}

.bsk-empty .lib-download {
  margin-top: 10px;
  text-decoration: none;
}

.bsk-saved-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.bsk-saved-icon svg {
  width: 22px;
  height: 22px;
}

/* Side card */

.bsk-side {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  display: grid;
  gap: 12px;
}

.bsk-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.bsk-card h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 17px;
}

.bsk-meter {
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6eef0;
}

.bsk-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #00ceb7, var(--teal-dark));
  transition: width 0.25s ease;
}

.bsk-meter span.is-full {
  background: #d9822b;
}

.bsk-meter-label {
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.bsk-label {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 600;
}

.bsk-name {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.bsk-name:focus-within {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(22, 156, 140, 0.14);
}

.bsk-name input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
}

.bsk-name span {
  padding: 0 12px;
  color: var(--muted);
  font-size: 12.5px;
  direction: ltr;
}

.bsk-card .lib-primary:disabled {
  opacity: 0.45;
  cursor: default;
}

.bsk-card .lib-primary.is-busy {
  opacity: 0.8;
  cursor: progress;
}

.bsk-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--navy);
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.bsk-save svg {
  width: 17px;
  height: 17px;
}

.bsk-save:hover:not(:disabled) {
  border-color: var(--teal-dark);
}

.bsk-save:disabled {
  opacity: 0.45;
  cursor: default;
}

.bsk-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}

.bsk-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.bsk-back svg {
  width: 16px;
  height: 16px;
}

/* Sequential preview strip: numbers when a slide has no picture */

.bsk-modal .lib-strip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
}

.bsk-modal .lib-info .bsk-ghost {
  margin-top: 6px;
}

/* Save dialog */

.bsk-dialog-box {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 25, 36, 0.35);
}

.bsk-dialog-box h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 18px;
}

.bsk-dialog-box p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.bsk-dialog-box input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.bsk-dialog-box input:focus {
  border-color: var(--teal-dark);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22, 156, 140, 0.14);
}

.bsk-dialog-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.bsk-dialog-actions .lib-primary {
  flex: 1;
  width: auto;
  min-height: 42px;
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .bsk-layout {
    grid-template-columns: 1fr;
  }

  .bsk-side {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .bsk-fab {
    left: 16px;
    bottom: 16px;
  }

  .bsk-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .bsk-row {
    flex-wrap: wrap;
  }

  .bsk-handle {
    display: none;
  }

  .bsk-thumb {
    width: 120px;
  }

  .bsk-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .bsk-saved-row {
    flex-wrap: wrap;
  }

  .lib-card-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}
