/* ============================================================
   presupuesto_ui.css — Ventana «Tu presupuesto», enlace «Mi presupuesto» del menú,
   barra «Tu presupuesto» y popup de categorías.
   Se carga desde includes/footer.php en todas las páginas.
   Colores: solo tokens de :root (style.css).
   ============================================================ */

/* ── Barra «Tu presupuesto» (abajo a la izquierda; a la derecha está el WhatsApp) ── */
.presu-barra {
  position: fixed; left: 16px; bottom: 20px; z-index: 900;
  border: none; cursor: pointer; text-align: left;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 10px 18px;
  background: var(--brown); color: #fff;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, .45);
  font-family: var(--font-display); font-size: 15px; text-decoration: none;
  max-width: calc(100vw - 100px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.presu-barra:hover { background: var(--brown-dark); transform: translateY(-1px); }
.presu-barra:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.presu-barra__txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presu-barra__ver { font-weight: 700; color: var(--orange); white-space: nowrap; }

/* ── Popup de categorías ── */
.presu-pop {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .5);
}
.presu-pop[hidden] { display: none; }
.presu-pop__caja {
  position: relative; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--bg); color: var(--ink);
  border-radius: 20px; padding: 28px 24px 22px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}
.presu-pop__cerrar {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .06); color: var(--ink);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.presu-pop__cerrar:hover { background: rgba(0, 0, 0, .12); }
.presu-pop__ok {
  margin: 0 48px 14px 0; padding: 10px 14px; border-radius: 10px;
  background: rgba(234, 106, 30, .1); color: var(--brown);
  font-size: 15px; font-weight: 600; line-height: 1.4;
}
.presu-pop__tit {
  font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  margin: 0 48px 16px 0;
}
.presu-pop__lleno { font-size: 15px; color: var(--brown); margin: 0 0 16px; }
.presu-pop__grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.presu-pop__grid[hidden] { display: none; }
@media (min-width: 560px) { .presu-pop__grid { grid-template-columns: repeat(3, 1fr); } }
.presu-pop__cat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px; border-radius: 14px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); text-decoration: none;
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.presu-pop__cat:hover, .presu-pop__cat:focus-visible { border-color: var(--orange); transform: translateY(-2px); outline: none; }
.presu-pop__foto {
  display: block; aspect-ratio: 4 / 3; border-radius: 10px; margin-bottom: 8px;
  background: var(--bg) center top / cover no-repeat;
}
.presu-pop__nombre { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.presu-pop__n { font-size: 12px; color: var(--muted); }
.presu-pop__pie {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px;
}
.presu-pop__ver {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px;
  border-radius: var(--radius-pill); background: var(--brown); color: #fff;
  font-weight: 600; text-decoration: none;
}
.presu-pop__ver:hover { background: var(--brown-dark); }
.presu-pop__ver[hidden] { display: none; }
.presu-pop__seguir {
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  font-size: 15px; cursor: pointer;
}
.presu-pop__seguir:hover { border-color: var(--brown); }

/* ── «Mi presupuesto (N)» en el menú (solo si hay prendas guardadas) ── */
.nav-presu[hidden] { display: none !important; }
.nav-links .nav-presu { display: inline-flex; align-items: center; gap: 6px; opacity: 1; font-weight: 600; }
.nav-presu__n {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brown); color: #fff; font-size: 12px; font-weight: 700; text-shadow: none;
}
.mobile-menu .nav-presu { display: inline-flex; align-items: center; gap: 10px; }
.mobile-menu .nav-presu__n { min-width: 30px; height: 30px; font-size: 16px; }

/* ── Ventana «Tu presupuesto» ── */
.pm {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .5);
}
.pm[hidden] { display: none; }
@media (min-width: 680px) { .pm { align-items: center; padding: 16px; } }
.pm__caja {
  width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); color: var(--ink);
  border-radius: 20px 20px 0 0; padding: 0 18px 28px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5);
}
@media (min-width: 680px) { .pm__caja { border-radius: 20px; padding: 0 26px 26px; max-height: calc(100vh - 32px); } }
.pm__cab {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 12px; margin-bottom: 8px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.pm__tit { font-family: var(--font-display); font-size: 22px; font-weight: 900; letter-spacing: -.02em; margin: 0; }
.pm__cerrar {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex-shrink: 0;
  background: rgba(0, 0, 0, .06); color: var(--ink); font-size: 24px; line-height: 1; cursor: pointer;
}
.pm__cerrar:hover { background: rgba(0, 0, 0, .12); }
.pm__btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px;
  border-radius: var(--radius-pill); border: none; background: var(--brown); color: #fff;
  font-family: var(--font-display); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.pm__btn:hover { background: var(--brown-dark); }
.pm__vacio { padding: 20px 0 8px; }
.pm__vacio p { font-size: 16px; color: var(--muted); margin: 0 0 16px; }
.pm__ok { text-align: center; padding: 28px 0 8px; }
.pm__ok[hidden] { display: none; }
.pm__ok-icono { font-size: 48px; margin-bottom: 10px; }
.pm__ok h3 { font-family: var(--font-display); font-size: 24px; font-weight: 900; margin: 0 0 8px; }
.pm__ok p { font-size: 15px; color: var(--muted); line-height: 1.6; margin: 0 0 18px; }

/* Lista de prendas */
.pm-lista { list-style: none; margin: 8px 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pm-item {
  display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px;
}
.pm-item__foto { grid-row: span 2; width: 64px; height: 76px; border-radius: 10px; overflow: hidden; background: var(--bg); }
.pm-item__foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-item__nombre { font-family: var(--font-display); font-size: 16px; font-weight: 800; margin: 0 0 3px; }
.pm-item__num { color: var(--orange); }
.pm-item__meta { font-size: 13px; margin: 0 0 2px; line-height: 1.4; }
.pm-item__sin { color: var(--orange); font-weight: 600; }
.pm-item__imps { margin: 3px 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.pm-item__diseno { margin: 3px 0 0; font-size: 12px; font-weight: 700; color: var(--brown); }
.pm-item__diseno[hidden] { display: none; }
.pm-item__precio { grid-column: 2; font-family: var(--font-display); font-size: 17px; font-weight: 800; }
.pm-item__precio small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.pm-item__acc { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.pm-link {
  min-height: 44px; min-width: 44px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: var(--radius-pill); border: 1.5px solid var(--line); background: transparent;
  color: var(--brown); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; font-family: inherit;
}
.pm-link:hover { border-color: var(--brown); }
.pm-link--quitar { color: #B42318; }
.pm-link--quitar:hover { border-color: #B42318; }
@media (min-width: 680px) {
  .pm-item { grid-template-columns: 72px 1fr auto; }
  .pm-item__foto { width: 72px; height: 86px; }
  .pm-item__precio { grid-column: 3; grid-row: 1; text-align: right; white-space: nowrap; }
  .pm-item__acc { grid-column: 2 / -1; border-top: none; padding-top: 0; margin-top: 0; }
}

/* Añadir otra prenda */
.pm-anadir {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px 16px; margin: 0 0 16px; border-radius: 14px;
  border: 2px dashed var(--orange); background: rgba(234, 106, 30, .06);
  color: var(--ink); cursor: pointer; font-family: inherit;
  transition: background .2s var(--ease);
}
.pm-anadir:hover, .pm-anadir:focus-visible { background: rgba(234, 106, 30, .14); outline: none; }
.pm-anadir[hidden] { display: none; }
.pm-anadir__mas {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: #fff; font-size: 24px; font-weight: 700; line-height: 1;
}
.pm-anadir strong { display: block; font-family: var(--font-display); font-size: 16px; }
.pm-anadir small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Total */
.pm-total { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; }
.pm-total__fila { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.pm-total__fila--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-family: var(--font-display); font-size: 19px; font-weight: 900; }
.pm-total__nota { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }

/* Formulario */
.pm-form { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.pm-form__tit { font-family: var(--font-display); font-size: 18px; font-weight: 800; margin: 0 0 12px; }
.pm-fila { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .pm-fila { grid-template-columns: 1fr 1fr; } }
.pm-campo { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.pm-campo label { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.pm-input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 16px; font-family: inherit;
}
.pm-input:focus { outline: none; border-color: var(--brown); }
.pm-input.error { border-color: #B42318; box-shadow: 0 0 0 3px rgba(180, 35, 24, .12); }
.pm-textarea { min-height: 80px; resize: vertical; }
.pm-error { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: #B42318; }
.pm-error[hidden] { display: none; }
.pm-drop {
  border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.pm-drop:hover, .pm-drop.drag, .pm-drop:focus-visible { border-color: var(--orange); background: rgba(234, 106, 30, .05); outline: none; }
.pm-drop p { font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.pm-drop strong { color: var(--brown); }
.pm-drop small { font-size: 11px; color: var(--muted); }
.pm-archivo { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.pm-archivo button { min-width: 32px; min-height: 32px; border: none; background: none; cursor: pointer; color: var(--muted); font-size: 18px; }
.pm-rgpd { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; margin: 4px 0 4px; cursor: pointer; }
.pm-rgpd input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brown); flex-shrink: 0; }
.pm-rgpd a { color: var(--brown); }
.pm-enviar {
  width: 100%; min-height: 54px; margin-top: 12px; border: none; border-radius: var(--radius-pill);
  background: var(--brown); color: #fff; font-family: var(--font-display); font-size: 16px; font-weight: 800; cursor: pointer;
  transition: background .2s var(--ease);
}
.pm-enviar:hover { background: var(--brown-dark); }
.pm-enviar:disabled { opacity: .55; cursor: not-allowed; }
.pm-nota { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; margin: 10px 0 0; }
