/* ============================================================
   ESTILOS DE AUTENTICACIÓN — login / registro / cuenta
   Usa las variables de color de la app (css/style.css).
   ============================================================ */

/* ── Botón "Ingresar" en el header ── */
.login-btn {
  display: flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--rose); color: var(--rose-dark);
  background: var(--white); border-radius: 50px;
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  font-family: var(--font-body); cursor: pointer;
  transition: background .15s, color .15s;
}
.login-btn:hover { background: var(--rose-light); }
.login-btn svg { display: block; }

/* ── Pastilla de usuario (logueado) ── */
.user-menu-wrap { position: relative; }
.user-pill {
  display: flex; align-items: center; gap: 7px;
  background: var(--rose-light); color: var(--rose-dark);
  border: none; border-radius: 50px; padding: 5px 12px 5px 6px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: var(--font-body);
}
.user-pill .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--rose); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px;
}
.user-pill .user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill .caret { font-size: 10px; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--sand);
  border-radius: 12px; overflow: hidden; min-width: 210px;
  box-shadow: var(--shadow-hover); z-index: 1200;
  display: none;
}
.user-menu.open { display: block; }
.user-menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 15px; font-size: 13.5px; color: var(--charcoal);
  text-decoration: none; border-bottom: 1px solid var(--sand);
  font-weight: 600; cursor: pointer;
}
.user-menu a:last-child { border-bottom: none; }
.user-menu a:hover { background: var(--cream); }
.user-menu a.soon { color: var(--nude); cursor: default; }
.user-menu a.soon small { font-weight: 400; }
.user-menu a.logout { color: var(--rose-dark); }

/* ── Overlay del modal ── */
.auth-overlay {
  position: fixed; inset: 0; background: rgba(44,40,36,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 2000; padding: 40px 14px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.auth-overlay.open { display: flex; }
.auth-card {
  background: var(--cream); border-radius: 22px;
  box-shadow: 0 10px 44px rgba(44,40,36,.28);
  width: 100%; max-width: 420px; overflow: hidden;
  border: 1px solid var(--sand); position: relative;
  animation: authIn .22s ease;
}
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--text-muted); cursor: pointer; z-index: 2;
}
.auth-body { padding: 30px 24px 26px; }
.auth-title { font-family: var(--font-script); font-size: 27px; text-align: center; margin: 0 0 2px; color: var(--charcoal); }
.auth-sub { text-align: center; color: var(--text-muted); font-size: 12.5px; margin: 0 0 20px; }

/* ── Campos ── */
.auth-field { margin-bottom: 12px; }
.auth-field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-field label {
  display: block; font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px;
}
.auth-field label .opt { color: var(--nude); font-weight: 400; text-transform: none; letter-spacing: 0; }
.auth-field input, .auth-field select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--sand);
  border-radius: var(--radius-sm); font-size: 14px; background: var(--white);
  color: var(--charcoal); font-family: var(--font-body);
}
.auth-field input:focus, .auth-field select:focus { outline: none; border-color: var(--rose); }
.auth-field input::placeholder { color: var(--nude); }
.auth-field input:disabled { background: var(--sand); color: var(--text-muted); cursor: not-allowed; }

/* ── Botones ── */
.btn-auth {
  width: 100%; background: var(--charcoal); color: #fff; border: none;
  border-radius: 50px; padding: 13px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; font-size: 13px; cursor: pointer; margin-top: 6px;
  font-family: var(--font-body);
}
.btn-auth:disabled { background: var(--sand-dark); cursor: default; }
.btn-auth-link {
  display: block; text-align: center; color: var(--rose-dark);
  font-size: 12.5px; margin-top: 16px; font-weight: 700;
  text-decoration: none; cursor: pointer; background: none; border: none; width: 100%;
}
.btn-auth-link.danger { color: #b5483a; margin-top: 14px; font-size: 12px; }

/* Botón secundario (Cambiar contraseña) — estilo outline */
.btn-auth-outline {
  width: 100%; background: var(--white); color: var(--rose-dark);
  border: 1.5px solid var(--rose); border-radius: 50px; padding: 12px;
  font-weight: 700; font-size: 12.5px; cursor: pointer;
  font-family: var(--font-body); margin-top: 9px;
}
.btn-auth-outline:hover { background: var(--rose-light); }

/* Línea divisoria fina en el modal */
.auth-divider-line { height: 1px; background: var(--sand); margin: 18px 0 0; }

/* Nota aclaratoria debajo de "Eliminar mi cuenta" */
.auth-danger-note { text-align: center; font-size: 11px; color: var(--nude); margin: 5px 0 0; }

/* ── CAPTCHA (Turnstile) ── */
.cf-box { display: flex; justify-content: center; margin: 12px 0 4px; min-height: 0; }
.cf-box:empty { margin: 0; }

/* ── Checkbox de términos ── */
.auth-accept {
  display: flex; align-items: flex-start; gap: 10px; background: var(--white);
  border: 1.5px solid var(--sand); border-radius: var(--radius-sm);
  padding: 11px 12px; margin: 13px 0 4px; cursor: pointer;
}
.auth-accept input { width: 18px; height: 18px; min-width: 18px; margin-top: 1px; accent-color: var(--rose); }
.auth-accept label { font-size: 12px; color: #5a4a3a; line-height: 1.45; cursor: pointer; }
.auth-accept a { color: var(--rose-dark); font-weight: 700; text-decoration: underline; }

/* ── Vista verificar email ── */
.verify-box { text-align: center; padding: 6px 4px; }
.verify-ico { font-size: 44px; margin-bottom: 6px; }
.verify-box p { font-size: 13.5px; color: #5a4a3a; line-height: 1.55; }
.verify-box .email-dest { font-weight: 700; color: var(--charcoal); }

/* ── Vista mis datos ── */
.dato-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--sand); font-size: 13.5px; }
.dato-row:last-child { border-bottom: none; }
.dato-k { color: var(--text-muted); font-weight: 700; }
.dato-v { color: var(--charcoal); text-align: right; }

/* ── Toast ── */
.auth-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-160%);
  background: var(--charcoal); color: #fff; padding: 12px 20px; border-radius: 50px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-hover);
  z-index: 3000; max-width: 90vw; text-align: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform .28s ease, opacity .28s ease, visibility .28s;
}
.auth-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.auth-toast.err { background: #b5483a; }
.auth-toast.ok { background: #3f7a44; }

/* ── Botón "Guardar borrador" en el carrito ── */
.btn-guardar-borrador {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--white); color: var(--rose-dark); border: 1.5px solid var(--rose);
  border-radius: 50px; padding: 12px; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .5px; cursor: pointer;
  font-family: var(--font-body); margin-top: 8px;
}
.btn-guardar-borrador:hover { background: var(--rose-light); }
.btn-guardar-borrador svg { display: block; }

/* "Guardar borrador" en la vista de pedido completo (footer) */
.btn-vista-borrador {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--white); color: var(--rose-dark); border: 1.5px solid var(--rose);
  border-radius: 50px; padding: 12px 22px; font-weight: 700; font-size: 13px;
  cursor: pointer; font-family: var(--font-body);
}
.btn-vista-borrador:hover { background: var(--rose-light); }
.btn-vista-borrador svg { display: block; }

/* ── Overlay de borradores / mis pedidos ── */
.borradores-overlay, .pedidos-overlay {
  position: fixed; inset: 0; background: rgba(44,40,36,.45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 2000; padding: 40px 14px; overflow-y: auto; backdrop-filter: blur(2px);
}
.borradores-overlay.open, .pedidos-overlay.open { display: flex; }
.borradores-modal, .pedidos-modal {
  background: var(--cream); border-radius: 22px; width: 100%; max-width: 440px;
  box-shadow: 0 10px 44px rgba(44,40,36,.28); border: 1px solid var(--sand);
  overflow: hidden; animation: authIn .22s ease;
}
.bd-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--sand); background: var(--white);
}
.bd-header h2 { margin: 0; font-size: 18px; color: var(--charcoal); }
.borradores-lista, .pedidos-lista { padding: 18px 18px 22px; }
.bd-empty { text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.6; padding: 26px 10px; }

/* ── Tarjeta de borrador ── */
.bd-card { background: var(--white); border: 1px solid var(--sand); border-radius: var(--radius); padding: 13px 15px; margin-bottom: 11px; }
.bd-top { display: flex; justify-content: space-between; align-items: flex-start; }
.bd-date { font-size: 11px; color: var(--text-muted); }
.bd-title { font-size: 14px; font-weight: 700; color: var(--charcoal); margin-top: 2px; }
.bd-badge { font-size: 10px; font-weight: 700; padding: 3px 9px; border-radius: 50px; text-transform: uppercase; letter-spacing: .5px; background: #fdeede; color: #b07a2a; }
.bd-badge.env { background: #e7f0e3; color: #3f7a34; }   /* Enviado (verde) */
.bd-info { font-size: 12px; color: var(--text-muted); margin: 8px 0 11px; }
.bd-info b { color: var(--charcoal); }
.bd-actions { display: flex; gap: 8px; }
.bd-btn { flex: 1; font-size: 11px; font-weight: 700; padding: 9px; border-radius: 50px; border: none; cursor: pointer; text-transform: uppercase; letter-spacing: .4px; font-family: var(--font-body); }
.bd-btn.ghost { background: var(--white); border: 1.5px solid var(--sand-dark); color: var(--charcoal); }
.bd-btn.dark { background: var(--charcoal); color: #fff; }
.bd-btn.rose { background: var(--rose); color: #fff; }

/* ── Detalle de pedido en PANTALLA COMPLETA ── */
.pedido-detalle-overlay {
  position: fixed; inset: 0; background: var(--cream); z-index: 2100;
  display: none; flex-direction: column;
}
.pedido-detalle-overlay.open { display: flex; }
.pdet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--sand); background: var(--white);
}
.pdet-head h2 { margin: 0; font-size: 18px; color: var(--charcoal); }
.pdet-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.pdet-actions { display: flex; align-items: center; gap: 12px; }
.pdet-actions .bd-btn { flex: 0 0 auto; padding: 10px 20px; }
.pdet-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.pdet-body {
  flex: 1; overflow-y: auto; padding: 18px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; align-content: start; max-width: 1100px; margin: 0 auto; width: 100%;
}

/* Ficha de artículo en el detalle */
.det-ficha { border: 1px solid var(--sand); border-radius: var(--radius-sm); overflow: hidden; background: var(--white); }
.det-ficha-cab { background: var(--rose-light); padding: 7px 10px; display: flex; align-items: baseline; gap: 6px; }
.df-art { font-size: 10px; color: var(--text-muted); font-weight: 700; }
.df-num { font-size: 14px; font-weight: 800; }
.df-name { font-size: 12px; }
.df-tot { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--rose-dark); white-space: nowrap; }
.det-ficha-body { padding: 6px 10px 8px; }
table.det-mini { width: 100%; border-collapse: collapse; }
table.det-mini th, table.det-mini td { text-align: center; padding: 4px 3px; font-size: 11px; }
table.det-mini thead th { color: var(--rose-dark); font-weight: 700; border-bottom: 1.5px solid var(--rose); }
table.det-mini td.col { color: var(--rose-dark); font-weight: 700; text-align: left; white-space: nowrap; }
table.det-mini tr.z td { background: var(--cream); }
table.det-mini td.q.has { color: var(--charcoal); font-weight: 700; }
table.det-mini td.q.no { color: var(--nude); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .login-btn span { display: none; }       /* solo ícono en mobile angosto */
  .login-btn { padding: 8px 10px; }
  .user-pill .user-name { max-width: 80px; }
}
