/* Mandrake Grifes V19 - mobile profissional, IA segura e navegacao sem bloqueios */
:root {
  --mg19-blue: #075ee8;
  --mg19-blue-dark: #0647aa;
  --mg19-ink: #101828;
  --mg19-muted: #667085;
  --mg19-line: #d7e0ec;
  --mg19-safe-bottom: 18px;
  --mg19-shadow: 0 18px 48px rgba(16, 24, 40, .16);
}

html.mg-v19 { overflow-x: clip; }

/* O menu fica acima da navegacao inferior e aceita toque em todos os links. */
.mg-header-inicio.menu-open {
  z-index: 2147483200 !important;
}
#overlay-inicio:not(.mg-inicio-hidden),
.mg-inicio-overlay:not(.mg-inicio-hidden) {
  z-index: 2147483210 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
#slide-menu-inicio.open,
.mg-inicio-slide-menu.open,
#mg-shop-menu.open {
  z-index: 2147483220 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
#slide-menu-inicio.open :is(a, button, input, select, textarea),
.mg-inicio-slide-menu.open :is(a, button, input, select, textarea) {
  pointer-events: auto !important;
}

/* Home: o header sticky ja ocupa espaco no fluxo; nao deve existir segunda reserva. */
body.mg-page-bg {
  padding-top: 0 !important;
}
body.mg-page-bg > .mg-header-inicio {
  position: sticky !important;
  top: 0 !important;
}
body.mg-page-bg main.mg-main {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
body.mg-page-bg .mg-story-shell {
  margin-top: 0 !important;
  padding-top: 8px !important;
}

/* Faixa de confianca curta, legivel e consistente em qualquer largura. */
.mg-fashion-trust {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
}
.mg-fashion-trust-item {
  min-width: 0 !important;
  align-items: center !important;
}
.mg-fashion-trust-icon {
  display: inline-grid !important;
  place-items: center !important;
  color: #fff !important;
  background: linear-gradient(145deg, #1473ff, #0754d5) !important;
  box-shadow: 0 8px 18px rgba(7, 94, 232, .20) !important;
  font-family: Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 900 !important;
}
.mg-fashion-trust-icon i { display: none !important; }
.mg-fashion-trust-item:nth-child(1) .mg-fashion-trust-icon::before { content: "\2194"; }
.mg-fashion-trust-item:nth-child(2) .mg-fashion-trust-icon::before { content: "\2713"; }
.mg-fashion-trust-item:nth-child(3) .mg-fashion-trust-icon::before { content: "\21BB"; }

/* Minha conta: remove o recuo legado que aparecia antes do cabecalho. */
body.mg-client-page {
  padding-top: 0 !important;
}
body.mg-client-page > .mg-header-inicio {
  position: sticky !important;
  top: 0 !important;
}
body.mg-client-page .minha-conta-main {
  padding-top: 12px !important;
}
body.mg-client-page .mg-account-title-wrap-clean {
  gap: 12px !important;
}
body.mg-client-page .mg-v31-account-hub {
  background: rgba(255, 255, 255, .96) !important;
}
body.mg-client-page .mg-dashboard-card,
body.mg-client-page .mg-v31-account-hub,
body.mg-client-page #clientData {
  border-color: var(--mg19-line) !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .06) !important;
}

/* Avaliacao publica e editavel. */
.mg19-review-editor .mg-client-chip {
  margin-bottom: 12px !important;
  border-color: #a9dbc6 !important;
  color: #126241 !important;
  background: #eefaf4 !important;
}
.mg19-review-editor textarea,
.mg19-review-editor select {
  color: var(--mg19-ink) !important;
  background: #fff !important;
}
.choice:has(input[name="cor"]) {
  gap: 8px !important;
  align-items: center !important;
}
.mg19-product-color-dot {
  display: inline-block !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 1px #98a2b3 !important;
}

/* Sacola e IA ocupam lados opostos e ficam acima da barra inferior. */
#carrinhoFlutuante.mg-floating-cart {
  right: 12px !important;
  bottom: calc(var(--mg19-safe-bottom) + 2px) !important;
  z-index: 10040 !important;
}

/* Widget HostGator: seletor pelos IDs oficiais gerados pelo proprio componente. */
#toggle-iframe-btn {
  right: 24px !important;
  bottom: 24px !important;
  left: auto !important;
  z-index: 2147482600 !important;
  width: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .72) !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  box-shadow: 0 14px 34px rgba(7, 55, 145, .28) !important;
}
#toggle-iframe-btn > span { display: none !important; }
#toggle-iframe-btn svg {
  width: 25px !important;
  height: 25px !important;
  margin: auto !important;
}
#custom-iframe-container {
  top: auto !important;
  right: 24px !important;
  bottom: 92px !important;
  left: auto !important;
  z-index: 2147482500 !important;
  width: min(400px, calc(100vw - 32px)) !important;
  height: min(600px, calc(100dvh - 116px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 116px) !important;
  border: 1px solid #cad8eb !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: var(--mg19-shadow) !important;
}
#custom-iframe-container iframe {
  position: static !important;
  inset: auto !important;
  display: block !important;
  visibility: visible !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  pointer-events: auto !important;
}
html.mg19-interface-busy #toggle-iframe-btn,
html.mg19-menu-open #toggle-iframe-btn,
html.mg19-interface-busy #custom-iframe-container,
html.mg19-menu-open #custom-iframe-container {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 899px) {
  html.mg19-has-bottom-nav { --mg19-safe-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }

  .mg-inicio-slide-menu,
  #slide-menu-inicio,
  #mg-shop-menu.mg-shop-menu {
    top: 58px !important;
    right: 7px !important;
    bottom: auto !important;
    left: auto !important;
    width: min(320px, calc(100vw - 14px)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(76dvh, 610px) !important;
    padding: 7px !important;
    border: 1px solid #d7e0ec !important;
    border-radius: 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    background: #fff !important;
    box-shadow: 0 24px 70px rgba(16, 24, 40, .28) !important;
  }
  .mg-inicio-menu-header {
    min-height: 0 !important;
    margin-bottom: 6px !important;
    padding: 10px 11px !important;
    border-radius: 13px !important;
  }
  .mg-inicio-menu-list { gap: 4px !important; padding: 3px !important; }
  .mg-inicio-menu-item,
  .mg-shop-menu a {
    min-height: 42px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
  }
  .mg-inicio-profile-box { min-height: 50px !important; }
  .mg-inicio-profile-img { width: 34px !important; height: 34px !important; }

  .mg-fashion-trust {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
  }
  .mg-wide-shell:has(> .mg-fashion-trust) {
    padding-top: 8px !important;
  }
  .mg-wide-shell:has(> .mg-fashion-trust) + .mg-wide-shell {
    padding-top: 14px !important;
  }
  .mg-fashion-trust-item {
    display: flex !important;
    min-height: 92px !important;
    flex-direction: column !important;
    justify-content: center !important;
    gap: 7px !important;
    padding: 9px 5px !important;
    text-align: center !important;
  }
  .mg-fashion-trust-icon {
    width: 34px !important;
    height: 34px !important;
    margin: 0 auto !important;
    border-radius: 11px !important;
    font-size: 17px !important;
  }
  .mg-fashion-trust-item > span:last-child {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    color: var(--mg19-ink) !important;
    text-align: center !important;
  }
  .mg-fashion-trust-item > span:last-child > span { display: none !important; }
  .mg-fashion-trust-item strong {
    display: block !important;
    font-size: clamp(9px, 2.5vw, 11px) !important;
    line-height: 1.2 !important;
  }

  body.mg-client-page .minha-conta-main {
    width: calc(100% - 12px) !important;
    padding: 10px 0 calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.mg-client-page .mg-account-title-wrap-clean { margin-bottom: 10px !important; }
  body.mg-client-page .mg-account-title { font-size: 27px !important; }
  body.mg-client-page .mg-account-subtitle { font-size: 12px !important; line-height: 1.45 !important; }
  body.mg-client-page .mg-account-shop-btn { min-height: 44px !important; }
  body.mg-client-page .mg-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  body.mg-client-page .mg-dashboard-card {
    min-height: 94px !important;
    padding: 11px !important;
  }
  body.mg-client-page .mg-v31-account-hub { margin-top: 10px !important; padding: 12px !important; }
  body.mg-client-page .mg-v31-account-hub .mg-client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  body.mg-client-page .mg-v31-account-hub .mg-client-btn {
    min-height: 44px !important;
    padding: 8px !important;
    font-size: 11px !important;
  }
  body.mg-client-page .mg-v31-account-hub > p { font-size: 11px !important; line-height: 1.45 !important; }
  body.mg-client-page .mg-section-toolbar { gap: 9px !important; }
  body.mg-client-page .section-title { font-size: 24px !important; }

  #carrinhoFlutuante.mg-floating-cart {
    right: 12px !important;
    bottom: calc(var(--mg19-safe-bottom) + 2px) !important;
    width: 54px !important;
    min-width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    border-radius: 17px !important;
  }
  #carrinhoFlutuante .mg-floating-cart-label { display: none !important; }

  #toggle-iframe-btn {
    right: auto !important;
    bottom: calc(var(--mg19-safe-bottom) + 2px) !important;
    left: 12px !important;
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 54px !important;
    min-height: 54px !important;
    border-radius: 17px !important;
  }
  #custom-iframe-container {
    top: 62px !important;
    right: 8px !important;
    bottom: calc(var(--mg19-safe-bottom) + 64px) !important;
    left: 8px !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 18px !important;
  }
}

@media (max-width: 390px) {
  .mg-fashion-trust { gap: 5px !important; }
  .mg-fashion-trust-item { min-height: 88px !important; padding-inline: 3px !important; }
  body.mg-client-page .mg-dashboard-grid,
  body.mg-client-page .mg-v31-account-hub .mg-client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-height: 650px) and (max-width: 899px) {
  #custom-iframe-container { top: 58px !important; }
  .mg-inicio-slide-menu,
  #slide-menu-inicio { max-height: calc(100dvh - 66px) !important; }
}

@media (prefers-reduced-motion: reduce) {
  #toggle-iframe-btn,
  #custom-iframe-container { transition: none !important; }
}
