/* build/css/auth.css — Estilos del login de usuarios (botón de cuenta + modales)
   Nota: el sitio usa html { font-size: 62.5% } => 1rem = 10px. */

/* ---------- Botón de cuenta en el navbar (sobre fondo rojo) ---------- */
.cuenta-contenedor {
  display: flex;
  align-items: center;
  margin-right: 14px;
}

.btn-cuenta {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.btn-cuenta:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(1.04);
}

.btn-cuenta i {
  font-size: 2.3rem;
  color: #fff !important;
}

.cuenta-label {
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* En pantallas chicas, mostramos solo el ícono y compactamos todo
   para que la parte del cliente no quede pegada/fuera del navbar.
   (auth.css carga después de app.css, así que estas reglas ganan.) */
@media (max-width: 600px) {
  /* Más espacio interno: achicamos el padding lateral del pill rojo */
  .navbar {
    padding: 0 14px;
  }
  /* El buscador no debe acaparar el ancho disponible */
  .nav-left {
    min-width: 0;
    flex: 1;
  }
  .search-container {
    flex: 1;
    min-width: 0;
    max-width: 18rem;
    margin: 0 8px 0 10px;
  }
  .busqueda {
    width: 100%;
    min-width: 0;
  }

  .cuenta-label {
    display: none;
  }
  .cuenta-contenedor {
    margin-right: 0;
    gap: 0.2rem;
  }
  .btn-cuenta {
    padding: 0.6rem;
    gap: 0;
  }
  .btn-cuenta i {
    font-size: 2.2rem;
  }
}

/* ---------- Botón "Mis pedidos" (solo visible logueado) ---------- */
.btn-pedidos {
  display: none;
}
body.usuario-logueado .btn-pedidos {
  display: inline-flex;
}

/* ---------- Lista de pedidos dentro del modal ---------- */
.pedidos-lista {
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.4rem;
}

.pedido-card {
  border: 1px solid #eee;
  border-radius: 1rem;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.2rem;
  background: #fafafa;
}

.pedido-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.pedido-head:focus-visible {
  box-shadow: 0 0 0 3px rgba(185, 22, 22, 0.18);
  border-radius: 0.6rem;
}

/* Parte derecha de la cabecera: estado + flecha */
.pedido-head-der {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Flechita que indica abrir/cerrar */
.pedido-flecha {
  color: #999;
  font-size: 1.5rem;
  transition: transform 0.25s ease;
}
.pedido-card.abierto .pedido-flecha {
  transform: rotate(180deg);
}

/* Detalle colapsable (items + total) */
.pedido-detalle {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.pedido-card.abierto .pedido-detalle {
  max-height: 60rem;
}
.pedido-detalle-inner {
  padding-top: 1rem;
}

.pedido-fecha {
  font-weight: 700;
  color: #444;
  font-size: 0.95em;
}

.pedido-estado {
  font-size: 0.8em;
  font-weight: 700;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  white-space: nowrap;
}
.pedido-estado.entregado {
  background: #e4f5e9;
  color: #1e7e44;
}
.pedido-estado.pendiente {
  background: #fdeaea;
  color: #b91616;
}

.pedido-items {
  list-style: none;
  margin: 0 0 0.8rem;
  padding: 0;
}
.pedido-items li {
  font-size: 0.92em;
  color: #555;
  padding: 0.25rem 0;
  border-bottom: 1px dashed #eaeaea;
}
.pedido-items li:last-child {
  border-bottom: none;
}
.pedido-cant {
  color: #999;
  font-weight: 600;
}

.pedido-total {
  text-align: right;
  font-size: 0.98em;
  color: #333;
}
.pedido-total strong {
  color: #b91616;
}

/* ---------- Modales de SweetAlert2 (agrandamos todo el modal) ---------- */
.swal2-popup {
  font-size: 1.7rem !important;
}

.swal2-title {
  font-size: 1.7em !important;
}

/* ---------- Look moderno de los modales de cuenta ---------- */
.auth-modal {
  border-radius: 2.4rem !important;
  padding: 2.8rem 2.6rem 2.4rem !important;
  box-shadow: 0 2.4rem 6rem rgba(31, 23, 23, 0.22) !important;
}

.auth-modal .swal2-title {
  color: #2c2c2c;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-top: 0.6rem;
}

/* Botones tipo "pill" con hover sutil */
.auth-modal .swal2-actions {
  gap: 1rem;
  margin-top: 2.2rem;
}

.auth-modal .swal2-styled {
  border-radius: 999px !important;
  padding: 1.15rem 2.6rem !important;
  font-weight: 700 !important;
  font-size: 0.95em !important;
  box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    filter 0.18s ease;
}

.auth-modal .swal2-styled:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.18);
  filter: brightness(1.04);
}

.auth-modal .swal2-styled:focus {
  box-shadow: 0 0 0 3px rgba(185, 22, 22, 0.22);
}

/* Botón cancelar/volver: gris suave moderno */
.auth-modal .swal2-cancel {
  background: #eef0f3 !important;
  color: #5a6068 !important;
}

/* Formularios dentro de los modales */
.auth-form {
  text-align: left;
  margin-top: 0.6rem;
}

.auth-form label {
  display: block;
  font-size: 0.92em;
  font-weight: 600;
  margin: 1.4rem 0 0.5rem;
  color: #555;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 1.25rem 1.4rem;
  border: 1.5px solid #e4e7ec;
  border-radius: 1.3rem;
  font-size: 1em;
  font-family: inherit;
  background: #f7f8fa;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease;
}

.auth-form input::placeholder {
  color: #aab0b8;
}

.auth-form input:focus {
  outline: none;
  border-color: #b91616;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(185, 22, 22, 0.15);
}

/* ---------- Tarjeta "Mi cuenta" (avatar + datos) ---------- */
.cuenta-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.6rem 0 0.4rem;
}

.cuenta-avatar {
  width: 8.4rem;
  height: 8.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d61f1f 0%, #8f1010 100%);
  color: #fff;
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 1rem 2.4rem rgba(185, 22, 22, 0.32);
  margin-bottom: 1.6rem;
}

.cuenta-nombre {
  margin: 0;
  font-size: 1.35em;
  font-weight: 700;
  color: #2c2c2c;
}

.cuenta-mail {
  margin: 0.5rem 0 0;
  font-size: 1em;
  color: #7a8088;
  word-break: break-all;
}

/* ---------- Mostrar/ocultar contraseña (ojito) ---------- */
.auth-pass-wrap {
  position: relative;
}
.auth-pass-wrap input {
  padding-right: 4rem; /* espacio para el ojito */
}
.auth-pass-toggle {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 1.6rem;
  padding: 0.4rem 0.6rem;
  line-height: 1;
}
.auth-pass-toggle:hover {
  color: #b91616;
}
/* En la página de restablecer, asegurar el espacio para el ojito */
.reset-card .auth-pass-wrap input {
  padding-right: 4rem;
}

.auth-links {
  margin-top: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.95em;
}

.auth-links a {
  color: #b91616;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ---------- Mensaje del carrito según estado de login ----------
   Por defecto (anónimo) se muestra la invitación a registrarse.
   Si el usuario está logueado, se muestra el recordatorio de compra mínima. */
.info-mayorista-registro {
  display: block;
}
.info-mayorista-min {
  display: none;
}
body.usuario-logueado .info-mayorista-registro {
  display: none;
}
body.usuario-logueado .info-mayorista-min {
  display: block;
}

/* ---------- Página de restablecer contraseña ---------- */
.reset-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f1ec;
  font-family: "Montserrat", sans-serif;
  padding: 2rem;
}

.reset-card {
  background: #fff;
  border-radius: 1.6rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  padding: 3.6rem 3rem;
  width: 100%;
  max-width: 44rem;
}

.reset-card h1 {
  font-size: 2.8rem;
  margin: 0 0 0.8rem;
  color: #333;
}

.reset-card p.sub {
  margin: 0 0 2rem;
  color: #777;
  font-size: 1.6rem;
}

.reset-card label {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.6rem 0 0.5rem;
  color: #444;
}

.reset-card input {
  width: 100%;
  box-sizing: border-box;
  padding: 1.3rem 1.3rem;
  border: 1px solid #ccc;
  border-radius: 0.9rem;
  font-size: 1.6rem;
}

.reset-card input:focus {
  outline: none;
  border-color: #b91616;
  box-shadow: 0 0 0 3px rgba(185, 22, 22, 0.18);
}

.reset-card button {
  width: 100%;
  margin-top: 2.2rem;
  padding: 1.4rem;
  border: none;
  border-radius: 0.9rem;
  background: #b91616;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.reset-card button:hover {
  background: #9c1212;
}

.reset-msg {
  margin-top: 1.6rem;
  font-size: 1.5rem;
  text-align: center;
}

.reset-msg.error {
  color: #c0392b;
}

.reset-msg.ok {
  color: #27ae60;
}
