/* Vula 0.3.66 — mobile product editor hardening */
@media (max-width:700px){
  /* Never allow a product editor to create horizontal page overflow. */
  .product-library-card,
  .product-library-card .product-library-grid,
  .product-library-card .product-library-row,
  .product-library-card .product-config,
  .product-library-card .product-config-grid,
  .product-library-card .product-config-section,
  .product-library-card .product-meta-form,
  .product-library-card .product-meta-grid,
  .product-library-card .product-meta-secondary{
    width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }
  .product-library-card .product-library-row{overflow:hidden!important}
  .product-library-card .product-config-grid{display:block!important;padding:12px!important;margin:0!important}
  .product-library-card .product-config-section{display:block!important;margin:0 0 12px!important;padding:14px!important}
  .product-library-card .product-config-section:last-child{margin-bottom:0!important}

  /* Product details = genuinely single column. */
  .product-library-card .product-meta-form{display:block!important;margin:10px 0 0!important}
  .product-library-card .product-meta-grid,
  .product-library-card .product-meta-secondary{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto!important;gap:12px!important;
  }
  .product-library-card .product-meta-grid>* ,
  .product-library-card .product-meta-secondary>*{
    grid-column:1!important;grid-row:auto!important;min-width:0!important;width:100%!important;max-width:100%!important;
  }
  .product-library-card .menu-config-field{display:block!important;width:100%!important;min-width:0!important}
  .product-library-card .menu-config-field>span,
  .product-library-card .menu-config-label{display:block!important;margin-bottom:7px!important}
  .product-library-card .product-meta-form input,
  .product-library-card .product-meta-form textarea,
  .product-library-card .menu-config-field input,
  .product-library-card .menu-config-field textarea{
    display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;font-size:16px!important;
  }
  .product-library-card .product-meta-form textarea{min-height:110px!important;resize:vertical!important}

  /* Dietary/certification controls wrap inside their own section. */
  .product-library-card .product-dietary-field{width:100%!important;min-width:0!important;overflow:hidden!important}
  .product-library-card .product-dietary-field .menu-allergen-grid,
  .product-library-card .menu-allergen-grid.compact{
    display:flex!important;flex-wrap:wrap!important;align-items:flex-start!important;gap:8px!important;width:100%!important;max-width:100%!important;overflow:visible!important;
  }
  .product-library-card .product-dietary-field .menu-allergen-grid label,
  .product-library-card .menu-allergen-grid.compact label{
    display:inline-flex!important;flex:0 1 auto!important;width:auto!important;max-width:100%!important;min-width:0!important;white-space:normal!important;line-height:1.2!important;
  }

  /* Save/Delete are normal flow actions at the bottom of Product details. */
  .product-library-card .product-save-row{
    position:static!important;inset:auto!important;float:none!important;clear:both!important;
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto!important;gap:8px!important;
    width:100%!important;max-width:100%!important;height:auto!important;min-height:0!important;margin:14px 0 0!important;padding:0!important;
    align-items:stretch!important;justify-items:stretch!important;justify-content:stretch!important;
  }
  .product-library-card .product-save-row>.product-save-button,
  .product-library-card .product-save-row>form,
  .product-library-card .product-save-row>form .vula-btn{
    position:static!important;inset:auto!important;transform:none!important;float:none!important;
    grid-column:1!important;grid-row:auto!important;display:flex!important;width:100%!important;max-width:none!important;min-width:0!important;
    height:46px!important;min-height:46px!important;margin:0!important;align-items:center!important;justify-content:center!important;
  }
  .product-library-card .product-save-row>form{height:auto!important;min-height:0!important}

  /* Quantity pricing is vertical and never clips its price field. */
  .product-library-card .tier-add-form{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important;max-width:100%!important;
  }
  .product-library-card .tier-add-form input,
  .product-library-card .tier-add-form .vula-btn{
    grid-column:1!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;
  }

  /* Modifier groups wrap within the card rather than widening it. */
  .product-library-card .modifier-toggle-list{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;width:100%!important}
  .product-library-card .modifier-toggle-list>form{width:100%!important;min-width:0!important;margin:0!important}
  .product-library-card .modifier-toggle-list .addon-toggle{width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;white-space:normal!important}
  .product-library-card .modifier-toggle-list .addon-toggle span{min-width:0!important;white-space:normal!important;overflow-wrap:anywhere!important}

  /* Configure button is a normal-width control, never a desktop-sized block. */
  .product-library-card .product-col-actions{padding-left:60px!important;width:auto!important}
  .product-library-card .product-col-actions .product-config-toggle{width:auto!important;max-width:100%!important;min-width:0!important}
}

@media (max-width:390px){
  .product-library-card .product-config-grid{padding:9px!important}
  .product-library-card .product-config-section{padding:12px!important}
}
