/**
 * ManuOpus Creative Theme - Core CSS
 * Variabili dinamiche, tipografia, effetti e lightbox responsive
 */

:root {
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-secondary: #475569;
  --bs-body-bg: #ffffff;
  --bs-body-color: #1e293b;
  --mno-hero-overlay: rgba(0, 0, 0, 0.55);
  --mno-card-radius: 12px;
  --mno-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glassmorphism & High-Contrast Cards */
.mno-glass-card {
  background-color: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  backdrop-filter: blur(8px);
}

.hover-white {
  transition: color 0.15s ease-in-out;
}
.hover-white:hover {
  color: #ffffff !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
  overflow-x: hidden;
  max-width: 100%;
}

/* Custom Modern Scrollbars ad Alto Impatto (Solo Desktop) */
@media (min-width: 992px) {
  ::-webkit-scrollbar {
    width: 9px;
    height: 9px;
  }

  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
  }

  ::-webkit-scrollbar-thumb {
    background: var(--bs-primary, #2563eb);
    background-image: linear-gradient(180deg, var(--bs-primary, #2563eb), rgba(var(--bs-primary-rgb), 0.75));
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: padding-box;
    transition: all 0.2s ease;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary, #2563eb);
    box-shadow: 0 0 10px rgba(var(--bs-primary-rgb), 0.5);
  }

  :root, html {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-primary, #2563eb) transparent;
  }
}

@media (min-width: 992px) {
  [data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
  }

  [data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bs-primary, #38bdf8);
    background-image: linear-gradient(180deg, var(--bs-primary, #38bdf8), rgba(var(--bs-primary-rgb), 0.8));
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }

  [data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary, #38bdf8);
    filter: brightness(1.2);
  }

  [data-bs-theme="dark"]:root, [data-bs-theme="dark"] html {
    scrollbar-color: var(--bs-primary, #38bdf8) rgba(15, 23, 42, 0.4);
  }
}

:root {
  --mno-navbar-height: 84px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  min-height: 100vh;
  width: 100%;
  padding-top: var(--mno-navbar-height);
  overflow-x: clip; /* Impedisce overflow orizzontale senza forzare un secondo scroll container verticale */
}

.btn {
  max-width: 100%;
}

/* Navbar */
.mno-navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1040 !important;
  transition: padding 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.85rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.mno-navbar.scrolled {
  padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
  padding-bottom: 0.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.mno-brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
  white-space: nowrap;
}

.mno-brand-img {
  height: 44px;
  max-height: 48px;
  width: auto;
  object-fit: contain;
  transition: height 0.2s ease;
}

/* Stili Link di Navigazione Moderni & Ordinati */
.mno-navbar .navbar-nav {
  gap: 0.25rem;
}

.mno-navbar .nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bs-body-color);
  padding: 0.45rem 0.85rem !important;
  border-radius: 8px;
  white-space: nowrap !important; /* MAI PIÙ TESTO SPEZZATO SU 2 RIGHE */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  letter-spacing: -0.01em;
  opacity: 0.82;
}

.mno-navbar .nav-link:hover {
  opacity: 1;
  color: var(--bs-primary) !important;
  background: rgba(var(--bs-primary-rgb), 0.08);
  transform: translateY(-1px);
}

.mno-navbar .nav-link.active {
  opacity: 1;
  font-weight: 600;
  color: var(--bs-primary) !important;
  background: rgba(var(--bs-primary-rgb), 0.12);
}

[data-bs-theme="dark"] .mno-navbar .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
}

[data-bs-theme="dark"] .mno-navbar .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

/* Divisore discreto tra le voci di menu e la CTA */
.mno-nav-divider {
  display: none;
}

@media (min-width: 992px) {
  .mno-nav-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: rgba(0, 0, 0, 0.12);
    margin: 0 0.4rem;
    align-self: center;
  }
  [data-bs-theme="dark"] .mno-nav-divider {
    background: rgba(255, 255, 255, 0.15);
  }
}

@media (max-width: 991.98px) {
  :root {
    --mno-navbar-height: 72px;
  }
  .mno-navbar {
    padding-top: calc(0.6rem + env(safe-area-inset-top, 0px));
    padding-bottom: 0.6rem;
  }
  .mno-navbar .navbar-collapse {
    max-height: calc(85vh - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767.98px) {
  .mno-brand-img {
    height: 46px;
    max-height: 50px;
    max-width: 210px;
  }
}

/* Hero Section Variants */
.mno-hero-fullscreen {
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
}

.mno-hero-bg-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.mno-hero-compact {
  padding: 5rem 0 4rem 0;
  position: relative;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.mno-hero-split {
  padding: 6rem 0 5rem 0;
  position: relative;
}

.mno-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--mno-hero-overlay);
  z-index: 1;
}

.mno-hero-content {
  position: relative;
  z-index: 2;
}

/* Section Spacing */
.mno-section {
  padding: 5.5rem 0;
}

.mno-section-alt {
  background-color: rgba(0, 0, 0, 0.02);
}

.mno-section-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.mno-section-subtitle {
  color: #475569;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

/* Cards & Services */
.mno-card {
  border-radius: var(--mno-card-radius);
  border: 1px solid rgba(0,0,0,0.07);
  background: #ffffff;
  transition: var(--mno-transition);
}

.mno-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
  border-color: rgba(var(--bs-primary-rgb), 0.3);
}

.mno-icon-box {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  font-size: 1.6rem;
  margin-bottom: 1.25rem;
}

/* Photography / Masonry Gallery */
.mno-gallery-grid {
  column-count: 3;
  column-gap: 1.25rem;
}

@media (max-width: 991px) {
  .mno-gallery-grid {
    column-count: 2;
  }
}

@media (max-width: 575px) {
  .mno-gallery-grid {
    column-count: 1;
  }
}

.mno-gallery-item {
  margin-bottom: 1.25rem;
  break-inside: avoid;
  overflow: hidden;
  border-radius: var(--mno-card-radius);
  position: relative;
  cursor: pointer;
}

.mno-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.mno-gallery-item:hover img {
  transform: scale(1.04);
}

.mno-gallery-caption {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  transition: opacity 0.3s ease;
}

.mno-gallery-item:hover .mno-gallery-caption {
  opacity: 1;
}

/* Pure Vanilla Lightbox Modal */
.mno-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mno-lightbox-overlay.active {
  display: flex;
}

.mno-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  object-fit: contain;
}

.mno-lightbox-close {
  position: absolute;
  top: 25px;
  right: 25px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
}

/* Footer */
.mno-footer {
  padding: 4rem 0 2rem 0;
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* Dark Mode Theme overrides */
[data-bs-theme="dark"] {
  --bs-body-bg: #0f172a;
  --bs-body-color: #f1f5f9;
}

[data-bs-theme="dark"] .mno-card {
  background: #1e293b;
  border-color: rgba(255,255,255,0.08);
}

[data-bs-theme="dark"] .mno-section-alt {
  background-color: rgba(255, 255, 255, 0.02);
}

[data-bs-theme="dark"] .mno-section-subtitle {
  color: #94a3b8;
}

[data-bs-theme="dark"] .mno-footer {
  border-top-color: rgba(255,255,255,0.08);
}

[data-bs-theme="dark"] .text-dark {
  color: #f1f5f9 !important;
}

[data-bs-theme="dark"] .bg-white {
  background-color: #1e293b !important;
  color: #f1f5f9;
}

[data-bs-theme="dark"] .bg-light {
  background-color: rgba(255, 255, 255, 0.04) !important;
}

/* ==========================================================================
   MANUOPUS FLOATING WIDGETS (WhatsApp, Back-To-Top, Call, AI)
   ========================================================================== */

.mno-floating-stack {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  display: flex;
  flex-direction: column-reverse;
  align-items: center; /* Allineamento perfetto su asse verticale centrale unico */
  width: 60px;
  gap: 12px;
  z-index: 9990;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), bottom 0.3s ease;
}

.mno-floating-stack * {
  pointer-events: auto;
}

.mno-floating-pos-bottom-right {
  right: max(20px, env(safe-area-inset-right, 20px));
}

.mno-floating-pos-bottom-left {
  left: max(20px, env(safe-area-inset-left, 20px));
}

/* Quando il sito è visualizzato all'interno di un iframe (es. galleria demo showcase o simulatore) */
.is-in-iframe .mno-floating-stack {
  bottom: max(30px, env(safe-area-inset-bottom, 30px));
}
.is-in-iframe .mno-floating-pos-bottom-right {
  right: max(24px, env(safe-area-inset-right, 24px));
}
.is-in-iframe .mno-floating-pos-bottom-left {
  left: max(24px, env(safe-area-inset-left, 24px));
}

.mno-floating-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.mno-floating-pos-bottom-right .mno-floating-item {
  flex-direction: row-reverse;
}

.mno-floating-pos-bottom-left .mno-floating-item {
  flex-direction: row;
}

/* Distanza extra verso l'alto per il tasto Torna in Alto */
.mno-floating-item-btt {
  margin-bottom: 4px;
}

/* Pulsanti Fluttuanti Base */
.mno-floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  position: relative;
  outline: none;
  user-select: none;
}

.mno-floating-btn i::before {
  vertical-align: 0 !important;
  line-height: 1 !important;
}

.mno-floating-btn svg {
  display: block;
  pointer-events: none;
}

.mno-floating-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

/* Tasto WhatsApp Speciale */
.mno-floating-btn-wa {
  width: 58px;
  height: 58px;
  background: #25D366;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #ffffff !important;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.42), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.mno-floating-btn-wa svg {
  width: 32px;
  height: 32px;
  transform: translate(0.5px, -1px); /* Bilanciamento ottico perfetto nel cerchio */
}

.mno-floating-btn-wa:hover {
  transform: scale(1.08) translateY(-3px);
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(37, 211, 102, 0.55), 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Effetto Pulsazione WhatsApp */
.mno-floating-btn-wa.mno-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: mno-wa-wave 2.2s infinite ease-out;
  pointer-events: none;
}

@keyframes mno-wa-wave {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
  }
  60% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

/* Tasto Chiamata Rapida */
.mno-floating-btn-call {
  width: 54px;
  height: 54px;
  background: var(--bs-primary, #0056b3);
  background: linear-gradient(135deg, var(--bs-primary, #0066cc) 0%, rgba(var(--bs-primary-rgb, 0, 86, 179), 0.85) 100%);
  color: #ffffff !important;
  font-size: 24px;
  box-shadow: 0 6px 20px rgba(0, 86, 179, 0.38), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.mno-floating-btn-call:hover {
  transform: scale(1.08) translateY(-2px);
  color: #ffffff !important;
  filter: brightness(1.1);
  box-shadow: 0 10px 24px rgba(0, 86, 179, 0.5), 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Tasto AI Chatbot */
.mno-floating-btn-ai {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff !important;
  font-size: 24px;
}

.mno-floating-btn-ai:hover {
  transform: scale(1.08) translateY(-2px);
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(168, 85, 247, 0.45);
}

/* Tasto Torna in Alto (Back to top) */
.mno-floating-btn-btt {
  width: 42px;
  height: 42px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff !important;
  font-size: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background-color 0.2s ease;
}

.mno-floating-btn-btt.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mno-floating-btn-btt:hover {
  background: var(--bs-primary, #0284c7);
  transform: translateY(-2px) scale(1.05);
}

/* Etichetta / Tooltip Fluttuante */
.mno-floating-label {
  position: absolute;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 50rem;
  background-color: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.mno-floating-pos-bottom-right .mno-floating-label {
  right: calc(100% + 12px);
}

.mno-floating-pos-bottom-left .mno-floating-label {
  left: calc(100% + 12px);
}

/* Label hover: compare solo al passaggio del mouse */
.mno-floating-label-hover {
  opacity: 0;
  visibility: hidden;
  transform: translateX(6px);
}

.mno-floating-pos-bottom-left .mno-floating-label-hover {
  transform: translateX(-6px);
}

.mno-floating-item:hover .mno-floating-label-hover {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Label permanente: sempre visibile */
.mno-floating-label-permanent {
  opacity: 1;
  visibility: visible;
}

/* Responsive mobile */
@media (max-width: 576px) {
  .mno-floating-stack {
    bottom: 18px;
    gap: 10px;
    width: 54px;
  }
  .mno-floating-pos-bottom-right {
    right: 16px;
  }
  .mno-floating-pos-bottom-left {
    left: 16px;
  }
  .mno-floating-btn-wa {
    width: 54px;
    height: 54px;
    font-size: 28px;
  }
  .mno-floating-btn-call {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
  .mno-floating-btn-btt {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .mno-floating-label-hover {
    display: none;
  }
}

/* ==========================================================================
   Animazioni di Comparsa allo Scroll (Scroll Reveal / AOS)
   Accelerazione GPU nativa (transform & opacity) a 60fps con Stagger fluido
   ========================================================================== */
.mno-reveal {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--mno-reveal-delay, 0ms);
}

.mno-reveal-fade-up {
  transform: translateY(55px);
}

.mno-reveal-fade-down {
  transform: translateY(-55px);
}

.mno-reveal-fade-left {
  transform: translateX(-60px);
}

.mno-reveal-fade-right {
  transform: translateX(60px);
}

.mno-reveal-zoom-in {
  transform: scale(0.88);
}

.mno-reveal-fade-in {
  transform: none;
}

/* Stato attivo quando la sezione entra nel viewport */
.mno-reveal.mno-revealed {
  opacity: 1 !important;
  transform: translate3d(0, 0, 0) scale(1) !important;
}

/* Micro-animazione a Cascata (Stagger) per Card, Griglie ed Elementi Figli */
.mno-reveal .mno-reveal-item {
  opacity: 0;
  transform: translateY(32px) scale(0.97);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--mno-item-delay, 0ms);
  will-change: transform, opacity;
}

.mno-reveal.mno-revealed .mno-reveal-item {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Rilascio GPU e ripristino pieno per hover states al completamento transizione */
.mno-reveal.mno-reveal-done {
  transform: none !important;
  will-change: auto;
}
.mno-reveal.mno-reveal-done .mno-reveal-item {
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .mno-reveal,
  .mno-reveal .mno-reveal-item {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


