/* ============================================================================
   plugin_area_floating_buton — Poziționare coordonată cu celelalte butoane flotante:
   - Stânga jos: .floating-order-button (Comandă, z-index: 1040)
   - Stânga jos / +75px mobil: #gdpr-floating-trigger (Cookie-uri/GDPR, z-index: 1045)
   - Centru jos: .floating-submit-button (Trimite Comanda, z-index: 1040)
   - Dreapta jos: #vlahx-pwa-install-root (Instalează PWA, z-index: 1080)
   - Dreapta sus față de Instalează: .vlahx-floating-buton-area (Gustav AI, z-index: 1046)
   ============================================================================ */

.vlahx-floating-buton-area {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 68px);
  z-index: 1046;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  pointer-events: none;
  transition: bottom 0.25s ease, right 0.25s ease;
}

.vlahx-floating-buton-area > * {
  pointer-events: auto;
}

/* Când butonul PWA Instalează nu este afișat (ex. deja instalat sau indisponibil),
   Gustav coboară curat în colțul dreapta-jos */
@supports selector(:has(*)) {
  body:not(:has(#vlahx-pwa-install-root:not([hidden]) .vlahx-pwa-install-button:not([hidden]))) .vlahx-floating-buton-area {
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  }
}

.vlahx-gustav-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0;
  color: inherit;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.vlahx-gustav-fab:hover {
  transform: translateY(-3px) scale(1.03);
}

.vlahx-gustav-fab:focus-visible {
  outline: 3px solid var(--accent-primary, #C25E00);
  outline-offset: 3px;
}

.vlahx-gustav-fab-avatar-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--accent-primary, #C25E00), #e88d34);
  box-shadow: 0 6px 20px rgba(62, 39, 35, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vlahx-gustav-fab-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background-color: var(--bg-primary, #FDFBF7);
  border: 2px solid #ffffff;
}

.vlahx-gustav-fab-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-primary, #C25E00);
  color: #ffffff;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.vlahx-gustav-fab-label {
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  white-space: nowrap;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #2b1d17);
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.12));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  font-size: 0.84rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vlahx-gustav-fab:hover .vlahx-gustav-fab-label,
.vlahx-gustav-fab:focus-visible .vlahx-gustav-fab-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 576px) {
  .vlahx-floating-buton-area {
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 68px);
  }

  /* În modul de comandă pe telefon, butonul "Trimite Comanda" ocupă centrul jos;
     păstrăm Gustav ridicat chiar dacă PWA Instalează este ascuns */
  body.order-selection-mode .vlahx-floating-buton-area {
    bottom: calc(max(1rem, env(safe-area-inset-bottom, 0px)) + 68px) !important;
  }

  .vlahx-gustav-fab-avatar-wrap {
    width: 50px;
    height: 50px;
  }

  .vlahx-gustav-fab-badge {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .vlahx-gustav-fab-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vlahx-floating-buton-area,
  .vlahx-gustav-fab,
  .vlahx-gustav-fab-label {
    transition: none;
  }
}
