/* Shared floating product-category launcher for article and product detail pages.
   The control is positioned outside the content card so the main content keeps
   the full available width. The opened catalogue overlays the page without
   changing the document layout. */
:root {
  --floating-product-menu-red: #c40009;
  --floating-product-menu-ink: #171d20;
  --floating-product-menu-line: #e2e6e8;
}

.has-floating-product-menu {
  position: relative;
  display: block !important;
  width: min(1120px, 100%) !important;
  margin-inline: auto;
}

.has-floating-product-menu > .product-detail-content,
.has-floating-product-menu > .article-card {
  width: 100%;
  min-width: 0;
}

.floating-product-menu {
  position: fixed;
  z-index: 96;
  top: var(--floating-product-menu-top, calc(var(--nav-height) + 24px));
  left: max(16px, calc((100vw - 1120px) / 2 - 74px));
  width: 52px;
  height: 52px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

.floating-product-menu.is-in-scope {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.floating-product-menu-toggle {
  position: relative;
  z-index: 3;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 0;
  border-radius: 11px;
  background: var(--floating-product-menu-red);
  box-shadow: 0 13px 30px rgba(196, 0, 9, .27);
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.floating-product-menu-toggle:hover,
.floating-product-menu-toggle:focus-visible {
  background: #980007;
  box-shadow: 0 16px 34px rgba(152, 0, 7, .32);
  transform: translateY(-2px);
}

.floating-product-menu-icon {
  position: relative;
  width: 20px;
  height: 20px;
}

.floating-product-menu-icon::before,
.floating-product-menu-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: transform .22s ease;
}

.floating-product-menu-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.floating-product-menu-toggle[aria-expanded="true"] .floating-product-menu-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.floating-product-menu-panel {
  position: absolute;
  top: 0;
  left: 64px;
  width: min(318px, calc(100vw - 100px));
  max-height: min(72vh, 660px);
  overflow: auto;
  color: var(--floating-product-menu-ink);
  border: 1px solid rgba(17, 22, 25, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 24px 68px rgba(10, 17, 20, .2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform-origin: top left;
  animation: floating-product-menu-in .2s ease both;
  scrollbar-width: thin;
}

.floating-product-menu-panel[hidden] { display: none !important; }

@keyframes floating-product-menu-in {
  from { opacity: 0; transform: translateX(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.floating-product-menu-heading {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 16px;
  color: #fff;
  background: #151c1f;
}

.floating-product-menu-heading p {
  margin: 0 0 4px;
  color: #ff8c91;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.floating-product-menu-heading h2 {
  margin: 0;
  color: #fff;
  font-size: 1.08rem;
  line-height: 1.15;
}

.floating-product-menu-close {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.floating-product-menu-close:hover { background: var(--floating-product-menu-red); }
.floating-product-menu-close svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

.floating-product-menu-nav { padding: 8px 10px 2px; }
.floating-product-menu-nav details { border-bottom: 1px solid var(--floating-product-menu-line); }
.floating-product-menu-nav details:last-child { border-bottom: 0; }
.floating-product-menu-nav summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  color: #242c30;
  font-size: .75rem;
  font-weight: 850;
  list-style: none;
  cursor: pointer;
}
.floating-product-menu-nav summary::-webkit-details-marker { display: none; }
.floating-product-menu-nav summary::after {
  content: "+";
  color: var(--floating-product-menu-red);
  font-size: 1rem;
  font-weight: 500;
}
.floating-product-menu-nav details[open] > summary { color: var(--floating-product-menu-red); }
.floating-product-menu-nav details[open] > summary::after { content: "−"; }
.floating-product-menu-nav summary small {
  color: #929a9e;
  font-size: .56rem;
  font-weight: 800;
  letter-spacing: .1em;
}

.floating-product-menu-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 4px 12px;
  list-style: none;
}

.floating-product-menu-list a {
  position: relative;
  display: block;
  padding: 10px 12px 10px 22px;
  color: #5a6469;
  border-radius: 8px;
  font-size: .69rem;
  font-weight: 650;
  line-height: 1.4;
  transition: color .18s ease, background .18s ease;
}

.floating-product-menu-list a::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 9px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c5cbce;
}

.floating-product-menu-list a:hover,
.floating-product-menu-list a.is-active,
.floating-product-menu-list a[aria-current="page"] {
  color: var(--floating-product-menu-red);
  background: #fff1f2;
}
.floating-product-menu-list a.is-active::before,
.floating-product-menu-list a[aria-current="page"]::before { background: var(--floating-product-menu-red); }

.floating-product-menu-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 10px 10px;
  padding: 13px 14px;
  color: #fff;
  border-radius: 10px;
  background: var(--floating-product-menu-red);
  font-size: .7rem;
  font-weight: 850;
}
.floating-product-menu-footer:hover { color: #fff; background: #980007; }

/* The old detail/sidebar grid must not reserve a column when this floating
   control is present. */
.product-detail-layout.has-floating-product-menu,
.product-detail-reference .product-detail-layout.has-floating-product-menu,
.product-detail-reference .product-detail-layout.has-floating-product-menu:not(.is-sidebar-collapsed),
.article-detail-grid.has-floating-product-menu {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

@media (max-width: 1200px) {
  .floating-product-menu {
    top: auto !important;
    right: auto;
    bottom: 84px;
    left: 16px;
  }
  .floating-product-menu-panel {
    top: auto;
    bottom: 0;
    left: 64px;
    transform-origin: bottom left;
  }
}

@media (max-width: 640px) {
  .floating-product-menu {
    bottom: 76px;
    left: 14px;
    width: 48px;
    height: 48px;
  }
  .floating-product-menu-toggle { width: 48px; height: 48px; border-radius: 10px; }
  .floating-product-menu-panel {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: 136px;
    left: 14px;
    width: auto;
    max-height: min(64vh, 560px);
    transform-origin: bottom left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-product-menu,
  .floating-product-menu-toggle,
  .floating-product-menu-icon::after,
  .floating-product-menu-panel { transition: none; animation: none; }
}

@media print {
  .floating-product-menu { display: none !important; }
}
