/**
 * FindEdition — platform-98.4-action-ui.css
 * Detail-page action bars for Mobiles, Autos, and Recipes.
 *
 * Copyright (c) FindEdition Developers. All rights reserved.
 */

/* ── Hide legacy sticky full bars; replaced by fe984 ── */
.fe8822-action-bar--sticky[data-fe8822-sticky-bar]:not([data-fe984-keep]) {
  display: none !important;
}

/* Inline bar: keep metadata; action buttons live in fe984 desktop/mobile UIs */
.md-device-page .fe8822-action-bar--inline .fe8822-action-bar__actions,
.au-device-page .fe8822-action-bar--inline .fe8822-action-bar__actions,
.rp-device-page .fe8822-action-bar--inline .fe8822-action-bar__actions,
.md-device-page .fe8822-action-bar--inline .fe8822-action-bar__collections,
.au-device-page .fe8822-action-bar--inline .fe8822-action-bar__collections,
.rp-device-page .fe8822-action-bar--inline .fe8822-action-bar__collections {
  display: none !important;
}

/* ── Desktop action bar (visible ≥1024px only) ── */
.fe984-desktop-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 850;
  width: 100%;
  min-height: 72px;
  max-height: 84px;
  border-bottom: 1px solid var(--fe984-bar-border, #e2e8f0);
  background: var(--fe984-bar-bg, #fff);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
  color: var(--fe984-bar-text, #0f172a);
}

@media (min-width: 1024px) {
  .fe984-desktop-bar {
    display: block;
  }
}

.fe984-desktop-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.75rem;
  min-height: 72px;
}

.fe984-desktop-bar__title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--fe984-bar-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fe984-desktop-bar__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.fe984-desktop-bar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  border-radius: 0.65rem;
  border: 1px solid var(--fe984-btn-border, #cbd5e1);
  background: var(--fe984-btn-bg, #f8fafc);
  color: var(--fe984-bar-text, #0f172a);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fe984-desktop-bar__btn:hover {
  border-color: var(--fe984-accent, #0891b2);
  color: var(--fe984-accent, #0891b2);
}

.fe984-desktop-bar__btn:focus-visible {
  outline: 2px solid var(--fe984-accent, #0891b2);
  outline-offset: 2px;
}

.fe984-desktop-bar__btn.is-active,
.fe984-desktop-bar__btn[aria-pressed="true"] {
  background: var(--fe984-accent-soft, rgba(6, 182, 212, 0.15));
  border-color: var(--fe984-accent, #0891b2);
  color: var(--fe984-accent-strong, #0e7490);
}

.fe984-desktop-bar__btn--primary {
  background: var(--fe984-accent, #0891b2);
  border-color: var(--fe984-accent, #0891b2);
  color: #fff;
}

.fe984-desktop-bar__btn--primary:hover {
  background: var(--fe984-accent-strong, #0e7490);
  color: #fff;
}

/* Module identity — desktop */
.fe984-desktop-bar--mobiles {
  --fe984-bar-bg: #ffffff;
  --fe984-bar-text: #0f172a;
  --fe984-bar-border: #e2e8f0;
  --fe984-btn-bg: #f8fafc;
  --fe984-btn-border: #cbd5e1;
  --fe984-accent: #0891b2;
  --fe984-accent-strong: #0e7490;
  --fe984-accent-soft: rgba(6, 182, 212, 0.14);
}

.fe984-desktop-bar--autos {
  --fe984-bar-bg: #18181b;
  --fe984-bar-text: #fafafa;
  --fe984-bar-border: #3f3f46;
  --fe984-btn-bg: #27272a;
  --fe984-btn-border: #52525b;
  --fe984-accent: #dc2626;
  --fe984-accent-strong: #b91c1c;
  --fe984-accent-soft: rgba(220, 38, 38, 0.16);
}

.fe984-desktop-bar--recipes {
  --fe984-bar-bg: #fffbf5;
  --fe984-bar-text: #292524;
  --fe984-bar-border: #e7e5e4;
  --fe984-btn-bg: #ffffff;
  --fe984-btn-border: #d6d3d1;
  --fe984-accent: #ea580c;
  --fe984-accent-strong: #c2410c;
  --fe984-accent-soft: #ffedd5;
}

/* ── Mobile / tablet action UI (visible <1024px only) ── */
.fe984-mobile-actions {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 860;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--fe984-m-bg, #fff);
  border-top: 1px solid var(--fe984-m-border, #e2e8f0);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
  color: var(--fe984-m-text, #0f172a);
}

/* Sit above module content; stay below compare tray (typically z ≥ 900) when both visible */
body:has(.mc-floating-bar.is-visible) .fe984-mobile-actions,
body:has(#ac-floating-bar:not([hidden])) .fe984-mobile-actions,
body:has(#rc-floating-bar:not([hidden])) .fe984-mobile-actions {
  bottom: 4.75rem;
}

@media (max-width: 1023.98px) {
  .fe984-mobile-actions {
    display: block;
  }

  /* Reserve space so content / compare tray aren't covered */
  .md-device-page,
  .au-device-page,
  .rp-device-page {
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}

.fe984-mobile-actions__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.fe984-mobile-actions__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--fe984-m-text, #0f172a);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fe984-mobile-actions__more {
  position: relative;
  flex: 0 0 auto;
}

.fe984-mobile-actions__more > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 0.55rem;
  border: 1px solid var(--fe984-m-border, #cbd5e1);
  background: var(--fe984-m-btn, #f8fafc);
  cursor: pointer;
  color: inherit;
}

.fe984-mobile-actions__more > summary::-webkit-details-marker {
  display: none;
}

.fe984-mobile-actions__more > summary:focus-visible {
  outline: 2px solid var(--fe984-m-accent, #0891b2);
  outline-offset: 2px;
}

.fe984-mobile-actions__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.35rem);
  min-width: 10rem;
  padding: 0.35rem;
  border-radius: 0.65rem;
  border: 1px solid var(--fe984-m-border, #e2e8f0);
  background: var(--fe984-m-bg, #fff);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  z-index: 5;
}

.fe984-mobile-actions__menu button,
.fe984-mobile-actions__menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.fe984-mobile-actions__menu button:hover,
.fe984-mobile-actions__menu a:hover {
  background: var(--fe984-m-accent-soft, rgba(6, 182, 212, 0.12));
}

.fe984-mobile-actions__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.fe984-mobile-actions__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 44px;
  padding: 0.4rem 0.35rem;
  border-radius: 0.6rem;
  border: 1px solid var(--fe984-m-border, #cbd5e1);
  background: var(--fe984-m-btn, #f8fafc);
  color: var(--fe984-m-text, #0f172a);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.fe984-mobile-actions__btn i {
  font-size: 0.95rem;
}

.fe984-mobile-actions__btn:focus-visible {
  outline: 2px solid var(--fe984-m-accent, #0891b2);
  outline-offset: 2px;
}

.fe984-mobile-actions__btn.is-active,
.fe984-mobile-actions__btn[aria-pressed="true"] {
  border-color: var(--fe984-m-accent, #0891b2);
  background: var(--fe984-m-accent-soft, rgba(6, 182, 212, 0.14));
  color: var(--fe984-m-accent-strong, #0e7490);
}

.fe984-mobile-actions__btn--primary {
  background: var(--fe984-m-accent, #0891b2);
  border-color: var(--fe984-m-accent, #0891b2);
  color: #fff;
}

.fe984-mobile-actions--mobiles {
  --fe984-m-bg: #ffffff;
  --fe984-m-text: #0f172a;
  --fe984-m-border: #e2e8f0;
  --fe984-m-btn: #f8fafc;
  --fe984-m-accent: #0891b2;
  --fe984-m-accent-strong: #0e7490;
  --fe984-m-accent-soft: rgba(6, 182, 212, 0.14);
}

.fe984-mobile-actions--autos {
  --fe984-m-bg: #18181b;
  --fe984-m-text: #fafafa;
  --fe984-m-border: #3f3f46;
  --fe984-m-btn: #27272a;
  --fe984-m-accent: #dc2626;
  --fe984-m-accent-strong: #b91c1c;
  --fe984-m-accent-soft: rgba(220, 38, 38, 0.16);
}

.fe984-mobile-actions--recipes {
  --fe984-m-bg: #fffbf5;
  --fe984-m-text: #292524;
  --fe984-m-border: #e7e5e4;
  --fe984-m-btn: #ffffff;
  --fe984-m-accent: #ea580c;
  --fe984-m-accent-strong: #c2410c;
  --fe984-m-accent-soft: #ffedd5;
}

/* Print: never print action chrome */
@media print {
  .fe984-desktop-bar,
  .fe984-mobile-actions,
  .fe8822-action-bar {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fe984-desktop-bar__btn,
  .fe984-mobile-actions__btn {
    transition: none;
  }
}
