/* Portal de clientes DocoKraft · pensado primero para el celular */
:root {
  --verde: #1d4a25; --verde-2: #235b2d; --crema: #efcfa2; --kraft: #f6e8d2; --fondo: #fbf6ee;
  --texto: #1f2a20; --suave: #5f6b5f; --borde: #e2d3bb; --ok: #2f7d32; --alerta: #b45309; --error: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--texto);
  background: var(--fondo); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: "Bricolage Grotesque", "Manrope", sans-serif; color: var(--verde); letter-spacing: -.01em; margin: 0 0 6px; }
h1 { font-size: 1.7rem; line-height: 1.15; }
h2 { font-size: 1.15rem; margin-top: 18px; }
h3 { font-size: 1rem; }
a { color: var(--verde-2); }
img { max-width: 100%; height: auto; }
.pt-suave { color: var(--suave); }
.pt-centro { text-align: center; }
.pt-chico-texto { font-size: .82rem; }

/* Barra superior y navegación */
.pt-barra { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  padding-top: max(10px, env(safe-area-inset-top)); background: var(--verde); color: var(--crema); }
.pt-marca { display: flex; align-items: center; gap: 8px; color: var(--crema); text-decoration: none; font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.1rem; }
.pt-marca img { border-radius: 50%; background: #fff; }
.pt-nav { display: flex; gap: 4px; margin-left: 12px; }
.pt-nav a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--kraft); text-decoration: none; font-weight: 600; font-size: .92rem; }
.pt-nav a:hover { background: rgba(255,255,255,.08); }
.pt-nav a.activa { background: var(--crema); color: var(--verde); }
.pt-ico { font-size: 1rem; }
.pt-salir { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.pt-quien { font-size: .85rem; color: var(--crema); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-boton-texto { background: none; border: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px; }
.pt-barra .pt-boton-texto { color: var(--crema); }

.pt-contenido { width: 100%; max-width: 980px; margin: 0 auto; padding: 22px 20px 40px; flex: 1; }
.pt-pie { text-align: center; padding: 18px 16px 24px; font-size: .88rem; color: var(--suave); }
.pt-pie a { color: var(--verde-2); font-weight: 600; }

/* Botones, tarjetas y formularios */
.pt-boton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: 12px;
  border: 0; background: var(--verde-2); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.pt-boton:hover { background: var(--verde); }
.pt-secundario { background: #fff; color: var(--verde-2); border: 1.5px solid var(--verde-2); }
.pt-secundario:hover { background: var(--kraft); }
.pt-chico { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.pt-ancho { width: 100%; }
.pt-grande { min-height: 54px; font-size: 1.08rem; }
.pt-tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 16px; padding: 18px; margin-bottom: 14px; }
.pt-tarjeta h2 { margin-top: 0; }
.pt-form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.pt-form input:not([type=radio]):not([type=checkbox]), .pt-form select, .pt-form textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; }
.pt-form input:focus-visible, .pt-form select:focus-visible, .pt-form textarea:focus-visible { outline: 2px solid var(--verde-2); outline-offset: 1px; }
.pt-form .pt-boton { margin-top: 16px; }
.pt-opcion { display: flex !important; align-items: center; gap: 10px; font-weight: 600; padding: 10px 0; margin: 0 !important; cursor: pointer; }
.pt-opcion input { width: 20px; height: 20px; accent-color: var(--verde-2); }
.pt-error { color: var(--error); font-weight: 600; margin: 4px 0; }
.pt-error-texto { color: var(--error) !important; font-weight: 600; }
.pt-errores { border-color: #f3c3bf; background: #fff7f6; }
.pt-mensajes { list-style: none; padding: 0; margin: 0 0 16px; }
.pt-mensaje { padding: 12px 14px; border-radius: 12px; background: var(--kraft); margin-bottom: 8px; font-weight: 600; }
.pt-mensaje.success { background: #e8f5e9; color: var(--ok); }
.pt-mensaje.error { background: #fde8e7; color: var(--error); }

/* Entrar */
.sin-sesion .pt-contenido { max-width: 440px; }
.pt-acceso { padding-top: 6vh; }
.pt-acceso h1 { text-align: center; }
.pt-acceso > .pt-suave { text-align: center; }
.pt-acceso-logo { display: block; margin: 0 auto 14px; border-radius: 50%; }

/* Cabecera de página */
.pt-cabecera { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.pt-cabecera p { margin: 0; }

/* Pedidos */
.pt-lista { display: grid; gap: 14px; }
.pt-pedido { background: #fff; border: 1px solid var(--borde); border-radius: 16px; transition: border-color .15s, box-shadow .15s; }
.pt-pedido:hover { border-color: var(--verde-2); box-shadow: 0 4px 16px rgba(29,74,37,.08); }
.pt-pedido-enlace { display: block; padding: 16px; color: inherit; text-decoration: none; }
.pt-pedido-cab { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pt-pedido-quien { display: flex; flex-direction: column; line-height: 1.25; }
.pt-pedido-quien strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.15rem; color: var(--verde); }
.pt-total { margin-left: auto; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.pt-arte { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--borde); border-radius: 10px; background: #fff; flex: none; }
.pt-arte-grande { display: block; max-width: 200px; max-height: 200px; object-fit: contain; border: 1px solid var(--borde); border-radius: 12px; margin-bottom: 10px; }
.pt-linea { color: var(--suave); font-size: .92rem; }
.pt-explicacion { margin: 10px 0 0; }
.pt-explicacion.pt-grande { font-size: 1.05rem; font-weight: 600; }
.pt-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pt-etiqueta { background: var(--kraft); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.pt-debe { background: #fff4e5; color: var(--alerta); }
.pt-cancelado { opacity: .7; }
.pt-con-accion { display: grid; gap: 8px; justify-items: start; }

/* Línea de tiempo del estado */
.pt-pasos { list-style: none; display: flex; gap: 0; padding: 0; margin: 14px 0 4px; counter-reset: paso; }
.pt-pasos li { flex: 1; position: relative; text-align: center; font-size: .7rem; color: var(--suave); padding-top: 22px; min-width: 0; }
.pt-pasos li span { display: block; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.pt-pasos li::before { content: ""; position: absolute; top: 4px; left: 50%; transform: translateX(-50%); width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--borde); z-index: 1; }
.pt-pasos li::after { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--borde); }
.pt-pasos li:first-child::after { display: none; }
.pt-pasos li.hecho::before { background: var(--verde-2); border-color: var(--verde-2); }
.pt-pasos li.hecho::after, .pt-pasos li.actual::after { background: var(--verde-2); }
.pt-pasos li.actual::before { background: var(--crema); border-color: var(--verde-2); box-shadow: 0 0 0 4px rgba(35,91,45,.15); }
.pt-pasos li.actual { color: var(--verde); font-weight: 700; }
.pt-pasos-grandes li { font-size: .82rem; }

/* Tablas */
.pt-tabla { width: 100%; border-collapse: collapse; }
.pt-tabla td { padding: 8px 0; border-bottom: 1px solid var(--kraft); vertical-align: top; }
.pt-num { text-align: right; white-space: nowrap; padding-left: 10px; }
.pt-fila-total td { font-weight: 700; }
.pt-guia { font-family: ui-monospace, Menlo, monospace; letter-spacing: .02em; }

/* Repetir y envíos */
.pt-repetir-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pt-repetir-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0; }
.pt-envios { display: grid; gap: 12px; }
.pt-envio { display: grid; gap: 4px; color: inherit; text-decoration: none; margin: 0; }
.pt-envio:hover { border-color: var(--verde-2); }
.pt-envio-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-envio-cab strong { font-family: "Bricolage Grotesque", sans-serif; color: var(--verde); font-size: 1.1rem; }
.pt-estado { background: var(--kraft); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; color: var(--verde); }
.pt-estado-disponible { background: #e8f5e9; color: var(--ok); }
.pt-vacio { text-align: center; }

/* Catálogo */
.pt-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.pt-producto { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; }
.pt-foto { aspect-ratio: 1 / 1; background: var(--kraft); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.pt-foto img { width: 100%; height: 100%; object-fit: cover; }
.pt-producto-cuerpo { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.pt-producto-cuerpo p { margin: 0; }
.pt-producto-cuerpo .pt-boton { margin-top: auto; }
.pt-precio { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--verde); margin: 6px 0 2px !important; }
.pt-precio small { font-family: "Manrope", sans-serif; font-size: .8rem; font-weight: 500; color: var(--suave); }
.pt-producto-cuerpo .pt-chico-texto { margin-bottom: 10px; }

/* Nuevo pedido */
.pt-lineas { display: grid; gap: 10px; }
.pt-linea-form { display: grid; grid-template-columns: minmax(0, 1fr) 130px 120px; gap: 8px; align-items: center; }
.pt-linea-precio { font-weight: 700; text-align: right; font-size: .9rem; }
.pt-total-pedido { margin: 14px 0 0; font-size: 1.05rem; }
.pt-total-pedido strong { font-family: "Bricolage Grotesque", sans-serif; font-size: 1.35rem; color: var(--verde); }
#sucursal-caja { margin: 0 0 6px 30px; }

/* Celular: navegación abajo, como una app */
@media (max-width: 760px) {
  .pt-barra { padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .pt-nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 20; justify-content: space-around; gap: 0;
    background: #fff; border-top: 1px solid var(--borde); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .pt-nav a { flex-direction: column; gap: 0; padding: 4px 6px; font-size: .7rem; color: var(--suave); border-radius: 10px; min-width: 60px; }
  .pt-nav a.activa { background: var(--kraft); color: var(--verde); }
  .pt-ico { font-size: 1.25rem; }
  .pt-quien { display: none; }
  .con-sesion .pt-pie { padding-bottom: 90px; }
  .pt-contenido { padding: 16px 16px 30px; }
  h1 { font-size: 1.45rem; }
  .pt-cabecera .pt-boton { width: 100%; }
  .pt-linea-form { grid-template-columns: 1fr 110px; }
  .pt-linea-form select { grid-column: 1 / -1; }
  .pt-catalogo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pt-producto-cuerpo { padding: 10px; }
  .pt-precio { font-size: 1.15rem; }
  .pt-pasos li span { font-size: .62rem; }
}

/* Pagar */
.pt-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-pagar { border-color: var(--verde-2); box-shadow: 0 0 0 1px var(--verde-2) inset; }
.pt-aviso { background: #fff4e5; color: var(--alerta); border-radius: 10px; padding: 8px 12px; font-weight: 600; }
.pt-metodos { display: grid; gap: 10px; margin: 12px 0; }
.pt-metodo { border: 1px solid var(--borde); border-radius: 12px; padding: 10px 14px; background: #fbfaf7; }
.pt-metodo summary { cursor: pointer; font-weight: 700; color: var(--verde); padding: 4px 0; }
.pt-metodo[open] summary { margin-bottom: 8px; }
.pt-cuenta { padding: 8px 0; border-bottom: 1px dashed var(--borde); }
.pt-dato { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; }
.pt-dato > span:first-child { min-width: 100px; color: var(--suave); font-size: .88rem; }
.pt-dato .pt-boton-texto { color: var(--verde-2); font-size: .85rem; }
.pt-qr { display: block; width: 220px; height: 220px; object-fit: contain; background: #fff; border: 1px solid var(--borde); border-radius: 12px; margin: 4px auto 10px; }
.pt-subir { border-top: 1px solid var(--kraft); margin-top: 6px; padding-top: 8px; }
.pt-subir h3 { margin-top: 6px; }
.pt-comprobantes { list-style: none; padding: 0; margin: 0; }
.pt-comprobantes li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--kraft); }
.pt-cp-aceptado { background: #e8f5e9; color: var(--ok); }
.pt-cp-rechazado { background: #fde8e7; color: var(--error); }

/* Que ningún texto o enlace largo se salga de la pantalla */
.pt-tarjeta, .pt-metodo, .pt-dato, .pt-cuenta { min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.pt-texto-libre { white-space: pre-line; }
.pt-texto-libre a { word-break: break-all; }
.pt-metodos { min-width: 0; }

/* Aviso al cliente: enlace de pago listo */
.pt-aviso-pago { display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #2f7d32; color: #fff;
  text-decoration: none; font-weight: 600; animation: pt-aviso-entra .5s ease-out; }
.pt-aviso-pago:hover { background: #256628; color: #fff; }
.pt-aviso-pago span:nth-child(2) { flex: 1; min-width: 0; }
.pt-aviso-ir { white-space: nowrap; background: rgba(255,255,255,.2); padding: 4px 12px; border-radius: 999px; }
@keyframes pt-aviso-entra { from { transform: translateY(-100%); opacity: 0; } }
@media (max-width: 760px) { .pt-aviso-pago { padding: 10px 14px; font-size: .9rem; } }
