﻿/* Profilo â€” embed bar (dashboard iframe, tutti i breakpoint) */

body.mt-profile.embed-mode .pf-embed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 10px 16px;
  margin: 0;
  background: var(--mt-glass-bg-strong);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--mt-divider);
}

body.mt-profile:not(.embed-mode) .pf-embed-bar {
  display: none;
}

:is(body.mt-profile, .mt-profile-root) .pf-embed-bar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--mt-text-primary);
  letter-spacing: -0.01em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:is(body.mt-profile, .mt-profile-root) .pf-embed-save {
  flex-shrink: 0;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--mt-purple), var(--mt-purple-deep));
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 16px rgba(124, 92, 246, 0.28);
}

:is(body.mt-profile, .mt-profile-root) .pf-embed-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Profilo mobile â€” user-profile.php â‰¤900px */

@media (max-width: 900px) {
  :is(body.mt-profile, .mt-profile-root) .pf-page {
    padding: 12px 14px 88px;
  }

  body.mt-profile.embed-mode .pf-page {
    padding-top: 8px;
  }

  body.mt-profile.embed-mode .pf-embed-bar {
    padding: 10px 14px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-embed-save {
    min-height: 40px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Intro compatta */
  :is(body.mt-profile, .mt-profile-root) .pf-intro {
    padding: 16px 14px;
    margin-bottom: 12px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-intro-title {
    font-size: 18px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-intro-sub {
    font-size: 12px;
  }

  body.mt-profile.embed-mode .pf-intro-label {
    font-size: 10px;
  }

  /* Hero compatto */
  :is(body.mt-profile, .mt-profile-root) .pf-banner {
    height: 96px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-hero-bottom {
    padding: 0 14px 14px;
    gap: 10px;
    margin-top: -32px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-hero-meta {
    padding-top: 34px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-hero-name {
    font-size: 15px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-hero-hint {
    font-size: 10px;
  }

  /* Sezioni */
  :is(body.mt-profile, .mt-profile-root) .pf-section {
    padding: 14px;
    margin-bottom: 10px;
    border-radius: var(--mt-radius-md);
  }

  :is(body.mt-profile, .mt-profile-root) .pf-section-hdr {
    gap: 10px;
    margin-bottom: 12px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-section-title {
    font-size: 14px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-section-sub {
    font-size: 11px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-grid-2,
  :is(body.mt-profile, .mt-profile-root) .pf-grid-3 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-input,
  :is(body.mt-profile, .mt-profile-root) select.pf-input,
  :is(body.mt-profile, .mt-profile-root) textarea.pf-input {
    font-size: 16px;
    min-height: 44px;
    padding: 11px 12px;
  }

  :is(body.mt-profile, .mt-profile-root) textarea.pf-input {
    min-height: 88px;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-page-check,
  :is(body.mt-profile, .mt-profile-root) .pf-page-row {
    padding: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-geocode-btn,
  :is(body.mt-profile, .mt-profile-root) .pf-map-wrap button {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Salva sticky + nascondi duplicato in fondo pagina */
  :is(body.mt-profile, .mt-profile-root) .pf-sticky-save {
    display: block;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0));
  }

  :is(body.mt-profile, .mt-profile-root) .pf-actions-bottom {
    display: none;
  }

  :is(body.mt-profile, .mt-profile-root) .pf-sticky-save-btn {
    min-height: 48px;
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }

  :is(body.mt-profile, .mt-profile-root) .toast {
    left: 14px;
    right: 14px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0));
    text-align: center;
  }

  body.mt-profile.pf-setup-mode .pf-setup-hint {
    font-size: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
  }
}
