/* =========================================================
   MGFIT APP THEME – theme.css
   Shell layout: font-face, body, struttura pagina.
   I componenti app (card, glass, dock, ecc.) vivono
   nel plugin mgfit-custom → assets/css/mgfit-frontend.css
   ========================================================= */


/* ---------------------------------------------------------
   @font-face – Font locali (variable fonts)
   --------------------------------------------------------- */

@font-face {
    font-family: 'Jost';
    src: url('fonts/Jost-VariableFont_wght.woff2') format('woff2 supports variations'),
         url('fonts/Jost-VariableFont_wght.woff2') format('woff2'),
         url('fonts/Jost-VariableFont_wght.ttf')   format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mulish';
    src: url('fonts/Mulish-VariableFont_wght.woff2') format('woff2 supports variations'),
         url('fonts/Mulish-VariableFont_wght.woff2') format('woff2'),
         url('fonts/Mulish-VariableFont_wght.ttf')   format('truetype');
    font-weight: 200 900;
    font-style: normal;
    font-display: swap;
}


/* ---------------------------------------------------------
   RESET MINIMALE
   --------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
     -webkit-tap-highlight-color: transparent; /* rimuove il flash blu su tap Android */
}


/* ---------------------------------------------------------
   HTML / BODY – sfondo app e font base
   --------------------------------------------------------- */

html {
    background-color: #F6F3F0;
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: linear-gradient(
        to bottom,
        #F6F3F0 0%,
        #EBDFD5 70%,
        #EBDFD5 100%
    );
    background-attachment: scroll; /* fix Android: fixed causa repaint continuo */
    font-family: 'Jost', system-ui, sans-serif;
    font-size: 16px;
    color: #1a1a1a;
    -webkit-overflow-scrolling: touch;
}


/* ---------------------------------------------------------
   STRUTTURA PAGINA
   --------------------------------------------------------- */

#mgfit-page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

#mgfit-main {
    flex: 1;
    width: 100%;
    padding-bottom: 80px; /* spazio sopra dock mobile */
}


/* ---------------------------------------------------------
   LAYOUT DESKTOP – regole globali + override per pagina
   --------------------------------------------------------- */

@media (min-width: 1024px) {
    #mgfit-main {
        max-width: 100%;
        margin: 0;
        padding-top: 0;
        padding-left: 40px;
        padding-right: 40px;
        padding-bottom: 100px;
    }

    /* Pagine con layout interno proprio */
    #mgfit-main.mgfit-main--app,
    #mgfit-main.mgfit-main--canali,
    #mgfit-main.mgfit-main--supporto {
        padding-left: 0;
        padding-right: 0;
    }
}


/* ---------------------------------------------------------
   LAYOUT MOBILE – padding laterale globale
   --------------------------------------------------------- */

@media (max-width: 1023px) {
    #mgfit-main {
        padding-top: 10px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 100px;
    }

    /* Pagine con layout interno proprio — azzerano il padding
       perché lo gestiscono internamente */
    #mgfit-main.mgfit-main--app,
    #mgfit-main.mgfit-main--canali {
        padding-left: 0;
        padding-right: 0;
    }
}


/* ---------------------------------------------------------
   HEADER TEMA – barra logo + saluto
   --------------------------------------------------------- */

#mgfit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 40px;
    min-height: 80px;
}

@media (max-width: 767px) {
    #mgfit-header {
        padding: 20px 24px 10px 24px;
        min-height: 60px;
    }
}

.mgfit-header__logo img {
    display: block;
    width: auto;
    height: 90px;
}

@media (max-width: 767px) {
    .mgfit-header__logo img {
        height: 60px;
    }
}

.mgfit-header__greeting {
    font-family: 'Jost', sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a1a;
    text-align: right;
}

@media (max-width: 767px) {
    .mgfit-header__greeting {
        font-size: 16px;
    }
}


/* ---------------------------------------------------------
   ACCESSIBILITÀ – skip link
   --------------------------------------------------------- */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    z-index: 9999;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}


/* ---------------------------------------------------------
   UTILITY – WP admin bar
   --------------------------------------------------------- */

body.admin-bar #mgfit-page-wrap {
    margin-top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #mgfit-page-wrap {
        margin-top: 46px;
    }
}


/* ---------------------------------------------------------
   TOAST UTENTI WIX
   --------------------------------------------------------- */

.mgfit-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.95);
    background: rgba(17, 17, 17, 0.95);
    color: #fff;
    padding: 18px 22px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 999999;
    max-width: 85%;
    text-align: center;
    backdrop-filter: blur(6px);
}

.mgfit-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}


/* ---------------------------------------------------------
   PAGINA ESERCIZI LARGHEZZA DEKSTOP
   --------------------------------------------------------- */
@media (min-width: 1024px) {
    #mgfit-main.mgfit-main--lesson {
        max-width: 1200px;
        margin: 0 auto;
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* ---------------------------------------------------------
   PWA STANDALONE – safe area insets
   Quando l'app è installata sulla home screen, il browser
   non aggiunge automaticamente il padding per la status bar.
   Usiamo display-mode: standalone per rilevarlo.
   --------------------------------------------------------- */

@media (display-mode: standalone) {

    /* Header: aggiungi la safe area in cima al padding esistente */
    #mgfit-header {
        padding-top: calc(10px + env(safe-area-inset-top));
    }

    @media (min-width: 768px) {
        #mgfit-header {
            padding-top: calc(10px + env(safe-area-inset-top));
        }
    }
}
/* ── SEZIONE UNIFICATA: PROVA GRATUITA + CODICE REGALO ─────────── */
.mgfit-pricing-extra {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  background: #ffffff;
  border: 1px solid rgba(30,26,23,0.07);
  border-radius: 28px;
  overflow: hidden;
  width: 100%;
}

.mgfit-extra-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 52px 48px;
  gap: 14px;
}

.mgfit-extra-card__icon {
  font-size: 30px;
  line-height: 1;
}

.mgfit-extra-card__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 400;
  color: #1e1a17;
  margin: 0;
  line-height: 1.2;
}

.mgfit-extra-card__sub {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #7a6e67;
  margin: 0;
  line-height: 1.6;
}

.mgfit-extra-card__cta {
  width: 100% !important;
  text-align: center !important;
  font-family: 'Jost', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  padding: 15px 24px !important;
  border-radius: 50px !important;
  background: #1e1a17 !important;
  color: #f7f3ee !important;
  border: none !important;
  display: block !important;
  transition: background 0.2s ease;
  cursor: pointer;
  margin-top: auto;
}

.mgfit-extra-card__cta:hover {
  background: #8a7060 !important;
}

/* Divisore verticale */
.mgfit-extra-divider {
  width: 1px;
  background: rgba(30,26,23,0.12);
  align-self: stretch;
  flex-shrink: 0;
}

/* Lista features trial */
.mgfit-extra-card--trial .mgfit-pricing-trial__list {
  text-align: left;
  width: 100%;
}

/* Colonna gift: centra verticalmente */
.mgfit-extra-card--gift {
  justify-content: center;
}

/* Lista step gift card */
.mgfit-extra-card__gift-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #3a3330;
  line-height: 1.5;
}

.mgfit-extra-card__gift-steps li {
  padding-left: 4px;
}

/* Link leggero "Accedi" quando non loggato */
.mgfit-extra-card__cta-link {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #8a7060;
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(138,112,96,0.3);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
  margin-top: auto;
}

.mgfit-extra-card__cta-link:hover {
  color: #1e1a17;
  border-color: #1e1a17;
}

/* Form input codice regalo */
.mgfit-extra-card--gift .mgfit-giftcard-box__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.mgfit-giftcard-box__input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid rgba(138,112,96,0.25);
  border-radius: 50px;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #1e1a17;
  background: #faf8f6;
  outline: none;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.mgfit-giftcard-box__input:focus {
  border-color: #8a7060;
  background: #fff;
}

.mgfit-giftcard-box__input::placeholder {
  color: #bbb;
  letter-spacing: 0.08em;
}

.mgfit-giftcard-box__status {
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 500;
  min-height: 18px;
  margin: 0;
  text-align: center;
}

.mgfit-giftcard-box__status--success { color: #27ae60; }
.mgfit-giftcard-box__status--error   { color: #c0392b; }

/* Rimuovi stili vecchi non più usati */
.mgfit-pricing-giftcard,
.mgfit-pricing-trial { display: none !important; }

/* Mobile: stack verticale */
@media (max-width: 700px) {
  .mgfit-pricing-extra {
    grid-template-columns: 1fr;
  }
  .mgfit-extra-divider {
    width: 100%;
    height: 1px;
  }
  .mgfit-extra-card {
    padding: 36px 28px;
  }
}

/* ── NOTE LEGALI — DRAWER ───────────────────────────────────────── */
.mgfit-legal-drawer {
  position: fixed;
  inset: 0;
  z-index: 99998;
  pointer-events: none;
}
.mgfit-legal-drawer.is-open {
  pointer-events: all;
}

.mgfit-legal-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}
.mgfit-legal-drawer.is-open .mgfit-legal-drawer__backdrop {
  background: rgba(0,0,0,0.35);
}

.mgfit-legal-drawer__sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #faf8f6;
  border-radius: 24px 24px 0 0;
  padding: 12px 24px calc(100px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.mgfit-legal-drawer.is-open .mgfit-legal-drawer__sheet {
  transform: translateY(0);
}

.mgfit-legal-drawer__handle {
  width: 36px;
  height: 4px;
  background: rgba(45,30,26,0.15);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.mgfit-legal-drawer__title {
  font-family: 'Jost', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e1a17;
  margin: 0 0 16px;
  text-align: center;
}

.mgfit-legal-drawer__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mgfit-legal-drawer__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(45,30,26,0.06);
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #1e1a17;
  transition: opacity 0.15s;
}
.mgfit-legal-drawer__item:last-child { border-bottom: none; }
.mgfit-legal-drawer__item:active { opacity: 0.6; }
.mgfit-legal-drawer__item svg { color: rgba(45,30,26,0.3); flex-shrink: 0; }

/* ── NOTE LEGALI — tile desktop vs bottone mobile ────────────────── */
/* Su mobile: tile nella griglia nascosto, bottone full-width visibile */
.mgfit-legal-tile-desktop { display: none !important; }

/* Su desktop: tile nella griglia visibile, bottone full-width nascosto */
@media (min-width: 901px) {
  .mgfit-legal-tile-desktop { display: flex !important; }
  #mgfitLegalBtn { display: none !important; }
}