
/* Mandrake final fix v3: produtos com foto, grid correto, menu app */
:root{
  --mg-blue:#0057ff;
  --mg-blue-dark:#003fc2;
  --mg-soft:#eef5ff;
  --mg-border:rgba(0,87,255,.16);
  --mg-shadow:0 16px 40px rgba(15,23,42,.08);
  --mg-shadow-hover:0 22px 56px rgba(15,23,42,.14);
}

/* Header/menu mais integrado */
.mg-header-inicio{
  background:rgba(255,255,255,.88)!important;
  border-bottom:1px solid rgba(0,87,255,.12)!important;
  box-shadow:0 10px 28px rgba(15,23,42,.08)!important;
  backdrop-filter:blur(18px)!important;
  -webkit-backdrop-filter:blur(18px)!important;
}
.mg-header-inicio-inner{width:min(1180px,calc(100% - 1rem))!important;padding:.55rem 0!important}
.mg-inicio-logo-card{border-radius:1rem!important;box-shadow:0 10px 24px rgba(0,87,255,.10)!important}
.mg-inicio-menu-button{border-radius:1rem!important;background:#fff!important;border:1px solid rgba(0,87,255,.20)!important;box-shadow:0 10px 24px rgba(0,87,255,.10)!important}

/* Container geral */
.mg-store{width:min(1180px,calc(100% - 1rem))!important;margin-inline:auto!important;padding-top:5.3rem!important}
@media (min-width:768px){.mg-store{width:min(1180px,calc(100% - 2rem))!important;padding-top:5.8rem!important}}

/* Hero não deve ficar escondido atrás do menu */
.mg-hero-card{margin-top:.25rem!important}
.mg-hero-pro{min-height:auto!important}
.mg-hero-pro-inner{align-items:center!important}
@media (max-width:700px){
  .mg-hero-pro-inner{display:grid!important;grid-template-columns:1fr!important}
  .mg-hero-status-card{width:100%!important;max-width:none!important}
  .mg-hero-copy h1{font-size:clamp(2rem,12vw,3.1rem)!important;line-height:.95!important}
}

/* Filtros */
.mg-filter-panel{margin-top:1rem!important;border-radius:1.4rem!important;background:rgba(255,255,255,.94)!important}
@media (min-width:980px){.mg-filter-panel{position:sticky!important;top:5.1rem!important;z-index:20!important}}

/* Remove a barra duplicada de categorias definitivamente */
#tabsList{display:none!important}

/* Grid equilibrado */
.js-products-grid,#mgUnifiedGrid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:.85rem!important;
  align-items:start!important;
}
@media (min-width:700px){.js-products-grid,#mgUnifiedGrid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:1rem!important}}
@media (min-width:1100px){.js-products-grid,#mgUnifiedGrid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:1.15rem!important}}

/* Cards não podem reservar altura falsa nem sumir foto */
.js-product-card,
.mg-product-card{
  content-visibility:visible!important;
  contain:none!important;
  contain-intrinsic-size:auto!important;
  height:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  border-radius:1.35rem!important;
  border:1px solid var(--mg-border)!important;
  background:#fff!important;
  box-shadow:var(--mg-shadow)!important;
  transform:none!important;
}
.js-product-card:hover{box-shadow:var(--mg-shadow-hover)!important;transform:translateY(-2px)!important}

/* Área da foto: sempre aparece, mesmo se a imagem falhar */
.js-product-card .mg-product-image-wrap{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-height:168px!important;
  aspect-ratio:4/5!important;
  flex:0 0 auto!important;
  overflow:hidden!important;
  background:linear-gradient(135deg,#f8fbff,#eaf2ff)!important;
  border-bottom:1px solid rgba(0,87,255,.10)!important;
}
.js-product-card .imagem-produto{
  display:block!important;
  width:100%!important;
  height:100%!important;
  min-height:100%!important;
  object-fit:contain!important;
  padding:8px!important;
  background:transparent!important;
  opacity:1!important;
  visibility:visible!important;
  transform:none!important;
}
.js-product-card:hover .imagem-produto{transform:scale(1.025)!important}

/* Corpo compacto e alinhado */
.js-product-card > .flex.flex-1.flex-col{
  padding:.8rem!important;
  border-top:0!important;
  min-height:0!important;
}
.mg-card-meta-row{display:flex!important;gap:.45rem!important;align-items:center!important;justify-content:space-between!important;margin-bottom:.45rem!important}
.mg-card-category{
  max-width:70%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-size:.62rem!important;
  line-height:1!important;
  padding:.38rem .5rem!important;
}
.mg-card-availability{
  font-size:.58rem!important;
  line-height:1!important;
  padding:.34rem .45rem!important;
  white-space:nowrap!important;
}
.js-product-card h3{
  min-height:2.35rem!important;
  font-size:.92rem!important;
  line-height:1.18rem!important;
  margin:0!important;
}
.js-product-card .mg-price-box{border-radius:1rem!important}
.js-product-card .text-lg.font-black,
.js-product-card .sm\:text-xl{font-size:1.2rem!important;line-height:1.25!important;color:var(--mg-blue)!important}
.js-rating{font-size:.68rem!important}
.js-product-card .mt-3.space-y-3{margin-top:.65rem!important;display:grid!important;gap:.55rem!important}
.js-product-card .mg-size-label,
.js-product-card .mg-color-chip-label{
  min-height:2rem!important;
  padding:.45rem .65rem!important;
  font-size:.68rem!important;
}
.js-product-card .mg-card-actions{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:.5rem!important;
  margin-top:auto!important;
  padding:.75rem!important;
  border-top:1px solid rgba(0,87,255,.08)!important;
}
.js-product-card .mg-card-actions .mg-detail-btn,
.js-product-card .mg-card-actions .mg-primary-btn{
  min-height:2.7rem!important;
  padding:.55rem .5rem!important;
  font-size:.72rem!important;
  border-radius:.95rem!important;
}

/* Mobile: foto visível e card não gigante */
@media (max-width:640px){
  .mg-store{padding-top:4.85rem!important}
  .mg-hero-card,.mg-filter-panel,.js-tab-content{border-radius:1.1rem!important}
  .js-products-grid,#mgUnifiedGrid{gap:.65rem!important}
  .js-product-card{border-radius:1.05rem!important}
  .js-product-card .mg-product-image-wrap{min-height:148px!important;aspect-ratio:1/1.18!important}
  .js-product-card .imagem-produto{padding:6px!important}
  .js-product-card > .flex.flex-1.flex-col{padding:.62rem!important}
  .js-product-card h3{font-size:.78rem!important;line-height:1.05rem!important;min-height:2.05rem!important}
  .mg-card-category{font-size:.52rem!important;max-width:66%!important}
  .mg-card-availability{font-size:.5rem!important}
  .js-rating{font-size:.58rem!important}
  .js-product-card .mg-size-label,.js-product-card .mg-color-chip-label{font-size:.58rem!important;min-height:1.8rem;padding:.35rem .48rem!important}
  .js-product-card .mg-card-actions{padding:.55rem!important;gap:.38rem!important}
  .js-product-card .mg-card-actions .mg-detail-btn,
  .js-product-card .mg-card-actions .mg-primary-btn{font-size:.62rem!important;min-height:2.35rem!important}
}

/* Home: destaques com foto e cards proporcionais */
#produtosCarrossel .produto-card{
  height:auto!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  border-radius:1.35rem!important;
  box-shadow:var(--mg-shadow)!important;
}
#produtosCarrossel .produto-card > .relative:first-child{
  display:flex!important;
  min-height:190px!important;
  aspect-ratio:4/5!important;
  background:linear-gradient(135deg,#f8fbff,#eaf2ff)!important;
  overflow:hidden!important;
}
#produtosCarrossel .produto-img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  object-fit:contain!important;
  padding:8px!important;
  opacity:1!important;
  visibility:visible!important;
}
@media (max-width:640px){
  #produtosCarrossel .produto-card{width:74vw!important}
  #produtosCarrossel .produto-card > .relative:first-child{min-height:210px!important}
}

/* Página produto individual */
.mg-gallery-main{background:linear-gradient(135deg,#f8fbff,#eaf2ff)!important}
.mg-gallery-main img{object-fit:contain!important}
