.floating-cart-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--shop-green);
  color: white;
  border: 2px solid white;
  border-radius: 50px;
  padding: 15px 25px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: transform 0.2s;
  /* An <a>: drop the link underline. inline-block, NOT flex: in flex, the text
     node "(0)" becomes an item and the space before it is dropped. */
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.floating-cart-btn:hover {
  transform: scale(1.05);
}

/* Shared identity of the floating buttons (background, border, shadow, hover);
   geometry is per family. legal-notice.css mirrors it from its Shadow DOM. */
.floating-help-btn,
.floating-mass-btn,
.floating-buyback-btn {
  position: fixed;
  height: 46px;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--brass);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  z-index: 999;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.floating-help-btn:hover,
.floating-mass-btn:hover,
.floating-buyback-btn:hover {
  background: var(--brass);
  color: var(--ink);
  transform: scale(1.08);
}

.floating-help-btn {
  bottom: 20px;
  left: 76px;
  width: 46px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
}

.floating-mass-btn,
.floating-buyback-btn {
  bottom: 76px;
  left: 20px;
  border-radius: 23px;
  padding: 0 16px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
}

.help-modal-overlay {
  border: none;
  margin: auto;
  padding: 0;
  background: transparent;
  max-width: calc(100% - 40px);
  max-height: calc(100% - 40px);
}

.help-modal-overlay::backdrop {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.help-modal {
  background-color: #f4f4f4;
  color: #333;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 2px solid #ccc;
  flex-shrink: 0;
}

.help-modal-header h2 {
  margin: 0;
  color: #333;
}

.help-modal-body {
  padding: 20px;
  overflow-y: auto;
  line-height: 1.5;
}

.app-version {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  font-size: 0.78rem;
  color: #999;
  font-family: monospace;
}

.help-modal-body h3 {
  color: var(--shop-green);
  margin: 20px 0 8px 0;
}

.help-modal-body h3:first-child {
  margin-top: 0;
}

.help-modal-body ul,
.help-modal-body ol {
  margin: 0 0 10px 0;
  padding-left: 22px;
}

.help-modal-body li {
  margin-bottom: 6px;
}

.help-modal-body p {
  margin: 0 0 10px 0;
  text-align: justify;
}

@media (max-width: 768px) {
  .help-modal {
    max-height: 90vh;
  }

  .help-modal-body {
    padding: 15px;
  }
}

.toast-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  /* The container is pointer-events:none so toasts do not block the page;
     each toast takes clicks back for its action button. */
  pointer-events: auto;
  background-color: #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border-left: 5px solid var(--shop-green);
  font-weight: bold;
  font-size: 0.95rem;
  opacity: 1;
  transition: opacity 0.3s ease;
  animation: slideInRight 0.3s forwards;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-action-btn {
  margin-left: 12px;
  padding: 4px 12px;
  border: 1px solid #7dc47d;
  border-radius: 4px;
  background: none;
  color: #7dc47d;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.toast-action-btn:hover {
  background-color: var(--shop-green);
  border-color: var(--shop-green);
  color: white;
}

.info-tooltip,
.condition-help {
  cursor: help;
  opacity: 0.8;
  vertical-align: middle;
}

.info-tooltip {
  font-size: 1.1rem;
  margin-left: 6px;
}

.info-tooltip:hover,
.condition-help:hover {
  opacity: 1;
}

/* Out of flow on the condition chip's corner: the finish / condition /
   language / price row is full, and anything widening it wraps the price. */
.condition-field {
  position: relative;
  display: inline-flex;
}

.condition-help {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 15px;
  height: 15px;
  line-height: 13px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: bold;
  text-decoration: none;
  color: #fff;
  background: var(--shop-green);
  border: 1px solid #fff;
  border-radius: 50%;
}

@media (max-width: 768px) {
  /* In the bottom dock (style.css): the help second, the mode fourth after the
     languages, the cart alone on the right. At the top the cart would cover the search
     field when the header collapses. */
  .floating-cart-btn {
    top: auto;
    bottom: var(--dock-bottom);
    right: var(--dock-side);
    height: var(--dock-button);
    padding: 0 14px;
    /* inline-block: the line height centres the text, inside 2 × 2px of border. */
    line-height: calc(var(--dock-button) - 4px);
    font-size: 0.95rem;
    box-shadow: none;
  }

  .floating-help-btn,
  .floating-mass-btn,
  .floating-buyback-btn {
    bottom: var(--dock-bottom);
    height: var(--dock-button);
    box-shadow: none;
  }

  .floating-help-btn {
    left: calc(var(--dock-side) + var(--dock-button) + var(--dock-gap));
    width: var(--dock-button);
  }

  .floating-mass-btn,
  .floating-buyback-btn {
    left: calc(
      var(--dock-side) + 2 * (var(--dock-button) + var(--dock-gap)) + var(--dock-flags-width) + var(--dock-gap)
    );
  }

  .toast-container {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
    max-width: 350px;
  }

  @keyframes slideInRight {
    from {
      transform: translateY(50px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* A phone's dock holds the mode as its icon and the cart without its total, which the
   cart screen shows. */
@media (max-width: 520px) {
  .floating-mass-btn,
  .floating-buyback-btn {
    width: var(--dock-button);
    padding: 0;
    justify-content: center;
  }

  /* Out of sight, still the link's accessible name. */
  .floating-mode-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .floating-cart-total {
    display: none;
  }
}
