/* Sito di Emil sul telefono «come un'app» (fino a 900px, dove il sito passa al menu da telefono).
   Barra delle schede petrolio con Lime al centro, menu a scheda, invito a installare, cambio pagina morbido. */

/* Cambio pagina senza lampi: la nuova pagina sfuma sulla vecchia, barra e testata restano ferme. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ecapp-out .18s ease both; }
::view-transition-new(root) { animation: ecapp-in .32s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ecapp-out { to { opacity: 0; } }
@keyframes ecapp-in { from { opacity: 0; transform: translateY(8px); } }
.ecapp-tabbar { view-transition-name: ecapp-tabbar; }
.site-header { view-transition-name: ecapp-header; }

/* Dalla seconda pagina della visita: niente preloader. */
.ec-return #preloader { display: none !important; }
.ec-return body.preloading { overflow: auto; }

.ecapp-tabbar, .ecapp-sheet, .ecapp-install { display: none; }

/* iubenda: niente pulsante tondo flottante, le preferenze si aprono dal link «Preferenze cookie» nel footer. */
html body .iubenda-tp-btn.iubenda-tp-btn[data-tp-float][data-tp-float] { display: none !important; visibility: hidden !important; pointer-events: none !important; }
.ec-cookie-pref-wrap { max-width: 880px; margin: 0 auto 40px; padding: 0 20px; font-size: 14px; }
.ec-cookie-pref-wrap a { color: inherit; text-decoration: underline; }

@media (max-width: 900px) {
  html { -webkit-tap-highlight-color: transparent; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

  /* La barra delle schede sostituisce barra azioni, hamburger e pulsante di Lime. */
  .sticky-bar, .menu-toggle, .ec-launch { display: none !important; }
  .ec-teaser { right: 50% !important; left: auto !important; transform: translate(50%, 10px) scale(.96) !important;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px)) !important; border-radius: 16px !important; text-align: center; }
  .ec-teaser.is-in { transform: translate(50%, 0) !important; }

  .ecapp-tabbar {
    position: fixed;
    z-index: 90;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    height: calc(66px + env(safe-area-inset-bottom, 0px));
    padding: 0 6px env(safe-area-inset-bottom, 0px);
    background: rgba(7, 63, 73, .94);
    -webkit-backdrop-filter: saturate(1.6) blur(18px);
    backdrop-filter: saturate(1.6) blur(18px);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 34px rgba(7, 63, 73, .28);
    font-family: Inter, Manrope, "DM Sans", system-ui, -apple-system, sans-serif;
  }
  .ecapp-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 66px;
    border: 0;
    padding: 0;
    background: none;
    color: rgba(255, 255, 255, .62);
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: color .2s, transform .15s;
  }
  .ecapp-tab svg { transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .ecapp-tab:active { transform: scale(.92); }
  .ecapp-tab.is-on { color: #ffc400; }
  .ecapp-tab.is-on svg { transform: translateY(-1px) scale(1.06); }

  /* Lime al centro: sfera gialla in rilievo che esce dalla barra. */
  .ecapp-tab--lime { justify-content: flex-end; padding-bottom: 9px; color: #fff; }
  .ecapp-lime {
    position: relative;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    margin-bottom: 2px;
    border-radius: 50%;
    border: 4px solid #073f49;
    background: radial-gradient(circle at 34% 28%, #ffe58a, #ffc400 55%, #d99c00);
    box-shadow: 0 12px 24px -6px rgba(255, 196, 0, .55), inset 0 -5px 10px rgba(0, 0, 0, .18), inset 0 4px 8px rgba(255, 255, 255, .5);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  .ecapp-lime b { font-size: 24px; font-weight: 900; color: #073f49; line-height: 1; }
  .ecapp-lime i { position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #ffc400; opacity: 0; animation: ecapp-pulse 2.8s ease-out infinite; }
  @keyframes ecapp-pulse { 0% { transform: scale(.85); opacity: .7; } 80%, 100% { transform: scale(1.25); opacity: 0; } }
  .ecapp-tab--lime:active .ecapp-lime { transform: scale(.9); }

  /* Menu a scheda dal basso. */
  .ecapp-sheet { display: block; position: fixed; inset: 0; z-index: 1100; pointer-events: none; font-family: Inter, Manrope, system-ui, sans-serif; }
  .ecapp-sheet__scrim { position: absolute; inset: 0; background: rgba(4, 30, 36, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .3s; }
  .ecapp-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88vh;
    overflow-y: auto;
    padding: 10px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 26px 26px 0 0;
    background: #fff;
    color: #163138;
    box-shadow: 0 -20px 50px rgba(7, 63, 73, .3);
    transform: translateY(105%);
    transition: transform .42s cubic-bezier(.2, .8, .2, 1);
  }
  .ecapp-sheet.is-open { pointer-events: auto; }
  .ecapp-sheet.is-open .ecapp-sheet__scrim { opacity: 1; }
  .ecapp-sheet.is-open .ecapp-sheet__panel { transform: none; }
  .ecapp-sheet__grip { display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 99px; background: #dde7e8; }
  .ecapp-sheet__brand { margin: 0 0 12px; font-weight: 900; font-size: 20px; letter-spacing: -.01em; color: #073f49; }
  .ecapp-sheet__brand small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #0b8aa6; }
  .ecapp-sheet__links { display: grid; gap: 6px; }
  .ecapp-sheet__links a {
    display: block;
    padding: 13px 16px;
    border-radius: 16px;
    background: #f3f7f7;
    color: #163138;
    text-decoration: none;
    transform: perspective(600px) translateZ(0);
    transition: transform .2s, background .2s;
  }
  .ecapp-sheet__links a:active { transform: perspective(600px) translateZ(-20px); }
  .ecapp-sheet__links a.is-on { background: #e3f3f6; box-shadow: inset 3px 0 0 #ffc400; }
  .ecapp-sheet__links b { display: block; font-size: 16px; }
  .ecapp-sheet__links small { display: block; font-size: 13px; color: #6f6f6f; margin-top: 2px; }
  .ecapp-sheet__cta { display: grid; gap: 8px; margin-top: 16px; }
  .ecapp-btn { display: block; padding: 15px; border-radius: 14px; text-align: center; font-weight: 800; font-size: 15px; text-decoration: none; }
  .ecapp-btn--main { background: #ffc400; color: #073f49; box-shadow: 0 10px 22px -10px rgba(255, 196, 0, .8); }
  .ecapp-btn--wa { background: #25d366; color: #fff; }
  .ecapp-sheet__legal { margin: 16px 0 0; text-align: center; font-size: 12px; color: #6f6f6f; }
  .ecapp-sheet__legal a { color: inherit; }
  html.ecapp-locked, html.ecapp-locked body { overflow: hidden; }

  /* Invito a installare, sopra la barra. */
  .ecapp-install:not([hidden]) {
    display: flex;
    position: fixed;
    z-index: 95;
    left: 12px;
    right: 12px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    color: #163138;
    box-shadow: 0 18px 40px rgba(7, 63, 73, .25);
    font-family: Inter, Manrope, system-ui, sans-serif;
    animation: ecapp-in .4s cubic-bezier(.2, .8, .2, 1);
  }
  .ecapp-install img { border-radius: 12px; flex: none; }
  .ecapp-install__text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.35; color: #4b5c60; }
  .ecapp-install__text b { display: block; font-size: 14px; color: #073f49; }
  .ecapp-install__go { flex: none; border: 0; border-radius: 999px; padding: 9px 14px; font: inherit; font-weight: 800; font-size: 13px; background: #ffc400; color: #073f49; }
  .ecapp-install__x { flex: none; border: 0; background: none; font-size: 24px; line-height: 1; color: #6f6f6f; padding: 0 4px; }

  /* Aperto dalla schermata Home: rispetta la tacca in alto. */
  html.is-app .site-header, html.is-app .minimal-header { padding-top: env(safe-area-inset-top, 0px); }
}

/* Lo stile del sito non deve riaccendere gli elementi nascosti dell'app. */
.ecapp-install [hidden], .ecapp-install[hidden] { display: none !important; }
