/* public/assets/modal-gramaje/modal-gramaje.css */
.modal-gramaje {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.modal-gramaje.active { display: block; }

.mg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.mg-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.mg-close {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  font-size: 26px;
  cursor: pointer;
  z-index: 2;
}

.mg-hero { width: 100%; background: #f3f4f6; }
.mg-img { width: 100%; height: 170px; object-fit: cover; display: block; }

.mg-body { padding: 14px 16px 16px; }

.mg-title {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  margin-top: 4px;
}

.mg-price-line {
  text-align: center;
  margin-top: 6px;
  font-size: 16px;
}

.mg-price { color: #f97316; font-weight: 900; }

.mg-muted { color: #6b7280; font-weight: 600; }

.mg-marks {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #6b7280;
  margin-top: 12px;
  margin-bottom: 6px;
}

.mg-range { width: 100%; }

.mg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.mg-label { font-weight: 800; color: #111827; }

.mg-select {
  width: 150px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  font-weight: 800;
}

.mg-box {
  margin-top: 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  background: #f8fafc;
  padding: 10px 12px;
}

.mg-box-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.mg-box-row:last-of-type { border-bottom: none; }

.mg-box-total {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  font-size: 24px;
  font-weight: 900;
}

.mg-sep {
  height: 1px;
  background: rgba(0,0,0,.1);
  margin: 14px 0;
}

.mg-label2 { display: block; margin-bottom: 6px; }

.mg-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.12);
  padding: 10px 12px;
  outline: none;
}
.mg-input:focus { border-color: rgba(249,115,22,.8); box-shadow: 0 0 0 3px rgba(249,115,22,.18); }

.mg-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mg-chip {
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  padding: 8px 12px;
  background: #f3f4f6;
  font-weight: 800;
  cursor: pointer;
}

.mg-add {
  width: 100%;
  margin-top: 14px;
  padding: 14px 12px;
  border: 0;
  border-radius: 14px;
  background: rgb(255, 123, 0);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}
.mg-add:hover { background:#e86d00; transform: translateY(-2px); }
.mg-add:disabled { opacity:.55; cursor:not-allowed; transform:none; }


/* Toggle + notas */
.mg-toggle-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.mg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff7ed; /* suave naranja */
  cursor: pointer;
  user-select: none;
}

.mg-toggle input { display: none; }

.mg-toggle-ui {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  position: relative;
  transition: .2s ease;
  flex: 0 0 auto;
}

.mg-toggle-ui::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  transition: .2s ease;
}

.mg-toggle-text {
  font-weight: 900;
  color: #111827;
}

.mg-toggle input:checked + .mg-toggle-ui {
  background: rgba(249,115,22,.95);
}

.mg-toggle input:checked + .mg-toggle-ui::after {
  transform: translateX(20px);
}

.mg-notes {
  margin-top: 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed rgba(0,0,0,.14);
  padding: 10px 12px;
}

.mg-note {
  font-weight: 800;
  color: #334155;
  font-size: 13px;
  padding: 4px 0;
}

.mg-hide { display: none !important; }

/* Toggle + notas */
.mg-toggle-row {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.mg-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff7ed;
  cursor: pointer;
  user-select: none;
}

.mg-toggle input { display: none; }

.mg-toggle-ui {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0,0,0,.14);
  position: relative;
  transition: .2s ease;
  flex: 0 0 auto;
}

.mg-toggle-ui::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  transition: .2s ease;
}

.mg-toggle-text {
  font-weight: 900;
  color: #111827;
}

.mg-toggle input:checked + .mg-toggle-ui {
  background: rgba(249,115,22,.95);
}

.mg-toggle input:checked + .mg-toggle-ui::after {
  transform: translateX(20px);
}

.mg-notes {
  margin-top: 10px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed rgba(0,0,0,.14);
  padding: 10px 12px;
}

.mg-note {
  font-weight: 800;
  color: #334155;
  font-size: 13px;
  padding: 4px 0;
}

.mg-marks{
  position: relative;
  height: 18px;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.mg-marks span{
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.mg-marks span:first-child { transform: translateX(0); }
.mg-marks span:last-child  { transform: translateX(-100%); }


/* =========================
   FIX: altura máxima + scroll interno
   ========================= */

/* el overlay centra, pero sin forzar que crezca */
.mg-content{
  /* tu width/max-width ya están bien */
  max-height: 95vh;
  max-height: 95dvh;           /* mejor en móviles modernos */
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* importante: el scroll lo hará el body */
}

/* el hero NO debe crecer, solo ocupa su alto */
.mg-hero{
  flex: 0 0 auto;
}

/* el body es el que hace scroll si se excede */
.mg-body{
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS smooth */
  padding-bottom: 18px;              /* colchón para que no “pegue” abajo */
}

/* opcional: evita que el botón quede muy arriba/abajo en scroll */
.mg-add{
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 14px;

  /* para que el sticky se vea bien al scrollear */
  background: rgb(255, 123, 0);
  box-shadow: 0 -10px 25px rgba(0,0,0,.08);
}

/* un poquito de padding abajo para que el sticky no tape contenido */
.mg-chips{
  padding-bottom: 6px;
}

/* (recomendado) cuando el modal esté activo, bloquea el scroll del body */
body.mg-modal-open{
  overflow: hidden;
}
